public class BlockTokenSecretManager extends SecretManager<BlockTokenIdentifier>
限定符和类型 | 类和说明 |
---|---|
static class |
BlockTokenSecretManager.AccessMode |
SecretManager.InvalidToken
限定符和类型 | 字段和说明 |
---|---|
static Token<BlockTokenIdentifier> |
DUMMY_TOKEN |
static org.apache.commons.logging.Log |
LOG |
构造器和说明 |
---|
BlockTokenSecretManager(boolean isMaster,
long keyUpdateInterval,
long tokenLifetime)
Constructor
|
限定符和类型 | 方法和说明 |
---|---|
void |
checkAccess(BlockTokenIdentifier id,
String userId,
Block block,
BlockTokenSecretManager.AccessMode mode)
Check if access should be allowed. userID is not checked if null.
|
void |
checkAccess(Token<BlockTokenIdentifier> token,
String userId,
Block block,
BlockTokenSecretManager.AccessMode mode)
Check if access should be allowed. userID is not checked if null
|
BlockTokenIdentifier |
createIdentifier()
Create an empty block token identifier
|
protected byte[] |
createPassword(BlockTokenIdentifier identifier)
Create a new password/secret for the given block token identifier.
|
ExportedBlockKeys |
exportKeys()
Export block keys, only to be used in master mode
|
Token<BlockTokenIdentifier> |
generateToken(Block block,
EnumSet<BlockTokenSecretManager.AccessMode> modes)
Generate an block token for current user
|
Token<BlockTokenIdentifier> |
generateToken(long[] blockIds,
EnumSet<BlockTokenSecretManager.AccessMode> modes)
Generate a block token for the current user based on a collection
of blockIds
|
Token<BlockTokenIdentifier> |
generateToken(String userId,
Block block,
EnumSet<BlockTokenSecretManager.AccessMode> modes)
Generate a block token for a specified user
|
Token<BlockTokenIdentifier> |
generateToken(String userID,
long[] blockIds,
EnumSet<BlockTokenSecretManager.AccessMode> modes)
Generate a block token based on a collection of blockIds
|
byte[] |
retrievePassword(BlockTokenIdentifier identifier)
Look up the token password/secret for the given block token identifier.
|
void |
setKeys(ExportedBlockKeys exportedKeys)
Set block keys, only to be used in slave mode
|
void |
setTokenLifetime(long tokenLifetime)
set token lifetime.
|
void |
updateKeys()
Update block keys, only to be used in master mode
|
createPassword, createSecretKey, generateSecret
public static final org.apache.commons.logging.Log LOG
public static final Token<BlockTokenIdentifier> DUMMY_TOKEN
public BlockTokenSecretManager(boolean isMaster, long keyUpdateInterval, long tokenLifetime) throws IOException
isMaster
- keyUpdateInterval
- tokenLifetime
- IOException
public ExportedBlockKeys exportKeys()
public void setKeys(ExportedBlockKeys exportedKeys) throws IOException
IOException
public void updateKeys() throws IOException
IOException
public Token<BlockTokenIdentifier> generateToken(Block block, EnumSet<BlockTokenSecretManager.AccessMode> modes) throws IOException
IOException
public Token<BlockTokenIdentifier> generateToken(String userId, Block block, EnumSet<BlockTokenSecretManager.AccessMode> modes) throws IOException
IOException
public Token<BlockTokenIdentifier> generateToken(long[] blockIds, EnumSet<BlockTokenSecretManager.AccessMode> modes) throws IOException
IOException
public Token<BlockTokenIdentifier> generateToken(String userID, long[] blockIds, EnumSet<BlockTokenSecretManager.AccessMode> modes)
public void checkAccess(BlockTokenIdentifier id, String userId, Block block, BlockTokenSecretManager.AccessMode mode) throws SecretManager.InvalidToken
public void checkAccess(Token<BlockTokenIdentifier> token, String userId, Block block, BlockTokenSecretManager.AccessMode mode) throws SecretManager.InvalidToken
public void setTokenLifetime(long tokenLifetime)
public BlockTokenIdentifier createIdentifier()
createIdentifier
在类中 SecretManager<BlockTokenIdentifier>
protected byte[] createPassword(BlockTokenIdentifier identifier)
createPassword
在类中 SecretManager<BlockTokenIdentifier>
identifier
- the block token identifierpublic byte[] retrievePassword(BlockTokenIdentifier identifier) throws SecretManager.InvalidToken
retrievePassword
在类中 SecretManager<BlockTokenIdentifier>
identifier
- the block token identifier to look upInvalidToken
SecretManager.InvalidToken
Copyright © 2009 The Apache Software Foundation