com.sun.grid.jgdi.security
public class JGDIPrincipal extends java.lang.Object implements java.security.Principal, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SESSION_ID_PREFIX |
static java.lang.String |
SESSION_ID_SUFFIX |
Constructor and Description |
---|
JGDIPrincipal(java.lang.String username,
long sessionId)
Create a JGDIPrincipal with a username.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o)
Compares the specified Object with this
JGDIPrincipal
for equality. |
java.lang.String |
getName()
Return the username for this
JGDIPrincipal . |
long |
getSessionId()
Get the session id
|
java.lang.String |
getUsername()
Get the username
|
int |
hashCode()
Return a hash code for this
JGDIPrincipal . |
java.lang.String |
toString()
Return a string representation of this
JGDIPrincipal . |
public static final java.lang.String SESSION_ID_PREFIX
public static final java.lang.String SESSION_ID_SUFFIX
public JGDIPrincipal(java.lang.String username, long sessionId)
username
- the username for this user.sessionId
- the id of the sessionjava.lang.NullPointerException
- if the name
is null
.public java.lang.String getName()
JGDIPrincipal
.
getName
in interface java.security.Principal
JGDIPrincipal
public java.lang.String toString()
JGDIPrincipal
.
toString
in interface java.security.Principal
toString
in class java.lang.Object
JGDIPrincipal
.public boolean equals(java.lang.Object o)
JGDIPrincipal
for equality. Returns true if the given object is also a
JGDIPrincipal
and the two JGDIPrincipals
have the same username.
equals
in interface java.security.Principal
equals
in class java.lang.Object
o
- Object to be compared for equality with this
JGDIPrincipal
.JGDIPrincipal
.public int hashCode()
JGDIPrincipal
.
hashCode
in interface java.security.Principal
hashCode
in class java.lang.Object
JGDIPrincipal
.public long getSessionId()
public java.lang.String getUsername()
Copyright © 2007 Sun Microsystems, Inc. All rights reserved.