|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nitido.nim.Credential
public final class Credential
The Credential class is data container of credential information for entities. This object is designed to store the credential data information only. It should NEVER be used as a KEY object in data containers (such as Hashtable, HashMap or HashSet). It is because its hashCode() method is not overrided and it will return the default hashCode, which depends on the instance ID only.
CredentialConstants
,
Serialized FormConstructor Summary | |
---|---|
Credential(Credential inCred)
Copy constructor of the credential. |
|
Credential(java.lang.String idGroup,
java.lang.String entityId)
This constructor is used to create a new instance of a Credential object. |
Method Summary | |
---|---|
java.lang.Object |
clone()
Clones ths credential. |
boolean |
equals(java.lang.Object obj)
This method returns true if the given object is a credential with the same tokens as this credential. |
java.lang.String |
getEntityId()
This method returns the entity identifier for this credential. |
java.lang.String |
getIdentifyingGroup()
This method returns the identifying group of the credential. |
java.io.Serializable |
getToken(java.lang.String key)
This method returns the authentication token associated with the given key. |
java.util.Enumeration |
getTokenKeys()
This method returns an enumeration with all the token keys currently associated to this credential. |
boolean |
isAuthenticated()
This method returns true if the credential has been authenticated, otherwise this method returns false. |
protected void |
setAuthenticated(boolean authFlag)
This PROTECTED method is used by the nim core to set the authenticated flag. |
void |
setToken(java.lang.String key,
java.io.Serializable value)
This methods is used to add an authentication token to this credential. |
java.lang.String |
toString()
This method returns the string representation of this credential. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Credential(java.lang.String idGroup, java.lang.String entityId) throws NiMRuntimeException
idGroup
- The String that specified the type of the entity this
credential represents. The actual semantics and format of
the idGroup String depends on the underlying
implementation of entity or entitlement services.entityId
- The string identifier of the entity this credential
represents.
NiMRuntimeException
- If any of the given parameters are null.public Credential(Credential inCred)
For example:
You have a Credential A that has a token X that is a Vector.
Now, you create Credential B with this constructor and with
Credential A as parameter. Credential B will have a reference
to the token X. If you add another token Y to Credential B,
Credential A will not be affected at all. However, if you add
another element to the vector referenced by token X, Credential
A may be affected since its token X value has a reference to
the same vector.
Method Detail |
---|
public final void setToken(java.lang.String key, java.io.Serializable value) throws java.lang.IllegalStateException
A token is a piece of information that can be used to authenticate the credential, for example, the password of a user.
key
- The key used to associate the given token.value
- The value of the authentication token. To remove the value
associated to a key, you can pass null object for this
parameter.
java.lang.IllegalStateException
- if the credential has been authenticated already (no token
change is allowed on an authenticated credential).public final java.io.Serializable getToken(java.lang.String key)
key
- The key of the requested token.
public final java.util.Enumeration getTokenKeys()
public final java.lang.String getIdentifyingGroup()
public final java.lang.String getEntityId()
public final boolean isAuthenticated()
protected final void setAuthenticated(boolean authFlag)
authFlag
- If the given flag is true, the credential is marked as
authenticated, otherwise the credential is not considered
to be authenticated.public final java.lang.String toString()
toString
in class java.lang.Object
public final boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- The object used to compared this credential with.
public java.lang.Object clone()
clone
in class java.lang.Object
|
Nitido NiM 2.5 Java API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1999-2009 Nitido Inc. Proprietary and Confidential. All Rights Reserved.