コード例 #1
0
 @RequestMapping("remove")
 @ResponseBody
 public void remove(@RequestBody SessionDTO session) {
   Session selectedSession = sessionRepository.lookUp(session);
   if (selectedSession.getUser().getUserName().equalsIgnoreCase(getCurrentUser().getUserName())) {
     throw new IllegalArgumentException("You can't delete your own session!");
   }
   sessionRepository.remove(selectedSession);
 }
コード例 #2
0
 @ResponseBody
 @RequestMapping("getCurrentUser")
 public UserDTO getCurrentUser() {
   Session session = sessionRepository.findBySSOToken(getSSOToken());
   return UserDTOAssembler.assemble(session.getUser());
 }
コード例 #3
0
 @RequestMapping("removeAllButMine")
 @ResponseBody
 public void removeAllButMine() {
   sessionRepository.removeAllBut(getSSOToken());
 }
コード例 #4
0
 @ResponseBody
 @RequestMapping("findAllActive")
 public Collection<SessionDTO> findAllActive() {
   return assemble(sessionRepository.findAllActive());
 }