Class Permission
java.lang.Object
energy.eddie.aiida.models.permission.Permission
- All Implemented Interfaces:
org.springframework.data.domain.Persistable<UUID>
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor only for JPA.Create a new permission from the contents of the AIIDA code. -
Method Summary
Modifier and TypeMethodDescriptiondataNeed()eddieId()org.springframework.scheduling.support.CronExpressiongetId()id()voidinitializeFromDataNeed(AiidaLocalDataNeed dataNeed) Initializes the permission from the data need by derivingserviceName,displayNameandinboundMessageFormatfrom it.booleanbooleanisNew()Resolved from the current connection limit default with the newest start time in the database.meterId()Resolved from the current connection limit default with the newest start time in the database.voidsetConnectionId(String connectionId) voidsetDataSource(DataSource dataSource) voidsetDisplayName(String displayName) voidsetExpirationTime(Instant expirationTime) voidsetGrantTime(Instant grantTime) voidsetMaxLimitKw(BigDecimal maxLimitKw) voidsetMeterId(String meterId) voidsetMinLimitKw(BigDecimal minLimitKw) voidsetMqttStreamingConfig(MqttStreamingConfig mqttStreamingConfig) voidsetRevokeTime(Instant revokeTime) Set the UTC timestamp when either the EP terminated the permission or the customer revoked the permission.voidsetStartTime(Instant startTime) voidsetStatus(PermissionStatus newStatus) voidsetTransmissionEnabled(boolean transmissionEnabled) voidsetTransmissionSchedule(org.springframework.scheduling.support.CronExpression transmissionSchedule) status()booleantrueif the permission allows the eligible party to send connection limits.booleanDefaults totrueand is toggled byPermissionCommand.SetTransmissionEnabledcommands from the EP.voidupdateInboundMessageFormat(@NonNull InboundMessageFormat inboundMessageFormat) voidupdateMonitoringDataSource(UUID dataSourceId) Assigns the data source to monitor for connection limit violations, or clears the assignment if null.userId()
-
Constructor Details
-
Permission
public Permission(UUID eddieId, UUID permissionId, String handshakeUrl, String accessToken, UUID userId) Create a new permission from the contents of the AIIDA code. Permissions are only persisted once the user accepted them, therefore the status is set toPermissionStatus.ACCEPTED. The details of the permission have to be set before it is persisted. -
Permission
public Permission()Constructor only for JPA.
-
-
Method Details
-
getId
- Specified by:
getIdin interfaceorg.springframework.data.domain.Persistable<UUID>
-
isNew
public boolean isNew()- Specified by:
isNewin interfaceorg.springframework.data.domain.Persistable<UUID>
-
startTime
- Returns:
- The UTC timestamp when this permission starts
-
eddieId
- Returns:
- The UUID of the EDDIE application that created this permission.
-
id
- Returns:
- The UUID of this permission.
- See Also:
-
expirationTime
- Returns:
- The UTC timestamp when this permission expires and no more data should be shared.
-
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.ACCEPTEDor a later status.
-
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
- Returns:
- The connectionId that was generated by the EDDIE framework and is sent along with each message to the EP.
-
meterId
- Returns:
- The optional physical meter ID provided by the eligible party. Used to map flexible connection agreements and control data source selection in AIIDA.
-
minLimitKw
Resolved from the current connection limit default with the newest start time in the database.- Returns:
- Optional current default minimum energy consumption or production limit in kilowatts for controllable units.
-
maxLimitKw
Resolved from the current connection limit default with the newest start time in the database.- Returns:
- Optional current default maximum energy consumption or production limit in kilowatts for controllable units.
-
monitoringDataSourceId
- Returns:
- The data source monitored for connection limit violations, or null if none is assigned.
-
updateMonitoringDataSource
Assigns the data source to monitor for connection limit violations, or clears the assignment if null. -
serviceName
- Returns:
- The service name for which this permission is for.
-
displayName
- Returns:
- The user-chosen display name for this permission. Defaults to the data need's name.
-
inboundMessageFormat
-
status
- Returns:
- The current status of the permission.
-
mqttStreamingConfig
- Returns:
- The MQTT streaming configuration for this permission.
-
handshakeUrl
- Returns:
- The URL for the handshake endpoint.
-
accessToken
- Returns:
- The access token for the permission.
-
userId
- Returns:
- The user ID associated with the permission.
-
dataSource
- Returns:
- The data source for the permission.
-
dataNeed
- Returns:
- The data need for the permission.
-
transmissionEnabled
public boolean transmissionEnabled()Defaults totrueand is toggled byPermissionCommand.SetTransmissionEnabledcommands from the EP.- Returns:
- Whether data transmission is currently enabled for this permission.
-
setStatus
-
setStartTime
-
setExpirationTime
-
setGrantTime
-
setRevokeTime
Set the UTC timestamp when either the EP terminated the permission or the customer revoked the permission. UsesetStatus(PermissionStatus)to indicate which of the two cases occurred.- Parameters:
revokeTime- The revocation or termination timestamp.
-
setConnectionId
-
setMeterId
-
setMinLimitKw
-
setMaxLimitKw
-
setDisplayName
-
setMqttStreamingConfig
-
initializeFromDataNeed
Initializes the permission from the data need by derivingserviceName,displayNameandinboundMessageFormatfrom it. -
setDataSource
-
updateInboundMessageFormat
public void updateInboundMessageFormat(@NonNull InboundMessageFormat inboundMessageFormat) throws InvalidInboundPermissionException -
setTransmissionEnabled
public void setTransmissionEnabled(boolean transmissionEnabled) -
setTransmissionSchedule
public void setTransmissionSchedule(org.springframework.scheduling.support.CronExpression transmissionSchedule) -
effectiveTransmissionSchedule
@Nullable public org.springframework.scheduling.support.CronExpression effectiveTransmissionSchedule()- Returns:
- The schedule that should be used to stream data for this permission: the permission's own transmission schedule if set, otherwise the data need's schedule as a fallback
-
isInbound
public boolean isInbound()- Returns:
trueif the permission is inbound.
-
supportsConnectionLimits
public boolean supportsConnectionLimits()trueif the permission allows the eligible party to send connection limits.- Returns:
- Whether the permission supports connection limit features such as monitoring.
-