Package energy.eddie.aiida.web
Class InboundController
java.lang.Object
energy.eddie.aiida.web.InboundController
-
Constructor Summary
ConstructorsConstructorDescriptionInboundController(InboundRecordService inboundRecordService) Creates the controller used to retrieve inbound records through REST provisioning. -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<InboundRecordDto> latestRecord(UUID permissionId, String bearerKey, String queryKey) Returns the latest inbound record using the configured REST provisioning mechanism.
-
Constructor Details
-
InboundController
Creates the controller used to retrieve inbound records through REST provisioning.- Parameters:
inboundRecordService- Service that retrieves and authorizes inbound records.
-
-
Method Details
-
latestRecord
@GetMapping(value="/latest/{permissionId}", produces="application/json") public org.springframework.http.ResponseEntity<InboundRecordDto> latestRecord(@PathVariable UUID permissionId, @RequestHeader(value="X-API-Key",required=false) String bearerKey, @RequestParam(value="apiKey",required=false) String queryKey) throws PermissionNotFoundException, UnauthorizedException, InvalidDataSourceTypeException, InboundRecordNotFoundException, UnsupportedInboundRecordTransformationException, InvalidInboundPermissionException, ProvisioningTypeNotConfiguredException Returns the latest inbound record using the configured REST provisioning mechanism. A non-blankX-API-Keyheader selects bearer provisioning; otherwise a non-blankapiKeyquery parameter selects API-token provisioning.- Parameters:
permissionId- ID of the inbound permission whose latest record should be returned.bearerKey- Access code supplied through theX-API-Keyheader.queryKey- Access code supplied through theapiKeyquery parameter.- Returns:
- A response containing the latest inbound record.
- Throws:
PermissionNotFoundException- If the permission does not exist.UnauthorizedException- If no access code is supplied or the code is invalid.InvalidDataSourceTypeException- If the permission does not use an inbound data source.InboundRecordNotFoundException- If no inbound record exists for the data source.UnsupportedInboundRecordTransformationException- If the record cannot be transformed to the configured format.InvalidInboundPermissionException- If the permission has no inbound message format.ProvisioningTypeNotConfiguredException- If the selected REST provisioning type is not active.
-