use of com.iplanet.services.comm.share.ResponseSet in project OpenAM by OpenRock.
the class PolicyRequestHandler method process.
/**
* Process the requests aÎnd return the responses.
*
* @param requests Requests specified in the policy request
* @return the set of the response
*/
public ResponseSet process(PLLAuditor auditor, List<Request> requests, HttpServletRequest servletRequest, HttpServletResponse servletResponse, ServletContext servletContext) {
ResponseSet resSet = new ResponseSet(PolicyService.POLICY_SERVICE);
int size = requests.size();
auditor.setComponent(POLICY);
for (Request req : requests) {
Response res = null;
try {
res = processRequest(req, auditor);
} catch (PolicyEvaluationException pe) {
if (debug.messageEnabled()) {
debug.message("PolicyRequesthandler.process" + " caught PolicyEvaluationException:", pe);
}
PolicyService ps = new PolicyService();
try {
String rev = getPolicyServiceRevision();
ps.setRevision(rev);
} catch (PolicyEvaluationException pee) {
debug.error("PolicyRequesthandler.process" + " can not get service revision number, " + ",revision defaulting to :" + PolicyService.ON_ERROR_REVISION_NUMBER, pee);
ps.setRevision(PolicyService.ON_ERROR_REVISION_NUMBER);
}
PolicyResponse pRes = new PolicyResponse();
pRes.setMethodID(PolicyResponse.POLICY_EXCEPTION);
pRes.setRequestId(pe.getRequestId());
pRes.setExceptionMsg(pe.getMessage());
pRes.setIssueInstant(System.currentTimeMillis());
ps.setMethodID(PolicyService.POLICY_RESPONSE_ID);
ps.setPolicyResponse(pRes);
res = new Response(ps.toXMLString());
auditor.auditAccessFailure(pe.getMessage());
}
if (res != null) {
resSet.addResponse(res);
}
}
return resSet;
}
use of com.iplanet.services.comm.share.ResponseSet in project OpenAM by OpenRock.
the class SessionRequestHandler method process.
public ResponseSet process(PLLAuditor auditor, List<Request> requests, HttpServletRequest servletRequest, HttpServletResponse servletResponse, ServletContext servletContext) {
ResponseSet rset = new ResponseSet(SessionService.SESSION_SERVICE);
auditor.setComponent(SESSION);
for (Request req : requests) {
Response res = processRequest(auditor, req, servletRequest, servletResponse);
rset.addResponse(res);
}
return rset;
}
Aggregations