Record Class AcceptedPermission

java.lang.Object
java.lang.Record
energy.eddie.aiida.models.permission.AcceptedPermission
Record Components:
id - The ID of the permission.
eddieId - The ID of the EDDIE application that created the permission.
userId - The ID of the user that owns the permission.
connectionId - The connection ID that is sent along with each message to the EP.
startTime - The UTC timestamp when the data sharing starts.
expirationTime - The UTC timestamp when the data sharing stops.
dataNeed - The data need of the permission.
dataSource - The data source of the permission.
mqttStreamingConfig - The MQTT configuration used to stream data to the EP.
transmissionSchedule - The schedule that is used to stream data, see Permission.effectiveTransmissionSchedule().
transmissionEnabled - Whether data transmission is enabled.

public record AcceptedPermission(UUID id, UUID eddieId, UUID userId, String connectionId, Instant startTime, Instant expirationTime, AiidaLocalDataNeed dataNeed, DataSource dataSource, MqttStreamingConfig mqttStreamingConfig, org.springframework.scheduling.support.CronExpression transmissionSchedule, boolean transmissionEnabled) extends Record
Immutable snapshot of an PermissionStatus.ACCEPTED permission with all fields that are required to stream data. In contrast to Permission, none of the fields are nullable.
  • Constructor Details

    • AcceptedPermission

      public AcceptedPermission(UUID id, UUID eddieId, UUID userId, String connectionId, Instant startTime, Instant expirationTime, AiidaLocalDataNeed dataNeed, DataSource dataSource, MqttStreamingConfig mqttStreamingConfig, org.springframework.scheduling.support.CronExpression transmissionSchedule, boolean transmissionEnabled)
      Creates an instance of a AcceptedPermission record class.
      Parameters:
      id - the value for the id record component
      eddieId - the value for the eddieId record component
      userId - the value for the userId record component
      connectionId - the value for the connectionId record component
      startTime - the value for the startTime record component
      expirationTime - the value for the expirationTime record component
      dataNeed - the value for the dataNeed record component
      dataSource - the value for the dataSource record component
      mqttStreamingConfig - the value for the mqttStreamingConfig record component
      transmissionSchedule - the value for the transmissionSchedule record component
      transmissionEnabled - the value for the transmissionEnabled record component
  • Method Details

    • from

      public static AcceptedPermission from(Permission permission) throws IllegalStateException
      Creates a snapshot of the passed permission.
      Throws:
      IllegalStateException - If the permission is not PermissionStatus.ACCEPTED or a field required for streaming is missing.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • id

      public UUID id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • eddieId

      public UUID eddieId()
      Returns the value of the eddieId record component.
      Returns:
      the value of the eddieId record component
    • userId

      public UUID userId()
      Returns the value of the userId record component.
      Returns:
      the value of the userId record component
    • connectionId

      public String connectionId()
      Returns the value of the connectionId record component.
      Returns:
      the value of the connectionId record component
    • startTime

      public Instant startTime()
      Returns the value of the startTime record component.
      Returns:
      the value of the startTime record component
    • expirationTime

      public Instant expirationTime()
      Returns the value of the expirationTime record component.
      Returns:
      the value of the expirationTime record component
    • dataNeed

      public AiidaLocalDataNeed dataNeed()
      Returns the value of the dataNeed record component.
      Returns:
      the value of the dataNeed record component
    • dataSource

      public DataSource dataSource()
      Returns the value of the dataSource record component.
      Returns:
      the value of the dataSource record component
    • mqttStreamingConfig

      public MqttStreamingConfig mqttStreamingConfig()
      Returns the value of the mqttStreamingConfig record component.
      Returns:
      the value of the mqttStreamingConfig record component
    • transmissionSchedule

      public org.springframework.scheduling.support.CronExpression transmissionSchedule()
      Returns the value of the transmissionSchedule record component.
      Returns:
      the value of the transmissionSchedule record component
    • transmissionEnabled

      public boolean transmissionEnabled()
      Returns the value of the transmissionEnabled record component.
      Returns:
      the value of the transmissionEnabled record component