org.opensaml
Class SAMLNameIdentifier

java.lang.Object
  extended byorg.opensaml.SAMLObject
      extended byorg.opensaml.SAMLNameIdentifier
All Implemented Interfaces:
java.lang.Cloneable

public class SAMLNameIdentifier
extends SAMLObject
implements java.lang.Cloneable

Represents a SAML Subject

Author:
Scott Cantor

Field Summary
protected  java.lang.String format
           
static java.lang.String FORMAT_EMAIL
          Email Format Identifier
static java.lang.String FORMAT_UNSPECIFIED
          Unspecified Format Identifier
static java.lang.String FORMAT_WINDOWS
          Windows Domain Format Identifier
static java.lang.String FORMAT_X509
          X.509 Subject Format Identifier
protected  java.lang.String name
           
protected  java.lang.String nameQualifier
           
 
Fields inherited from class org.opensaml.SAMLObject
config, log, root
 
Constructor Summary
SAMLNameIdentifier()
          Default constructor
SAMLNameIdentifier(org.w3c.dom.Element e)
          Reconstructs a name identifier from a DOM tree
SAMLNameIdentifier(java.io.InputStream in)
          Reconstructs a name identifier from a stream
SAMLNameIdentifier(java.lang.String name, java.lang.String nameQualifier, java.lang.String format)
          Builds a name identifier out of its component parts
 
Method Summary
 void checkValidity()
          Evaluates the object's content to see if it is currently valid if serialized.
 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 an object from a DOM element
 java.lang.String getFormat()
          Gets the format of the name
 java.lang.String getName()
          Gets the name of the Subject
 java.lang.String getNameQualifier()
          Gets the name qualifier
 void setFormat(java.lang.String format)
          Sets the format of the name
 void setName(java.lang.String name)
          Sets the name of the Subject
 void setNameQualifier(java.lang.String nameQualifier)
          Sets the name qualifier
 org.w3c.dom.Node toDOM(org.w3c.dom.Document doc, boolean xmlns)
          Transforms the object into a DOM tree using an existing document context
 
Methods inherited from class org.opensaml.SAMLObject
fromStream, plantRoot, toBase64, toDOM, toDOM, toDOM, toStream, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected java.lang.String name

nameQualifier

protected java.lang.String nameQualifier

format

protected java.lang.String format

FORMAT_UNSPECIFIED

public static final java.lang.String FORMAT_UNSPECIFIED
Unspecified Format Identifier

See Also:
Constant Field Values

FORMAT_EMAIL

public static final java.lang.String FORMAT_EMAIL
Email Format Identifier

See Also:
Constant Field Values

FORMAT_X509

public static final java.lang.String FORMAT_X509
X.509 Subject Format Identifier

See Also:
Constant Field Values

FORMAT_WINDOWS

public static final java.lang.String FORMAT_WINDOWS
Windows Domain Format Identifier

See Also:
Constant Field Values
Constructor Detail

SAMLNameIdentifier

public SAMLNameIdentifier()
Default constructor


SAMLNameIdentifier

public SAMLNameIdentifier(java.lang.String name,
                          java.lang.String nameQualifier,
                          java.lang.String format)
                   throws SAMLException
Builds a name identifier out of its component parts

Parameters:
name - Name of subject (optional)
nameQualifier - Federates or qualifies subject name (optional)
format - URI describing name semantics and format (optional)
Throws:
SAMLException - Raised if a name cannot be constructed from the supplied information

SAMLNameIdentifier

public SAMLNameIdentifier(org.w3c.dom.Element e)
                   throws SAMLException
Reconstructs a name identifier from a DOM tree

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

SAMLNameIdentifier

public SAMLNameIdentifier(java.io.InputStream in)
                   throws SAMLException
Reconstructs a name identifier 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
Description copied from class: SAMLObject
Initialization of an object from a DOM element

Overrides:
fromDOM in class SAMLObject
Parameters:
e - Root element of a DOM tree
Throws:
SAMLException - Raised if an exception occurs while constructing the object
See Also:
SAMLObject.fromDOM(org.w3c.dom.Element)

getName

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

Returns:
The Subject name

setName

public void setName(java.lang.String name)
Sets the name of the Subject

Parameters:
name - The name

getNameQualifier

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

Returns:
The name qualifier

setNameQualifier

public void setNameQualifier(java.lang.String nameQualifier)
Sets the name qualifier

Parameters:
nameQualifier - The name qualifier

getFormat

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

Returns:
The name format URI

setFormat

public void setFormat(java.lang.String format)
Sets the format of the name

Parameters:
format - The name format URI

toDOM

public org.w3c.dom.Node toDOM(org.w3c.dom.Document doc,
                              boolean xmlns)
                       throws SAMLException
Description copied from class: SAMLObject
Transforms the object into a DOM tree using an existing document context

Overrides:
toDOM in class SAMLObject
Parameters:
doc - A Document object to use in manufacturing the tree
xmlns - Include namespace(s) on root element?
Returns:
Root element node of the DOM tree capturing the object
Throws:
SAMLException - Raised if the object is incompletely defined
See Also:
SAMLObject.toDOM(org.w3c.dom.Document,boolean)

checkValidity

public void checkValidity()
                   throws SAMLException
Description copied from class: SAMLObject
Evaluates the object's content to see if it is currently valid if serialized. Does not evaluate embedded objects except on the basis of whether they exist. For example, an Assertion must have a Statement, but if an invalid statement is added, SAMLAssertion.isValid() would succeed, while SAMLStatement.isValid would raise an exception.

Overrides:
checkValidity in class SAMLObject
Throws:
SAMLException - Raised if the serialized object would be invalid SAML, excluding any embedded objects
See Also:
SAMLObject.checkValidity()

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
Throws:
java.lang.CloneNotSupportedException
See Also:
Object.clone()


Copyright ? 2002 UCAID. All Rights Reserved.