コード例 #1
0
ファイル: PwmApplication.java プロジェクト: Alqobais/pwm
  public String readAppAttribute(final AppAttribute appAttribute) {
    if (localDB == null || localDB.status() != LocalDB.Status.OPEN) {
      LOGGER.error("error retrieving key '" + appAttribute.getKey() + "', localDB unavailable: ");
      return null;
    }

    if (appAttribute == null) {
      return null;
    }

    try {
      return localDB.get(LocalDB.DB.PWM_META, appAttribute.getKey());
    } catch (Exception e) {
      LOGGER.error(
          "error retrieving key '"
              + appAttribute.getKey()
              + "' installation date from localDB: "
              + e.getMessage());
    }
    return null;
  }
コード例 #2
0
ファイル: PwmApplication.java プロジェクト: Alqobais/pwm
  public void writeAppAttribute(final AppAttribute appAttribute, final String value) {
    if (localDB == null || localDB.status() != LocalDB.Status.OPEN) {
      LOGGER.error("error writing key '" + appAttribute.getKey() + "', localDB unavailable: ");
      return;
    }

    if (appAttribute == null) {
      return;
    }

    try {
      if (value == null) {
        localDB.remove(LocalDB.DB.PWM_META, appAttribute.getKey());
      } else {
        localDB.put(LocalDB.DB.PWM_META, appAttribute.getKey(), value);
      }
    } catch (Exception e) {
      LOGGER.error(
          "error retrieving key '"
              + appAttribute.getKey()
              + "' installation date from localDB: "
              + e.getMessage());
    }
  }