org.apache.hadoop.lib.service.security
Class DelegationTokenManagerService

java.lang.Object
  extended by org.apache.hadoop.lib.server.BaseService
      extended by org.apache.hadoop.lib.service.security.DelegationTokenManagerService
All Implemented Interfaces:
Service, DelegationTokenManager

@InterfaceAudience.Private
public class DelegationTokenManagerService
extends BaseService
implements DelegationTokenManager

DelegationTokenManager service implementation.


Constructor Summary
DelegationTokenManagerService()
           
 
Method Summary
 void cancelToken(org.apache.hadoop.security.token.Token<DelegationTokenIdentifier> token, String canceler)
          Cancels a delegation token.
 org.apache.hadoop.security.token.Token<DelegationTokenIdentifier> createToken(org.apache.hadoop.security.UserGroupInformation ugi, String renewer)
          Creates a delegation token.
 void destroy()
          Destroys the service.
 Class getInterface()
          Returns the service interface.
protected  void init()
          Initializes the service.
 long renewToken(org.apache.hadoop.security.token.Token<DelegationTokenIdentifier> token, String renewer)
          Renews a delegation token.
 org.apache.hadoop.security.UserGroupInformation verifyToken(org.apache.hadoop.security.token.Token<DelegationTokenIdentifier> token)
          Verifies a delegation token.
 
Methods inherited from class org.apache.hadoop.lib.server.BaseService
getPrefix, getPrefixedName, getServer, getServiceConfig, getServiceDependencies, init, postInit, serverStatusChange
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DelegationTokenManagerService

public DelegationTokenManagerService()
Method Detail

init

protected void init()
             throws ServiceException
Initializes the service.

Specified by:
init in class BaseService
Throws:
ServiceException - thrown if the service could not be initialized.

destroy

public void destroy()
Destroys the service.

Specified by:
destroy in interface Service
Overrides:
destroy in class BaseService

getInterface

public Class getInterface()
Returns the service interface.

Specified by:
getInterface in interface Service
Returns:
the service interface.

createToken

public org.apache.hadoop.security.token.Token<DelegationTokenIdentifier> createToken(org.apache.hadoop.security.UserGroupInformation ugi,
                                                                                     String renewer)
                                                                              throws DelegationTokenManagerException
Creates a delegation token.

Specified by:
createToken in interface DelegationTokenManager
Parameters:
ugi - UGI creating the token.
renewer - token renewer.
Returns:
new delegation token.
Throws:
DelegationTokenManagerException - thrown if the token could not be created.

renewToken

public long renewToken(org.apache.hadoop.security.token.Token<DelegationTokenIdentifier> token,
                       String renewer)
                throws DelegationTokenManagerException
Renews a delegation token.

Specified by:
renewToken in interface DelegationTokenManager
Parameters:
token - delegation token to renew.
renewer - token renewer.
Returns:
epoc expiration time.
Throws:
DelegationTokenManagerException - thrown if the token could not be renewed.

cancelToken

public void cancelToken(org.apache.hadoop.security.token.Token<DelegationTokenIdentifier> token,
                        String canceler)
                 throws DelegationTokenManagerException
Cancels a delegation token.

Specified by:
cancelToken in interface DelegationTokenManager
Parameters:
token - delegation token to cancel.
canceler - token canceler.
Throws:
DelegationTokenManagerException - thrown if the token could not be canceled.

verifyToken

public org.apache.hadoop.security.UserGroupInformation verifyToken(org.apache.hadoop.security.token.Token<DelegationTokenIdentifier> token)
                                                            throws DelegationTokenManagerException
Verifies a delegation token.

Specified by:
verifyToken in interface DelegationTokenManager
Parameters:
token - delegation token to verify.
Returns:
the UGI for the token.
Throws:
DelegationTokenManagerException - thrown if the token could not be verified.


Copyright © 2014 Apache Software Foundation. All Rights Reserved.