org.opensaml
Class SAMLResponse

java.lang.Object
  |
  +--org.opensaml.SAMLObject
        |
        +--org.opensaml.SAMLSignedObject
              |
              +--org.opensaml.SAMLResponse
All Implemented Interfaces:
java.lang.Cloneable

public class SAMLResponse
extends SAMLSignedObject

Represents a SAML protocol response

Author:
Scott Cantor

Field Summary
 
Fields inherited from class org.opensaml.SAMLObject
config, log, root
 
Constructor Summary
SAMLResponse(org.w3c.dom.Element e)
          Reconstructs a response from a DOM tree
SAMLResponse(java.io.InputStream in)
          Reconstructs a response from a stream
SAMLResponse(java.lang.String inResponseTo, java.lang.String recipient, java.util.Collection assertions, SAMLException e)
          Builds a SAML response out of its component parts
 
Method Summary
 java.lang.Object clone()
          Copies a SAML object such that no dependencies exist between the original and the copy
 void fromDOM(org.w3c.dom.Element e)
          Initialization of response from a DOM element.
 java.util.Iterator getAssertions()
          Gets the SAML assertions contained in the response, if any
 java.lang.String getInResponseTo()
          Gets the InResponseTo attribute of the SAML response
 java.util.Date getIssueInstant()
          Gets the IssueInstant attribute of the SAML response
 java.lang.String getRecipient()
          Gets the Recipient attribute of the SAML response
 java.lang.String getResponseId()
          Gets the ResponseID attribute of the SAML response
protected  void insertSignature()
          Places the signature into the object's DOM to prepare for signing
 org.w3c.dom.Node toDOM(org.w3c.dom.Document doc)
          Overridden method to return a DOM tree representing the response
 
Methods inherited from class org.opensaml.SAMLSignedObject
getNativeSignature, getSignatureAlgorithm, getSignatureElement, getX509Certificates, isSigned, sign, toDOM, verify, verify, verify
 
Methods inherited from class org.opensaml.SAMLObject
fromStream, plantRoot, toBase64, toStream, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SAMLResponse

public SAMLResponse(java.lang.String inResponseTo,
                    java.lang.String recipient,
                    java.util.Collection assertions,
                    SAMLException e)
             throws SAMLException
Builds a SAML response out of its component parts

If a signature object is provided, it is annotated with transforms to sign the entire response and use the SHA-1 digest algorithm.

Parameters:
inResponseTo - The request ID that prompted the response, if any
recipient - The URL of the intended recipient of the response
assertions - The SAML assertion(s) to return in the response, if any
e - The SAML error status information to return in the response, if any
Throws:
SAMLException - Raised if a response cannot be constructed from the supplied information

SAMLResponse

public SAMLResponse(org.w3c.dom.Element e)
             throws SAMLException
Reconstructs a response from a DOM tree

Parameters:
e - The root of a DOM tree
Throws:
SAMLException - Thrown if the object cannot be constructed

SAMLResponse

public SAMLResponse(java.io.InputStream in)
             throws SAMLException
Reconstructs a response from a stream

Parameters:
in - A stream containing XML
Throws:
SAMLException - Raised if an exception occurs while constructing the object.
Method Detail

insertSignature

protected void insertSignature()
                        throws SAMLException
Places the signature into the object's DOM to prepare for signing

Specified by:
insertSignature in class SAMLSignedObject
Throws:
SAMLException - Thrown if an error occurs while placing the signature

fromDOM

public void fromDOM(org.w3c.dom.Element e)
             throws SAMLException
Initialization of response from a DOM element.

Checks the response's syntactic validity. An exception is thrown if any problems are detected. The exception will contain a message describing the problem, and may wrap another exception.

Overrides:
fromDOM in class SAMLSignedObject
Parameters:
e - Root element of a DOM tree
Throws:
SAMLException - Raised if an exception occurs while constructing the object.

getResponseId

public java.lang.String getResponseId()
Gets the ResponseID attribute of the SAML response

Returns:
The ResponseID value

getInResponseTo

public java.lang.String getInResponseTo()
Gets the InResponseTo attribute of the SAML response

Returns:
The InResponseTo value

getIssueInstant

public java.util.Date getIssueInstant()
Gets the IssueInstant attribute of the SAML response

Returns:
The IssueInstant value

getRecipient

public java.lang.String getRecipient()
Gets the Recipient attribute of the SAML response

Returns:
The Recipient value

getAssertions

public java.util.Iterator getAssertions()
Gets the SAML assertions contained in the response, if any

Returns:
Zero or more assertion objects

toDOM

public org.w3c.dom.Node toDOM(org.w3c.dom.Document doc)
Overridden method to return a DOM tree representing the response

Overrides:
toDOM in class SAMLObject
Parameters:
doc - A Document object to use in manufacturing the tree
Returns:
Root "Response" element of a DOM tree

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Copies a SAML object such that no dependencies exist between the original and the copy

Overrides:
clone in class SAMLSignedObject
Returns:
The new object
java.lang.CloneNotSupportedException
See Also:
Object.clone()


Copyright © 2002 UCAID. All Rights Reserved.