javax.security.auth.callback

Class TextOutputCallback

public class TextOutputCallback extends Object implements Callback, Serializable

Underlying security services instantiate and pass a TextOutputCallback to the handle() method of a {@link CallbackHandler} to display information messages, warning messages and error messages.

See Also: CallbackHandler

Field Summary
static intERROR
Error message
static intINFORMATION
Information message
static intWARNING
Warning message
Constructor Summary
TextOutputCallback(int messageType, String message)

Construct a TextOutputCallback with a message type and message to be displayed.

Method Summary
StringgetMessage()

Returns the message to be displayed.

intgetMessageType()

Returns the message's messageType.

Field Detail

ERROR

public static final int ERROR
Error message

INFORMATION

public static final int INFORMATION
Information message

WARNING

public static final int WARNING
Warning message

Constructor Detail

TextOutputCallback

public TextOutputCallback(int messageType, String message)

Construct a TextOutputCallback with a message type and message to be displayed.

Parameters: messageType the message type (INFORMATION, WARNING or ERROR). message the message to be displayed.

Throws: IllegalArgumentException if messageType is not either INFORMATION, WARNING or ERROR, if message is null, or if message has a length of 0.

Method Detail

getMessage

public String getMessage()

Returns the message to be displayed.

Returns: the message to be displayed.

getMessageType

public int getMessageType()

Returns the message's messageType.

Returns: the message type (INFORMATION, WARNING or ERROR).