Example usage for org.springframework.web.bind.support SessionStatus isComplete

List of usage examples for org.springframework.web.bind.support SessionStatus isComplete

Introduction

In this page you can find the example usage for org.springframework.web.bind.support SessionStatus isComplete.

Prototype

boolean isComplete();

Source Link

Document

Return whether the current handler's session processing has been marked as complete.

Usage

From source file:com.epam.training.taranovski.web.project.controller.LoginControllerTest.java

/**
 * Test of logout method, of class LoginController.
 *//*from   ww  w  . j a va  2 s. c o m*/
@Test
@Ignore
public void testLogout() {
    System.out.println("logout");
    ModelAndView modelAndView = new ModelAndView();
    SessionStatus sessionStatus = new SimpleSessionStatus();

    instance.logout(modelAndView, sessionStatus);

    assertTrue(sessionStatus.isComplete());
    assertTrue("login.jsp".equals(modelAndView.getViewName()));
}

From source file:it.polimi.diceH2020.launcher.controller.view.MainFlowController.java

@RequestMapping(value = "/launchRetry", method = RequestMethod.GET)
public String launch(@RequestParam("cloudType") String cloudType,
        @RequestParam("useComplexPricingModel") String useComplexPricingModel,
        @RequestParam("admissionControl") String admissionControl, @RequestParam("message") String message,
        SessionStatus sessionStatus, Model model) {
    if (model.containsAttribute("sim_manager")) {
        sessionStatus.isComplete();
    }/* w w w  .  j  av  a  2s .c  o m*/
    List<Scenario> privateScenariosModels = new ArrayList<>();
    privateScenariosModels.add(new Scenario(Technology.SPARK, CloudType.valueOf(cloudType), null, true));
    privateScenariosModels.add(new Scenario(Technology.SPARK, CloudType.valueOf(cloudType), null, true));
    model.addAttribute("scenario", new Scenario(Technology.SPARK, CloudType.valueOf(cloudType), null,
            Boolean.valueOf(admissionControl)));
    model.addAttribute("Scenarios", privateScenariosModels);
    model.addAttribute("message", message);
    return "fileUpload";
}

From source file:it.polimi.diceH2020.launcher.controller.view.MainFlowController.java

@RequestMapping(value = "/", method = RequestMethod.GET)
public String showHome(SessionStatus sessionStatus, Model model) {
    if (model.containsAttribute("sim_manager")) {
        sessionStatus.isComplete();
    }/*from   www.j a v  a2  s.  c  om*/
    model.addAttribute("wsStatusMap", ds.getWsStatus());
    model.addAttribute("queueSize", ds.getQueueSize());
    model.addAttribute("privateQueueSize", ds.getPrivateQueueSize());

    List<String> descriptions = new ArrayList<>();
    descriptions.add("Private cloud with Admission Control");
    descriptions.add("Private cloud without Admission Control");
    descriptions.add("Public cloud with Complex Pricing Model");
    descriptions.add("Public cloud without Complex Pricing Model");

    model.addAttribute("descriptions", descriptions);
    return "home";
}

From source file:it.polimi.diceH2020.launcher.controller.MainFlowController.java

@RequestMapping(value = "/launchRetry", method = RequestMethod.GET)
public String launch(@RequestParam("scenario") String scenario, @RequestParam("message") String message,
        SessionStatus sessionStatus, Model model) {
    if (model.containsAttribute("sim_manager")) {
        sessionStatus.isComplete();
    }//from  w  w w.  ja v a 2  s .c  om
    List<Scenarios> privateScenariosModels = new ArrayList<Scenarios>();
    privateScenariosModels.add(Scenarios.PrivateAdmissionControl);
    privateScenariosModels.add(Scenarios.PrivateAdmissionControlWithPhysicalAssignment);
    model.addAttribute("scenario", Scenarios.valueOf(scenario));
    model.addAttribute("Scenarios", privateScenariosModels);
    model.addAttribute("message", message);
    return "launchSimulation_FileUpload";
}

From source file:it.polimi.diceH2020.launcher.controller.MainFlowController.java

@RequestMapping(value = "/", method = RequestMethod.GET)
public String showHome(SessionStatus sessionStatus, Model model) {
    if (model.containsAttribute("sim_manager")) {
        sessionStatus.isComplete();
    }/*  w w  w .  j  a va  2  s. c  om*/
    model.addAttribute("wsStatusMap", ds.getWsStatus());
    model.addAttribute("queueSize", ds.getQueueSize());
    model.addAttribute("privateQueueSize", ds.getPrivateQueueSize());

    Map<Integer, Scenarios> scenarios = new HashMap<>();
    scenarios.put(0, Scenarios.PrivateAdmissionControl);
    scenarios.put(1, Scenarios.PrivateNoAdmissionControl);
    scenarios.put(2, Scenarios.PublicPeakWorkload);
    scenarios.put(3, Scenarios.PublicAvgWorkLoad);

    model.addAttribute("scenarios", scenarios);
    return "home";
}

