org.opensaml
Class SAMLRequest

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

public class SAMLRequest
extends SAMLSignedObject
implements java.lang.Cloneable

Represents a SAML protocol request

Author:
Scott Cantor

Field Summary
 
Fields inherited from class org.opensaml.SAMLObject
config, log, root
 
Constructor Summary
SAMLRequest(java.util.Collection respondWiths, SAMLQuery query, java.util.Collection assertionIdRefs, java.util.Collection artifacts)
          Builds a SAML request out of its component parts
SAMLRequest(org.w3c.dom.Element e)
          Reconstructs a request from a DOM tree
SAMLRequest(java.io.InputStream in)
          Reconstructs a request from a stream
 
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 request from a DOM element.
 java.util.Iterator getArtifacts()
          Gets the artifacts contained within the request
 java.util.Iterator getAssertionIdRefs()
          Gets the assertion ID references contained within the request
 java.util.Date getIssueInstant()
          Gets the IssueInstant attribute of the SAML request
 SAMLQuery getQuery()
          Gets the query contained within the request
 java.lang.String getRequestId()
          Gets the RequestID attribute of the SAML request
 java.util.Iterator getRespondWiths()
          Gets the types of statements the requester is prepared to accept
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 request
 
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

SAMLRequest

public SAMLRequest(java.util.Collection respondWiths,
                   SAMLQuery query,
                   java.util.Collection assertionIdRefs,
                   java.util.Collection artifacts)
            throws SAMLException
Builds a SAML request out of its component parts

The last three parameters are mutually exclusive of each other, and two of them should be null. They will be evaluated in order.

Parameters:
respondWiths - The types of SAML statements (as QNames) to accept in the query response
query - A query to place in the request
assertionIdRefs - A set of AssertionIDRef values to dereference
artifacts - A set of artifacts to dereference
Throws:
SAMLException - Thrown if a request cannot be constructed from the supplied information

SAMLRequest

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

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

SAMLRequest

public SAMLRequest(java.io.InputStream in)
            throws SAMLException
Reconstructs a request 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 request from a DOM element.

Checks the request'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.

getRequestId

public java.lang.String getRequestId()
Gets the RequestID attribute of the SAML request

Returns:
The RequestID value

getIssueInstant

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

Returns:
The IssueInstant value

getRespondWiths

public java.util.Iterator getRespondWiths()
Gets the types of statements the requester is prepared to accept

Returns:
An iterator of QNames representing statement types

getQuery

public SAMLQuery getQuery()
Gets the query contained within the request

Returns:
The query in the request

getAssertionIdRefs

public java.util.Iterator getAssertionIdRefs()
Gets the assertion ID references contained within the request

Returns:
An iterator over the references

getArtifacts

public java.util.Iterator getArtifacts()
Gets the artifacts contained within the request

Returns:
An iterator over the artifacts

toDOM

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

Overrides:
toDOM in class SAMLObject
Parameters:
doc - A Document object to use in manufacturing the tree
Returns:
Root "Request" 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.