1 /* 2 Copyright 2008 Members of the EGEE Collaboration. 3 Copyright 2008 University Corporation for Advanced Internet Development, 4 Inc. 5 6 Licensed under the Apache License, Version 2.0 (the "License"); 7 you may not use this file except in compliance with the License. 8 You may obtain a copy of the License at 9 10 http://www.apache.org/licenses/LICENSE-2.0 11 12 Unless required by applicable law or agreed to in writing, software 13 distributed under the License is distributed on an "AS IS" BASIS, 14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 See the License for the specific language governing permissions and 16 limitations under the License. 17 */ 18 19 package org.opensaml.xacml.profile.saml; 20 21 import java.util.List; 22 23 import javax.xml.namespace.QName; 24 25 import org.opensaml.saml2.core.RequestAbstractType; 26 import org.opensaml.xacml.XACMLObject; 27 import org.opensaml.xacml.ctx.RequestType; 28 import org.opensaml.xacml.policy.PolicySetType; 29 import org.opensaml.xacml.policy.PolicyType; 30 import org.opensaml.xml.schema.XSBooleanValue; 31 32 /** A SAML XACML profile XACMLAuthzDecisionQuery schema type. */ 33 public interface XACMLAuthzDecisionQueryType extends RequestAbstractType, XACMLObject { 34 35 /** Element local name. */ 36 public static final String DEFAULT_ELEMENT_LOCAL_NAME = "XACMLAuthzDecisionQuery"; 37 38 /** Default element name for XACML 1.0. */ 39 public static final QName DEFAULT_ELEMENT_NAME_XACML10 = new QName(SAMLProfileConstants.SAML20XACML10P_NS, 40 DEFAULT_ELEMENT_LOCAL_NAME, SAMLProfileConstants.SAML20XACMLPROTOCOL_PREFIX); 41 42 /** Default element name for XACML 1.1. */ 43 public static final QName DEFAULT_ELEMENT_NAME_XACML11 = new QName(SAMLProfileConstants.SAML20XACML1_1P_NS, 44 DEFAULT_ELEMENT_LOCAL_NAME, SAMLProfileConstants.SAML20XACMLPROTOCOL_PREFIX); 45 46 /** Default element name for XACML 2.0. */ 47 public static final QName DEFAULT_ELEMENT_NAME_XACML20 = new QName(SAMLProfileConstants.SAML20XACML20P_NS, 48 DEFAULT_ELEMENT_LOCAL_NAME, SAMLProfileConstants.SAML20XACMLPROTOCOL_PREFIX); 49 50 /** Default element name for XACML 3.0. */ 51 public static final QName DEFAULT_ELEMENT_NAME_XACML30 = new QName(SAMLProfileConstants.SAML20XACML30P_NS, 52 DEFAULT_ELEMENT_LOCAL_NAME, SAMLProfileConstants.SAML20XACMLPROTOCOL_PREFIX); 53 54 /** Local name of the XSI type. */ 55 public static final String TYPE_LOCAL_NAME = "XACMLAuthzDecisionQueryType"; 56 57 /** QName of the XSI type.XACML1.0. */ 58 public static final QName TYPE_NAME_XACML10 = new QName(SAMLProfileConstants.SAML20XACML10P_NS, TYPE_LOCAL_NAME, 59 SAMLProfileConstants.SAML20XACMLPROTOCOL_PREFIX); 60 61 /** QName of the XSI type.XACML1.1. */ 62 public static final QName TYPE_NAME_XACML11 = new QName(SAMLProfileConstants.SAML20XACML1_1P_NS, TYPE_LOCAL_NAME, 63 SAMLProfileConstants.SAML20XACMLPROTOCOL_PREFIX); 64 65 /** QName of the XSI type.XACML2.0. */ 66 public static final QName TYPE_NAME_XACML20 = new QName(SAMLProfileConstants.SAML20XACML20P_NS, TYPE_LOCAL_NAME, 67 SAMLProfileConstants.SAML20XACMLPROTOCOL_PREFIX); 68 69 /** QName of the XSI type.XACML3.0. */ 70 public static final QName TYPE_NAME_XACML30 = new QName(SAMLProfileConstants.SAML20XACML30P_NS, TYPE_LOCAL_NAME, 71 SAMLProfileConstants.SAML20XACMLPROTOCOL_PREFIX); 72 73 /** InputContextOnly attribute name. */ 74 public static final String INPUTCONTEXTONLY_ATTRIB_NAME = "InputContextOnly"; 75 76 /** ReturnContext attribute name. */ 77 public static final String RETURNCONTEXT_ATTRIB_NAME = "ReturnContext"; 78 79 /** CombinePolicies attribute name. */ 80 public static final String COMBINEPOLICIES_ATTRIB_NAME = "CombinePolicies"; 81 82 /** 83 * Returns if the PDP can combine policies from the query and local policies. 84 * 85 * @return XSBooleanValue true if the PDP can combine policies from the query and locally 86 */ 87 public XSBooleanValue getCombinePoliciesXSBooleanValue(); 88 89 /** 90 * True then use only information in the XACMLAuthzDecisionQuery, if false could use external XACML attributes. 91 * 92 * @return if the use of just attributes in the XACMLAuthzDecisionQuery is allowed 93 */ 94 public XSBooleanValue getInputContextOnlyXSBooleanValue(); 95 96 /** 97 * Gets the policies to be used while rendering a decision. 98 * 99 * @return policies to be used while rendering a decision 100 */ 101 public List<PolicyType> getPolicies(); 102 103 /** 104 * Gets the policy sets to be used while rendering a decision. 105 * 106 * @return policy sets to be used while rendering a decision 107 */ 108 public List<PolicySetType> getPolicySets(); 109 110 /** 111 * Gets the reference to the policies to be used while rendering a decision. 112 * 113 * @return references to the policies to be used while rendering a decision 114 */ 115 public ReferencedPoliciesType getReferencedPolicies(); 116 117 /** 118 * Sets the reference to the policies to be used while rendering a decision. 119 * 120 * @param policies reference to the policies to be used while rendering a decision 121 */ 122 public void setReferencedPolicies(ReferencedPoliciesType policies); 123 124 /** 125 * Gets the request of the query. 126 * 127 * @return XACMLRequest The request inside the query 128 */ 129 public RequestType getRequest(); 130 131 /** 132 * If true then include the {@link org.opensaml.xacml.ctx.RequestType} in the response. 133 * 134 * @return boolean true if the {@link org.opensaml.xacml.ctx.RequestType} should be included in the response 135 */ 136 public XSBooleanValue getReturnContextXSBooleanValue(); 137 138 /** 139 * Returns if the PDP can combine policies from the query and local policies. 140 * 141 * @return true if the PDP can combine policies from the query and locally 142 */ 143 public Boolean isCombinePolicies(); 144 145 /** 146 * True then use only information in the XACMLAuthzDecisionQuery, if false could use external XACML attributes. 147 * 148 * @return boolean true then use of just attributes in the XACMLAuthzDecisionQuery is allowed 149 */ 150 public Boolean isInputContextOnly(); 151 152 /** 153 * If true then include the {@link RequestType} in the response. 154 * 155 * @return boolean if the {@link RequestType} should be included in the response 156 */ 157 public Boolean isReturnContext(); 158 159 /** 160 * Sets if the PDP can combine policies from this query and the one locally. 161 * 162 * @param combinePolicies If true then the PDP can combine policies from this query and the one locally 163 */ 164 public void setCombinePolicies(Boolean combinePolicies); 165 166 /** 167 * Sets if the PDP can combine policies from this query and the one locally. 168 * 169 * @param combinePolicies If true then the PDP can combine policies from this query and the one locally 170 */ 171 public void setCombinePolicies(XSBooleanValue combinePolicies); 172 173 /** 174 * Sets if external attributes is allowed in the decision, true if it's allowed. 175 * 176 * @param inputContextOnly if external attributes is allowed in the decision, true if it's allowed. 177 */ 178 public void setInputContextOnly(Boolean inputContextOnly); 179 180 /** 181 * Sets if external attributes is allowed in the decision, true if it's allowed. 182 * 183 * @param inputContextOnly if external attributes is allowed in the decision, true if it's allowed. 184 */ 185 public void setInputContextOnly(XSBooleanValue inputContextOnly); 186 187 /** 188 * Set's the XACML Request. 189 * 190 * @param request The request of the decision query 191 */ 192 public void setRequest(RequestType request); 193 194 /** 195 * Set's if the {@link RequestType} should be included inside the request message. 196 * 197 * @param returnContext is true if the {@link RequestType} should be included inside the request message 198 */ 199 public void setReturnContext(Boolean returnContext); 200 201 /** 202 * Set's if the {@link RequestType} should be included inside the request message. 203 * 204 * @param returnContext is true if the {@link RequestType} should be included inside the request message 205 */ 206 public void setReturnContext(XSBooleanValue returnContext); 207 208 }