Esempio n. 1
0
  /**
   * Reset timestamps and possibly set syncID.
   *
   * @param syncID if non-null, new syncID to persist.
   */
  protected void resetLocal(String syncID) {
    // Clear both timestamps.
    SynchronizerConfiguration config;
    try {
      config = this.getConfig();
    } catch (Exception e) {
      Logger.warn(LOG_TAG, "Unable to reset " + this + ": fetching config failed.", e);
      return;
    }

    if (syncID != null) {
      config.syncID = syncID;
      Logger.info(LOG_TAG, "Setting syncID for " + this + " to '" + syncID + "'.");
    }
    config.localBundle.setTimestamp(0L);
    config.remoteBundle.setTimestamp(0L);
    persistConfig(config);
    Logger.info(LOG_TAG, "Reset timestamps for " + this);
  }
Esempio n. 2
0
 protected void persistConfig(SynchronizerConfiguration synchronizerConfiguration) {
   synchronizerConfiguration.persist(session.config.getBranch(bundlePrefix()));
 }