@ThreadSafe @DefaultAnnotation(value=edu.umd.cs.findbugs.annotations.NonNull.class) public abstract class ConsoleSafePbeParametersView<S extends KeyStrength,P extends SafePbeParameters<S,P>> extends SafePbeParametersView<P>
| Modifier and Type | Class and Description |
|---|---|
private static class |
ConsoleSafePbeParametersView.PromptingLock
Used to lock out concurrent prompting.
|
| Modifier and Type | Field and Description |
|---|---|
private static URI |
lastResource
The last resource ID used when prompting.
|
private static ConsoleSafePbeParametersView.PromptingLock |
lock
Used to lock out prompting by multiple threads.
|
private static int |
MIN_PASSWD_LEN
The minimum acceptable length of a password.
|
private static String |
NO |
private static ResourceBundle |
resources |
private static String |
YES |
| Constructor and Description |
|---|
ConsoleSafePbeParametersView() |
| Modifier and Type | Method and Description |
|---|---|
void |
promptReadKey(PromptingKeyProvider.Controller<P> controller,
boolean invalid)
Prompts the user for the key for reading the contents of an
existing protected resource.
|
void |
promptWriteKey(PromptingKeyProvider.Controller<P> controller)
Prompts the user for the key for (over)writing the contents of a
new or existing protected resource.
|
newPbeParametersprivate static URI lastResource
private static final ConsoleSafePbeParametersView.PromptingLock lock
private static final int MIN_PASSWD_LEN
private static final String NO
private static final ResourceBundle resources
private static final String YES
public void promptReadKey(PromptingKeyProvider.Controller<P> controller, boolean invalid) throws KeyPromptingDisabledException
PromptingKeyProvider.Viewkey property of the given
controller.
If the implementation has called PromptingKeyProvider.Controller.setKey(K) with a
non-null parameter, then a clone of this object will be
used as the key.
Otherwise, if the implementation has called PromptingKeyProvider.Controller.setKey(K)
with a null parameter or throws a
KeyPromptingCancelledException, then prompting for the key
is permanently disabled and each subsequent call to
SafeKeyProvider.getWriteKey() or SafeKeyProvider.getReadKey(boolean) results in a
KeyPromptingCancelledException until
PromptingKeyProvider.resetCancelledKey() or PromptingKeyProvider.resetUnconditionally() gets
called.
Otherwise, the state of the key provider is not changed and this method gets called again.
controller - The key controller for storing the result.invalid - true iff a previous call to this method
resulted in an invalid key.KeyPromptingDisabledExceptionpublic final void promptWriteKey(PromptingKeyProvider.Controller<P> controller) throws KeyPromptingDisabledException
PromptingKeyProvider.Viewkey property of the given
controller.
If the implementation has called PromptingKeyProvider.Controller.setKey(K) with a
non-null parameter, then a clone of this object will be
used as the key.
Otherwise, prompting for a key is permanently disabled and each
subsequent call to SafeKeyProvider.getWriteKey() or SafeKeyProvider.getReadKey(boolean)
results in a KeyPromptingCancelledException until
PromptingKeyProvider.resetCancelledKey() or PromptingKeyProvider.resetUnconditionally() gets
called.
controller - The key controller for storing the result.KeyPromptingDisabledExceptionCopyright © 2004-2011 Schlichtherle IT Services. All Rights Reserved.