K - The type of the secret keys.@ThreadSafe public abstract class KeyManager<K> extends Object
Implementations must be thread-safe.
| Constructor and Description |
|---|
KeyManager() |
| Modifier and Type | Method and Description |
|---|---|
abstract KeyProvider<K> |
delete(URI resource)
Deletes the mapped key provider for the given protected resource.
|
abstract KeyProvider<K> |
get(URI resource)
Returns the mapped key provider for the given protected resource or
null if no key provider is mapped yet. |
abstract KeyProvider<K> |
make(URI resource)
Returns the mapped key provider for the given protected resource.
|
abstract KeyProvider<K> |
move(URI oldResource,
URI newResource)
Moves the mapped key provider from the URI
oldResource to
newResource. |
String |
toString()
Returns a string representation of this object for debugging and logging
purposes.
|
abstract 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.
|
@CheckForNull public abstract KeyProvider<K> delete(URI resource)
resource - the URI of the protected resource.@CheckForNull public abstract KeyProvider<K> get(URI resource)
null if no key provider is mapped yet.resource - the URI of the protected resource.null if no key provider is mapped yet.public abstract KeyProvider<K> make(URI resource)
resource - the URI of the protected resource.@CheckForNull public abstract KeyProvider<K> move(URI oldResource, URI newResource)
oldResource to
newResource.oldResource - the old URI of the protected resource.newResource - the new URI of the protected resource.newResource.IllegalArgumentException - if oldResource compares
equal to newResource.public String toString()
public abstract void unlock(URI resource)
This 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.
resource - Copyright © 2005-2012 Schlichtherle IT Services. All Rights Reserved.