com.j_spaces.core.filters
Class GenericPrincipal

java.lang.Object
  extended by com.j_spaces.core.filters.GenericPrincipal
All Implemented Interfaces:
Serializable, Principal

public class GenericPrincipal
extends Object
implements Principal, Serializable

GenericPrincipal implementation of Principal that is available for use by ISpaceUserAccountDriver implementations.

See Also:
Serialized Form

Nested Class Summary
static class GenericPrincipal.Attribute
           
 
Field Summary
 Map<String,List> readEntries
           
 Map readMatchObjects
           
 ArrayList<String> userDefinedRoles
          List contains only user-defined roles.
 Map<String,List> writeEntries
           
 Map writeMatchObjects
           
 
Constructor Summary
GenericPrincipal(String userName, String password)
          Construct a new Principal for the specified username and password.
GenericPrincipal(String userName, String password, List<String> roles, Map<String,List> writeEntries, Map<String,List> readEntries)
          Construct a new Principal for the specified username and password, with the specified role names (as Strings).
 
Method Summary
 boolean equals(Object another)
          Indicates whether some other object is "equal to" this one.
 String getName()
           
 String getPassword()
          Returns the password of the user represented by this Principal.
 String[] getRoles()
          Returns set of roles associated with this user.
 String getUserName()
          Returns the username of the user represented by this Principal.
 boolean isHidden()
          Return true if user defined as hidden to security management on client side (e.g.
 void setRoles(String[] roles)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.security.Principal
hashCode
 

Field Detail

userDefinedRoles

public ArrayList<String> userDefinedRoles
List contains only user-defined roles.


writeEntries

public Map<String,List> writeEntries

readEntries

public Map<String,List> readEntries

writeMatchObjects

public Map writeMatchObjects

readMatchObjects

public Map readMatchObjects
Constructor Detail

GenericPrincipal

public GenericPrincipal(String userName,
                        String password,
                        List<String> roles,
                        Map<String,List> writeEntries,
                        Map<String,List> readEntries)
Construct a new Principal for the specified username and password, with the specified role names (as Strings).

Parameters:
userName - The username of the user represented by this Principal
password - Credentials used to authenticate this user
roles - List of roles (must be Strings) possessed by this user
writeEntries - List of permitted entries for write operation
readEntries - List of permitted entries for read operation

GenericPrincipal

public GenericPrincipal(String userName,
                        String password)
Construct a new Principal for the specified username and password.

Parameters:
userName - The username of the user represented by this Principal
password - The encrypted value used to authenticate user. The encryption algorithm is DES/ECB/PKCS5Padding.
Method Detail

getName

public String getName()
Specified by:
getName in interface Principal

getUserName

public String getUserName()
Returns the username of the user represented by this Principal.


getPassword

public String getPassword()
Returns the password of the user represented by this Principal.


getRoles

public String[] getRoles()
Returns set of roles associated with this user.


setRoles

public void setRoles(String[] roles)

toString

public String toString()
Specified by:
toString in interface Principal
Overrides:
toString in class Object

equals

public boolean equals(Object another)
Indicates whether some other object is "equal to" this one.

Specified by:
equals in interface Principal
Overrides:
equals in class Object

isHidden

public boolean isHidden()
Return true if user defined as hidden to security management on client side (e.g. SpaceBrowser application), otherwise false.