Top Description Fields Constructors Methods
jakarta.security.auth.message.callback

public Class CallerPrincipalCallback

extends Object
implements Callback
Class Inheritance
All Implemented Interfaces
javax.security.auth.callback.Callback
Imports
java.security.Principal, javax.security.auth.Subject, javax.security.auth.callback.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.

Field Summary

Modifier and TypeField and Description
private String
private Principal
private Subject

Constructor Summary

AccessConstructor and Description
public
CallerPrincipalCallback(Subject
The Subject in which the container will distinguish the caller identity.
subject
,
Principal
The Principal that will be distinguished as the caller principal. This value may be null.
principal
)

Create a CallerPrincipalCallback to set the container's representation of the caller principal

The CallbackHandler must use the argument Principal to establish the caller principal associated with the invocation being processed by the container.

public
CallerPrincipalCallback(Subject
The Subject in which the container will distinguish the caller identity.
subject
,
String
The String value that will be returned when getName() is called on the principal established as the caller principal or null.
name
)

Create a CallerPrincipalCallback to set the container's representation of the caller principal.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

The principal name or null.
getName
()

Get the caller principal name.

public Principal

Returns:

The principal or null.
getPrincipal
()

Get the caller principal.

public Subject

Returns:

The subject.
getSubject
()

Get the Subject in which the handler will distinguish the caller principal

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

nameback to summary
private String name
principalback to summary
private Principal principal
subjectback to summary
private Subject subject

Constructor Detail

CallerPrincipalCallbackback to summary
public CallerPrincipalCallback(Subject subject, Principal principal)

Create a CallerPrincipalCallback to set the container's representation of the caller principal

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

The handler may perform principal mapping of non-null argument Principal values, but it must be possible to configure the handler such that it establishes the non-null argument Principal as the caller principal.

Parameters
subject:Subject

The Subject in which the container will distinguish the caller identity.

principal:Principal

The Principal that will be distinguished as the caller principal. This value may be null.

CallerPrincipalCallbackback to summary
public CallerPrincipalCallback(Subject subject, String name)

Create a CallerPrincipalCallback to set the container's representation of the caller principal.

The CallbackHandler must use the name argument to establish the caller principal associated with the invocation being processed by the container. When the name argument is null, the handler must 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).

The handler may perform principal mapping of non-null values of name, but it must be possible to configure the handler such that it establishes the non-null argument value as the value returned when getName is called on the established principal.

Parameters
subject:Subject

The Subject in which the container will distinguish the caller identity.

name:String

The String value that will be returned when getName() is called on the principal established as the caller principal or null.

Method Detail

getNameback to summary
public String getName()

Get the caller principal name.

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.

Returns:String

The principal name or null.

getPrincipalback to summary
public Principal getPrincipal()

Get the caller principal.

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.

Returns:Principal

The principal or null.

getSubjectback to summary
public Subject getSubject()

Get the Subject in which the handler will distinguish the caller principal

Returns:Subject

The subject.