DLESE Tools
v1.6.0

org.dlese.dpc.schemedit.security.auth
Class CollectionRolePrincipal

java.lang.Object
  extended by org.dlese.dpc.schemedit.security.auth.TypedPrincipal
      extended by org.dlese.dpc.schemedit.security.auth.CollectionRolePrincipal
All Implemented Interfaces:
Serializable, Principal

public class CollectionRolePrincipal
extends TypedPrincipal
implements Principal, Serializable

TypedPrincipals are derived from, and can be treated like Principals but they also contain extra information about the type of the Principal which can be USER, GROUP or DOMAIN. I'm not 100% certain that this is a good way of doing things. Suggestions welcome.

Version:
1.0.3
Author:
Andy Armstrong
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.dlese.dpc.schemedit.security.auth.TypedPrincipal
AUTH, COLLECTION, DOMAIN, GROUP, name, type, typeMap, UNKNOWN, USER
 
Constructor Summary
CollectionRolePrincipal()
          Create a CollectionRolePrincipal with a blank name.
CollectionRolePrincipal(String name, String collection)
          Create a CollectionRolePrincipal with a name.
CollectionRolePrincipal(String name, String collection, int type)
           
 
Method Summary
 boolean equals(Object o)
          Compares the specified Object with this TypedPrincipal for equality.
 String getCollection()
           
 void setCollection(String collection)
           
 
Methods inherited from class org.dlese.dpc.schemedit.security.auth.TypedPrincipal
getName, getType, getTypeName, hashCode, setName, setType, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.security.Principal
getName, hashCode, toString
 

Constructor Detail

CollectionRolePrincipal

public CollectionRolePrincipal(String name,
                               String collection,
                               int type)

CollectionRolePrincipal

public CollectionRolePrincipal(String name,
                               String collection)
Create a CollectionRolePrincipal with a name.

Parameters:
name - the name for this Principal.
Throws:
NullPointerException - if the name is null.

CollectionRolePrincipal

public CollectionRolePrincipal()
Create a CollectionRolePrincipal with a blank name.

Method Detail

getCollection

public String getCollection()

setCollection

public void setCollection(String collection)

equals

public boolean equals(Object o)
Description copied from class: TypedPrincipal
Compares the specified Object with this TypedPrincipal for equality. Returns true if the given object is also a TypedPrincipal and the two TypedPrincipals have the same name and type. If the object is any other kind Principal its will be considered equal if the name matches.

Specified by:
equals in interface Principal
Overrides:
equals in class TypedPrincipal
Parameters:
o - Object to be compared for equality with this TypedPrincipal.
Returns:
true if the specified Object is equal to this TypedPrincipal.

DLESE Tools
v1.6.0