Java Code Examples for org.wso2.carbon.identity.application.authentication.framework.util.FrameworkUtils#getMaxInactiveInterval()

The following examples show how to use org.wso2.carbon.identity.application.authentication.framework.util.FrameworkUtils#getMaxInactiveInterval() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CommonAuthenticationServlet.java    From carbon-identity-framework with Apache License 2.0 5 votes vote down vote up
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {

    if (FrameworkUtils.getMaxInactiveInterval() == 0) {
        FrameworkUtils.setMaxInactiveInterval(request.getSession().getMaxInactiveInterval());
    }
    FrameworkUtils.getRequestCoordinator().handle(request, response);
}
 
Example 2
Source File: CommonAuthenticationHandler.java    From carbon-identity-framework with Apache License 2.0 5 votes vote down vote up
public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {

    if (FrameworkUtils.getMaxInactiveInterval() == 0) {
        FrameworkUtils.setMaxInactiveInterval(request.getSession().getMaxInactiveInterval());
    }
    FrameworkUtils.getRequestCoordinator().handle(request, response);

}
 
Example 3
Source File: CommonAuthenticationServlet.java    From carbon-identity with Apache License 2.0 5 votes vote down vote up
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {

    if (FrameworkUtils.getMaxInactiveInterval() == 0) {
        FrameworkUtils.setMaxInactiveInterval(request.getSession().getMaxInactiveInterval());
    }
    FrameworkUtils.getRequestCoordinator().handle(request, response);
}
 
Example 4
Source File: CommonAuthenticationHandler.java    From carbon-identity with Apache License 2.0 5 votes vote down vote up
public void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {

    if (FrameworkUtils.getMaxInactiveInterval() == 0) {
        FrameworkUtils.setMaxInactiveInterval(request.getSession().getMaxInactiveInterval());
    }
    FrameworkUtils.getRequestCoordinator().handle(request, response);

}
 
Example 5
Source File: LongWaitStatusServlet.java    From carbon-identity-framework with Apache License 2.0 4 votes vote down vote up
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response)
        throws ServletException, IOException {

    if (FrameworkUtils.getMaxInactiveInterval() == 0) {
        FrameworkUtils.setMaxInactiveInterval(request.getSession().getMaxInactiveInterval());
    }
    String id = request.getParameter(PROP_WAITING_ID);
    if (id == null) {
        if (request.getContentType() != null && request.getContentType().startsWith
                (FrameworkConstants.ContentTypes.TYPE_APPLICATION_JSON)) {
            Gson gson = new Gson();
            LongWaitStatusRequest longWaitStatusRequest = gson.fromJson(request.getReader(),
                                                                        LongWaitStatusRequest.class);
            id = longWaitStatusRequest.getWaitId();
        }
    }

    LongWaitStatusResponse longWaitResponse = new LongWaitStatusResponse();
    longWaitResponse.setWaitId(id);
    if (id == null) {
        longWaitResponse.setStatus(LongWaitStatus.Status.UNKNOWN.name());
        response.setStatus(HttpServletResponse.SC_NOT_FOUND);
    } else {
        LongWaitStatusStoreService longWaitStatusStoreService =
                FrameworkServiceDataHolder.getInstance().getLongWaitStatusStoreService();
        if (longWaitStatusStoreService == null) {
            response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
        } else {
            LongWaitStatus longWaitStatus = null;
            try {
                longWaitStatus = longWaitStatusStoreService.getWait(id);
            } catch (FrameworkException e) {
                response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
            }
            if (longWaitStatus == null) {
                longWaitResponse.setStatus(LongWaitStatus.Status.COMPLETED.name());
            } else {
                if (longWaitStatus.getStatus() != null) {
                    if (longWaitStatus.getStatus() == LongWaitStatus.Status.UNKNOWN) {
                        longWaitResponse.setStatus(LongWaitStatus.Status.COMPLETED.name());
                    } else {
                        longWaitResponse.setStatus(longWaitStatus.getStatus().name());
                    }
                } else {
                    longWaitResponse.setStatus(LongWaitStatus.Status.COMPLETED.name());
                }
            }
        }
    }

    response.setContentType(FrameworkConstants.ContentTypes.TYPE_APPLICATION_JSON);
    String json = new Gson().toJson(longWaitResponse);
    try (PrintWriter out = response.getWriter()) {
        out.print(json);
        out.flush();
    }
}