@Override public synchronized void putLong(String key, long value) { this.preferences.putLong(key, value); }
public void putValueInPreferencesIfEmpty(String key, String value) { if (getValueFromPreferences(key) == null) { prefs.put(key, value); long expirationTime = new Date().getTime() + SECONDS.toMillis(config.getTtl()); prefs.putLong(getExpirationKey(key), expirationTime); if (log.isDebugEnabled()) { log.debug("Storing preference {}={} (valid until {})", key, value, formatTime(expirationTime)); } } }
private void incrementTotalUsage() { Preferences node = Preferences.userRoot().node(USAGE_PATH); node.putLong(TASKS_EXECUTED_KEY, node.getLong(TASKS_EXECUTED_KEY, 0) + 1); }
/** * The update checker completed the check without error. * * @param checker the update checker * @param appcast the appcast */ public void checkCompleted(UpdateChecker checker, Appcast appcast) { hideUpdateCheckDialog(); // Delegate method. if (delegate != null) if (delegate.checkCompleted(checker, appcast)) return; // Store last check update check time. getPreferences().putLong(LAST_UPDATE_CHECK, System.currentTimeMillis()); try { getPreferences().flush(); } catch (BackingStoreException e) { throw new RuntimeException("Error while storing preferences", e); } }
public void putLong(String key, long val) { preferences.putLong(key, val); }
@Override public long generateFieldId() { lastId++; NbPreferences.forModule(this.getClass()).putLong(PREF_LAST_GENERATED_ID, lastId); return lastId; }
/** @see java.util.prefs.Preferences#putLong(String, long) */ public void putLong(final String key, final long value) { p.putLong(safeKey(key), value); }
/** * Sets this instance's preference value. * * @param prefs the {@linkplain Preferences} object to set the value longo. * @param value the preference value to set. */ public void putLong(Preferences prefs, long value) { prefs.putLong(key(), value); }
public static void saveSessionInformation(long sessionId) { assert sessionId != 0; Preferences.userNodeForPackage(WebCloudNameLookup.class).putLong(KEY_APPENGINECLOUD_SESSION_ID, sessionId); }
@Override public void putLong(String key, long value) { if (Boolean.TRUE != ignorePut.get()) { stored.putLong(key, value); } super.putLong(key, value); }
@Override public void putLong(String key, long value) { if (Boolean.TRUE != ignorePut.get()) { stored.putLong(key, value); } super.putLong(key, value); }
/** * Schedules a new execution. * Will set the lastUpdated property to now * @param the delay for first execution */ protected void schedule(long delay){ long time = new Date().getTime(); NbPreferences.forModule(this.getClass()).putLong(LAST_UPDATED_PROPERTY_NAME, time); timer.schedule(new WebServiceUpdater(), delay, TIME_DELAY); }
/** * Sets the value of the specified preference, overriding the value defined in the * configuration files shipped with the application. */ public void setValue (String name, long value) { Long oldValue = null; if (_prefs.get(name, null) != null || _props.getProperty(name) != null) { oldValue = Long.valueOf(_prefs.getLong(name, super.getValue(name, 0L))); } _prefs.putLong(name, value); _propsup.firePropertyChange(name, oldValue, Long.valueOf(value)); }
public static void setLastIndexUpdate(String repoId,Date date) { if(repoId.contains("//")) { repoId = repoId.replace("//", "_"); LOG.log(Level.FINE, "Setting last index update: Repo''s id contains consecutive slashes, replacing them with '_': {0}", repoId); } getPreferences().remove(PROP_LAST_INDEX_UPDATE + "." + repoId); storage().node(repoId).putLong(PROP_LAST_INDEX_UPDATE, date.getTime()); }
public void putValueInPreferencesIfEmpty(String key, String value) { if (getValueFromPreferences(key) == null) { prefs.put(key, value); long expirationTime = new Date().getTime() + SECONDS.toMillis(config.getTtl()); prefs.putLong(getExpirationKey(key), expirationTime); if (log.isDebugEnabled()) { log.debug("Storing preference {}={} (valid until {})", key, value, formatTime(expirationTime)); } } }
public static void setLastCheckTimeNow(Product product) { getLogger().fine("Marking license for " + product + " as checked now"); getPreferences().putLong(getLastCheckKey(product), Instant.now().toEpochMilli()); }
/** * Set the preference value. * * @param value The value to set. */ public void putLong(long value) { preferences().putLong(key(), value); }
public void setLong(String key, Long value) { init(); if (value != null) { this.preferences.putLong(key, value); } else { this.preferences.remove(key); } }
private void setRepositoryCreationTime (String repositoryUrl, long time) { if (time == -1) { getPreferences().remove(PROP_REPOSITORY_CREATION_TIME + repositoryUrl); } else { getPreferences().putLong(PROP_REPOSITORY_CREATION_TIME + repositoryUrl, time); } }
@Override public void run() { try { final Preferences prefs = PreferencesManager.getInstance().getPreferences(); prefs.putLong(PROPERTY_TOTAL_UPSTART, prefs.getLong(PROPERTY_TOTAL_UPSTART, 0L) + (System.currentTimeMillis() - UPSTART)); PreferencesManager.getInstance().flush(); } finally { PlatformProvider.getPlatform().dispose(); } } });