Top Description Fields Constructors Methods
javax.security.auth.callback

public Class TextOutputCallback

extends Object
implements Callback, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, javax.security.auth.callback.Callback

Underlying security services instantiate and pass a TextOutputCallback to the handle method of a CallbackHandler to display information messages, warning messages and error messages.

Since
1.4
See Also
javax.security.auth.callback.CallbackHandler

Field Summary

Modifier and TypeField and Description
public static final int
ERROR

Error message.

public static final int
INFORMATION

Information message.

private final String
private final int
private static final long
public static final int
WARNING

Warning message.

Constructor Summary

AccessConstructor and Description
public
TextOutputCallback(int
the message type (INFORMATION, WARNING or ERROR).
messageType
,
String
the message to be displayed.
message
)

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

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

the message to be displayed.
getMessage
()

Get the message to be displayed.

public int

Returns:

the message type (INFORMATION, WARNING or ERROR).
getMessageType
()

Get the message type.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ERRORback to summary
public static final int ERROR

Error message.

INFORMATIONback to summary
public static final int INFORMATION

Information message.

messageback to summary
private final String message
Since
1.4
messageTypeback to summary
private final int messageType
Since
1.4
serialVersionUIDback to summary
private static final long serialVersionUID
Annotations
@Serial
WARNINGback to summary
public static final int WARNING

Warning message.

Constructor Detail

TextOutputCallbackback to summary
public TextOutputCallback(int messageType, String message)

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

Parameters
messageType:int

the message type (INFORMATION, WARNING or ERROR).

message:String

the message to be displayed.

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

Method Detail

getMessageback to summary
public String getMessage()

Get the message to be displayed.

Returns:String

the message to be displayed.

getMessageTypeback to summary
public int getMessageType()

Get the message type.

Returns:int

the message type (INFORMATION, WARNING or ERROR).