Class User

    • Field Detail

      • DEFAULT_EDGE_ID

        public static final java.lang.String DEFAULT_EDGE_ID
        Default-Edge-ID for User.
        See Also:
        Constant Field Values
    • Constructor Detail

      • User

        protected User​(java.lang.String id,
                       java.lang.String name,
                       Language language,
                       Role role)
        Constructs an User.
        Parameters:
        id - the User-ID
        name - the name
        language - the Language
        role - the Role; used as global Role and assigned to DEFAULT_EDGE_ID.
    • Method Detail

      • getRole

        public Role getRole()
        Gets the Role (Global and Per-Edge-Role are the same for OpenEMS Edge User).
        Returns:
        the Role
      • assertRoleIsAtLeast

        public void assertRoleIsAtLeast​(java.lang.String resource,
                                        Role role)
                                 throws OpenemsError.OpenemsNamedException
        Throws an exception if the Role (Global and Per-Edge-Role are the same for OpenEMS Edge User) is equal or more privileged than the given Role.
        Parameters:
        resource - a resource identifier; used for the exception
        role - the compared Role
        Throws:
        OpenemsError.OpenemsNamedException - if the global Role privileges are less
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object