Class PasswordToken
- java.lang.Object
-
- org.apache.accumulo.core.client.security.tokens.PasswordToken
-
- All Implemented Interfaces:
Cloneable,Destroyable,AuthenticationToken,org.apache.hadoop.io.Writable
- Direct Known Subclasses:
CredentialProviderToken,DelegationTokenImpl
public class PasswordToken extends Object implements AuthenticationToken
- Since:
- 1.5.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.accumulo.core.client.security.tokens.AuthenticationToken
AuthenticationToken.AuthenticationTokenSerializer, AuthenticationToken.Properties, AuthenticationToken.TokenProperty
-
-
Constructor Summary
Constructors Constructor Description PasswordToken()Constructor for use withWritable.PasswordToken(byte[] password)Constructs a token from a copy of the password.PasswordToken(CharSequence password)Constructs a token from a copy of the password.PasswordToken(ByteBuffer password)Constructs a token from a copy of the password.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PasswordTokenclone()voiddestroy()booleanequals(Object obj)byte[]getPassword()Set<AuthenticationToken.TokenProperty>getProperties()inthashCode()voidinit(AuthenticationToken.Properties properties)booleanisDestroyed()voidreadFields(DataInput arg0)protected voidsetPassword(byte[] password)protected voidsetPassword(CharBuffer charBuffer)voidwrite(DataOutput arg0)
-
-
-
Constructor Detail
-
PasswordToken
public PasswordToken()
Constructor for use withWritable. CallreadFields(DataInput).
-
PasswordToken
public PasswordToken(CharSequence password)
Constructs a token from a copy of the password. Destroying the argument after construction will not destroy the copy in this token, and destroying this token will only destroy the copy held inside this token, not the argument. Password tokens created with this constructor will store the password as UTF-8 bytes.
-
PasswordToken
public PasswordToken(byte[] password)
Constructs a token from a copy of the password. Destroying the argument after construction will not destroy the copy in this token, and destroying this token will only destroy the copy held inside this token, not the argument.
-
PasswordToken
public PasswordToken(ByteBuffer password)
Constructs a token from a copy of the password. Destroying the argument after construction will not destroy the copy in this token, and destroying this token will only destroy the copy held inside this token, not the argument.
-
-
Method Detail
-
getPassword
public byte[] getPassword()
-
readFields
public void readFields(DataInput arg0) throws IOException
- Specified by:
readFieldsin interfaceorg.apache.hadoop.io.Writable- Throws:
IOException
-
write
public void write(DataOutput arg0) throws IOException
- Specified by:
writein interfaceorg.apache.hadoop.io.Writable- Throws:
IOException
-
destroy
public void destroy() throws DestroyFailedException- Specified by:
destroyin interfaceDestroyable- Throws:
DestroyFailedException
-
isDestroyed
public boolean isDestroyed()
- Specified by:
isDestroyedin interfaceDestroyable
-
clone
public PasswordToken clone()
- Specified by:
clonein interfaceAuthenticationToken- Overrides:
clonein classObject
-
setPassword
protected void setPassword(byte[] password)
-
setPassword
protected void setPassword(CharBuffer charBuffer)
-
init
public void init(AuthenticationToken.Properties properties)
- Specified by:
initin interfaceAuthenticationToken
-
getProperties
public Set<AuthenticationToken.TokenProperty> getProperties()
- Specified by:
getPropertiesin interfaceAuthenticationToken
-
-