From source file:it.polimi.diceH2020.launcher.controller.view.MainFlowController.java

@RequestMapping(value = "/launch", method = RequestMethod.GET)
public String launch(@RequestParam("cloudType") String cloudType,
        @RequestParam("useComplexPricingModel") String useComplexPricingModel,
        @RequestParam("admissionControl") String admissionControl, SessionStatus sessionStatus, Model model) {
    if (model.containsAttribute("sim_manager")) {
        sessionStatus.isComplete();
    }//from  w  ww  . ja  v  a2 s  . com

    model.addAttribute("cloudType", cloudType);
    model.addAttribute("useComplexPricingModel", useComplexPricingModel);
    model.addAttribute("admissionControl", admissionControl);

    List<Scenario> scenarios = new ArrayList<>();
    switch (CloudType.valueOf(cloudType)) {
    case PRIVATE:
        scenarios.add(
                new Scenario(Technology.SPARK, CloudType.PRIVATE, null, Boolean.valueOf(admissionControl)));
        scenarios.add(
                new Scenario(Technology.HADOOP, CloudType.PRIVATE, null, Boolean.valueOf(admissionControl)));
        break;
    case PUBLIC:
        scenarios.add(new Scenario(Technology.SPARK, CloudType.PUBLIC, Boolean.valueOf(useComplexPricingModel),
                null));
        scenarios.add(new Scenario(Technology.HADOOP, CloudType.PUBLIC, Boolean.valueOf(useComplexPricingModel),
                null));
        scenarios.add(new Scenario(Technology.STORM, CloudType.PUBLIC, Boolean.valueOf(useComplexPricingModel),
                null));
        break;
    default:
        throw new RuntimeException("Unknown type of cloud");
    }
    model.addAttribute("scenarios", scenarios);
    return "fileUpload";
}

From source file:it.polimi.diceH2020.launcher.controller.MainFlowController.java

@RequestMapping(value = "/launch", method = RequestMethod.GET)
public String launch(@RequestParam("scenario") String scenario, SessionStatus sessionStatus, Model model) {
    if (model.containsAttribute("sim_manager")) {
        sessionStatus.isComplete();
    }/*from   www.  j  a va2 s  . c o  m*/

    model.addAttribute("scenario", Scenarios.valueOf(scenario));

    List<Scenarios> privateScenariosModels = new ArrayList<>();
    privateScenariosModels.add(Scenarios.PrivateAdmissionControl);
    privateScenariosModels.add(Scenarios.PrivateAdmissionControlWithPhysicalAssignment);
    model.addAttribute("Scenarios", privateScenariosModels);

    List<Scenarios> publicScenariosModels = new ArrayList<>();
    publicScenariosModels.add(Scenarios.PublicAvgWorkLoad);
    publicScenariosModels.add(Scenarios.StormPublicAvgWorkLoad);
    model.addAttribute("PublicScenarios", publicScenariosModels);

    return "launchSimulation_FileUpload";
}

From source file:it.polimi.diceH2020.launcher.controller.MainFlowController.java

@RequestMapping(value = "/launch2", method = RequestMethod.GET)
public String launchWithMultipleJson(@RequestParam("scenario") String scenario, SessionStatus sessionStatus,
        Model model) {//  ww w .  j  a  va2s.c  om
    if (model.containsAttribute("sim_manager")) {
        sessionStatus.isComplete();
    }
    model.addAttribute("scenario", Scenarios.valueOf(scenario));
    //model.addAttribute("activeJson", FileService.activeJson(Scenarios.valueOf(scenario)));

    return "launchSimulation_FileUploadWithMultipleJson";
}

From source file:egovframework.oe1.cms.mrm.web.EgovOe1ResveMtgController.java

/**
* ? ./*from  w w w .j  a  v a2  s  .c  om*/
* @param egovOe1ResveMtgVO -    VO
* @param status
* @return "forward:/cms/mrm/selectResveMtgList.do"
* @exception Exception
*/
@RequestMapping("/cms/mrm/removeResveMtgOK.do")
public String removeResveMtgOK(@RequestParam("selectedId") String selectedId,
        @ModelAttribute("egovOe1ResveMtgVO") EgovOe1ResveMtgVO egovOe1ResveMtgVO, SessionStatus status,
        Model model) throws Exception {

    log.debug(this.getClass().getName() + " ==> ?  ");

    Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
    if (!isAuthenticated) {
        return "/cms/com/EgovLoginUsr"; //? ??
    }

    //?   ?   ??.
    model.addAttribute("searchMode", egovOe1ResveMtgVO);

    egovOe1ResveMtgVO.setMtgRoomResId(selectedId);

    if (!"".equals(egovOe1ResveMtgVO.getAtchFileId())) {
        EgovOe1FileVO fileVo = new EgovOe1FileVO();
        fileVo.setAtchFileId(egovOe1ResveMtgVO.getAtchFileId());// ? ID
        fileMngService.deleteAllFileInf(fileVo);
    }

    egovOe1ResveMtgService.deleteMtGattenInfo(egovOe1ResveMtgVO);

    egovOe1ResveMtgService.deleteResveMtg(egovOe1ResveMtgVO);

    status.setComplete();

    if (status.isComplete()) {
        model.addAttribute("resultMsg", "?  ");
    } else {
        model.addAttribute("resultMsg", "?  ");
    }

    return "forward:/cms/mrm/selectResveMtgList.do";
}

