Underlying security services instantiate and pass a
ConfirmationCallback
to the handle
method of a CallbackHandler
to ask for YES/NO,
OK/CANCEL, YES/NO/CANCEL or other similar confirmations.
javax.security.auth.callback.CallbackHandler
Modifier and Type | Field and Description |
---|---|
public static final int | CANCEL
CANCEL option. |
private final int | |
public static final int | ERROR
ERROR message type. |
public static final int | INFORMATION
INFORMATION message type. |
private final int | |
public static final int | NO
NO option. |
public static final int | OK
OK option. |
public static final int | OK_CANCEL_OPTION
OK/CANCEL confirmation option. |
private String[] | |
private final int | |
private final String | |
private int | |
private static final long | |
public static final int | UNSPECIFIED_OPTION
Unspecified option type. |
public static final int | WARNING
WARNING message type. |
public static final int | YES
YES option. |
public static final int | YES_NO_CANCEL_OPTION
YES/NO/CANCEL confirmation option. |
public static final int | YES_NO_OPTION
YES/NO confirmation option. |
Access | Constructor and Description |
---|---|
public | ConfirmationCallback(int
the message type ( messageType, int INFORMATION ,
WARNING or ERROR ).the option type ( optionType, int YES_NO_OPTION ,
YES_NO_CANCEL_OPTION or
OK_CANCEL_OPTION ).the default option
from the provided optionType ( defaultOption)YES ,
NO , CANCEL or
OK ).Construct a |
public | ConfirmationCallback(int
the message type ( messageType, String[] INFORMATION ,
WARNING or ERROR ).the list of confirmation options. The array is cloned
to protect against subsequent modification. options, int the default option, represented as an index
into the defaultOption)options array.Construct a |
public | ConfirmationCallback(String
the prompt used to describe the list of options. prompt, int the message type ( messageType, int INFORMATION ,
WARNING or ERROR ).the option type ( optionType, int YES_NO_OPTION ,
YES_NO_CANCEL_OPTION or
OK_CANCEL_OPTION ).the default option
from the provided optionType ( defaultOption)YES ,
NO , CANCEL or
OK ).Construct a |
public | ConfirmationCallback(String
the prompt used to describe the list of options. prompt, int the message type ( messageType, String[] INFORMATION ,
WARNING or ERROR ).the list of confirmation options. The array is cloned
to protect against subsequent modification. options, int the default option, represented as an index
into the defaultOption)options array.Construct a |
Modifier and Type | Method and Description |
---|---|
public int | Returns: the default option, represented asYES , NO , OK or
CANCEL if an optionType
was specified to the constructor of this
ConfirmationCallback .
Otherwise, this method returns the default option as
an index into the
options array specified to the constructor
of this ConfirmationCallback .Get the default option. |
public int | |
public String[] | Returns: a copy of the list of confirmation options, or null if thisConfirmationCallback was instantiated with
an optionType instead of options .Get the confirmation options. |
public int | Returns: the option type (YES_NO_OPTION ,
YES_NO_CANCEL_OPTION or
OK_CANCEL_OPTION ), or
UNSPECIFIED_OPTION if this
ConfirmationCallback was instantiated with
options instead of an optionType .Get the option type. |
public String | Returns: the prompt, or null if thisConfirmationCallback
was instantiated without a prompt .Get the prompt. |
public int | Returns: the selected confirmation option represented asYES , NO , OK or
CANCEL if an optionType
was specified to the constructor of this
ConfirmationCallback .
Otherwise, this method returns the selected confirmation
option as an index into the
options array specified to the constructor
of this ConfirmationCallback .Get the selected confirmation option. |
private void | readObject(ObjectInputStream
the stream)ObjectInputStream from which data is readRestores the state of this object from the stream. |
public void | setSelectedIndex(int
the selection represented as selection)YES ,
NO , OK or CANCEL
if an optionType was specified to the constructor
of this ConfirmationCallback .
Otherwise, the selection represents the index into the
options array specified to the constructor
of this ConfirmationCallback .Set the selected confirmation option. |
CANCEL | back to summary |
---|---|
public static final int CANCEL CANCEL option. If an |
defaultOption | back to summary |
---|---|
private final int defaultOption
|
ERROR | back to summary |
---|---|
public static final int ERROR ERROR message type. |
INFORMATION | back to summary |
---|---|
public static final int INFORMATION INFORMATION message type. |
messageType | back to summary |
---|---|
private final int messageType
|
NO | back to summary |
---|---|
public static final int NO NO option. If an |
OK | back to summary |
---|---|
public static final int OK OK option. If an |
OK_CANCEL_OPTION | back to summary |
---|---|
public static final int OK_CANCEL_OPTION OK/CANCEL confirmation option. An underlying security service specifies this as the
|
options | back to summary |
---|---|
private String[] options
|
optionType | back to summary |
---|---|
private final int optionType
|
prompt | back to summary |
---|---|
private final String prompt
|
selection | back to summary |
---|---|
private int selection
|
serialVersionUID | back to summary |
---|---|
private static final long serialVersionUID
|
UNSPECIFIED_OPTION | back to summary |
---|---|
public static final int UNSPECIFIED_OPTION Unspecified option type. The |
WARNING | back to summary |
---|---|
public static final int WARNING WARNING message type. |
YES | back to summary |
---|---|
public static final int YES YES option. If an |
YES_NO_CANCEL_OPTION | back to summary |
---|---|
public static final int YES_NO_CANCEL_OPTION YES/NO/CANCEL confirmation option. An underlying security service specifies this as the
|
YES_NO_OPTION | back to summary |
---|---|
public static final int YES_NO_OPTION YES/NO confirmation option. An underlying security service specifies this as the
|
ConfirmationCallback | back to summary |
---|---|
public ConfirmationCallback(int messageType, int optionType, int defaultOption) Construct a Underlying security services use this constructor if they require either a YES/NO, YES/NO/CANCEL or OK/CANCEL confirmation.
|
ConfirmationCallback | back to summary |
---|---|
public ConfirmationCallback(int messageType, String[] options, int defaultOption) Construct a Underlying security services use this constructor if
they require a confirmation different from the available preset
confirmations provided (for example, CONTINUE/ABORT or STOP/GO).
The confirmation options are listed in the
|
ConfirmationCallback | back to summary |
---|---|
public ConfirmationCallback(String prompt, int messageType, int optionType, int defaultOption) Construct a Underlying security services use this constructor if they require either a YES/NO, YES/NO/CANCEL or OK/CANCEL confirmation.
|
ConfirmationCallback | back to summary |
---|---|
public ConfirmationCallback(String prompt, int messageType, String[] options, int defaultOption) Construct a Underlying security services use this constructor if
they require a confirmation different from the available preset
confirmations provided (for example, CONTINUE/ABORT or STOP/GO).
The confirmation options are listed in the
|
getDefaultOption | back to summary |
---|---|
public int getDefaultOption() Get the default option.
|
getMessageType | back to summary |
---|---|
public int getMessageType() Get the message type.
|
getOptions | back to summary |
---|---|
public String[] getOptions() Get the confirmation options.
|
getOptionType | back to summary |
---|---|
public int getOptionType() Get the option type. If this method returns
|
getPrompt | back to summary |
---|---|
public String getPrompt() Get the prompt.
|
getSelectedIndex | back to summary |
---|---|
public int getSelectedIndex() Get the selected confirmation option.
|
readObject | back to summary |
---|---|
private void readObject(ObjectInputStream stream) throws IOException, ClassNotFoundException Restores the state of this object from the stream.
|
setSelectedIndex | back to summary |
---|---|
public void setSelectedIndex(int selection) Set the selected confirmation option.
|