Class Permission

java.lang.Object
energy.eddie.aiida.models.permission.Permission

@Entity public class Permission extends Object
  • Constructor Details

    • Permission

      public Permission(QrCodeDto qrCodeDto, UUID userId)
      Create a new permission from the contents of the QR code. The status will be set to PermissionStatus.CREATED.
    • Permission

      public Permission()
      Constructor only for JPA.
  • Method Details

    • eddieId

      public UUID eddieId()
      Returns the UUID of the EDDIE application that created this permission.
    • id

      public UUID id()
      Returns the UUID of this permission.
    • startTime

      @Nullable public Instant startTime()
      Returns the UTC start timestamp for sharing data of this permission. Only available if status is PermissionStatus.FETCHED_DETAILS or a later status.
    • expirationTime

      @Nullable public Instant expirationTime()
      Returns the UTC timestamp when this permission expires and no more data should be shared. Only available if status is PermissionStatus.FETCHED_DETAILS or a later status.
    • grantTime

      @Nullable public Instant grantTime()
      Returns the UTC timestamp when the customer granted the permission. Will return null until the customer grants the permission. Only available if status is PermissionStatus.ACCEPTED or a later status.
    • revokeTime

      @Nullable public Instant revokeTime()
      Returns the time at which either the EP terminated the permission or the customer revoked the permission. The return value of status() indicates which of the two cases occurred.
    • connectionId

      @Nullable public String connectionId()
      Returns the connectionId that was generated by the EDDIE framework and is sent along with each message to the EP. Only available if status is PermissionStatus.FETCHED_DETAILS or a later status.
    • serviceName

      public String serviceName()
      Returns the service name for which this permission is for.
    • status

      public PermissionStatus status()
      Returns the current status of the permission.
    • mqttStreamingConfig

      @Nullable public MqttStreamingConfig mqttStreamingConfig()
      Only available if status is PermissionStatus.FETCHED_MQTT_CREDENTIALS or a later status.
    • handshakeUrl

      public String handshakeUrl()
    • accessToken

      public String accessToken()
    • userId

      @Nullable public UUID userId()
    • dataSource

      @Nullable public DataSource dataSource()
    • dataNeed

      @Nullable public AiidaLocalDataNeed dataNeed()
      Only available if status is PermissionStatus.FETCHED_DETAILS or a later status.
    • setStatus

      public void setStatus(PermissionStatus newStatus)
    • setStartTime

      public void setStartTime(Instant startTime)
    • setExpirationTime

      public void setExpirationTime(Instant expirationTime)
    • setGrantTime

      public void setGrantTime(Instant grantTime)
    • setRevokeTime

      public void setRevokeTime(Instant revokeTime)
      Set the UTC timestamp when either the EP terminated the permission or the customer revoked the permission. Use setStatus(PermissionStatus) to indicate which of the two cases occurred.
      Parameters:
      revokeTime - The revocation or termination timestamp.
    • setConnectionId

      public void setConnectionId(String connectionId)
    • setMqttStreamingConfig

      public void setMqttStreamingConfig(MqttStreamingConfig mqttStreamingConfig)
    • setDataNeed

      public void setDataNeed(AiidaLocalDataNeed dataNeed)
    • setDataSource

      public void setDataSource(@Nullable DataSource dataSource)