org.opensaml
Class SAMLSubject

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

public class SAMLSubject
extends SAMLObject
implements java.lang.Cloneable

Represents a SAML Subject

Author:
Scott Cantor

Field Summary
static java.lang.String ARTIFACT01
          Type 01 Artifact Confirmation Method Identifier
static java.lang.String CONF_BEARER
          Assertion Bearer Confirmation Method Identifier
static java.lang.String HOLDER_KEY
          Holder of Key Confirmation Method Identifier
protected  org.w3c.dom.Element keyInfo
          Handle ds:KeyInfo as XML, let the application sort it out
static java.lang.String SENDER_VOUCHES
          Sender Vouches Confirmation Method Identifier
 
Fields inherited from class org.opensaml.SAMLObject
config, log, root
 
Constructor Summary
SAMLSubject(org.w3c.dom.Element e)
          Reconstructs a subject from a DOM tree
SAMLSubject(java.io.InputStream in)
          Reconstructs a subject from a stream
SAMLSubject(java.lang.String name, java.lang.String nameQualifier, java.lang.String format, java.util.Collection confirmationMethods, java.lang.String confirmationData, org.w3c.dom.Element keyInfo)
          Builds a subject 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)
          Initializes a subject from a DOM tree.
 java.lang.String getConfirmationData()
          Gets the optional confirmation data of the Subject
 java.util.Iterator getConfirmationMethods()
          Gets the confirmation methods of the Subject
 java.lang.String getFormat()
          Gets the format of the Subject name
 org.w3c.dom.Element getKeyInfo()
          Get the ds:KeyInfo DOM that is included in the subject, if any
 java.lang.String getName()
          Gets the name of the Subject
 java.lang.String getNameQualifier()
          Gets the name qualifier of the Subject
 org.w3c.dom.Node toDOM()
          Overridden method to return a DOM tree representing the subject
 org.w3c.dom.Node toDOM(org.w3c.dom.Document doc)
          Overridden method to return a DOM tree representing the subject
 
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
 

Field Detail

keyInfo

protected org.w3c.dom.Element keyInfo
Handle ds:KeyInfo as XML, let the application sort it out


ARTIFACT01

public static final java.lang.String ARTIFACT01
Type 01 Artifact Confirmation Method Identifier

See Also:
Constant Field Values

CONF_BEARER

public static final java.lang.String CONF_BEARER
Assertion Bearer Confirmation Method Identifier

See Also:
Constant Field Values

HOLDER_KEY

public static final java.lang.String HOLDER_KEY
Holder of Key Confirmation Method Identifier

See Also:
Constant Field Values

SENDER_VOUCHES

public static final java.lang.String SENDER_VOUCHES
Sender Vouches Confirmation Method Identifier

See Also:
Constant Field Values
Constructor Detail

SAMLSubject

public SAMLSubject(java.lang.String name,
                   java.lang.String nameQualifier,
                   java.lang.String format,
                   java.util.Collection confirmationMethods,
                   java.lang.String confirmationData,
                   org.w3c.dom.Element keyInfo)
            throws SAMLException
Builds a subject out of its component parts

Parameters:
name - Name of subject
nameQualifier - Federates or qualifies subject name (optional)
format - URI describing name semantics and format (optional)
confirmationMethods - Confirmation method(s) that bind the subject to an enclosing assertion (optional)
confirmationData - Arbitrary string-ified confirmation data (optional)
keyInfo -
Throws:
SAMLException - Raised if a subject cannot be constructed from the supplied information

SAMLSubject

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

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

SAMLSubject

public SAMLSubject(java.io.InputStream in)
            throws SAMLException
Reconstructs a subject from a stream

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

fromDOM

public void fromDOM(org.w3c.dom.Element e)
             throws SAMLException
Initializes a subject from a DOM tree.

The constructor checks the subject's syntactic and semantic 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 SAMLObject
Parameters:
e - A DOM Subject element
Throws:
SAMLException - Thrown if the subject cannot be constructed

getName

public java.lang.String getName()
Gets the name of the Subject

Returns:
The Subject name

getNameQualifier

public java.lang.String getNameQualifier()
Gets the name qualifier of the Subject

Returns:
The Subject name qualifier

getFormat

public java.lang.String getFormat()
Gets the format of the Subject name

Returns:
The Subject name format URI

getConfirmationMethods

public java.util.Iterator getConfirmationMethods()
Gets the confirmation methods of the Subject

Returns:
An iterator of Subject confirmation method URIs

getConfirmationData

public java.lang.String getConfirmationData()
Gets the optional confirmation data of the Subject

Returns:
String-ized Subject confirmation data

getKeyInfo

public org.w3c.dom.Element getKeyInfo()
Get the ds:KeyInfo DOM that is included in the subject, if any

Returns:
Root of the ds:KeyInfo DOM

toDOM

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

Overrides:
toDOM in class SAMLObject
Returns:
Root "Subject" element of a DOM tree

toDOM

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

Overrides:
toDOM in class SAMLObject
Parameters:
doc - A Document object to use in manufacturing the tree
Returns:
Root "Subject" 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 SAMLObject
Returns:
The new object
java.lang.CloneNotSupportedException
See Also:
Object.clone()


Copyright © 2002 UCAID. All Rights Reserved.