com.sun.identity.saml.assertion
Class NameIdentifier

java.lang.Object
  |
  +--com.sun.identity.saml.assertion.NameIdentifier

public class NameIdentifier
extends java.lang.Object


Constructor Summary
NameIdentifier(org.w3c.dom.Element nameIdentifierElement)
          This constructor builds a NameIdentifer element from an existing XML block
NameIdentifier(java.lang.String name)
          constructor
NameIdentifier(java.lang.String name, java.lang.String nameQualifier)
          constructor
NameIdentifier(java.lang.String name, java.lang.String nameQualifier, java.lang.String format)
          constructor
 
Method Summary
 boolean equals(NameIdentifier nid)
          Checks for equality between this object and the NameIdentifier passed down as paramater.
 java.lang.String getFormat()
          get format from NameIdentifier
 java.lang.String getName()
          get the name from NameIdentifier
 java.lang.String getNameQualifier()
          get the name from NameIdentifier /** get nameQualifier from NameIdentifier
 boolean setFormat(java.lang.String format)
          set the format attribute for NameIdentifier
 boolean setNameQualifier(java.lang.String nameQualifier)
          set the nameQualifier attribute for NameIdentifier
 java.lang.String toString()
          Create a String representation of the element
 java.lang.String toString(boolean includeNS, boolean declareNS)
          Create a String representation of the <NameIdentifier> element
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NameIdentifier

public NameIdentifier(org.w3c.dom.Element nameIdentifierElement)
               throws SAMLException
This constructor builds a NameIdentifer element from an existing XML block
Parameters:
nameIdentifierElement: - A org.w3c.dom.Element representing DOM tree for NameIdentifier object
Throws:
SAMLException - if it could not process the org.w3c.dom.Element properly, implying that there is an error in the sender or in the element definition.

NameIdentifier

public NameIdentifier(java.lang.String name)
               throws SAMLException
constructor
Parameters:
name - - The string representing the name of the Subject
Throws:
SAMLException - if the input has an error.

NameIdentifier

public NameIdentifier(java.lang.String name,
                      java.lang.String nameQualifier)
               throws SAMLException
constructor
Parameters:
name - - The string representing the name of the Subject
nameQualifier - - The security or adminstrative domain that qualifies the name of the Subject. This is optional, could be null or "".
Throws:
SAMLException - if the input has an error.

NameIdentifier

public NameIdentifier(java.lang.String name,
                      java.lang.String nameQualifier,
                      java.lang.String format)
               throws SAMLException
constructor
Parameters:
name - - The string representing the name of the Subject
nameQualifier - - The security or adminstrative domain that qualifies the name of the Subject. This is optional could be null or "".
format - - The syntax used to describe the name of the Subject. This optional, could be null or "".
Throws:
SAMLException - if the input has an error.
Method Detail

getFormat

public java.lang.String getFormat()
get format from NameIdentifier
Returns:
A String representing the format within NameIdentifier element. Returns null if there is no format specified.

setFormat

public boolean setFormat(java.lang.String format)
set the format attribute for NameIdentifier
Parameters:
name - : A String representing the format of the NameIdentifier element
Returns:
boolean representing success of failure of operation

getNameQualifier

public java.lang.String getNameQualifier()
get the name from NameIdentifier /** get nameQualifier from NameIdentifier
Returns:
A String representing the nameQualifier within NameIdentifier element. Returns null if there is no nameQualifier.

setNameQualifier

public boolean setNameQualifier(java.lang.String nameQualifier)
set the nameQualifier attribute for NameIdentifier
Parameters:
name - : A String representing the nameQualifier of the NameIdentifier element
Returns:
boolean representing success of failure of operation

getName

public java.lang.String getName()
get the name from NameIdentifier
Returns:
A String representing the name of the NameIdentifier element

toString

public java.lang.String toString()
Create a String representation of the element
Overrides:
toString in class java.lang.Object
Returns:
A string containing the valid XML for this element By default name space name is prepended to the element name eg <saml:NameIdentifier>

toString

public java.lang.String toString(boolean includeNS,
                                 boolean declareNS)
Create a String representation of the <NameIdentifier> element
Parameters:
IncludeNS - : Determines whether or not the namespace qualifier is prepended to the Element when converted DeclareNS : Determines whether or not the namespace is declared within the Element.
Returns:
A string containing the valid XML for this element

equals

public boolean equals(NameIdentifier nid)
Checks for equality between this object and the NameIdentifier passed down as paramater. Checks if Name is equal and if it has NameQualifier and Format defined checks for equality in those too.
Parameters:
NameIdentifier - to be checked
Returns:
boolean representing whether the two are equal or not