Package org.apache.hadoop.security.token
Class TokenIdentifier
java.lang.Object
org.apache.hadoop.security.token.TokenIdentifier
- All Implemented Interfaces:
Writable
- Direct Known Subclasses:
AbstractDelegationTokenIdentifier,AMRMTokenIdentifier,ClientToAMTokenIdentifier,ContainerTokenIdentifier,NMTokenIdentifier
An identifier that identifies a token, may contain public information
about a token, including its kind (or type).
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getBytes()Get the bytes for the token identifierabstract TextgetKind()Get the token kindReturns a tracking identifier that can be used to associate usages of a token across multiple client sessions.abstract UserGroupInformationgetUser()Get the Ugi with the username encoded in the token identifierMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.hadoop.io.Writable
readFields, write
-
Constructor Details
-
TokenIdentifier
public TokenIdentifier()
-
-
Method Details
-
getKind
Get the token kind- Returns:
- the kind of the token
-
getUser
Get the Ugi with the username encoded in the token identifier- Returns:
- the username. null is returned if username in the identifier is empty or null.
-
getBytes
public byte[] getBytes()Get the bytes for the token identifier- Returns:
- the bytes of the identifier
-
getTrackingId
Returns a tracking identifier that can be used to associate usages of a token across multiple client sessions. Currently, this function just returns an MD5 of {getBytes().- Returns:
- tracking identifier
-