FileDocCategorySizeDatePackage
TextOutputCallback.javaAPI DocJava SE 5 API2412Fri Aug 26 14:57:48 BST 2005javax.security.auth.callback

TextOutputCallback

public class TextOutputCallback extends Object implements Callback, Serializable

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

version
1.15, 12/19/03
see
javax.security.auth.callback.CallbackHandler

Fields Summary
private static final long
serialVersionUID
public static final int
INFORMATION
Information message.
public static final int
WARNING
Warning message.
public static final int
ERROR
Error message.
private int
messageType
private String
message
Constructors Summary
public TextOutputCallback(int messageType, String message)
Construct a TextOutputCallback with a message type and message to be displayed.

param
messageType the message type (INFORMATION, WARNING or ERROR).

param
message the message to be displayed.

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


                       			               			   			  			   			            
         
	if ((messageType != INFORMATION &&
		messageType != WARNING && messageType != ERROR) ||
	    message == null || message.length() == 0)
	    throw new IllegalArgumentException();

	this.messageType = messageType;
	this.message = message;
    
Methods Summary
public java.lang.StringgetMessage()
Get the message to be displayed.

return
the message to be displayed.

	return message;
    
public intgetMessageType()
Get the message type.

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

	return messageType;