Class User

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DEFAULT_EDGE_ID
      Default-Edge-ID for User.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected User​(java.lang.String id, java.lang.String name, Role role)
      Constructs an 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,
                       Role role)
        Constructs an User.
        Parameters:
        id - the User-ID
        name - the name
        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