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

java.lang.Object
  extended bycom.sun.identity.liberty.ws.security.SessionContext

public class SessionContext
extends java.lang.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.


Constructor Summary
SessionContext(org.w3c.dom.Element element)
          Constructs an SessionContext object from a DOM Element.
SessionContext(SessionSubject sessionSubject, AuthnContext authnContext, java.lang.String providerID)
          Constructs a SessionContext object from a SessionSubject object, a AuthnContext object and a String.
 
Method Summary
 AuthnContext getAuthnContext()
          Gets the AuthnContext within the SessionContext element.
 java.lang.String getProviderID()
          Gets the ProviderID within the SessionContext element.
 SessionSubject getSessionSubject()
          Gets the SessionSubject within the SessionContext.
 boolean setAuthnContext(AuthnContext authnContext)
          Sets the AuthnContext to the SessionContext.
 void setSessionSubject(SessionSubject sub)
          Sets the SessionSubject within the SessionContext.
 java.lang.String toXMLString()
          Returns a String representation of the SessionContext element.
 java.lang.String toXMLString(boolean includeNS, boolean declareNS)
          Returns a String representation of the <SessionContext> element.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SessionContext

public SessionContext(SessionSubject sessionSubject,
                      AuthnContext authnContext,
                      java.lang.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(org.w3c.dom.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()
Gets the SessionSubject within the SessionContext. element.

Returns:
SessionSubject object, within this SessionContext.

setSessionSubject

public void setSessionSubject(SessionSubject sub)
Sets the SessionSubject within the SessionContext. element.

Parameters:
sub - SessionSubject object, within this SessionContext.

getAuthnContext

public AuthnContext getAuthnContext()
Gets the AuthnContext within the SessionContext element.

Returns:
AuthnContext object, within this SessionSubject.

getProviderID

public java.lang.String getProviderID()
Gets the ProviderID within the SessionContext element.

Returns:
ProviderID object, within this SessionSubject.

setAuthnContext

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

Parameters:
authnContext - AuthnContext to be set.
Returns:
true indicating success or failure of the operation.

toXMLString

public java.lang.String toXMLString()
                             throws java.text.ParseException,
                                    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:
java.text.ParseException - if could not convert String Date expression to Date object.
FSMsgException - if could not get AuthnContext XML String representation.

toXMLString

public java.lang.String toXMLString(boolean includeNS,
                                    boolean declareNS)
                             throws java.text.ParseException,
                                    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:
java.text.ParseException - if could not convert String Date expression to Date object.
FSMsgException - if could not get AuthnContext XML String representation.


Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.