@ThreadSafe public abstract class SafeKeyManager<K extends SafeKey<K>,P extends SafeKeyProvider<K>> extends Object implements KeyManager<K>
Modifier | Constructor and Description |
---|---|
protected |
SafeKeyManager()
Constructs a new safe key manager.
|
Modifier and Type | Method and Description |
---|---|
P |
getKeyProvider(URI resource)
Returns the mapped key provider for the given protected resource.
|
P |
getMappedKeyProvider(URI resource)
Returns the key provider which is mapped for the given
resource
or null if no key provider is mapped. |
int |
getPriority()
Returns a priority to help the key manager service locator.
|
P |
moveKeyProvider(URI oldResource,
URI newResource)
Moves the mapped key provider from the URI
oldResource to
newResource . |
protected abstract P |
newKeyProvider()
Returns a new key provider.
|
P |
removeKeyProvider(URI resource)
Removes the mapped key provider for the given protected resource.
|
String |
toString()
Returns a string representation of this object for debugging and logging
purposes.
|
protected SafeKeyManager()
public P getKeyProvider(URI resource)
KeyManager
getKeyProvider
in interface KeyManager<K extends SafeKey<K>>
resource
- the URI of the protected resource.@Nullable public P getMappedKeyProvider(URI resource)
resource
or null
if no key provider is mapped.
TODO: Make this part of the interface KeyManager
in the next
major version.
resource
- the nullable URI of the protected resource.public int getPriority()
KeyManager
0
.getPriority
in interface KeyManager<K extends SafeKey<K>>
public P moveKeyProvider(URI oldResource, URI newResource)
KeyManager
oldResource
to
newResource
.moveKeyProvider
in interface KeyManager<K extends SafeKey<K>>
oldResource
- the old URI of the protected resource.newResource
- the new URI of the protected resource.newResource
.protected abstract P newKeyProvider()
public P removeKeyProvider(URI resource)
The returned key provider is invalidated and will behave as if prompting for the secret key had been disabled or cancelled by the user.
removeKeyProvider
in interface KeyManager<K extends SafeKey<K>>
resource
- the URI of the protected resource.Copyright © 2005–2018 Schlichtherle IT Services. All rights reserved.