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: ResourceContent.java,v 1.2 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;
032
033import java.util.List;
034
035/**
036 * The <code>ResourceContent</code> element specifies information about the
037 * resource to which access is requested by listing a 
038 * sequence of <code>Attribute</code> elements associated with the
039 * resource. it may include <code>ResourceContent</code>
040 * <p>
041 * <pre>
042 * &lt;xs:complexType name="ResourceContentType" mixed="true">
043 *   &lt;xs:sequence>
044 *      &lt;xs:any namespace="##any" processContents="lax" minOccurs="0" 
045 *         maxOccurs="unbounded"/>
046 *   &lt;xs:sequence>
047 *   &lt;xs:anyAttribute namespace="##any" processContents="lax"/>
048 * &lt;xs:complexType>
049 * </pre>
050 *@supported.all.api
051 */
052public interface ResourceContent {
053
054    /**
055     * Returns the resource content of the <code>Resource</code>
056     *
057     * @return <code>String</code> representing the contents
058     * of the <code>Resource</code>.
059     */
060    public String getResourceContent();
061
062    /**
063     * Sets the resource content of this object
064     *
065     * @param resourceContent  <code>ResourceContent</code> of this object
066     * <code>ResourceContent</code> is optional so could be null.
067     * are present.
068     *
069     * @exception XACMLException if the object is immutable
070     * An object is considered <code>immutable</code> if <code>
071     * makeImmutable()</code> has been invoked on it. It can
072     * be determined by calling <code>isMutable</code> on the object.
073     */
074    public void setResourceContent(String resourceContent) 
075        throws XACMLException;
076
077    /**
078     * Returns zero to many <code>Attribute</code> elements of this object
079     * If no attributes and present, empty <code>List</code> will be returned.
080     * Typically a <code>Resource</code> element will contain an <code>
081     * Attribute</code> with an <code>AttributeId</code> of
082     * "urn:oasis:names:tc:xacml:1.0:resource:resource-id". Each such
083     * <code>Attribute</code> SHALL be an absolute abd fully resolved 
084     * representation of the identity of the single resource to which
085     * access is requested.
086     *
087     * @return <code>List</code> containing the <code>Attribute</code> 
088     * elements of this object
089     */
090    public List getAttributes();
091
092    /**
093     * Sets the <code>Attribute</code> elements of this object
094     *
095     * @param attributes <code>Attribute</code> elements of this object
096     * attributes could be an empty <code>List</code>, if no attributes
097     * are present.
098     *
099     * @exception XACMLException if the object is immutable
100     * An object is considered <code>immutable</code> if <code>
101     * makeImmutable()</code> has been invoked on it. It can
102     * be determined by calling <code>isMutable</code> on the object.
103     */
104    public void setAttributes(List attributes) throws XACMLException;
105
106   /**
107    * Returns a <code>String</code> representation of this object
108    * @param includeNSPrefix Determines whether or not the namespace qualifier
109    *        is prepended to the Element when converted
110    * @param declareNS Determines whether or not the namespace is declared
111    *        within the Element.
112    * @return a string representation of this object
113    * @exception XACMLException if conversion fails for any reason
114     */
115    public String toXMLString(boolean includeNSPrefix, boolean declareNS)
116            throws XACMLException;
117
118   /**
119    * Returns a string representation of this object
120    *
121    * @return a string representation of this object
122    * @exception XACMLException if conversion fails for any reason
123    */
124    public String toXMLString() throws XACMLException;
125
126   /**
127    * Makes the object immutable
128    */
129    public void makeImmutable();
130
131   /**
132    * Checks if the object is mutable
133    *
134    * @return <code>true</code> if the object is mutable,
135    *         <code>false</code> otherwise
136    */
137    public boolean isMutable();
138    
139}




























































Copyright © 2010-2017, ForgeRock All Rights Reserved.