001/**
002 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
003 *
004 * Copyright (c) 2007 Sun Microsystems Inc. All Rights Reserved
005 *
006 * The contents of this file are subject to the terms
007 * of the Common Development and Distribution License
008 * (the License). You may not use this file except in
009 * compliance with the License.
010 *
011 * You can obtain a copy of the License at
012 * https://opensso.dev.java.net/public/CDDLv1.0.html or
013 * opensso/legal/CDDLv1.0.txt
014 * See the License for the specific language governing
015 * permission and limitations under the License.
016 *
017 * When distributing Covered Code, include this CDDL
018 * Header Notice in each file and include the License file
019 * at opensso/legal/CDDLv1.0.txt.
020 * If applicable, add the following below the CDDL Header,
021 * with the fields enclosed by brackets [] replaced by
022 * your own identifying information:
023 * "Portions Copyrighted [year] [name of copyright owner]"
024 *
025 * $Id: Attribute.java,v 1.5 2008/06/25 05:48:11 qcheng Exp $
026 *
027 */
028
029package com.sun.identity.xacml.context;
030
031import com.sun.identity.xacml.common.XACMLException;
032import java.net.URI;
033import java.util.List;
034
035/**
036 * The <code>Attribute</code> element specifies information about the
037 * action/subject/resource requested in the <code>Request</code> context by 
038 * listing a sequence of <code>Attribute</code> elements associated with 
039 * the action.
040 * <p>
041 * <pre>
042 * &lt;xs:element name="Attribute" type="xacml-context:AttributeType"/>
043 * &lt;xs:complexType name="AttributeType">
044 *    &lt;xs:sequence>
045 *       &lt;xs:element ref="xacml-context:AttributeValue" 
046 *        maxOccurs="unbounded"/>
047 *    &lt;xs:sequence>
048 *    &lt;xs:attribute name="AttributeId" type="xs:anyURI" use="required"/>
049 *    &lt;xs:attribute name="DataType" type="xs:anyURI" use="required"/>
050 *    &lt;xs:attribute name="Issuer" type="xs:string" use="optional"/>
051 * &lt;xs:complexType>
052 * </pre>
053 *@supported.all.api
054 */
055public interface Attribute {
056
057    /**
058     * Returns the AttributeId of the <code>Attribute</code>
059     * which the attribute identifier.
060     * @return the <code>URI</code> representing the data type.
061     */
062    public URI getAttributeId() ;
063
064    /**
065     * Sets the attributeId of the <code>Attribute</code>.
066     * @param attributeID <code>URI</code> representing the attribite id.
067     * @exception XACMLException if the object is immutable
068     */
069    public void setAttributeId(URI attributeID) throws XACMLException;
070
071    /**
072     * Returns the issuer of the <code>Attribute</code>.
073     * @return <code>String</code> representing the issuer. It MAY be an 
074     * x500Name that binds to a public key or some other identification 
075     * exchanged out-of-band by participating entities.
076     */
077    public String getIssuer();
078
079    /**
080     * Sets the issuer of the <code>Attribute</code>.
081     * @param issuer <code>String</code> representing the issuer. 
082     * It MAY be an x500Name that binds to a public key or some other 
083     * identification  exchanged out-of-band by participating entities. 
084     * This is optional so return value could be null or an empty 
085     * <code>String</code>.
086     * @exception XACMLException if the object is immutable
087     */
088    public void setIssuer(String issuer) throws XACMLException;
089
090    /**
091     * Returns the datatype of the contents of the <code>AttributeValue</code>
092     * elements. This will be either a primitive datatype defined by XACML 2.0 
093     * specification or a type ( primitive or structured) defined in a  
094     * namespace declared in the <xacml-context> element.
095     * @return the <code>URI</code> representing the data type.
096     */
097    public URI getDataType();
098
099    /**
100     * Sets the data type of the contents of the <code>AttributeValue</code>
101     * elements.
102     * @param dataType <code>URI</code> representing the data type.
103     * @exception XACMLException if the object is immutable
104     */
105    public void setDataType(URI dataType) throws XACMLException;
106      
107
108    /**
109     * Returns one to many <code>AttributeValue</code> elements for this object
110     * each attribite value MAY have empty contents, occur once or occur 
111     * multiple times.
112     *
113     * @return the List <code>AttributeValue</code> elements of this object
114     */
115    public List getAttributeValues();
116
117    /**
118     * Sets the <code>AttributeValue</code> elements of this object
119     *
120     * @param attrValues List containing <code>AttributeValue</code> elements 
121     * of this object.
122     *
123     * @exception XACMLException if the object is immutable
124     * An object is considered <code>immutable</code> if <code>
125     * makeImmutable()</code> has been invoked on it. It can
126     * be determined by calling <code>isMutable</code> on the object.
127     */
128    public void setAttributeValues(List attrValues) throws XACMLException;
129
130    /**
131     * Sets the attribute values for this object
132     *
133     * @param attrValues <code>List</code> containing <code>String<code> values
134     * of this object.
135     *
136     * @exception XACMLException if the object is immutable
137     * An object is considered <code>immutable</code> if <code>
138     * makeImmutable()</code> has been invoked on it. It can
139     * be determined by calling <code>isMutable</code> on the object.
140     */
141    public void setAttributeStringValues(List attrValues) throws XACMLException;
142
143   /**
144    * Returns a <code>String</code> representation of this object
145    * @param includeNSPrefix Determines whether or not the namespace qualifier
146    *        is prepended to the Element when converted
147    * @param declareNS Determines whether or not the namespace is declared
148    *        within the Element.
149    * @return a string representation of this object
150    * @exception XACMLException if conversion fails for any reason
151     */
152    public String toXMLString(boolean includeNSPrefix, boolean declareNS)
153            throws XACMLException;
154
155   /**
156    * Returns a string representation of this object.
157    *
158    * @return a string representation of this object.
159    * @exception XACMLException if conversion fails for any reason.
160    */
161    public String toXMLString() throws XACMLException;
162
163   /**
164    * Makes the object immutable
165    */
166    public void makeImmutable();
167
168   /**
169    * Returns <code>true</code> if the object is mutable.
170    *
171    * @return <code>true</code> if the object is mutable.
172    */
173    public boolean isMutable();
174    
175}




























































Copyright © 2010-2017, ForgeRock All Rights Reserved.