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: Result.java,v 1.3 2008/06/25 05:48:12 qcheng Exp $
026 *
027 */
028
029package com.sun.identity.xacml.context;
030
031import com.sun.identity.xacml.common.XACMLException;
032import com.sun.identity.xacml.policy.Obligations;
033import java.util.List;
034
035/**
036 * The <code>Result</code> element is a container of 
037 * one or more <code>Result</code>s issuded by authorization authority.
038 * @supported.all.api
039 * <p/>
040 * <pre>
041 * schema:
042 *      &lt;xs:complexType name="ResultType">
043 *          &lt;xs:sequence>
044 *              &lt;xs:element ref="xacml-context:Decision"/>
045 *              &lt;xs:element ref="xacml-context:Status" minOccurs="0"/>
046 *              &lt;xs:element ref="xacml:Obligations" minOccurs="0"/>
047 *          &lt;xs:sequence>
048 *          &lt;xs:attribute name="ResourceId" type="xs:string" use="optional"/>
049 *      &lt;xs:complexType>
050 * </pre>
051 */
052public interface Result {
053
054    /**
055     * Returns the <code>Resourceid</code>s of this object
056     *
057     * @return the <code>Resourceid</code>s of this object
058     */
059    public String getResourceId();
060
061    /**
062     * Sets the <code>Resourceid</code>s of this object
063     *
064     * @exception XACMLException if the object is immutable
065     */
066    public void setResourceId(String resourceId) throws XACMLException;
067
068    /**
069     * Returns the <code>Decision</code> of this object
070     *
071     * @return the <code>Decision</code> of this object
072     */
073    public Decision getDecision();
074
075    /**
076     * Sets the <code>Decision</code> of this object
077     *
078     * @exception XACMLException if the object is immutable
079     */
080    public void setDecision(Decision decision) throws XACMLException;
081
082    /**
083     * Returns the <code>Status</code> of this object
084     *
085     * @return the <code>Status</code> of this object
086     */
087    public Status getStatus();
088
089    /**
090     * Sets the <code>Status</code> of this object
091     *
092     * @exception XACMLException if the object is immutable
093     */
094    public void setStatus(Status status) throws XACMLException;
095
096    /**
097     * Returns the <code>Obligations</code> of this object
098     *
099     * @return the <code>Obligations</code> of this object
100     */
101    public Obligations getObligations();
102
103    /**
104     * Sets the <code>Obligations</code> of this object
105     * @param obligations <code>Obligations</code> to set
106     *
107     * @exception XACMLException if the object is immutable
108     */
109    public void setObligations(Obligations obligations) throws XACMLException;
110
111
112   /**
113    * Returns a string representation
114    *
115    * @return a string representation
116    * @exception XACMLException if conversion fails for any reason
117    */
118    public String toXMLString() throws XACMLException;
119
120   /**
121    * Returns a string representation
122    * @param includeNSPrefix Determines whether or not the namespace qualifier
123    *        is prepended to the Element when converted
124    * @param declareNS Determines whether or not the namespace is declared
125    *        within the Element.
126    * @return a string representation
127    * @exception XACMLException if conversion fails for any reason
128     */
129    public String toXMLString(boolean includeNSPrefix, boolean declareNS)
130            throws XACMLException;
131
132   /**
133    * Checks if the object is mutable
134    *
135    * @return <code>true</code> if the object is mutable,
136    *         <code>false</code> otherwise
137    */
138    public boolean isMutable();
139
140   /**
141    * Makes the object immutable
142    */
143    public void makeImmutable();
144
145    
146}