Package com.hazelcast.security
Class SimpleTokenCredentials
java.lang.Object
com.hazelcast.security.SimpleTokenCredentials
- All Implemented Interfaces:
DataSerializable
,IdentifiedDataSerializable
,Credentials
,TokenCredentials
,Serializable
public class SimpleTokenCredentials
extends Object
implements TokenCredentials, IdentifiedDataSerializable
Simple implementation of
Credentials
using a raw byte array token.- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
int
Returns type identifier for this class.int
Returns DataSerializableFactory factory ID for this class.getName()
Simple implementation which returns"<empty>"
fornull
tokens and"<token>"
for all other tokens.byte[]
getToken()
Gets the token.int
hashCode()
void
Reads fields from the input streamtoString()
void
Writes object fields to output stream
-
Constructor Details
-
SimpleTokenCredentials
public SimpleTokenCredentials() -
SimpleTokenCredentials
public SimpleTokenCredentials(byte[] token)
-
-
Method Details
-
getToken
public byte[] getToken()Gets the token.- Specified by:
getToken
in interfaceTokenCredentials
-
getName
Simple implementation which returns"<empty>"
fornull
tokens and"<token>"
for all other tokens.- Specified by:
getName
in interfaceCredentials
-
writeData
Description copied from interface:DataSerializable
Writes object fields to output stream- Specified by:
writeData
in interfaceDataSerializable
- Parameters:
out
- output- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
Description copied from interface:DataSerializable
Reads fields from the input stream- Specified by:
readData
in interfaceDataSerializable
- Parameters:
in
- input- Throws:
IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-
getFactoryId
public int getFactoryId()Description copied from interface:IdentifiedDataSerializable
Returns DataSerializableFactory factory ID for this class.- Specified by:
getFactoryId
in interfaceIdentifiedDataSerializable
- Returns:
- factory ID
-
getClassId
public int getClassId()Description copied from interface:IdentifiedDataSerializable
Returns type identifier for this class. It should be unique per DataSerializableFactory.- Specified by:
getClassId
in interfaceIdentifiedDataSerializable
- Returns:
- type ID
-
toString
-
hashCode
public int hashCode() -
equals
-