Class AssetService
java.lang.Object
overit.geocallapp.utilities.rs.common.PrivateService
overit.geocallapp.wfm.assets.rs1.asset.AssetService
@RestController
@RequestMapping("assets/r1/assets")
@Resource(logging=true)
public class AssetService
extends PrivateService
Service to manage assets.
- Since:
- 16.0
- GCApi:
- rest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Void> batchInsertAssetChild(@Size(min=1,max=200) @Valid List<DTOAssetChildBatchInsert> batchInput) Create a batch of asset children by calling theAssetChildInsertBatchEventorg.springframework.http.ResponseEntity<Void> batchPatch(@Size(min=1,max=200) @Valid List<DTOAssetBatchUpdate> batchInput) Update a batch of assets by calling theAssetUpdateBatchEventorg.springframework.http.ResponseEntity<List<DTOIdentifier<Long>>> Create a batch of assets by calling theAssetInsertBatchEventorg.springframework.http.ResponseEntity<DTOAsset> get(Long assetId, Collection<String> fields) Retrieves the requiredDTOAssetby calling theAssetLoadEvent.org.springframework.http.ResponseEntity<PageResponse<DTOAsset>> getCollection(@Valid Page page, Collection<String> fields, String order, @Valid DTOAssetFilter filter) Returns the collection of all the stored assets by calling theAssetSearchEvent.org.springframework.http.ResponseEntity<PageResponse<DTOAssetDescendant>> getDescendant(Long assetId, @Valid Page page, Collection<String> fields, String order, @Valid DTOAssetDescendantFilter filter) Returns the collection of all the stored descendant assets by calling theAssetDescendantSearchEvent.org.springframework.http.ResponseEntity<Void> insertAssetChild(Long assetId, @Valid DTOAssetChildInsert dto) Inserts a new child for a given asset by calling theAssetChildInsertEvent.org.springframework.http.ResponseEntity<Void> patch(Long assetId, @Valid DTOAssetUpdate dto) Update an asset by calling theAssetUpdateEventorg.springframework.http.ResponseEntity<DTOIdentifier<Long>> post(@Valid DTOAssetInsert dto) Create a new asset by calling theAssetInsertEventorg.springframework.http.ResponseEntity<Void> removeAssetChild(Long assetId, Long assetChildId) Remove a parent for a given asset by calling theAssetChildRemoveEvent.
-
Constructor Details
-
AssetService
public AssetService()
-
-
Method Details
-
getCollection
@GetMapping(produces="application/json") public org.springframework.http.ResponseEntity<PageResponse<DTOAsset>> getCollection(@RequestParam("_page") @Valid @Valid Page page, @RequestParam(required=false,value="_fields") Collection<String> fields, @RequestParam(required=false,value="_order") String order, @Valid @Valid DTOAssetFilter filter) throws DAValidateException, DAException Returns the collection of all the stored assets by calling theAssetSearchEvent.- Parameters:
page- thePagethat will contain the paginated resultfields- the collection of fields the response will containorder- the ordering fieldfilter- theDTOAssetFilter- Returns:
- the collection of
DTOAsset - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
get
@GetMapping(value="{assetId:[0-9]+}", produces="application/json") public org.springframework.http.ResponseEntity<DTOAsset> get(@PathVariable("assetId") Long assetId, @RequestParam(required=false,name="_fields") Collection<String> fields) throws DAValidateException, DAException Retrieves the requiredDTOAssetby calling theAssetLoadEvent.- Parameters:
assetId- the asset idfields- the collection of fields the response will contain- Returns:
- the response containing the loaded asset
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
insertAssetChild
@PostMapping(consumes="application/json", produces="application/json", path="/{assetId:[0-9]+}/children") public org.springframework.http.ResponseEntity<Void> insertAssetChild(@PathVariable("assetId") Long assetId, @Valid @RequestBody @Valid DTOAssetChildInsert dto) throws DAValidateException, DAException Inserts a new child for a given asset by calling theAssetChildInsertEvent.- Parameters:
assetId- the asset iddto- theDTOAssetChildInsert- Returns:
- the standard response
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
post
@PostMapping(consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<DTOIdentifier<Long>> post(@Valid @RequestBody @Valid DTOAssetInsert dto) throws DAValidateException, DAException Create a new asset by calling theAssetInsertEvent- Parameters:
dto- theDTOAssetInsert- Returns:
- the standard response containing the new asset id
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
removeAssetChild
@DeleteMapping(path="/{assetId:[0-9]+}/children/{assetChildId:[0-9]+}") public org.springframework.http.ResponseEntity<Void> removeAssetChild(@PathVariable("assetId") Long assetId, @PathVariable("assetChildId") Long assetChildId) throws DAValidateException, DAException Remove a parent for a given asset by calling theAssetChildRemoveEvent.- Parameters:
assetId- the asset idassetChildId- the asset child id- Returns:
- the empty response
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
patch
@PatchMapping(value="{assetId:[0-9]+}", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<Void> patch(@PathVariable("assetId") Long assetId, @Valid @RequestBody @Valid DTOAssetUpdate dto) throws DAValidateException, DAException Update an asset by calling theAssetUpdateEvent- Parameters:
assetId- the asset iddto- theDTOAssetUpdate- Returns:
- the standard response
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
batchInsertAssetChild
@PostMapping(consumes="application/json", produces="application/json", path="/children/batch") public org.springframework.http.ResponseEntity<Void> batchInsertAssetChild(@Size(min=1,max=200) @Valid @RequestBody @Size(min=1,max=200) @Valid List<DTOAssetChildBatchInsert> batchInput) throws DAValidateException, DAException Create a batch of asset children by calling theAssetChildInsertBatchEvent- Parameters:
batchInput- a list ofDTOAssetChildBatchInsert- Returns:
- the standard response
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
batchPatch
@PatchMapping(value="/batch", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<Void> batchPatch(@Size(min=1,max=200) @Valid @RequestBody @Size(min=1,max=200) @Valid List<DTOAssetBatchUpdate> batchInput) throws DAValidateException, DAException Update a batch of assets by calling theAssetUpdateBatchEvent- Parameters:
batchInput- a list ofDTOAssetBatchUpdate- Returns:
- the standard response
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
batchPost
@PostMapping(value="/batch", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<List<DTOIdentifier<Long>>> batchPost(@Size(min=1,max=200) @Valid @RequestBody @Size(min=1,max=200) @Valid List<DTOAssetInsert> batchInput) throws DAValidateException, DAException Create a batch of assets by calling theAssetInsertBatchEvent- Parameters:
batchInput- a list ofDTOAssetInsert- Returns:
- the standard response containing the list of new assets ids
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
getDescendant
@GetMapping(value="/{assetId:[0-9]+}/descendants", produces="application/json") public org.springframework.http.ResponseEntity<PageResponse<DTOAssetDescendant>> getDescendant(@PathVariable("assetId") Long assetId, @RequestParam("_page") @Valid @Valid Page page, @RequestParam(required=false,value="_fields") Collection<String> fields, @RequestParam(required=false,value="_order") String order, @Valid @Valid DTOAssetDescendantFilter filter) throws DAValidateException, DAException Returns the collection of all the stored descendant assets by calling theAssetDescendantSearchEvent.- Parameters:
page- thePagethat will contain the paginated resultfields- the collection of fields the response will containorder- the ordering fieldfilter- theDTOAssetDescendantFilter- Returns:
- the collection of
DTOAsset - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-