|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.tagish.auth.TypedPrincipal
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.
| Field Summary | |
static int |
DOMAIN
This TypedPrincipal represents the domain name or SID. |
static int |
GROUP
This TypedPrincipal represents a group name or SID. |
protected String |
name
|
protected int |
type
|
protected static String[] |
typeMap
|
static int |
UNKNOWN
This TypedPrincipal represents an item of unknown type. |
static int |
USER
This TypedPrincipal represents a username or SID. |
| Constructor Summary | |
TypedPrincipal()
Create a TypedPrincipal with a blank name. |
|
TypedPrincipal(String name)
Create a TypedPrincipal with a name. |
|
TypedPrincipal(String name,
int type)
Create a TypedPrincipal with a name and type. |
|
| Method Summary | |
boolean |
equals(Object o)
Compares the specified Object with this TypedPrincipal
for equality. |
String |
getName()
Return the name for this TypedPrincipal. |
int |
getType()
Return the type for this TypedPrincipal. |
String |
getTypeName()
Return the name of the type for this TypedPrincipal. |
int |
hashCode()
Return a hash code for this TypedPrincipal. |
void |
setName(String name)
|
void |
setType(int type)
|
String |
toString()
Return a string representation of this TypedPrincipal. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected String name
protected int type
public static final int USER
TypedPrincipal represents a username or SID.public static final int DOMAIN
TypedPrincipal represents the domain name or SID.public static final int GROUP
TypedPrincipal represents a group name or SID.public static final int UNKNOWN
TypedPrincipal represents an item of unknown type.protected static final String[] typeMap
| Constructor Detail |
public TypedPrincipal(String name,
int type)
name - the name for this principal.type - the type for this principal.NullPointerException - if the name
is null.public TypedPrincipal(String name)
name - the name for this Principal.NullPointerException - if the name
is null.public TypedPrincipal()
| Method Detail |
public void setType(int type)
public void setName(String name)
public String getName()
TypedPrincipal.
getName in interface PrincipalTypedPrincipalpublic int getType()
TypedPrincipal.
TypedPrincipalpublic String getTypeName()
TypedPrincipal.
TypedPrincipalpublic String toString()
TypedPrincipal.
toString in interface PrincipaltoString in class ObjectTypedPrincipal.public boolean equals(Object o)
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.
equals in interface Principalequals in class Objecto - Object to be compared for equality with this TypedPrincipal.TypedPrincipal.public int hashCode()
TypedPrincipal.
hashCode in interface PrincipalhashCode in class ObjectTypedPrincipal.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||