Class PermissionRequestService
java.lang.Object
energy.eddie.regionconnector.es.datadis.services.PermissionRequestService
-
Constructor Summary
ConstructorsConstructorDescriptionPermissionRequestService(EsPermissionRequestRepository repository, AccountingPointDataService accountingPointDataService, PermissionRequestConsumer permissionRequestConsumer, Outbox outbox, DataNeedCalculationService<DataNeed> calculationService) -
Method Summary
Modifier and TypeMethodDescriptionvoidacceptPermission(String permissionId) createAndSendPermissionRequest(PermissionRequestForCreation requestForCreation) Creates a new permission request with the start and end date according to the data needs.voidrejectPermission(String permissionId) voidterminatePermission(String permissionId)
-
Constructor Details
-
Method Details
-
acceptPermission
- Throws:
PermissionNotFoundException
-
rejectPermission
- Throws:
PermissionNotFoundException
-
createAndSendPermissionRequest
public CreatedPermissionRequest createAndSendPermissionRequest(PermissionRequestForCreation requestForCreation) throws DataNeedNotFoundException, UnsupportedDataNeedException, EsValidationException Creates a new permission request with the start and end date according to the data needs. It adds one day to the end date automatically to ensure that the end date is inclusive.- Parameters:
requestForCreation- basis for the permission request.- Returns:
- a validated permission request, that was sent to the permission administrator.
- Throws:
DataNeedNotFoundException- if the data need does not exist.UnsupportedDataNeedException- if the region connector does not support the data need.EsValidationException
-
terminatePermission
- Throws:
PermissionNotFoundException
-