@ProviderType
public interface Metadata
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
activeStateChannelsToString(java.util.Map<ChannelAddress,EdgeConfig.Component.Channel> activeStateChannels)
Helper method for creating a String of all active State-Channels by Level.
|
default BackendUser |
authenticate()
Authenticates a User without any information.
|
BackendUser |
authenticate(java.lang.String sessionId)
Authenticates the User by a Session-ID.
|
BackendUser |
authenticate(java.lang.String username,
java.lang.String password)
Authenticates the User by username and password.
|
java.util.Collection<Edge> |
getAllEdges()
Gets all Edges.
|
java.util.Optional<Edge> |
getEdge(java.lang.String edgeId)
Get an Edge by its unique Edge-ID.
|
java.util.Optional<java.lang.String> |
getEdgeIdForApikey(java.lang.String apikey)
Gets the Edge-ID for an API-Key, i.e.
|
default Edge |
getEdgeOrError(java.lang.String edgeId)
Get an Edge by its unique Edge-ID.
|
java.util.Optional<BackendUser> |
getUser(java.lang.String userId)
Gets the User for the given User-ID.
|
boolean |
isInitialized()
Was the Metadata service fully initialized?.
|
boolean isInitialized()
default BackendUser authenticate() throws OpenemsError.OpenemsNamedException
This is only useful for Dummy-Implementations. By default authentication is denied in this case.
OpenemsError.OpenemsNamedException
- on errorBackendUser authenticate(java.lang.String username, java.lang.String password) throws OpenemsError.OpenemsNamedException
username
- the Usernamepassword
- the PasswordOpenemsError.OpenemsNamedException
- on errorBackendUser authenticate(java.lang.String sessionId) throws OpenemsError.OpenemsNamedException
sessionId
- the Session-IDOpenemsError.OpenemsNamedException
- on errorjava.util.Optional<java.lang.String> getEdgeIdForApikey(java.lang.String apikey)
apikey
- the API-Keyjava.util.Optional<Edge> getEdge(java.lang.String edgeId)
edgeId
- the Edge-IDdefault Edge getEdgeOrError(java.lang.String edgeId) throws OpenemsException
edgeId
- the Edge-IDOpenemsException
- on errorjava.util.Optional<BackendUser> getUser(java.lang.String userId)
userId
- the User-IDjava.util.Collection<Edge> getAllEdges()
static java.lang.String activeStateChannelsToString(java.util.Map<ChannelAddress,EdgeConfig.Component.Channel> activeStateChannels)
activeStateChannels
- Map of ChannelAddress and
EdgeConfig.Component.Channel; as returned by
Edge.onSetSumState()