Class User
java.lang.Object
io.openems.common.session.AbstractUser
io.openems.backend.common.metadata.User
- Direct Known Subclasses:
MyUser
A
User
used by OpenEMS Backend.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionassertEdgeRoleIsAtLeast
(String resource, String edgeId, Role role) Throws an exception if the current Role is equal or more privileged than the given Role.static List<GetEdgesResponse.EdgeMetadata>
generateEdgeMetadatas
(User user, Metadata metadataService) Gets the Metadata information of the accessible Edges.getToken()
Gets the login token.Methods inherited from class io.openems.common.session.AbstractUser
getEdgeRoles, getGlobalRole, getId, getLanguage, getName, getRole, setLanguage, setRole
-
Constructor Details
-
User
-
-
Method Details
-
getToken
Gets the login token.- Returns:
- the token
-
assertEdgeRoleIsAtLeast
public Role assertEdgeRoleIsAtLeast(String resource, String edgeId, Role role) throws OpenemsError.OpenemsNamedException Throws an exception if the current Role is equal or more privileged than the given Role.- Parameters:
resource
- a resource identifier; used for the exceptionedgeId
- the Edge-IDrole
- the compared Role- Returns:
- the current
Role
- Throws:
OpenemsError.OpenemsNamedException
- if the current Role privileges are less
-
generateEdgeMetadatas
public static List<GetEdgesResponse.EdgeMetadata> generateEdgeMetadatas(User user, Metadata metadataService) Gets the Metadata information of the accessible Edges.- Parameters:
user
- theUser
metadataService
- aMetadata
provider- Returns:
- a list of
GetEdgesResponse.EdgeMetadata
-