com.sun.identity.liberty.ws.security
Class SessionContext

java.lang.Object
  extended by com.sun.identity.liberty.ws.security.SessionContext

public class SessionContext
extends Object

The SessionContext class represents session status of an entity to another system entity. It is supplied to a relying party to support policy enforcement.


Field Summary
protected  Date _authenticationInstant
           
protected  AuthnContext _authnContext
           
protected  Date _issueInstant
           
protected  String _providerID
           
protected  SessionSubject _sessionSubject
           
 
Constructor Summary
protected SessionContext()
          Default constructor
  SessionContext(Element element)
          Constructs an SessionContext object from a DOM Element.
  SessionContext(SessionSubject sessionSubject, AuthnContext authnContext, String providerID)
          Constructs a SessionContext object from a SessionSubject object, a AuthnContext object and a String.
 
Method Summary
 AuthnContext getAuthnContext()
          Returns the AuthnContext within the SessionContext object.
 String getProviderID()
          Returns the ProviderID in the SessionContext object.
 SessionSubject getSessionSubject()
          Returns the SessionSubject within the SessionContext object.
 boolean setAuthnContext(AuthnContext authnContext)
          Sets the AuthnContext in the SessionContext.
 void setSessionSubject(SessionSubject sub)
          Sets the SessionSubject object.
 String toXMLString()
          Returns a String representation of the SessionContext element.
 String toXMLString(boolean includeNS, boolean declareNS)
          Returns a String representation of the <SessionContext> element.
 

Field Detail

_sessionSubject

protected SessionSubject _sessionSubject

_authnContext

protected AuthnContext _authnContext

_providerID

protected String _providerID

_issueInstant

protected Date _issueInstant

_authenticationInstant

protected Date _authenticationInstant
Constructor Detail

SessionContext

protected SessionContext()
Default constructor


SessionContext

public SessionContext(SessionSubject sessionSubject,
                      AuthnContext authnContext,
                      String providerID)
               throws SAMLException
Constructs a SessionContext object from a SessionSubject object, a AuthnContext object and a String.

Parameters:
sessionSubject - SessionSubject object.
authnContext - authentication context object.
providerID - provider ID.
Throws:
SAMLException - if sessionSubject is null or providerID is null.

SessionContext

public SessionContext(Element element)
               throws SAMLException
Constructs an SessionContext object from a DOM Element.

Parameters:
element - representing a DOM tree element.
Throws:
SAMLException - if there is an error in the sender or in the element definition.
Method Detail

getSessionSubject

public SessionSubject getSessionSubject()
Returns the SessionSubject within the SessionContext object.

Returns:
SessionSubject object.

setSessionSubject

public void setSessionSubject(SessionSubject sub)
Sets the SessionSubject object.

Parameters:
sub - SessionSubject object.

getAuthnContext

public AuthnContext getAuthnContext()
Returns the AuthnContext within the SessionContext object.

Returns:
AuthnContext object.

getProviderID

public String getProviderID()
Returns the ProviderID in the SessionContext object.

Returns:
ProviderID object

setAuthnContext

public boolean setAuthnContext(AuthnContext authnContext)
Sets the AuthnContext in the SessionContext.

Parameters:
authnContext - AuthnContext to be set.
Returns:
true if AuthnContext was set.

toXMLString

public String toXMLString()
                   throws FSMsgException
Returns a String representation of the SessionContext element.

Returns:
A string containing the valid XML for this element. By default name space name is prepended to the element name example <saml:Subject>.
Throws:
ParseException - if could not convert String Date expression to Date object.
FSMsgException - if could not get AuthnContext XML String representation.

toXMLString

public String toXMLString(boolean includeNS,
                          boolean declareNS)
                   throws FSMsgException
Returns a String representation of the <SessionContext> element.

Parameters:
includeNS - if true prepends all elements by their Namespace name <saml:Subject>.
declareNS - if true includes the namespace within the generated XML.
Returns:
A string containing the valid XML for this element. Return null if error happened.
Throws:
ParseException - if could not convert String Date expression to Date object.
FSMsgException - if could not get AuthnContext XML String representation.