Class AuthenticationToken.AuthenticationTokenSerializer
- java.lang.Object
-
- org.apache.accumulo.core.client.security.tokens.AuthenticationToken.AuthenticationTokenSerializer
-
- Enclosing interface:
- AuthenticationToken
public static final class AuthenticationToken.AuthenticationTokenSerializer extends Object
A utility class to serialize/deserializeAuthenticationToken
objects.
Unfortunately, these methods are provided in an inner-class, to avoid breaking the interface API.- Since:
- 1.6.0
-
-
Constructor Summary
Constructors Constructor Description AuthenticationTokenSerializer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <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.
-
-
-
Method Detail
-
deserialize
public static <T extends AuthenticationToken> T deserialize(Class<T> tokenType, byte[] tokenBytes)
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:
serialize(AuthenticationToken)
-
deserialize
public static AuthenticationToken deserialize(String tokenClassName, byte[] tokenBytes)
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(AuthenticationToken)
-
serialize
public static byte[] serialize(AuthenticationToken token)
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:
deserialize(Class, byte[])
-
-