com.adobe.idp
Class Context

java.lang.Object
  extended by com.adobe.idp.Context
All Implemented Interfaces:
java.io.Serializable

public final class Context
extends java.lang.Object
implements java.io.Serializable

General IDP context class.

Propagates crucial information among IDP components, and is used in many of the product APIs. By convention, it appears as the last parameter in any method that propagates it.

Currently, the context propagates:

The context is designed so that it can be serialized to an older version of itself and back without losing any information.

See Also:
Serialized Form

Constructor Summary
Context()
          Default constructor.
 
Method Summary
static Context create(byte[] buf)
          Instantiates a context from a byte array.
 User getAuthenticatedUser()
          Retrieves the authenticated user.
 java.util.Date getExpirationHint()
          Provides a date indicating when this Context will expire.
 java.lang.String getRequestId()
          Retrieves the request ID.
 java.lang.String getUserAssertion()
          Retrieves the user's assertion string.
 void initPrincipal(AuthResult authResult)
          Initializes the Context object's Principal (the authenticated user).
 void initRequestId(java.lang.String requestId)
          Initializes the request ID.
 boolean isComplete()
           
 byte[] toByteArray()
          Converts a context to a byte array.
 java.lang.String toString()
          Retrieves a printable rendition of the context.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Context

public Context()
Default constructor.

Method Detail

create

public static Context create(byte[] buf)
Instantiates a context from a byte array. This can be useful when using IDL-defined CORBA interfaces.

Parameters:
buf - The byte array used to create the context.
Returns:
The context.

toByteArray

public byte[] toByteArray()
Converts a context to a byte array. This can be useful when using IDL-defined CORBA interfaces.

Returns:
A byte array containing the context information.

initPrincipal

public void initPrincipal(AuthResult authResult)
Initializes the Context object's Principal (the authenticated user).

This method should be called to set the authenticated user in the Context object. The only way to get an AuthResult is by calling the authenticate method in the AuthenticationManagerServiceClient class.

Parameters:
authResult - The information used to set the authenticated user's information.

isComplete

public boolean isComplete()

getAuthenticatedUser

public User getAuthenticatedUser()
Retrieves the authenticated user.


getExpirationHint

public java.util.Date getExpirationHint()
Provides a date indicating when this Context will expire. There is no guarantee that the value is accurate, but it will be no later than the actual expiration date.

Returns:
The latest possible expiration date.

getUserAssertion

public java.lang.String getUserAssertion()
Retrieves the user's assertion string.

Returns:
The user's assertion string.

initRequestId

public void initRequestId(java.lang.String requestId)
Initializes the request ID.

Parameters:
requestId - The request ID to be initialized.

getRequestId

public java.lang.String getRequestId()
Retrieves the request ID.

Returns:
The request ID.

toString

public java.lang.String toString()
Retrieves a printable rendition of the context.

Overrides:
toString in class java.lang.Object