K
- The type of the keys.@ThreadSafe public final 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> |
getKeyProvider(URI resource)
Returns the mapped key provider for the given protected resource.
|
PromptingKeyProvider<K> |
getMappedKeyProvider(URI resource)
Returns the key provider which is mapped for the given
resource
or null if no key provider is mapped. |
PromptingKeyProvider<K> |
moveKeyProvider(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.
|
PromptingKeyProvider<K> |
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.
|
getPriority
public PromptingKeyManager(PromptingKeyProvider.View<K> view)
view
- the view instance for prompting for keys.public PromptingKeyProvider<K> getKeyProvider(URI resource)
KeyManager
getKeyProvider
in interface KeyManager<K extends SafeKey<K>>
getKeyProvider
in class SafeKeyManager<K extends SafeKey<K>,PromptingKeyProvider<K extends SafeKey<K>>>
resource
- the URI of the protected resource.@Nullable public PromptingKeyProvider<K> getMappedKeyProvider(URI resource)
SafeKeyManager
resource
or null
if no key provider is mapped.
TODO: Make this part of the interface KeyManager
in the next
major version.
getMappedKeyProvider
in class SafeKeyManager<K extends SafeKey<K>,PromptingKeyProvider<K extends SafeKey<K>>>
resource
- the nullable URI of the protected resource.public PromptingKeyProvider<K> moveKeyProvider(URI oldResource, URI newResource)
KeyManager
oldResource
to
newResource
.moveKeyProvider
in interface KeyManager<K extends SafeKey<K>>
moveKeyProvider
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 PromptingKeyProvider<K> newKeyProvider()
newKeyProvider
in class SafeKeyManager<K extends SafeKey<K>,PromptingKeyProvider<K extends SafeKey<K>>>
public PromptingKeyProvider<K> removeKeyProvider(URI resource)
SafeKeyManager
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>>
removeKeyProvider
in class SafeKeyManager<K extends SafeKey<K>,PromptingKeyProvider<K extends SafeKey<K>>>
resource
- the URI of the protected resource.public String toString()
toString
in class SafeKeyManager<K extends SafeKey<K>,PromptingKeyProvider<K extends SafeKey<K>>>
Copyright © 2005–2018 Schlichtherle IT Services. All rights reserved.