Search in sources :

Example 6 with ResponseSet

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;
}
Also used : HttpServletResponse(javax.servlet.http.HttpServletResponse) Response(com.iplanet.services.comm.share.Response) Request(com.iplanet.services.comm.share.Request) HttpServletRequest(javax.servlet.http.HttpServletRequest) ResponseSet(com.iplanet.services.comm.share.ResponseSet)

Example 7 with ResponseSet

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;
}
Also used : HttpServletResponse(javax.servlet.http.HttpServletResponse) Response(com.iplanet.services.comm.share.Response) SessionResponse(com.iplanet.dpro.session.share.SessionResponse) Request(com.iplanet.services.comm.share.Request) HttpServletRequest(javax.servlet.http.HttpServletRequest) SessionRequest(com.iplanet.dpro.session.share.SessionRequest) ResponseSet(com.iplanet.services.comm.share.ResponseSet)

Aggregations

ResponseSet (com.iplanet.services.comm.share.ResponseSet)7 Request (com.iplanet.services.comm.share.Request)5 Response (com.iplanet.services.comm.share.Response)5 HttpServletRequest (javax.servlet.http.HttpServletRequest)5 HttpServletResponse (javax.servlet.http.HttpServletResponse)5 SessionRequest (com.iplanet.dpro.session.share.SessionRequest)1 SessionResponse (com.iplanet.dpro.session.share.SessionResponse)1 NamingRequest (com.iplanet.services.naming.share.NamingRequest)1 NamingResponse (com.iplanet.services.naming.share.NamingResponse)1 SSOException (com.iplanet.sso.SSOException)1 SSOToken (com.iplanet.sso.SSOToken)1 SSOTokenManager (com.iplanet.sso.SSOTokenManager)1 SsoServerLoggingHdlrEntryImpl (com.sun.identity.monitoring.SsoServerLoggingHdlrEntryImpl)1 SsoServerLoggingSvcImpl (com.sun.identity.monitoring.SsoServerLoggingSvcImpl)1 BufferedReader (java.io.BufferedReader)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 InputStreamReader (java.io.InputStreamReader)1 OutputStream (java.io.OutputStream)1