Class InboundRecordService
java.lang.Object
energy.eddie.aiida.services.record.InboundRecordService
-
Constructor Summary
ConstructorsConstructorDescriptionInboundRecordService(InboundRecordRepository inboundRecordRepository, PermissionRepository permissionRepository, InboundPayloadTransformationService inboundPayloadTransformationService) Creates a service for retrieving, authorizing, and transforming inbound records. -
Method Summary
Modifier and TypeMethodDescriptionlatestRecord(UUID permissionId) Returns the latest inbound record without performing access-code or provisioning-type validation.latestRecord(UUID permissionId, String accessCode, InboundProvisioningType provisioningType) Returns the latest inbound record after validating the access code and configured REST provisioning type.
-
Constructor Details
-
InboundRecordService
public InboundRecordService(InboundRecordRepository inboundRecordRepository, PermissionRepository permissionRepository, InboundPayloadTransformationService inboundPayloadTransformationService) Creates a service for retrieving, authorizing, and transforming inbound records.- Parameters:
inboundRecordRepository- Repository containing inbound records.permissionRepository- Repository used to resolve inbound permissions.inboundPayloadTransformationService- Service used to transform stored payloads into the requested format.
-
-
Method Details
-
latestRecord
public InboundRecordDto latestRecord(UUID permissionId, String accessCode, InboundProvisioningType provisioningType) throws PermissionNotFoundException, UnauthorizedException, InvalidDataSourceTypeException, InboundRecordNotFoundException, UnsupportedInboundRecordTransformationException, InvalidInboundPermissionException, ProvisioningTypeNotConfiguredException Returns the latest inbound record after validating the access code and configured REST provisioning type.- Parameters:
permissionId- ID of the inbound permission whose latest record should be returned.accessCode- Access code supplied by the caller.provisioningType- REST provisioning type through which the caller supplied the access code.- Returns:
- The latest inbound record transformed to the permission's configured message format.
- Throws:
PermissionNotFoundException- If the permission does not exist.UnauthorizedException- If the supplied access 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 requested REST provisioning type is not active.
-
latestRecord
public InboundRecordDto latestRecord(UUID permissionId) throws PermissionNotFoundException, InvalidDataSourceTypeException, InboundRecordNotFoundException, UnsupportedInboundRecordTransformationException, InvalidInboundPermissionException Returns the latest inbound record without performing access-code or provisioning-type validation.- Parameters:
permissionId- ID of the inbound permission whose latest record should be returned.- Returns:
- The latest inbound record transformed to the permission's configured message format.
- Throws:
PermissionNotFoundException- If the permission does not exist.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.
-