Package com.sun.identity.saml.assertion
Class NameIdentifier
- java.lang.Object
-
- com.sun.identity.saml.assertion.NameIdentifier
-
- Direct Known Subclasses:
IDPProvidedNameIdentifier,OldProvidedNameIdentifier,SPProvidedNameIdentifier
public class NameIdentifier extends Object
The NameIdentifier element specifies aSubjectby a combination of a name and a security domain governing the name of theSubject.
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedNameIdentifier()Default contructorNameIdentifier(String name)ConstructorNameIdentifier(String name, String nameQualifier)Constructs aNameQualifierinstance.NameIdentifier(String name, String nameQualifier, String format)Constructs aNameQualifierinstance.NameIdentifier(Element nameIdentifierElement)Constructs aNameIdentiferelement from an existing XML block.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(NameIdentifier nid)Checks for equality between this object and theNameQualifierpassed down as parameter.StringgetFormat()Returns format.StringgetName()Returns the name fromNameQualifier.StringgetNameQualifier()Returns the name.booleansetFormat(String format)Sets the format attribute.protected booleansetName(String name)Sets the name attribute.booleansetNameQualifier(String nameQualifier)SetsnameQualifierattribute.StringtoString()Returns a String representation of the element.StringtoString(boolean includeNS, boolean declareNS)Returns String representation of the<NameIdentifier>element.
-
-
-
Constructor Detail
-
NameIdentifier
protected NameIdentifier()
Default contructor
-
NameIdentifier
public NameIdentifier(Element nameIdentifierElement) throws SAMLException
Constructs aNameIdentiferelement from an existing XML block.- Parameters:
nameIdentifierElement- Aorg.w3c.dom.Elementrepresenting DOM tree forNameIdentifierobject- Throws:
SAMLException- if it could not process theorg.w3c.dom.Elementproperly, implying that there is an error in the sender or in the element definition.
-
NameIdentifier
public NameIdentifier(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(String name, String nameQualifier) throws SAMLException
Constructs aNameQualifierinstance.- Parameters:
name- The string representing the name of the SubjectnameQualifier- The security or administrative domain that qualifies the name of theSubject. This is optional, could be null or "".- Throws:
SAMLException- if the input has an error.
-
NameIdentifier
public NameIdentifier(String name, String nameQualifier, String format) throws SAMLException
Constructs aNameQualifierinstance.- Parameters:
name- The string representing the name of the SubjectnameQualifier- The security or administrative domain that qualifies the name of theSubject. This is optional could be null or "".format- The syntax used to describe the name of theSubject. This optional, could be null or "".- Throws:
SAMLException- if the input has an error.
-
-
Method Detail
-
getFormat
public String getFormat()
Returns format.- Returns:
- format element. Returns null if there is no format specified.
-
setFormat
public boolean setFormat(String format)
Sets the format attribute.- Parameters:
format- A String representing the format.- Returns:
- true if operation succeeds.
-
getNameQualifier
public String getNameQualifier()
Returns the name.- Returns:
- A String representing the
nameQualifier. Returns null if there is nonameQualifier.
-
setNameQualifier
public boolean setNameQualifier(String nameQualifier)
SetsnameQualifierattribute.- Parameters:
nameQualifier- name qualifier.- Returns:
- true if operation succeeds.
-
setName
protected boolean setName(String name)
Sets the name attribute.- Parameters:
name- name of thenameQualifier.- Returns:
- true if operation succeeds.
-
getName
public String getName()
Returns the name fromNameQualifier.- Returns:
- name
-
toString
public String toString()
Returns a String representation of the element.
-
toString
public String toString(boolean includeNS, boolean declareNS)
Returns 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 theNameQualifierpassed down as parameter. Checks if Name is equal and if it hasNameQualifierand Format defined checks for equality in those too.- Parameters:
nid-NameIdentifierto be checked- Returns:
- true if the two
NameQualifierare equal or not
-
-