|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dlese.dpc.schemedit.security.auth.TypedPrincipal
public class TypedPrincipal
This class is based on the Tagish JAAS Login Modules (http://thekirschners.com/tagish-jaas/), and extended only to add "COLLECTION" and "AUTH" principles. 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 |
AUTH
This TypedPrincipal represents an authentication method. |
static int |
COLLECTION
|
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 COLLECTION
public static final int AUTH
TypedPrincipal
represents an authentication method.
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 Principal
TypedPrincipal
public int getType()
TypedPrincipal
.
TypedPrincipal
public String getTypeName()
TypedPrincipal
.
TypedPrincipal
public String toString()
TypedPrincipal
.
toString
in interface Principal
toString
in class Object
TypedPrincipal
.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 Principal
equals
in class Object
o
- Object to be compared for equality with this TypedPrincipal
.
TypedPrincipal
.public int hashCode()
TypedPrincipal
.
hashCode
in interface Principal
hashCode
in class Object
TypedPrincipal
.
|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |