FileDocCategorySizeDatePackage
FileRealmUser.javaAPI DocGlassfish v2 API5190Fri May 04 22:35:30 BST 2007com.sun.enterprise.security.auth.realm.file

FileRealmUser

public class FileRealmUser extends com.sun.enterprise.deployment.PrincipalImpl implements com.sun.enterprise.security.auth.realm.User
Represents a FileRealm user.

Fields Summary
private static final String
GROUP_KEY
private String[]
groups
private String
realm
private Hashtable
attributes
private byte[]
salt
private byte[]
hash
Constructors Summary
public FileRealmUser(String name)
Constructor.

    
          
      
    
        super(name);
        attributes = new Hashtable(1);       // not really needed
    
public FileRealmUser(String name, String[] groups, String realm, byte[] salt, byte[] hash)
Constructor.

param
name User name.
param
groups Group memerships.
param
realm Realm.
param
salt SSHA salt.
param
hash SSHA password hash.

        super(name);
        this.groups = groups;
        this.realm = realm;
        this.hash = hash;
        this.salt = salt;
        
        attributes = new Hashtable(1);       // not really needed
        attributes.put(GROUP_KEY, groups);
    
Methods Summary
public java.lang.ObjectgetAttribute(java.lang.String key)
Return the requested attribute for the user.

Not really needed.

param
key string identifies the attribute.

        return attributes.get(key);
    
public java.util.EnumerationgetAttributeNames()
Return the names of the supported attributes for this user.

Not really needed.

	return attributes.keys();
    
public java.lang.String[]getGroups()
Return the names of the groups this user belongs to.

return
String[] List of group memberships.

	return groups;
    
public byte[]getHash()
Get hash value.

        return hash;
    
public com.sun.enterprise.security.auth.realm.RealmgetRealm()
Returns the realm with which this user is associated

return
Realm name.
exception
NoSuchRealmException if the realm associated this user no longer exist

	return Realm.getInstance(realm);
    
public byte[]getSalt()
Returns salt value.

        return salt;
    
public voidsetGroups(java.lang.String[] grp)
Set group membership.

        this.groups = grp;
    
public voidsetGroups(java.util.Vector grp)
Set group membership.

        String[] g = new String[grp.size()];
        grp.toArray(g);
        this.groups = g;
        attributes.put(GROUP_KEY, groups);
    
public voidsetHash(byte[] hash)
Set hash value.

        this.hash = hash;
    
public voidsetSalt(byte[] salt)
Set salt value.

        this.salt = salt;