Class AccountMeterService
java.lang.Object
overit.geocallapp.utilities.rs.common.PrivateService
overit.geocallapp.wfm.accounts.rs1.meter.AccountMeterService
@RestController
@RequestMapping("assets/accounts/r1/accounts/{accountId}/meters")
@Resource(logging=true)
public class AccountMeterService
extends PrivateService
Service to manage meters of an account
- Since:
- 16.0
- GCApi:
- rest
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<Void> batchPatch(Long accountId, @Size(min=1,max=200) @Valid List<DTOMeterBatchUpdate> batchInput) Update a batch of account meters by calling theMeterUpdateBatchEventorg.springframework.http.ResponseEntity<List<DTOIdentifier<Long>>> Create a batch of account meters by calling theMeterInsertBatchEventorg.springframework.http.ResponseEntity<DTOMeter> get(Long accountId, Long meterId, Collection<String> fields) Retrieves the requiredDTOMeterby calling theMeterLoadEvent.org.springframework.http.ResponseEntity<PageResponse<DTOMeter>> getCollection(Long accountId, @Valid Page page, Collection<String> fields, String order, @Valid DTOMeterFilter filter) Returns the collection of all the stored meters by calling theMeterSearchEvent.org.springframework.http.ResponseEntity<DTOMeterConverter> getConverter(Long accountId, Long meterId, Collection<String> fields) Retrieves the requiredDTOMeterConverterby calling theMeterConverterLoadEvent.org.springframework.http.ResponseEntity<Void> patch(Long accountId, Long meterId, @Valid DTOMeterUpdate dto) Update a meter by calling theMeterUpdateEventorg.springframework.http.ResponseEntity<Void> patchConverter(Long accountId, Long meterId, @Valid DTOMeterConverterUpdate dto) Update a meter converter by calling theMeterConverterUpdateEventorg.springframework.http.ResponseEntity<DTOIdentifier<Long>> post(Long accountId, @Valid DTOMeterInsert dto) Create a new meter by calling theMeterInsertEvent.org.springframework.http.ResponseEntity<DTOIdentifier<Long>> postConverter(Long accountId, Long meterId, @Valid DTOMeterConverterInsert dto) Create a new meter converter by calling theMeterConverterInsertEvent
-
Constructor Details
-
AccountMeterService
public AccountMeterService()
-
-
Method Details
-
getCollection
@GetMapping(produces="application/json") public org.springframework.http.ResponseEntity<PageResponse<DTOMeter>> getCollection(@PathVariable("accountId") Long accountId, @RequestParam("_page") @Valid @Valid Page page, @RequestParam(required=false,name="_fields") Collection<String> fields, @RequestParam(required=false,name="_order") String order, @Valid @Valid DTOMeterFilter filter) throws DAValidateException, DAException Returns the collection of all the stored meters by calling theMeterSearchEvent.- Parameters:
accountId- the account idpage- thePagethat will contain the paginated resultfields- the collection of fields the response will containorder- the ordering fieldfilter- theDTOMeterFilter- Returns:
- the collection of
DTOMeter - Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
get
@GetMapping(value="{meterId:[0-9]+}", produces="application/json") public org.springframework.http.ResponseEntity<DTOMeter> get(@PathVariable("accountId") Long accountId, @PathVariable("meterId") Long meterId, @RequestParam(required=false,name="_fields") Collection<String> fields) throws DAValidateException, DAException Retrieves the requiredDTOMeterby calling theMeterLoadEvent.- Parameters:
accountId- the account idmeterId- the meter idfields- the collection of fields the response will contain- Returns:
- the response containing the loaded meter
- 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(@PathVariable("accountId") Long accountId, @Valid @RequestBody @Valid DTOMeterInsert dto) throws DAValidateException, DAException Create a new meter by calling theMeterInsertEvent.- Parameters:
accountId- the account iddto- theDTOMeterInsert- Returns:
- the standard response containing the new meter id
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
patch
@PatchMapping(value="{meterId:[0-9]+}", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<Void> patch(@PathVariable("accountId") Long accountId, @PathVariable("meterId") Long meterId, @Valid @RequestBody @Valid DTOMeterUpdate dto) throws DAValidateException, DAException Update a meter by calling theMeterUpdateEvent- Parameters:
accountId- the account idmeterId- the meter iddto- theDTOMeterUpdate- Returns:
- the standard response
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
getConverter
@GetMapping(value="{meterId:[0-9]+}/converter", produces="application/json") public org.springframework.http.ResponseEntity<DTOMeterConverter> getConverter(@PathVariable("accountId") Long accountId, @PathVariable("meterId") Long meterId, @RequestParam(required=false,name="_fields") Collection<String> fields) throws DAValidateException, DAException Retrieves the requiredDTOMeterConverterby calling theMeterConverterLoadEvent.- Parameters:
accountId- the account idmeterId- the meter idfields- the collection of fields the response will contain- Returns:
- the response containing the loaded meter converter
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
patchConverter
@PatchMapping(value="{meterId:[0-9]+}/converter", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<Void> patchConverter(@PathVariable("accountId") Long accountId, @PathVariable("meterId") Long meterId, @Valid @RequestBody @Valid DTOMeterConverterUpdate dto) throws DAValidateException, DAException Update a meter converter by calling theMeterConverterUpdateEvent- Parameters:
accountId- the account idmeterId- the meter iddto- theDTOMeterConverterUpdate- Returns:
- the standard response
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-
postConverter
@PostMapping(value="{meterId:[0-9]+}/converter", consumes="application/json", produces="application/json") public org.springframework.http.ResponseEntity<DTOIdentifier<Long>> postConverter(@PathVariable("accountId") Long accountId, @PathVariable("meterId") Long meterId, @Valid @RequestBody @Valid DTOMeterConverterInsert dto) throws DAValidateException, DAException Create a new meter converter by calling theMeterConverterInsertEvent- Parameters:
accountId- the account idmeterId- the meter iddto- theDTOMeterConverterInsert- Returns:
- the standard response containing the new meter converter id
- 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(@PathVariable("accountId") Long accountId, @Size(min=1,max=200) @Valid @RequestBody @Size(min=1,max=200) @Valid List<DTOMeterBatchUpdate> batchInput) throws DAValidateException, DAException Update a batch of account meters by calling theMeterUpdateBatchEvent- Parameters:
batchInput- a list ofDTOMeterBatchUpdate- 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(@PathVariable("accountId") Long accountId, @Size(min=1,max=200) @Valid @RequestBody @Size(min=1,max=200) @Valid List<DTOMeterBatchInsert> batchInput) throws DAValidateException, DAException Create a batch of account meters by calling theMeterInsertBatchEvent- Parameters:
batchInput- a list ofDTOMeterBatchInsert- Returns:
- the standard response containing the list of new account meters ids
- Throws:
DAValidateException- the DA validate exceptionDAException- the DA exception
-