mobile/android/base/fxa/sync/SchedulePolicy.java

Wed, 31 Dec 2014 07:22:50 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:22:50 +0100
branch
TOR_BUG_3246
changeset 4
fc2d59ddac77
permissions
-rw-r--r--

Correct previous dual key logic pending first delivery installment.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 package org.mozilla.gecko.fxa.sync;
     7 import org.mozilla.gecko.fxa.login.State.Action;
     8 import org.mozilla.gecko.sync.BackoffHandler;
    10 public interface SchedulePolicy {
    11   /**
    12    * Call this with the number of other clients syncing to the account.
    13    */
    14   public abstract void onSuccessfulSync(int otherClientsCount);
    15   public abstract void onHandleFinal(Action needed);
    16   public abstract void onUpgradeRequired();
    17   public abstract void onUnauthorized();
    19   /**
    20    * Before a sync we typically wish to adjust our backoff policy. This cleans
    21    * the slate prior to encountering a new backoff, and also functions as a rate
    22    * limiter.
    23    *
    24    * The {@link SchedulePolicy} acts as a controller for the {@link BackoffHandler}.
    25    * As a result of calling these two methods, the {@link BackoffHandler} will be
    26    * mutated, and additional side-effects (such as scheduling periodic syncs) can
    27    * occur.
    28    *
    29    * @param rateHandler the backoff handler to configure for basic rate limiting.
    30    * @param backgroundHandler the backoff handler to configure for background operations.
    31    */
    32   public abstract void configureBackoffMillisBeforeSyncing(BackoffHandler rateHandler, BackoffHandler backgroundHandler);
    34   /**
    35    * We received an explicit backoff instruction, typically from a server.
    36    *
    37    * @param onlyExtend
    38    *          if <code>true</code>, the backoff handler will be asked to update
    39    *          its backoff only if the provided value is greater than the current
    40    *          backoff.
    41    */
    42   public abstract void configureBackoffMillisOnBackoff(BackoffHandler backoffHandler, long backoffMillis, boolean onlyExtend);
    43 }

mercurial