示例#1
0
  /**
   * @param searchCriteria
   * @return
   */
  public VXAuthSessionList searchAuthSessions(SearchCriteria searchCriteria) {

    if (searchCriteria != null
        && searchCriteria.getParamList() != null
        && searchCriteria.getParamList().size() > 0) {

      int clientTimeOffsetInMinute = RestUtil.getClientTimeOffset();
      java.util.Date temp = null;
      DateUtil dateUtil = new DateUtil();
      if (searchCriteria.getParamList().containsKey("startDate")) {
        temp = (java.util.Date) searchCriteria.getParamList().get("startDate");
        temp = dateUtil.getDateFromGivenDate(temp, 0, 0, 0, 0);
        temp = dateUtil.addTimeOffset(temp, clientTimeOffsetInMinute);
        searchCriteria.getParamList().put("startDate", temp);
      }
      if (searchCriteria.getParamList().containsKey("endDate")) {
        temp = (java.util.Date) searchCriteria.getParamList().get("endDate");
        temp = dateUtil.getDateFromGivenDate(temp, 0, 23, 59, 59);
        temp = dateUtil.addTimeOffset(temp, clientTimeOffsetInMinute);
        searchCriteria.getParamList().put("endDate", temp);
      }
    }

    return authSessionService.search(searchCriteria);
  }
示例#2
0
  public VXAuthSession getAuthSessionBySessionId(String authSessionId) {
    if (stringUtil.isEmpty(authSessionId)) {
      throw restErrorUtil.createRESTException(
          "Please provide the auth session id.", MessageEnums.INVALID_INPUT_DATA);
    }

    XXAuthSession xXAuthSession =
        daoManager.getXXAuthSession().getAuthSessionBySessionId(authSessionId);

    if (xXAuthSession == null) {
      throw restErrorUtil.createRESTException(
          "Please provide a valid " + "session id.", MessageEnums.INVALID_INPUT_DATA);
    }

    VXAuthSession vXAuthSession = authSessionService.populateViewBean(xXAuthSession);
    return vXAuthSession;
  }
示例#3
0
 public VXAuthSession getAuthSession(Long id) {
   return authSessionService.readResource(id);
 }
示例#4
0
 public VXLong countAuthSessions(SearchCriteria searchCriteria) {
   return authSessionService.getSearchCount(
       searchCriteria, AuthSessionService.AUTH_SESSION_SEARCH_FLDS);
 }