Package com.hazelcast.security
Class UsernamePasswordCredentials
- java.lang.Object
-
- com.hazelcast.security.UsernamePasswordCredentials
-
- All Implemented Interfaces:
DataSerializable
,IdentifiedDataSerializable
,Credentials
,PasswordCredentials
,java.io.Serializable
public class UsernamePasswordCredentials extends java.lang.Object implements PasswordCredentials, IdentifiedDataSerializable
Simple implementation ofPasswordCredentials
using name and password as security attributes.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description UsernamePasswordCredentials()
UsernamePasswordCredentials(java.lang.String username, java.lang.String password)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
int
getClassId()
Returns type identifier for this class.int
getFactoryId()
Returns DataSerializableFactory factory ID for this class.java.lang.String
getName()
java.lang.String
getPassword()
Gets the password.int
hashCode()
void
readData(ObjectDataInput in)
Reads fields from the input streamvoid
setName(java.lang.String name)
void
setPassword(java.lang.String password)
java.lang.String
toString()
void
writeData(ObjectDataOutput out)
Writes object fields to output stream
-
-
-
Method Detail
-
getPassword
public java.lang.String getPassword()
Gets the password.- Specified by:
getPassword
in interfacePasswordCredentials
-
setPassword
public void setPassword(java.lang.String password)
- Parameters:
password
- the password to set
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceCredentials
-
setName
public void setName(java.lang.String name)
- Parameters:
name
- the name to set
-
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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
writeData
public void writeData(ObjectDataOutput out) throws java.io.IOException
Description copied from interface:DataSerializable
Writes object fields to output stream- Specified by:
writeData
in interfaceDataSerializable
- Parameters:
out
- output- Throws:
java.io.IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the output stream has been closed.
-
readData
public void readData(ObjectDataInput in) throws java.io.IOException
Description copied from interface:DataSerializable
Reads fields from the input stream- Specified by:
readData
in interfaceDataSerializable
- Parameters:
in
- input- Throws:
java.io.IOException
- if an I/O error occurs. In particular, anIOException
may be thrown if the input stream has been closed.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
-