Class HandshakeService

java.lang.Object
energy.eddie.aiida.services.HandshakeService

@Service public class HandshakeService extends Object
Performs the handshake with the EDDIE framework that created a permission request: fetching its details and reporting whether it was accepted, rejected, or cannot be fulfilled.
  • Constructor Details

    • HandshakeService

      public HandshakeService(ApplicationInformationService applicationInformationService, org.springframework.web.reactive.function.client.WebClient webClient)
  • Method Details

    • fetchDetails

      public reactor.core.publisher.Mono<PermissionDetailsDto> fetchDetails(HandshakeTarget target)
      Fetches the details about the permission and the associated data need from the respective EDDIE framework.
    • accept

      public reactor.core.publisher.Mono<MqttDto> accept(HandshakeTarget target)
      Accepts the permission request at the respective EDDIE framework. Returns the MQTT credentials and topic names that are to be used by the associated permission.
    • reject

      public void reject(HandshakeTarget target, @Nullable String reason)
      Makes a blocking request to the EDDIE framework to report that the user rejected the permission request. Occurring errors are logged and rethrown.
      Parameters:
      reason - Optional human-readable reason that is forwarded to the eligible party.
    • denoteUnfulfillable

      public void denoteUnfulfillable(HandshakeTarget target, @Nullable String reason)
      Makes a blocking request to the EDDIE framework to report that this AIIDA instance cannot fulfill the permission request. Occurring errors are logged and rethrown.
      Parameters:
      reason - Optional human-readable reason that is forwarded to the eligible party.