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.delegates; michael@0: michael@0: import java.net.URI; michael@0: michael@0: import org.mozilla.gecko.sync.GlobalSession; michael@0: import org.mozilla.gecko.sync.stage.GlobalSyncStage.Stage; michael@0: michael@0: public interface BaseGlobalSessionCallback { michael@0: /** michael@0: * Request that no further syncs occur within the next `backoff` milliseconds. michael@0: * @param backoff a duration in milliseconds. michael@0: */ michael@0: void requestBackoff(long backoff); michael@0: michael@0: /** michael@0: * Called on a 401 HTTP response. michael@0: */ michael@0: void informUnauthorizedResponse(GlobalSession globalSession, URI oldClusterURL); michael@0: michael@0: michael@0: /** michael@0: * Called when an HTTP failure indicates that a software upgrade is required. michael@0: */ michael@0: void informUpgradeRequiredResponse(GlobalSession session); michael@0: michael@0: void handleAborted(GlobalSession globalSession, String reason); michael@0: void handleError(GlobalSession globalSession, Exception ex); michael@0: void handleSuccess(GlobalSession globalSession); michael@0: void handleStageCompleted(Stage currentState, GlobalSession globalSession); michael@0: michael@0: /** michael@0: * Called when a {@link GlobalSession} wants to know if it should continue michael@0: * to make storage requests. michael@0: * michael@0: * @return false if the session should make no further requests. michael@0: */ michael@0: boolean shouldBackOffStorage(); michael@0: }