michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: package org.mozilla.gecko.sync; michael@0: michael@0: michael@0: public interface BackoffHandler { michael@0: public long getEarliestNextRequest(); michael@0: michael@0: /** michael@0: * Provide a timestamp in millis before which we shouldn't sync again. michael@0: * Overrides any existing value. michael@0: * michael@0: * @param next michael@0: * a timestamp in milliseconds. michael@0: */ michael@0: public void setEarliestNextRequest(long next); michael@0: michael@0: /** michael@0: * Provide a timestamp in millis before which we shouldn't sync again. Only michael@0: * change our persisted value if it's later than the existing time. michael@0: * michael@0: * @param next michael@0: * a timestamp in milliseconds. michael@0: */ michael@0: public void extendEarliestNextRequest(long next); michael@0: michael@0: /** michael@0: * Return the number of milliseconds until we're allowed to sync again, michael@0: * or 0 if now is fine. michael@0: */ michael@0: public long delayMilliseconds(); michael@0: }