Class IdentityPrincipal
- java.lang.Object
-
- com.ibm.websphere.security.auth.IdentityPrincipal
-
- All Implemented Interfaces:
- java.security.Principal
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.- Version:
- 7.0
- See Also:
javax.resource.spi.security.PasswordCredential
-
-
Constructor Summary
Constructors Constructor and Description IdentityPrincipal(java.lang.String userName, java.lang.String realm, java.lang.String origUser, byte[] token)
-
Method Summary
Methods Modifier and Type Method and Description boolean
equals(java.lang.Object obj)
equals
returns true if and only if the specifiedIdentityPrincipal
object contains the same userName, realm, origUser, and token values.javax.resource.spi.ManagedConnectionFactory
getManagedConnectionFactory()
getManagedConnectionFactory
returns a reference of theManagedConnectionFactory
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 specifiedManagedConnectionFactory
in theIdentityPrincipal
object.java.lang.String
toString()
toString
returns a String representation of userName, realm, origUser, and token.
-
-
-
Constructor Detail
-
IdentityPrincipal
public IdentityPrincipal(java.lang.String userName, java.lang.String realm, java.lang.String origUser, byte[] token)
- Parameters:
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.
-
-
Method Detail
-
getName
public java.lang.String getName()
getName
returns the userName String. This is the user name to be used in identity assertion.- Specified by:
getName
in interfacejava.security.Principal
-
getRealm
public java.lang.String getRealm()
getRealm
returns a symbolic name represents the repository or repositories in which userName is defined.
-
getOriginalUser
public java.lang.String getOriginalUser()
getOriginalUser
returns origUser which represents the user who originally submits the request.
-
getToken
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.
-
getManagedConnectionFactory
public javax.resource.spi.ManagedConnectionFactory getManagedConnectionFactory()
getManagedConnectionFactory
returns a reference of theManagedConnectionFactory
to which the username identity should be used.- Returns:
- a
ManagedConnectionFactory
object.
-
setManagedConnectionFactory
public void setManagedConnectionFactory(javax.resource.spi.ManagedConnectionFactory mcf)
setManagedConnectionFactory
sets the specifiedManagedConnectionFactory
in theIdentityPrincipal
object.
-
equals
public boolean equals(java.lang.Object obj)
equals
returns true if and only if the specifiedIdentityPrincipal
object contains the same userName, realm, origUser, and token values.- Specified by:
equals
in interfacejava.security.Principal
- Overrides:
equals
in classjava.lang.Object
- Returns:
- a boolean value.
-
hashCode
public int hashCode()
hashCode
returns the hash value of userName, realm, origUser, and token.- Specified by:
hashCode
in interfacejava.security.Principal
- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- an int hash value of the object.
-
toString
public java.lang.String toString()
toString
returns a String representation of userName, realm, origUser, and token.- Specified by:
toString
in interfacejava.security.Principal
- Overrides:
toString
in classjava.lang.Object
- Returns:
- a String representation of the object.
-
-