XACMLQueryUtil.java revision 1b49125c5fbcee4ac3052f0831212bbb6feae221
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2009 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
* 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: XACMLQueryUtil.java,v 1.1 2009/09/22 22:50:14 madan_ranganath Exp $
*
*/
/*
* Portions copyright 2013 ForgeRock, Inc.
*/
/**
* This class provides methods to send or process <code>AttributeQuery</code>.
*
* @supported.api
*/
public class XACMLQueryUtil {
static {
try {
} catch (SessionException se) {
}
}
private XACMLQueryUtil() {
}
/**
* Sends the XACML query to specifiied PDP, gets the policy decision
* and sends it back to the Fedlet
*
* @param request HTTP Servlet Request
* @param pepEntityID PEP entity ID
* @param pdpEntityID PDP entity ID
* @param nameIDValue NameID value
* @param serviceName Service Name
* @param resource Resource URL
* @param action Action
*
* @return the <code>String</code> object
* @exception SAML2Exception if the operation is not successful
*
* @supported.api
*/
throws SAML2Exception {
try {
//Subject
//set subject id
// Set Subject in Request
// Resource
// Set resource id
attributeList = new ArrayList();
// Set serviceName
// Set Resource in Request
// Action
// Set actionID
attributeList = new ArrayList();
// Set Action in Request
if (xacmlResponse != null) {
if (policy_result != null) {
if (policy_decision != null) {
return policy_decision;
}
}
}
}
}
} catch (URISyntaxException uriexp){
"getPolicyDecisionForFedlet: " +
"URI Exception while sending the XACML Request");
}
} catch (XACMLException xacmlexp){
"getPolicyDecisionForFedlet: " +
"Error while processing the XACML Response");
}
}
return null;
}
}