/*
* 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: PolicyResponse.java,v 1.8 2008/12/04 00:38:52 dillidorai Exp $
*
* Portions Copyrighted 2011-2015 ForgeRock AS.
*/
/**
* This <code>PolicyResponse</code> represents a PolicyResponse
* XML document. The PolicyResponse DTD is defined as the following:
* <p>
* <pre>
* <!-- PolicyResponse element is used by the server to return a
* response to the client.
* If the client request is a policy evaluation request, then the
* policy decision is sent back using ResourceResult.
* If the client request is a policy listener addition, then an
* acknowledgement is sent back using AddPolicyListenerResponse.
* If the client request is a policy listener removal, then an
* acknowledgement is sent back using RemovePolicyListenerResponse.
* If anything wrong happens during the request processing, an
* error message is sent back to the client using Exception.
* The attribute requestId specifies the id of the request to
* which this response is regarding.
* -->
*
* <!ELEMENT PolicyResponse ( ResourceResult+
* | AddPolicyListenerResponse
* | RemovePolicyListenerResponse
* | AdvicesHandleableByAMResponse
* | Exception ) >
* <!ATTLIST PolicyResponse
* requestId CDATA #REQUIRED
* >
* </pre>
* <p>
*/
public class PolicyResponse {
/**
* Policy Response Resource Result ID.
*/
/**
* Add Policy Listener Resource ID.
*/
/**
* Remove Policy Listener Resource ID.
*/
/**
* Policy Exception ID.
*/
/**
* Policy Advices Handleable by OpenAM Response ID.
*/
/**
* Exception message if Application SSO Token is invalid
*/
= "Application sso token is invalid";
"RemovePolicyListenerResponse";
= "AdvicesHandleableByAMResponse";
/**
* Default constructor for <code>PolicyResponse</code>.
*/
public PolicyResponse() {
}
/**
* Returns the method ID of the Policy Response.
*
* @return the method ID.
*/
public int getMethodID() {
return methodID;
}
/**
* Sets the method ID of the Policy Response.
*
* @param id the method ID.
*/
}
/**
* Returns the request ID.
*
* @return the request ID.
*/
return requestId;
}
/**
* Sets the request ID.
*
* @param reqId the ID of the request.
*/
}
/**
* Returns the issue instant
*
* @return the issue instant
*/
public long getIssueInstant() {
return issueInstant;
}
/**
* Sets the issue instant
*
* @param issueInst issue instant
*/
}
/**
* Returns the set of the sub resource results.
*
* @return the sub resource result set.
*/
return resourceResults;
}
/**
* Sets the set of the sub resource results.
*
* @param set the sub resource result set.
*/
}
/**
* Returns the <code>AdvicesHandleableByAMResponse</code> object.
*
* @return <code>AdvicesHandleableByAMResponse</code> object.
*/
return advicesHandleableByAMResponse;
}
/**
* Set the <code>AdvicesHandleableByAMResponse</code>.
*
* @param advicesHandleableByAMResponse the
* <code>AdvicesHandleableByAMResponse</code>.
*/
{
}
/**
* Returns the exception response.
*
* @return the exception response.
*/
return exceptionMsg;
}
/**
* Sets the exception response.
*
* @param exMsg the exception response.
*/
}
/**
* Returns <code>PolicyResponse</code> object constructed from XML.
*
* @param pNode the XML DOM node for the <code>PolicyResponse</code> object.
* @return constructed <code>PolicyResponse</code> object.
*/
throws PolicyEvaluationException
{
}
try {
} catch(NumberFormatException nfe) {
//This should never happen
if (debug.warningEnabled()) {
}
}
} else {
if (debug.messageEnabled()) {
+ ISSUE_INSTANT);
}
}
try {
} catch (Exception e) {
throw new PolicyEvaluationException(
}
}
return pres;
}
return pres;
}
return pres;
}
return pres;
}
return pres;
}
/* We reach here, there is no valid method name specified in
the xml docuemnt. Throw exception.
*/
}
/**
* Returns string representation of this object.
*
* @return string representation of this object.
*/
.append(" ")
if (issueInstant != 0) {
}
if (methodID == POLICY_RESPONSE_RESOURCE_RESULT) {
}
} else if (methodID == POLICY_ADD_LISTENER_RESPONSE) {
.append("/>")
} else if (methodID == POLICY_REMOVE_LISTENER_RESPONSE) {
.append("/>")
} else if (methodID == POLICY_ADVICES_HANDLEABLE_BY_AM_RESPONSE) {
} else if (methodID == POLICY_EXCEPTION) {
.append(">")
.append(">")
}
.append(">")
}
}