1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mobile/android/base/sync/BackoffHandler.java Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,34 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +package org.mozilla.gecko.sync; 1.9 + 1.10 + 1.11 +public interface BackoffHandler { 1.12 + public long getEarliestNextRequest(); 1.13 + 1.14 + /** 1.15 + * Provide a timestamp in millis before which we shouldn't sync again. 1.16 + * Overrides any existing value. 1.17 + * 1.18 + * @param next 1.19 + * a timestamp in milliseconds. 1.20 + */ 1.21 + public void setEarliestNextRequest(long next); 1.22 + 1.23 + /** 1.24 + * Provide a timestamp in millis before which we shouldn't sync again. Only 1.25 + * change our persisted value if it's later than the existing time. 1.26 + * 1.27 + * @param next 1.28 + * a timestamp in milliseconds. 1.29 + */ 1.30 + public void extendEarliestNextRequest(long next); 1.31 + 1.32 + /** 1.33 + * Return the number of milliseconds until we're allowed to sync again, 1.34 + * or 0 if now is fine. 1.35 + */ 1.36 + public long delayMilliseconds(); 1.37 +} 1.38 \ No newline at end of file