public class BaseNMTokenSecretManager extends SecretManager<NMTokenIdentifier>
SecretManager.InvalidToken
Modifier and Type | Field and Description |
---|---|
protected MasterKeyData |
currentMasterKey |
protected Lock |
readLock |
protected ReadWriteLock |
readWriteLock |
protected Lock |
writeLock |
Constructor and Description |
---|
BaseNMTokenSecretManager() |
Modifier and Type | Method and Description |
---|---|
NMTokenIdentifier |
createIdentifier()
It is required for RPC
|
protected MasterKeyData |
createNewMasterKey() |
Token |
createNMToken(ApplicationAttemptId applicationAttemptId,
NodeId nodeId,
String applicationSubmitter)
Helper function for creating NMTokens.
|
protected byte[] |
createPassword(NMTokenIdentifier identifier)
Create the password for the given identifier.
|
MasterKey |
getCurrentKey() |
static Token |
newInstance(byte[] password,
NMTokenIdentifier identifier) |
byte[] |
retrievePassword(NMTokenIdentifier identifier)
Retrieve the password for the given token identifier.
|
protected byte[] |
retrivePasswordInternal(NMTokenIdentifier identifier,
MasterKeyData masterKey) |
checkAvailableForRead, createPassword, createSecretKey, generateSecret
protected final ReadWriteLock readWriteLock
protected final Lock readLock
protected final Lock writeLock
protected MasterKeyData currentMasterKey
protected MasterKeyData createNewMasterKey()
@InterfaceAudience.Private public MasterKey getCurrentKey()
protected byte[] createPassword(NMTokenIdentifier identifier)
SecretManager
createPassword
in class SecretManager<NMTokenIdentifier>
identifier
- the identifier to usepublic byte[] retrievePassword(NMTokenIdentifier identifier) throws SecretManager.InvalidToken
SecretManager
retrievePassword
in class SecretManager<NMTokenIdentifier>
identifier
- the identifier to validateSecretManager.InvalidToken
- the token was invalidprotected byte[] retrivePasswordInternal(NMTokenIdentifier identifier, MasterKeyData masterKey)
public NMTokenIdentifier createIdentifier()
createIdentifier
in class SecretManager<NMTokenIdentifier>
public Token createNMToken(ApplicationAttemptId applicationAttemptId, NodeId nodeId, String applicationSubmitter)
public static Token newInstance(byte[] password, NMTokenIdentifier identifier)
Copyright © 2013 Apache Software Foundation. All rights reserved.