javax.security.auth.message.callback
Class CallerPrincipalCallback

java.lang.Object
  extended by javax.security.auth.message.callback.CallerPrincipalCallback
All Implemented Interfaces:
Callback

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%

Constructor Summary
CallerPrincipalCallback(Subject s, Principal p)
          Create a CallerPrincipalCallback to set the container's representation of the caller principal
CallerPrincipalCallback(Subject s, String n)
          Create a CallerPrincipalCallback to set the container's representation of the caller principal.
 
Method Summary
 String getName()
          Get the caller principal name.
 Principal getPrincipal()
          Get the caller principal.
 Subject getSubject()
          Get the Subject in which the handler will distinguish the caller principal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CallerPrincipalCallback

public CallerPrincipalCallback(Subject s,
                               Principal p)
Create a CallerPrincipalCallback to set the container's representation of the caller principal

Parameters:
s - The Subject in which the container will distinguish the caller identity.
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.


CallerPrincipalCallback

public CallerPrincipalCallback(Subject s,
                               String n)
Create a CallerPrincipalCallback to set the container's representation of the caller principal.

Parameters:
s - The Subject in which the container will distinguish the caller identity.
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.

Method Detail

getSubject

public Subject getSubject()
Get the Subject in which the handler will distinguish the caller principal

Returns:
The subject.

getPrincipal

public Principal getPrincipal()
Get the caller principal.

Returns:
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.


getName

public String getName()
Get the caller principal name.

Returns:
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.



Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.