com.sun.identity.saml2.assertion
Interface Attribute


public interface Attribute

The Attribute element identifies an attribute by name and optionally includes its value(s). It has the AttributeType complex type.

 <complexType name="AttributeType">
   <complexContent>
     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
       <sequence>
         <element ref="{urn:oasis:names:tc:SAML:2.0:assertion}AttributeValue" maxOccurs="unbounded" minOccurs="0"/>
       </sequence>
       <attribute name="FriendlyName" type="{http://www.w3.org/2001/XMLSchema}string" />
       <attribute name="Name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
       <attribute name="NameFormat" type="{http://www.w3.org/2001/XMLSchema}anyURI" />
     </restriction>
   </complexContent>
 </complexType>
 


Method Summary
 EncryptedAttribute encrypt(java.security.Key recipientPublicKey, java.lang.String dataEncAlgorithm, int dataEncStrength, java.lang.String recipientEntityID)
          Returns an EncryptedAttribute object.
 java.util.Map getAnyAttribute()
          Returns the anyAttribute of the attribute.
 java.util.List getAttributeValue()
          Returns the AttributeValue(s) of the Attribute.
 java.util.List getAttributeValueString()
          Returns the AttributeValue(s) of the Attribute.
 java.lang.String getFriendlyName()
          Returns the FriendlyName of the attribute.
 java.lang.String getName()
          Returns the Name of the attribute.
 java.lang.String getNameFormat()
          Returns the NameFormat of the attribute.
 boolean isMutable()
          Returns the mutability of the object.
 void makeImmutable()
          Makes the object immutable.
 void setAnyAttribute(java.util.Map value)
          Sets the anyAttribute of the attribute.
 void setAttributeValue(java.util.List value)
          Sets the AttributeValue(s) of the Attribute.
 void setAttributeValueString(java.util.List value)
          Sets the value of AttributeValue element(s).
 void setFriendlyName(java.lang.String value)
          Sets the FriendlyName of the attribute.
 void setName(java.lang.String value)
          Sets the Name of the attribute.
 void setNameFormat(java.lang.String value)
          Sets the NameFormat of the attribute.
 java.lang.String toXMLString()
          Returns a String representation of the element.
 java.lang.String toXMLString(boolean includeNS, boolean declareNS)
          Returns a String representation of the element.
 

Method Detail

makeImmutable

public void makeImmutable()
Makes the object immutable.


isMutable

public boolean isMutable()
Returns the mutability of the object.

Returns:
true if the object is mutable; false otherwise.

getAttributeValue

public java.util.List getAttributeValue()
Returns the AttributeValue(s) of the Attribute.

Returns:
List of xml String representing AttributeValue(s) of the Attribute.
See Also:
setAttributeValue(List)

setAttributeValue

public void setAttributeValue(java.util.List value)
                       throws SAML2Exception
Sets the AttributeValue(s) of the Attribute.

Parameters:
value - List of xml String representing the new AttributeValue element(s).
Throws:
SAML2Exception - if the object is immutable.
See Also:
getAttributeValue()

getAttributeValueString

public java.util.List getAttributeValueString()
Returns the AttributeValue(s) of the Attribute.

Returns:
List of String representing the value of AttributeValue(s).
See Also:
setAttributeValueString(List)

setAttributeValueString

public void setAttributeValueString(java.util.List value)
                             throws SAML2Exception
Sets the value of AttributeValue element(s).

Parameters:
value - List of String representing the value of the new AttributeValue element(s).
Throws:
SAML2Exception - if the object is immutable.
See Also:
getAttributeValueString()

getName

public java.lang.String getName()
Returns the Name of the attribute.

Returns:
the Name of the attribute.
See Also:
setName(String)

setName

public void setName(java.lang.String value)
             throws SAML2Exception
Sets the Name of the attribute.

Parameters:
value - new Name of the attribute.
Throws:
SAML2Exception - if the object is immutable.
See Also:
getName()

getNameFormat

public java.lang.String getNameFormat()
Returns the NameFormat of the attribute.

Returns:
the value of NameFormat.
See Also:
setNameFormat(String)

setNameFormat

public void setNameFormat(java.lang.String value)
                   throws SAML2Exception
Sets the NameFormat of the attribute.

Parameters:
value - new NameFormat of the attribute.
Throws:
SAML2Exception - if the object is immutable.
See Also:
getNameFormat()

getFriendlyName

public java.lang.String getFriendlyName()
Returns the FriendlyName of the attribute.

Returns:
the value of FriendlyName of the attribute.
See Also:
setFriendlyName(String)

setFriendlyName

public void setFriendlyName(java.lang.String value)
                     throws SAML2Exception
Sets the FriendlyName of the attribute.

Parameters:
value - new FriendlyName of the attribute.
Throws:
SAML2Exception - if the object is immutable.
See Also:
getFriendlyName()

getAnyAttribute

public java.util.Map getAnyAttribute()
Returns the anyAttribute of the attribute.

Returns:
A Map containing name/value pairs of anyAttribute. Both the name and value are String object types.
See Also:
setAnyAttribute(Map)

setAnyAttribute

public void setAnyAttribute(java.util.Map value)
                     throws SAML2Exception
Sets the anyAttribute of the attribute.

Parameters:
value - Map of name/value pairs to be set. Both the name and value are String object types.
Throws:
SAML2Exception - if the object is immutable.
See Also:
getAnyAttribute()

encrypt

public EncryptedAttribute encrypt(java.security.Key recipientPublicKey,
                                  java.lang.String dataEncAlgorithm,
                                  int dataEncStrength,
                                  java.lang.String recipientEntityID)
                           throws SAML2Exception
Returns an EncryptedAttribute object.

Parameters:
recipientPublicKey - Public key used to encrypt the data encryption (secret) key, it is the public key of the recipient of the XML document to be encrypted.
dataEncAlgorithm - Data encryption algorithm.
dataEncStrength - Data encryption strength.
recipientEntityID - Unique identifier of the recipient, it is used as the index to the cached secret key so that the key can be reused for the same recipient; It can be null in which case the secret key will be generated every time and will not be cached and reused. Note that the generation of a secret key is a relatively expensive operation.
Returns:
EncryptedAttribute object
Throws:
SAML2Exception - if error occurs during the encryption process.

toXMLString

public java.lang.String toXMLString()
                             throws SAML2Exception
Returns a String representation of the element.

Returns:
A string containing the valid XML for this element. By default name space name is prepended to the element name.
Throws:
SAML2Exception - if the object does not conform to the schema.

toXMLString

public java.lang.String toXMLString(boolean includeNS,
                                    boolean declareNS)
                             throws SAML2Exception
Returns a String representation of the 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
Throws:
SAML2Exception - if the object does not conform to the schema.


Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.