/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 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: PolicyRequest.java,v 1.5 2008/08/19 19:09:19 veiming Exp $
*
* Portions Copyrighted 2011-2015 ForgeRock AS.
*/
/**
* This <code>PolicyRequest</code> class represents a PolicyRequest
* XML document. The PolicyRequest DTD is defined as the following:
* <p>
* <pre>
* <!-- PolicyRequest element is used by the client to request the
* The attribute appSSOToken provides the SSO token of the client
* as its identity that can be used by the server to check if the
* client can receive the requested information.
* The attribute requestId specifies the id of the request.
* -->
*
* <!ELEMENT PolicyRequest ( GetResourceResults
* | AddPolicyListener
* | RemovePolicyListener
* | AdvicesHandleableByAMRequest ) >
* <!ATTLIST PolicyRequest
* appSSOToken CDATA #REQUIRED
* requestId CDATA #REQUIRED
* >
* </pre>
* <p>
*/
public class PolicyRequest {
/**
* Policy Request - Get Resource Results ID.
*/
/**
* Policy Request - Add Policy Listener ID.
*/
/**
* Policy Request - Remove Policy Listener ID.
*/
/**
* Policy Request - Advices handleable by OpenAM ID.
*/
= "AdvicesHandleableByAMRequest";
/**
* Default constructor for <code>PolicyRequest</code>.
*/
public PolicyRequest() {
}
/**
* Returns the method ID of the Policy Request.
*
* @return the method ID.
*/
public int getMethodID() {
return methodID;
}
/**
* Retrieves the string representation of the method Id.
*
* @return the string representation of the method Id
* @throws IllegalStateException should the method Id become unknown
*/
switch (methodID) {
return "REQUEST_ADD_POLICY_LISTENER";
return "REQUEST_REMOVE_POLICY_LISTENER";
return "REQUEST_ADVICES_HANDLEABLE_BY_AM_REQUEST";
return "REQUEST_GET_RESOURCE_RESULTS";
default:
throw new IllegalStateException("Unknown method Id");
}
}
/**
* Sets the method ID of the Policy Request.
*
* @param id the method ID.
*/
}
/**
* Returns the single sign on token of the application who sends the
* request.
*
* @return the single sign on token of the application.
*/
return appSSOToken;
}
/**
* Sets the single sign on token of the application who sends the request.
*
* @param ssoToken the single sign on token of the application.
*/
}
/**
* Returns the request ID.
*
* @return the request ID.
*/
return requestId;
}
/**
* Sets the request ID.
*
* @param reqId the ID of the request.
*/
}
/**
* Returns the resource result request object.
*
* @return the resource result request.
*/
return resourceResultReq;
}
/**
* Sets the resource result request object.
*
* @param req the resource result request.
*/
}
/**
* Returns the <code>PolicyListenerRequest</code> object.
*
* @return the <code>PolicyListenerRequest</code> object.
*/
return policyListenerReq;
}
/**
* Sets the <code>PolicyListenerRequest</code> of the Policy Service.
*
* @param req the <code>PolicyListenerRequest</code> of this Policy Service
*/
}
/**
* Returns the <code>RemoveListenerRequest</code> object.
*
* @return the <code>RemoveListenerRequest</code> object
*/
return removeListenerReq;
}
/**
* Sets the <code>RemoveListenerRequest</code> of the Policy Service.
*
* @param req the <code>RemoveListenerRequest</code> of this Policy Service
*/
}
/**
* Sets the <code>AdvicesHandleableByAMRequest</code> sub element of
* <code>PolicyRequest</code>.
*
* @param advicesHandleableByAMRequest the
* <code>AdvicesHandleableByAMRequest</code> sub element of
* <code>PolicyRequest</code>.
*/
public void setAdvicesHandleableByAMRequest(
{
}
/**
* Returns a <code>PolicyRequest</code> object constructed from a XML.
*
* @param pNode the XML DOM node for the <code>PolicyRequest</code> object.
* @return constructed <code>PolicyRequest</code> object
*/
throws PolicyEvaluationException
{
}
}
try {
} catch (PolicyEvaluationException pe) {
}
return preq;
}
try {
} catch (PolicyEvaluationException pe) {
}
return preq;
}
try {
} catch (PolicyEvaluationException pe) {
}
return preq;
}
new AdvicesHandleableByAMRequest());
return preq;
}
/*
* We reach here, there is no valid method name specified in
* the xml docuemnt. Throw exception.
*/
}
/**
* Returns a string representation of this object.
*
* @return a string representation of this object.
*/
.append(" ")
.append("=\"")
.append("\" ")
.append("=\"")
.append("\">")
if (methodID == POLICY_REQUEST_GET_RESOURCE_RESULTS) {
} else if (methodID == POLICY_REQUEST_ADD_POLICY_LISTENER) {
} else if (methodID == POLICY_REQUEST_REMOVE_POLICY_LISTENER) {
} else if (methodID
}
.append(">")
}
}