use of com.hack23.cia.service.api.action.application.DestroyApplicationSessionResponse in project cia by Hack23.
the class DestroyApplicationSessionService method processService.
@Override
@Secured({ "ROLE_ANONYMOUS" })
public DestroyApplicationSessionResponse processService(final DestroyApplicationSessionRequest serviceRequest) {
final DestroyApplicationSessionResponse inputValidation = inputValidation(serviceRequest);
if (inputValidation != null) {
return inputValidation;
}
final ApplicationSession applicationSession = applicationSessionDAO.findFirstByProperty(ApplicationSession_.sessionId, serviceRequest.getSessionId());
if (applicationSession != null) {
LOGGER.info("Destroy Application session: {}", applicationSession.getSessionId());
applicationSession.setDestroyedDate(new Date());
applicationSessionDAO.persist(applicationSession);
return new DestroyApplicationSessionResponse(ServiceResult.SUCCESS);
} else {
LOGGER.warn("Failed to destroy Application session, no session found for id: {}", serviceRequest.getSessionId());
return new DestroyApplicationSessionResponse(ServiceResult.FAILURE);
}
}
Aggregations