public boolean isGzipEnabled() throws PropertyManagerException {
    try {
      Property property = getPropertyObject(GZIP_ENABLED);

      return Boolean.parseBoolean(property.getValue());

    } catch (ObjectNotFoundException e) {
      throw new PropertyManagerException(e.getMessage(), e);
    }
  }
  public boolean isSecureCookie() {
    try {
      Property property = getPropertyObject(SECURE_COOKIE);

      return Boolean.parseBoolean(property.getValue());

    } catch (Exception e) {
      return false;
    }
  }
  public boolean isCacheEnabled() {
    try {
      Property property = getPropertyObject(CACHE_ENABLED);

      return Boolean.parseBoolean(property.getValue());

    } catch (Exception e) {
      return false;
    }
  }
  public boolean isUsingDatabaseTokenStorage() throws PropertyManagerException {
    boolean usingDatabaseStorage;
    try {
      usingDatabaseStorage =
          Boolean.parseBoolean(getPropertyObject(DATABASE_TOKEN_STORAGE_ENABLED).getValue());
    } catch (ObjectNotFoundException e) {
      // By default return true
      usingDatabaseStorage = true;
    }

    return usingDatabaseStorage;
  }
  private SMTPServer buildSMTPServer(InternetAddress fromAddress, String prefix)
      throws PropertyManagerException {
    String host;

    // Required
    try {
      host = getPropertyObject(MAILSERVER_HOST).getValue();
    } catch (ObjectNotFoundException e) {
      throw new PropertyManagerException(e);
    }

    // Optional Attributes
    String password = null;
    try {
      password = getPropertyObject(MAILSERVER_PASSWORD).getValue();
    } catch (ObjectNotFoundException ignored) {
      // Ignore since these are optional
    }

    String username = null;
    try {
      username = getPropertyObject(MAILSERVER_USERNAME).getValue();
    } catch (ObjectNotFoundException ignored) {
      // Ignore since these are optional
    }

    int port = SMTPServer.DEFAULT_MAIL_PORT;
    try {
      String value = getPropertyObject(MAILSERVER_PORT).getValue();
      if (StringUtils.isNotBlank(value)) {
        port = Integer.parseInt(value);
      }
    } catch (NumberFormatException e) {
      throw new IllegalArgumentException("SMTP port number was not a valid number", e);
    } catch (ObjectNotFoundException ignored) {
      // Ignore since these are optional
    }

    boolean useSSL = false;
    try {
      useSSL = Boolean.valueOf(getPropertyObject(MAILSERVER_USE_SSL).getValue());
    } catch (ObjectNotFoundException ignored) {
      // Ignore since these are optional
    }

    return new SMTPServer(port, prefix, fromAddress, password, username, host, useSSL);
  }
 public void setUsingDatabaseTokenStorage(boolean usingMemoryTokenStorage) {
   setProperty(DATABASE_TOKEN_STORAGE_ENABLED, Boolean.toString(usingMemoryTokenStorage));
 }
 public void setGzipEnabled(boolean gzip) {
   setProperty(GZIP_ENABLED, Boolean.toString(gzip));
 }
 public void setCacheEnabled(boolean enabled) {
   setProperty(CACHE_ENABLED, Boolean.toString(enabled));
 }
 public void setSecureCookie(boolean secure) {
   setProperty(SECURE_COOKIE, Boolean.toString(secure));
 }