K - the type of the safe keys.@ThreadSafe public class PromptingKeyManager<K extends SafeKey<K>> extends SafeKeyManager<K,PromptingKeyProvider<K>>
PromptingKeyProvider| Constructor and Description |
|---|
PromptingKeyManager(PromptingKeyProvider.View<K> view)
Constructs a new prompting key manager.
|
| Modifier and Type | Method and Description |
|---|---|
PromptingKeyProvider<K> |
delete(URI resource)
Deletes the mapped key provider for the given protected resource.
|
PromptingKeyProvider<K> |
get(URI resource)
Returns the mapped key provider for the given protected resource or
null if no key provider is mapped yet. |
PromptingKeyProvider<K> |
make(URI resource)
Returns the mapped key provider for the given protected resource.
|
PromptingKeyProvider<K> |
move(URI oldResource,
URI newResource)
Moves the mapped key provider from the URI
oldResource to
newResource. |
protected PromptingKeyProvider<K> |
newKeyProvider()
Returns a new prompting key provider.
|
String |
toString()
Returns a string representation of this object for debugging and logging
purposes.
|
void |
unlock(URI resource)
If and only if this key manager prompts users for keys, e.g. a password,
and prompting for the key for the given protected resources had
been cancelled by the user, then the key provider shall get reset to a
state so that the user will get prompted again the next time a key is
requested from the provider.
|
public PromptingKeyManager(PromptingKeyProvider.View<K> view)
view - the view instance for prompting for keys.@CheckForNull public final PromptingKeyProvider<K> delete(URI resource)
SafeKeyManagerThe returned key provider is invalidated and will behave as if prompting for the secret key had been disabled or cancelled by the user.
delete in class SafeKeyManager<K extends SafeKey<K>,PromptingKeyProvider<K extends SafeKey<K>>>resource - the URI of the protected resource.@CheckForNull public final PromptingKeyProvider<K> get(URI resource)
KeyManagernull if no key provider is mapped yet.get in class SafeKeyManager<K extends SafeKey<K>,PromptingKeyProvider<K extends SafeKey<K>>>resource - the URI of the protected resource.null if no key provider is mapped yet.public final PromptingKeyProvider<K> make(URI resource)
KeyManagermake in class SafeKeyManager<K extends SafeKey<K>,PromptingKeyProvider<K extends SafeKey<K>>>resource - the URI of the protected resource.@CheckForNull public final PromptingKeyProvider<K> move(URI oldResource, URI newResource)
KeyManageroldResource to
newResource.move in class SafeKeyManager<K extends SafeKey<K>,PromptingKeyProvider<K extends SafeKey<K>>>oldResource - the old URI of the protected resource.newResource - the new URI of the protected resource.newResource.protected final PromptingKeyProvider<K> newKeyProvider()
newKeyProvider in class SafeKeyManager<K extends SafeKey<K>,PromptingKeyProvider<K extends SafeKey<K>>>public String toString()
toString in class KeyManager<K extends SafeKey<K>>public void unlock(URI resource)
KeyManagerThis method is typically used once a file system has been synced in order to give the user a chance to enter the key the next time the file system will get accessed again. Otherwise the key provider would forever stay in its cancelled state.
unlock in class KeyManager<K extends SafeKey<K>>Copyright © 2005-2012 Schlichtherle IT Services. All Rights Reserved.