Class AiidaPermissionService
java.lang.Object
energy.eddie.regionconnector.aiida.services.AiidaPermissionService
- All Implemented Interfaces:
EventListener,org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
@Component
public class AiidaPermissionService
extends Object
implements org.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
-
Constructor Summary
ConstructorsConstructorDescriptionAiidaPermissionService(Outbox outbox, DataNeedsService dataNeedsService, AiidaConfiguration configuration, MqttService mqttService, AiidaPermissionRequestViewRepository viewRepository, DataNeedCalculationService<DataNeed> calculationService, reactor.core.publisher.Sinks.Many<AiidaConnectionStatusMessageDto> statusSink, org.springframework.context.ApplicationContext applicationContext) -
Method Summary
Modifier and TypeMethodDescriptionacceptPermission(String permissionId, UUID aiidaId) detailsForPermission(String permissionId) Returns a wrapper containing theAiidaPermissionRequestand its associatedDataNeed.voidexternallyTerminatePermission(String permissionId) voidfulfillPermission(String permissionId) voidonApplicationEvent(org.springframework.context.event.ContextRefreshedEvent event) voidrejectPermission(String permissionId, UUID aiidaId) voidrevokePermission(String permissionId) voidvoidterminatePermission(String permissionId) voidunableToFulfillPermission(String permissionId, UUID aiidaId) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Constructor Details
-
Method Details
-
onApplicationEvent
public void onApplicationEvent(@NonNull org.springframework.context.event.ContextRefreshedEvent event) - Specified by:
onApplicationEventin interfaceorg.springframework.context.ApplicationListener<org.springframework.context.event.ContextRefreshedEvent>
-
statusChangedExternally
-
createValidateAndSendPermissionRequest
public QrCodeDto createValidateAndSendPermissionRequest(PermissionRequestForCreation forCreation) throws DataNeedNotFoundException, UnsupportedDataNeedException -
unableToFulfillPermission
public void unableToFulfillPermission(String permissionId, UUID aiidaId) throws PermissionNotFoundException, PermissionStateTransitionException -
rejectPermission
public void rejectPermission(String permissionId, UUID aiidaId) throws PermissionNotFoundException, PermissionStateTransitionException -
acceptPermission
public MqttDto acceptPermission(String permissionId, UUID aiidaId) throws CredentialsAlreadyExistException, PermissionNotFoundException, PermissionStateTransitionException, DataNeedNotFoundException -
revokePermission
-
terminatePermission
-
externallyTerminatePermission
-
fulfillPermission
-
detailsForPermission
public PermissionDetailsDto detailsForPermission(String permissionId) throws PermissionNotFoundException, DataNeedNotFoundException Returns a wrapper containing theAiidaPermissionRequestand its associatedDataNeed.- Throws:
PermissionNotFoundException- If there is no permission with the specified ID saved in the DB.DataNeedNotFoundException- If the data need referenced in the permission request cannot be found in the DB.
-