Package org.fenixedu.academic.util.stork

Examples of org.fenixedu.academic.util.stork.AttributesManagement


    }

    public ActionForward returnFromPeps(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) {

        AttributesManagement attrManagement = null;
        try {
            String memcachedCode = request.getParameter("key");
            MemcachedClient c =
                    new MemcachedClient(new InetSocketAddress(SPUtil.getInstance().getMemcachedHostname(), SPUtil.getInstance()
                            .getMemcachedPort()));

            String attrList = null;
            if (!StringUtils.isEmpty((String) request.getAttribute("storkTestAttrList"))) {
                attrList = (String) request.getAttribute("storkTestAttrList");
            } else {
                attrList = (String) c.get(memcachedCode);
            }

            if (StringUtils.isEmpty(attrList)) {
                return mapping.findForward("stork-error-authentication-failed");
            }

            attrManagement = new AttributesManagement(attrList);

            if (StringUtils.isEmpty(attrManagement.getStorkReturnCode())
                    || !AttributesManagement.STORK_RETURN_CODE_OK.equals(attrManagement.getStorkReturnCode())) {
                String errorCode = attrManagement.getStorkErrorCode();
                String errorMessage = attrManagement.getStorkErrorMessage();

                Exception e =
                        new Exception(String.format("Error on stork authentication method, Error: %s, Description: %s",
                                errorCode, errorMessage));
                logger.error(e.getMessage(), e);
                return mapping.findForward("stork-error-authentication-failed");
            }

        } catch (IOException e) {
            logger.error(e.getMessage(), e);
            return mapping.findForward("stork-error-authentication-failed");
        }

        String eIdentifier = attrManagement.getEIdentifier();

        ActionForward actionForwardError = verifySubmissionPreconditions(mapping);
        if (actionForwardError != null) {
            return actionForwardError;
        }
View Full Code Here


    }

    public ActionForward returnFromPepsToAccessApplication(ActionMapping mapping, ActionForm form, HttpServletRequest request,
            HttpServletResponse response) throws Exception {

        AttributesManagement attrManagement = null;
        try {
            String memcachedCode = request.getParameter("key");
            MemcachedClient c =
                    new MemcachedClient(new InetSocketAddress(SPUtil.getInstance().getMemcachedHostname(), SPUtil.getInstance()
                            .getMemcachedPort()));
            String attrList = (String) c.get(memcachedCode);

            if (StringUtils.isEmpty(attrList)) {
                return mapping.findForward("stork-error-authentication-failed");
            }

            attrManagement = new AttributesManagement(attrList);

            if (!AttributesManagement.STORK_RETURN_CODE_OK.equals(attrManagement.getStorkReturnCode())) {
                Exception e =
                        new Exception(String.format("Error on stork authentication method, Error: %s, Description: %s",
                                attrManagement.getStorkErrorCode(), attrManagement.getStorkErrorMessage()));
                logger.error(e.getMessage(), e);
                return mapping.findForward("stork-error-authentication-failed");
            }

        } catch (IOException e) {
            logger.error(e.getMessage(), e);
            return mapping.findForward("stork-error-authentication-failed");
        }

        String eidentifier = attrManagement.getEIdentifier();
        MobilityIndividualApplicationProcess process =
                ((MobilityApplicationProcess) getCurrentOpenParentProcess()).getOpenProcessByEIdentifier(eidentifier);

        if (process == null) {
            return mapping.findForward("open-candidacy-processes-not-found");
View Full Code Here

        return mapping.findForward("bind-link-submited-individual-candidacy-with-stork");
    }

    public ActionForward bindLinkSubmitedIndividualCandidacyWithStork(ActionMapping mapping, ActionForm form,
            HttpServletRequest request, HttpServletResponse response) throws FenixServiceException {
        AttributesManagement attrManagement = null;
        try {
            String memcachedCode = request.getParameter("key");
            MemcachedClient c =
                    new MemcachedClient(new InetSocketAddress(SPUtil.getInstance().getMemcachedHostname(), SPUtil.getInstance()
                            .getMemcachedPort()));
            String attrList = (String) c.get(memcachedCode);

            if (StringUtils.isEmpty(attrList)) {
                return mapping.findForward("stork-error-authentication-failed");
            }

            attrManagement = new AttributesManagement(attrList);

            if (!AttributesManagement.STORK_RETURN_CODE_OK.equals(attrManagement.getStorkReturnCode())) {
                Exception e =
                        new Exception(String.format("Error on stork authentication method, Error: %s, Description: %s",
                                attrManagement.getStorkErrorCode(), attrManagement.getStorkErrorMessage()));
                logger.error(e.getMessage(), e);
                return mapping.findForward("stork-error-authentication-failed");
            }

        } catch (IOException e) {
            logger.error(e.getMessage(), e);
            return mapping.findForward("stork-error-authentication-failed");
        }

        String eidentifier = attrManagement.getEIdentifier();
        MobilityIndividualApplicationProcess process = (MobilityIndividualApplicationProcess) getProcess(request);

        if (process == null) {
            return mapping.findForward("open-candidacy-processes-not-found");
        }
View Full Code Here

TOP

Related Classes of org.fenixedu.academic.util.stork.AttributesManagement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.