Class CallerPrincipalCallback
- All Implemented Interfaces:
Callback
public class CallerPrincipalCallback extends Object implements Callback
This callback is intended to be called by a serverAuthModule
during its validateRequest
processing.
-
Constructor Summary
Constructors Constructor Description CallerPrincipalCallback(Subject subject, String name)
Create a CallerPrincipalCallback to set the container's representation of the caller principal.CallerPrincipalCallback(Subject subject, Principal principal)
Create a CallerPrincipalCallback to set the container's representation of the caller principal -
Method Summary
Modifier and Type Method Description 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
-
Constructor Details
-
CallerPrincipalCallback
Create a CallerPrincipalCallback to set the container's representation of the caller principalThe CallbackHandler must use the argument
Principal
to establish the caller principal associated with the invocation being processed by the container. When the argumentPrincipal
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 argumentPrincipal
as the caller principal.- Parameters:
subject
- The Subject in which the container will distinguish the caller identity.principal
- The Principal that will be distinguished as the caller principal. This value may be null.
-
CallerPrincipalCallback
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 thename
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 whengetName
is called on the established principal.- Parameters:
subject
- The Subject in which the container will distinguish the caller identity.name
- The String value that will be returned whengetName()
is called on the principal established as the caller principal or null.
-
-
Method Details
-
getSubject
Get the Subject in which the handler will distinguish the caller principal- Returns:
- The subject.
-
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:
- The principal or null.
-
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:
- The principal name or null.
-