From source file:egovframework.oe1.cms.mrm.web.EgovOe1ResveMtgController.java

/**
* ? .//from w  ww  .ja va 2 s . c o  m
* @param egovOe1ResveMtgVO    -    VO
* @param status
* @return "forward:/cms/mrm/selectResveMtgList.do"
* @exception Exception
*/
@RequestMapping("/cms/mrm/updateResveMtgOK.do")
public String updateResveMtgOK(final MultipartHttpServletRequest multiRequest,
        @RequestParam("selectedId") String selectedId,
        @ModelAttribute("egovOe1ResveMtgVO") EgovOe1ResveMtgVO egovOe1ResveMtgVO, BindingResult bindingResult,
        Model model, SessionStatus status) throws Exception {

    log.debug(this.getClass().getName() + " ==> ?  ");

    Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();
    if (!isAuthenticated) {
        return "/cms/com/EgovLoginUsr"; //? ??
    }

    //?   ?   ??.
    model.addAttribute("searchMode", egovOe1ResveMtgVO);

    beanValidator.validate(egovOe1ResveMtgVO, bindingResult);
    if (bindingResult.hasErrors()) {
        model.addAttribute("egovOe1ResveMtgVO", egovOe1ResveMtgVO);
        return "/cms/mrm/EgovResveMtgUpdt";
    }

    //
    EgovOe1LoginVO user = (EgovOe1LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();

    String atchFileId = egovOe1ResveMtgVO.getAtchFileId();

    egovOe1ResveMtgVO.setMtgRoomResId(selectedId);

    final Map<String, MultipartFile> files = multiRequest.getFileMap();
    if (!files.isEmpty()) {
        if ("".equals(atchFileId)) {
            List<EgovOe1FileVO> result = fileUtil.parseFileInf(files, "MTR_", 0, atchFileId, "");
            atchFileId = fileMngService.insertFileInfs(result);
            egovOe1ResveMtgVO.setAtchFileId(atchFileId);
        } else {
            EgovOe1FileVO fvo = new EgovOe1FileVO();
            fvo.setAtchFileId(atchFileId);
            int cnt = fileMngService.getMaxFileSN(fvo);
            List<EgovOe1FileVO> _result = fileUtil.parseFileInf(files, "MTR_", cnt, atchFileId, "");
            fileMngService.updateFileInfs(_result);
        }
    }
    egovOe1ResveMtgVO.setAtchFileId(atchFileId); //? ?? ID  VO? .
    egovOe1ResveMtgVO.setRegisterId(user.getMberId()); //??? ID VO? .

    String shh = egovOe1ResveMtgVO.getStartHh();
    String smm = egovOe1ResveMtgVO.getStartMm();
    String fhh = egovOe1ResveMtgVO.getFinishHh();
    String fmm = egovOe1ResveMtgVO.getFinishMm();

    egovOe1ResveMtgVO.setMtgStartDate(egovOe1ResveMtgVO.getInsRepeatDate()); //??? 
    egovOe1ResveMtgVO.setMtgEndDate(egovOe1ResveMtgVO.getInsRepeatDate()); //???               
    egovOe1ResveMtgVO.setMtgBeginTime(shh + smm); //?
    egovOe1ResveMtgVO.setMtgEndTime(fhh + fmm); //?
    egovOe1ResveMtgService.updateResveMtg(egovOe1ResveMtgVO); //??? .

    egovOe1ResveMtgService.deleteMtGattenInfo(egovOe1ResveMtgVO); //???  . 

    StringTokenizer st = new StringTokenizer(egovOe1ResveMtgVO.getAttendantId(), "|"); //????
    int n = st.countTokens();
    for (int j = 0; j < n; j++) {
        String token = st.nextToken();
        egovOe1ResveMtgVO.setMtgAttenId(token);
        egovOe1ResveMtgService.insertMtGattenInfo(egovOe1ResveMtgVO);
    }

    status.setComplete();

    if (status.isComplete()) {
        model.addAttribute("resultMsg", "?  ");
    } else {
        model.addAttribute("resultMsg", "?  ");
    }

    return "forward:/cms/mrm/selectResveMtgList.do";
}