public class Token<T extends TokenIdentifier> extends Object implements Writable
| 限定符和类型 | 类和说明 |
|---|---|
static class |
Token.TrivialRenewer
A trivial renewer for token kinds that aren't managed.
|
| 限定符和类型 | 字段和说明 |
|---|---|
static org.apache.commons.logging.Log |
LOG |
| 构造器和说明 |
|---|
Token()
Default constructor
|
Token(byte[] identifier,
byte[] password,
Text kind,
Text service)
Construct a token from the components.
|
Token(Token<T> other)
Clone a token.
|
Token(T id,
SecretManager<T> mgr)
Construct a token given a token identifier and a secret manager for the
type of the token identifier.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
cancel(Configuration conf)
Cancel this delegation token
|
void |
decodeFromUrlString(String newValue)
Decode the given url safe string into this token.
|
String |
encodeToUrlString()
Encode this token as a url safe string
|
boolean |
equals(Object right) |
byte[] |
getIdentifier()
Get the token identifier
|
Text |
getKind()
Get the token kind
|
byte[] |
getPassword()
Get the token password/secret
|
Text |
getService()
Get the service on which the token is supposed to be used
|
int |
hashCode() |
boolean |
isManaged()
Is this token managed so that it can be renewed or cancelled?
|
void |
readFields(DataInput in)
Deserialize the fields of this object from
in. |
long |
renew(Configuration conf)
Renew this delegation token
|
void |
setKind(Text newKind)
Set the token kind.
|
void |
setService(Text newService)
Set the service on which the token is supposed to be used
|
String |
toString() |
void |
write(DataOutput out)
Serialize the fields of this object to
out. |
public Token(T id, SecretManager<T> mgr)
id - the token identifiermgr - the secret managerpublic Token(byte[] identifier,
byte[] password,
Text kind,
Text service)
identifier - the token identifierpassword - the token's passwordkind - the kind of tokenservice - the service for this tokenpublic Token()
public byte[] getIdentifier()
public byte[] getPassword()
public Text getKind()
@InterfaceAudience.Private public void setKind(Text newKind)
newKind - public Text getService()
public void setService(Text newService)
newService - the service namepublic void readFields(DataInput in) throws IOException
in.
For efficiency, implementations should attempt to re-use storage in the existing object where possible.
readFields 在接口中 Writablein - DataInput to deseriablize this object from.IOExceptionpublic void write(DataOutput out) throws IOException
out.write 在接口中 Writableout - DataOuput to serialize this object into.IOExceptionpublic String encodeToUrlString() throws IOException
IOExceptionpublic void decodeFromUrlString(String newValue) throws IOException
newValue - the encoded stringIOExceptionpublic boolean isManaged()
throws IOException
IOExceptionpublic long renew(Configuration conf) throws IOException, InterruptedException
IOExceptionInterruptedExceptionpublic void cancel(Configuration conf) throws IOException, InterruptedException
Copyright © 2009 The Apache Software Foundation