Package io.openems.common.session
Class AbstractUser
java.lang.Object
io.openems.common.session.AbstractUser
Represents a User; shared by OpenEMS Backend
('io.openems.backend.common.metadata.User') and Edge
('io.openems.edge.common.user.User').
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractUser
(String id, String name, Language language, Role globalRole, NavigableMap<String, Role> roles, com.google.gson.JsonObject settings) -
Method Summary
Modifier and TypeMethodDescriptionGets all Roles for Edge-IDs.Gets the global Role.getId()
Gets the user language.getName()
Gets the Role for a given Edge-ID.com.google.gson.JsonObject
Gets the settings for this user.abstract boolean
Gets the Number of Devices, that the user is allowed to see.void
setLanguage
(Language language) Sets the user language.void
Sets the Role for a given Edge-ID.
-
Constructor Details
-
Method Details
-
getId
-
getName
-
getLanguage
Gets the user language.- Returns:
- the language
-
setLanguage
Sets the user language.- Parameters:
language
- theLanguage
-
getEdgeRoles
Gets all Roles for Edge-IDs.- Returns:
- the map of Roles
-
getGlobalRole
Gets the global Role.- Returns:
Role
-
getRole
Gets the Role for a given Edge-ID.- Parameters:
edgeId
- the Edge-ID- Returns:
- the Role
-
setRole
Sets the Role for a given Edge-ID.- Parameters:
edgeId
- the Edge-IDrole
- the Role
-
getSettings
public com.google.gson.JsonObject getSettings()Gets the settings for this user.- Returns:
- the Role
-
hasMultipleEdges
public abstract boolean hasMultipleEdges()Gets the Number of Devices, that the user is allowed to see.- Returns:
- the numberOfDevices
-