public final class IdentityPrincipal
extends java.lang.Object
implements java.security.Principal
Identity Principal class implements the java.security.principal interface.
An IdentityPrincipal object represents the user identity to assert to an enterprise information
system.
javax.resource.spi.security.PasswordCredential| Constructor and Description |
|---|
IdentityPrincipal(java.lang.String userName,
java.lang.String realm,
java.lang.String origUser,
byte[] token)
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
equals returns true if and only if the specified IdentityPrincipal
object contains the same userName, realm, origUser, and token values. |
javax.resource.spi.ManagedConnectionFactory |
getManagedConnectionFactory()
getManagedConnectionFactory returns a reference of the
ManagedConnectionFactory to which the username identity should be used. |
java.lang.String |
getName()
getName returns the userName String. |
java.lang.String |
getOriginalUser()
getOriginalUser returns origUser which represents the user who originally submits
the request. |
java.lang.String |
getRealm()
getRealm returns a symbolic name represents the repository or repositories in which
userName is defined. |
byte[] |
getToken()
getToken returns a serialized form of the security context of userName. |
int |
hashCode()
hashCode returns the hash value of userName, realm, origUser, and token. |
void |
setManagedConnectionFactory(javax.resource.spi.ManagedConnectionFactory mcf)
setManagedConnectionFactory sets the specified
ManagedConnectionFactory in the IdentityPrincipal object. |
java.lang.String |
toString()
toString returns a String representation of userName, realm, origUser, and token. |
public IdentityPrincipal(java.lang.String userName,
java.lang.String realm,
java.lang.String origUser,
byte[] token)
userName - String specifies the user identity to be asserted to an enterprise information
system.realm - String is a logical representation of the user repository in which the userName
is defined. The realm is a symbolic name an enterprise information system uses
to determine the user repository.origUser - String contains an identity that represents the original user who submits
the request. origUser may or may not be the same as the userName parameter.
userName may be different from the origUser depending on the J2EE Run-As mode
and the JCA resource reference identity mapping configuration.token - contains a serialized form of the user's security context.public java.lang.String getName()
getName returns the userName String.
This is the user name to be used in identity assertion.
getName in interface java.security.Principalpublic java.lang.String getRealm()
getRealm returns a symbolic name represents the repository or repositories in which
userName is defined.
public java.lang.String getOriginalUser()
getOriginalUser returns origUser which represents the user who originally submits
the request.
public byte[] getToken()
getToken returns a serialized form of the security context of userName. The token
is an opaque object that may be used by security auditing or may be used to reconstruct the
security context.
public javax.resource.spi.ManagedConnectionFactory getManagedConnectionFactory()
getManagedConnectionFactory returns a reference of the
ManagedConnectionFactory to which the username identity should be used.
ManagedConnectionFactory object.public void setManagedConnectionFactory(javax.resource.spi.ManagedConnectionFactory mcf)
setManagedConnectionFactory sets the specified
ManagedConnectionFactory in the IdentityPrincipal object.
public boolean equals(java.lang.Object obj)
equals returns true if and only if the specified IdentityPrincipal
object contains the same userName, realm, origUser, and token values.
equals in interface java.security.Principalequals in class java.lang.Objectpublic int hashCode()
hashCode returns the hash value of userName, realm, origUser, and token.
hashCode in interface java.security.PrincipalhashCode in class java.lang.Objectpublic java.lang.String toString()
toString returns a String representation of userName, realm, origUser, and token.
toString in interface java.security.PrincipaltoString in class java.lang.Object