/**
  * @param errorCode
  * @return
  */
 public static String getErrorMessage(final int errorCode) {
   String errorMessage;
   if (errorCode == HttpErrorCodeEnum.UNC_BAD_REQUEST.getCode()) {
     errorMessage = HttpErrorCodeEnum.UNC_BAD_REQUEST.getMessage();
   } else if (errorCode == HttpErrorCodeEnum.UNC_FORBIDDEN.getCode()) {
     errorMessage = HttpErrorCodeEnum.UNC_FORBIDDEN.getMessage();
   } else if (errorCode == HttpErrorCodeEnum.UNC_INTERNAL_SERVER_ERROR.getCode()) {
     errorMessage = HttpErrorCodeEnum.UNC_INTERNAL_SERVER_ERROR.getMessage();
   } else if (errorCode == HttpErrorCodeEnum.UNC_METHOD_NOT_ALLOWED.getCode()) {
     errorMessage = HttpErrorCodeEnum.UNC_METHOD_NOT_ALLOWED.getMessage();
   } else if (errorCode == HttpErrorCodeEnum.UNC_NOT_ACCEPTABLE.getCode()) {
     errorMessage = HttpErrorCodeEnum.UNC_NOT_ACCEPTABLE.getMessage();
   } else if (errorCode == HttpErrorCodeEnum.UNC_NOT_FOUND.getCode()) {
     errorMessage = HttpErrorCodeEnum.UNC_NOT_FOUND.getMessage();
   } else if (errorCode == HttpErrorCodeEnum.UNC_SERVICE_UNAVAILABLE.getCode()) {
     errorMessage = HttpErrorCodeEnum.UNC_SERVICE_UNAVAILABLE.getMessage();
   } else if (errorCode == HttpErrorCodeEnum.UNC_STATUS_OK.getCode()) {
     errorMessage = HttpErrorCodeEnum.UNC_STATUS_OK.getMessage();
   } else if (errorCode == HttpErrorCodeEnum.UNC_UNAUTHORIZED.getCode()) {
     errorMessage = HttpErrorCodeEnum.UNC_UNAUTHORIZED.getMessage();
   } else if (errorCode == HttpErrorCodeEnum.UNC_UNSUPPORTED_MEDIA_TYPE.getCode()) {
     errorMessage = HttpErrorCodeEnum.UNC_UNSUPPORTED_MEDIA_TYPE.getMessage();
   } else {
     errorMessage = HttpErrorCodeEnum.UNC_INTERNAL_SERVER_ERROR.getMessage();
   }
   return errorMessage;
 }
  /**
   * Gets the session object.
   *
   * @param sessionJson the session json
   * @return the session object
   * @throws VtnServiceWebAPIException the vtn service web api exception
   */
  public static SessionBean getSessionObject(final JsonObject sessionJson)
      throws VtnServiceWebAPIException {
    LOG.trace("Start VtnServiceCommonUtil#getSessionObject()");
    final SessionBean sessionBean = new SessionBean();
    final List<String> mandatoryList =
        Arrays.asList(
            SessionEnum.USERNAME.getSessionElement(),
            SessionEnum.PASSWORD.getSessionElement(),
            SessionEnum.IPADDRESS.getSessionElement());
    final JsonObject sessionJsonObj = (JsonObject) sessionJson.get(ApplicationConstants.SESSION);

    for (final String value : mandatoryList) {
      if (!sessionJsonObj.has(value) || null == sessionJsonObj.get(value)) {
        throw new VtnServiceWebAPIException(HttpErrorCodeEnum.UNC_UNAUTHORIZED.getCode());
      }
    }
    sessionBean.setUserName(
        sessionJsonObj.get(SessionEnum.USERNAME.getSessionElement()) != null
            ? sessionJsonObj.get(SessionEnum.USERNAME.getSessionElement()).getAsString()
            : null);
    sessionBean.setPassword(
        sessionJsonObj.get(SessionEnum.PASSWORD.getSessionElement()) != null
            ? sessionJsonObj.get(SessionEnum.PASSWORD.getSessionElement()).getAsString()
            : null);
    sessionBean.setIpAddress(
        sessionJsonObj.get(SessionEnum.IPADDRESS.getSessionElement()) != null
            ? sessionJsonObj.get(SessionEnum.IPADDRESS.getSessionElement()).getAsString()
            : null);

    sessionBean.setType(ApplicationConstants.SESSION_TYPE);

    LOG.debug("Username : "******"Password : "******"Type : " + sessionBean.getType());

    LOG.trace("Complete VtnServiceCommonUtil#getSessionObject()");
    return sessionBean;
  }