edu.internet2.middleware.shibboleth.common.attribute.encoding.provider
Class SAML2StringNameIDEncoder

java.lang.Object
  extended by edu.internet2.middleware.shibboleth.common.attribute.encoding.provider.AbstractAttributeEncoder<org.opensaml.saml2.core.NameID>
      extended by edu.internet2.middleware.shibboleth.common.attribute.encoding.provider.SAML2StringNameIDEncoder
All Implemented Interfaces:
AttributeEncoder<org.opensaml.saml2.core.NameID>, SAML2NameIDEncoder, SAMLNameIdentifierEncoder<org.opensaml.saml2.core.NameID>, XMLObjectAttributeEncoder<org.opensaml.saml2.core.NameID>

public class SAML2StringNameIDEncoder
extends AbstractAttributeEncoder<org.opensaml.saml2.core.NameID>
implements SAML2NameIDEncoder

An attribute encoder that takes the first value of an attribute and creates a NameID of it. Attribute values are turned into the values for the NameID by invoking the values Object.toString() method.


Field Summary
private  String nameFormat
          Format of the NameID.
private  org.opensaml.common.SAMLObjectBuilder<org.opensaml.saml2.core.NameID> nameIdBuilder
          NameID builder object.
private  String nameQualifier
          Name qualifier for the NameID.
 
Constructor Summary
SAML2StringNameIDEncoder()
          Constructor.
 
Method Summary
 org.opensaml.saml2.core.NameID encode(BaseAttribute attribute)
          Enocdes the attribute into a protocol specific representations.
 String getNameFormat()
          Gets the name format URI for the NameID.
 String getNameQualifier()
          Gets the name domain qualifier for the NameID.
 void setNameFormat(String format)
          Sets the name format URI for the NameID.
 void setNameQualifier(String qualifier)
          Sets the name domain qualifier for the NameID.
 
Methods inherited from class edu.internet2.middleware.shibboleth.common.attribute.encoding.provider.AbstractAttributeEncoder
getAttributeName, setAttributeName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.internet2.middleware.shibboleth.common.attribute.encoding.AttributeEncoder
getAttributeName, setAttributeName
 

Field Detail

nameIdBuilder

private org.opensaml.common.SAMLObjectBuilder<org.opensaml.saml2.core.NameID> nameIdBuilder
NameID builder object.


nameFormat

private String nameFormat
Format of the NameID.


nameQualifier

private String nameQualifier
Name qualifier for the NameID.

Constructor Detail

SAML2StringNameIDEncoder

public SAML2StringNameIDEncoder()
Constructor.

Method Detail

encode

public org.opensaml.saml2.core.NameID encode(BaseAttribute attribute)
                                      throws AttributeEncodingException
Enocdes the attribute into a protocol specific representations.

Specified by:
encode in interface AttributeEncoder<org.opensaml.saml2.core.NameID>
Parameters:
attribute - the attribute to encode
Returns:
the Object the attribute was encoded into
Throws:
AttributeEncodingException - if unable to successfully encode attribute

getNameFormat

public String getNameFormat()
Gets the name format URI for the NameID.

Specified by:
getNameFormat in interface SAMLNameIdentifierEncoder<org.opensaml.saml2.core.NameID>
Returns:
name format URI for the NameID

setNameFormat

public void setNameFormat(String format)
Sets the name format URI for the NameID.

Specified by:
setNameFormat in interface SAMLNameIdentifierEncoder<org.opensaml.saml2.core.NameID>
Parameters:
format - name format URI for the NameID

getNameQualifier

public String getNameQualifier()
Gets the name domain qualifier for the NameID.

Specified by:
getNameQualifier in interface SAMLNameIdentifierEncoder<org.opensaml.saml2.core.NameID>
Returns:
name domain qualifier for the NameID

setNameQualifier

public void setNameQualifier(String qualifier)
Sets the name domain qualifier for the NameID.

Specified by:
setNameQualifier in interface SAMLNameIdentifierEncoder<org.opensaml.saml2.core.NameID>
Parameters:
qualifier - name domain qualifier for the NameID


Copyright © 1999-2012. All Rights Reserved.