/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* https://opensso.dev.java.net/public/CDDLv1.0.html or
* opensso/legal/CDDLv1.0.txt
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: Attribute.java,v 1.5 2008/06/25 05:48:11 qcheng Exp $
*
*/
package com.sun.identity.xacml.context;
import com.sun.identity.xacml.common.XACMLException;
import java.net.URI;
import java.util.List;
/**
* The Attribute
element specifies information about the
* action/subject/resource requested in the Request
context by
* listing a sequence of Attribute
elements associated with
* the action.
*
*
* <xs:element name="Attribute" type="xacml-context:AttributeType"/> * <xs:complexType name="AttributeType"> * <xs:sequence> * <xs:element ref="xacml-context:AttributeValue" * maxOccurs="unbounded"/> * <xs:sequence> * <xs:attribute name="AttributeId" type="xs:anyURI" use="required"/> * <xs:attribute name="DataType" type="xs:anyURI" use="required"/> * <xs:attribute name="Issuer" type="xs:string" use="optional"/> * <xs:complexType> **@supported.all.api */ public interface Attribute { /** * Returns the AttributeId of the
Attribute
* which the attribute identifier.
* @return the URI
representing the data type.
*/
public URI getAttributeId() ;
/**
* Sets the attributeId of the Attribute
.
* @param attributeID URI
representing the attribite id.
* @exception XACMLException if the object is immutable
*/
public void setAttributeId(URI attributeID) throws XACMLException;
/**
* Returns the issuer of the Attribute
.
* @return String
representing the issuer. It MAY be an
* x500Name that binds to a public key or some other identification
* exchanged out-of-band by participating entities.
*/
public String getIssuer();
/**
* Sets the issuer of the Attribute
.
* @param issuer String
representing the issuer.
* It MAY be an x500Name that binds to a public key or some other
* identification exchanged out-of-band by participating entities.
* This is optional so return value could be null or an empty
* String
.
* @exception XACMLException if the object is immutable
*/
public void setIssuer(String issuer) throws XACMLException;
/**
* Returns the datatype of the contents of the AttributeValue
* elements. This will be either a primitive datatype defined by XACML 2.0
* specification or a type ( primitive or structured) defined in a
* namespace declared in the URI
representing the data type.
*/
public URI getDataType();
/**
* Sets the data type of the contents of the AttributeValue
* elements.
* @param dataType URI
representing the data type.
* @exception XACMLException if the object is immutable
*/
public void setDataType(URI dataType) throws XACMLException;
/**
* Returns one to many AttributeValue
elements for this object
* each attribite value MAY have empty contents, occur once or occur
* multiple times.
*
* @return the List AttributeValue
elements of this object
*/
public List getAttributeValues();
/**
* Sets the AttributeValue
elements of this object
*
* @param attrValues List containing AttributeValue
elements
* of this object.
*
* @exception XACMLException if the object is immutable
* An object is considered immutable
if
* makeImmutable()
has been invoked on it. It can
* be determined by calling isMutable
on the object.
*/
public void setAttributeValues(List attrValues) throws XACMLException;
/**
* Sets the attribute values for this object
*
* @param attrValues List
containing String values
* of this object.
*
* @exception XACMLException if the object is immutable
* An object is considered immutable
if
* makeImmutable()
has been invoked on it. It can
* be determined by calling isMutable
on the object.
*/
public void setAttributeStringValues(List attrValues) throws XACMLException;
/**
* Returns a String
representation of this object
* @param includeNSPrefix Determines whether or not the namespace qualifier
* is prepended to the Element when converted
* @param declareNS Determines whether or not the namespace is declared
* within the Element.
* @return a string representation of this object
* @exception XACMLException if conversion fails for any reason
*/
public String toXMLString(boolean includeNSPrefix, boolean declareNS)
throws XACMLException;
/**
* Returns a string representation of this object.
*
* @return a string representation of this object.
* @exception XACMLException if conversion fails for any reason.
*/
public String toXMLString() throws XACMLException;
/**
* Makes the object immutable
*/
public void makeImmutable();
/**
* Returns true
if the object is mutable.
*
* @return true
if the object is mutable.
*/
public boolean isMutable();
}