FileDocCategorySizeDatePackage
CallerPrincipalCallback.javaAPI DocGlassfish v2 API5236Fri May 04 22:36:10 BST 2007javax.security.auth.message.callback

CallerPrincipalCallback

public class CallerPrincipalCallback extends Object implements Callback
Callback for setting the container's caller (or Remote user) principal. This callback is intended to be called by a serverAuthModule during its validateRequest processing.
version
%I%, %G%

Fields Summary
private Subject
subject
private Principal
principal
private String
name
Constructors Summary
public CallerPrincipalCallback(Subject s, Principal p)
Create a CallerPrincipalCallback to set the container's representation of the caller principal

param
s The Subject in which the container will distinguish the caller identity.
param
p The Principal that will be distinguished as the caller principal. This value may be null.

The CallbackHandler must establish the argument Principal as the caller principal associated with the invocation being processed by the container. When the argument Principal is null, the handler will establish the container's representation of the unauthenticated caller principal.

 
	subject = s;
	principal = p;
        name = null;
    
public CallerPrincipalCallback(Subject s, String n)
Create a CallerPrincipalCallback to set the container's representation of the caller principal.

param
s The Subject in which the container will distinguish the caller identity.
param
n The String value that will be returned when getName() is called on the principal established as the caller principal or null.

When the n argument is null, the handler will establish the container's representation of the unauthenticated caller principal (which may or may not be equal to null, depending on the requirements of the container type). When the container type requires that a non-null principal be established as the caller principal, the value obatined by calling getName on the principal may not match the argument value.

 
	subject = s;
	principal = null;
        name = n;
    
Methods Summary
public java.lang.StringgetName()
Get the caller principal name.

return
The principal name or null.

When the values returned by this method and the getPrincipal methods are null, the handler must establish the container's representation of the unauthenticated caller principal within the Subject.

	return name;
    
public java.security.PrincipalgetPrincipal()
Get the caller principal.

return
The principal or null.

When the values returned by this method and the getName methods are null, the handler must establish the container's representation of the unauthenticated caller principal within the Subject.

	return principal;
    
public javax.security.auth.SubjectgetSubject()
Get the Subject in which the handler will distinguish the caller principal

return
The subject.

	return subject;