Class AuthenticationToken.AuthenticationTokenSerializer
java.lang.Object
org.apache.accumulo.core.client.security.tokens.AuthenticationToken.AuthenticationTokenSerializer
- Enclosing interface:
- AuthenticationToken
A utility class to serialize/deserialize
Unfortunately, these methods are provided in an inner-class, to avoid breaking the interface API.
AuthenticationToken
objects.Unfortunately, these methods are provided in an inner-class, to avoid breaking the interface API.
- Since:
- 1.6.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends AuthenticationToken>
Tdeserialize
(Class<T> tokenType, byte[] tokenBytes) A convenience method to create tokens from serialized bytes, created byserialize(AuthenticationToken)
static AuthenticationToken
deserialize
(String tokenClassName, byte[] tokenBytes) An alternate version ofdeserialize(Class, byte[])
that accepts a token class name rather than a token class.static byte[]
serialize
(AuthenticationToken token) A convenience method to serialize tokens.
-
Constructor Details
-
AuthenticationTokenSerializer
public AuthenticationTokenSerializer()
-
-
Method Details
-
deserialize
A convenience method to create tokens from serialized bytes, created byserialize(AuthenticationToken)
The specified tokenType will be instantiated, and used to deserialize the decoded bytes. The resulting object will then be returned to the caller.
- Parameters:
tokenType
- the token class to use to deserialize the bytestokenBytes
- the token-specific serialized bytes- Returns:
- an
AuthenticationToken
instance of the type specified by tokenType - See Also:
-
deserialize
An alternate version ofdeserialize(Class, byte[])
that accepts a token class name rather than a token class.- Parameters:
tokenClassName
- the fully-qualified class name to be returned- See Also:
-
serialize
A convenience method to serialize tokens.The provided
AuthenticationToken
will be serialized to bytes by its own implementation and returned to the caller.- Parameters:
token
- the token to serialize- Returns:
- a serialized representation of the provided
AuthenticationToken
- See Also:
-