Class FileRealmHelper.User

java.lang.Object
org.glassfish.security.common.FileRealmHelper.User
All Implemented Interfaces:
Serializable, Principal, UserPrincipal
Enclosing class:
FileRealmHelper

public static class FileRealmHelper.User extends Object implements UserPrincipal
Represents a FileRealm user.
See Also:
  • Constructor Details

    • User

      public User(String name)
      Constructor.
    • User

      public User(String name, String[] groups, String realm, byte[] salt, byte[] hash, String algo)
      Constructor.
      Parameters:
      name - User name.
      groups - Group memerships.
      realm - Realm.
      salt - SSHA salt.
      hash - SSHA password hash.
  • Method Details

    • getName

      public String getName()
      Gets the name of the Principal as a java.lang.String
      Specified by:
      getName in interface Principal
      Returns:
      the name of the principal.
    • getSalt

      public byte[] getSalt()
      Returns salt value.
    • setSalt

      public void setSalt(byte[] salt)
      Set salt value.
    • getHash

      public byte[] getHash()
      Get hash value.
    • setHash

      public void setHash(byte[] hash)
      Set hash value.
    • getGroups

      public String[] getGroups()
      Return the names of the groups this user belongs to.
      Returns:
      String[] List of group memberships.
    • setGroups

      public void setGroups(String[] grp)
      Set group membership.
    • getAlgo

      public String getAlgo()
      Returns:
      the algo
    • setAlgo

      public void setAlgo(String algo)
      Parameters:
      algo - the algo to set
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in interface Principal
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Principal
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Specified by:
      toString in interface Principal
      Overrides:
      toString in class Object
      Returns:
      same as getName()