| Modifier | Constructor and Description |
|---|---|
protected |
AuthToken() |
|
AuthToken(String userName,
String principal,
String type)
Creates an authentication token.
|
| Modifier and Type | Method and Description |
|---|---|
protected static void |
checkForIllegalArgument(String value,
String name)
Check if the provided value is invalid.
|
long |
getExpires()
Returns the expiration time of the token.
|
String |
getName()
Returns the principal name (this method name comes from the JDK
Principal interface). |
String |
getType()
Returns the authentication mechanism of the token.
|
String |
getUserName()
Returns the user name.
|
boolean |
isExpired()
Returns true if the token has expired.
|
static AuthToken |
parse(String tokenStr) |
void |
setExpires(long expires)
Sets the expiration of the token.
|
String |
toString()
Returns the string representation of the token.
|
protected AuthToken()
public AuthToken(String userName, String principal, String type)
userName - user name.principal - principal (commonly matches the user name, with Kerberos is the full/long principal
name while the userName is the short name).type - the authentication mechanism name.
(System.currentTimeMillis() + validityPeriod).protected static void checkForIllegalArgument(String value, String name)
value - the value to check.name - the parameter name to use in an error message if the value is invalid.public static AuthToken parse(String tokenStr) throws org.apache.hadoop.security.authentication.client.AuthenticationException
org.apache.hadoop.security.authentication.client.AuthenticationExceptionpublic boolean isExpired()
public String getUserName()
public String getName()
Principal interface).public String getType()
public long getExpires()
public void setExpires(long expires)
expires - expiration time of the token in milliseconds since the epoch.Copyright © 2017. All rights reserved.