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.net; michael@0: michael@0: public interface SyncStorageRequestDelegate { michael@0: public AuthHeaderProvider getAuthHeaderProvider(); michael@0: michael@0: String ifUnmodifiedSince(); michael@0: michael@0: // TODO: at this point we can access X-Weave-Timestamp, compare michael@0: // that to our local timestamp, and compute an estimate of clock michael@0: // skew. Bug 721887. michael@0: michael@0: /** michael@0: * Override this to handle a successful SyncStorageRequest. michael@0: * michael@0: * SyncStorageResourceDelegate implementers must ensure that the HTTP michael@0: * responses underlying SyncStorageResponses are fully consumed to ensure that michael@0: * connections are returned to the pool, for example by calling michael@0: * BaseResource.consumeEntity(response). michael@0: */ michael@0: void handleRequestSuccess(SyncStorageResponse response); michael@0: michael@0: /** michael@0: * Override this to handle a failed SyncStorageRequest. michael@0: * michael@0: * michael@0: * SyncStorageResourceDelegate implementers must ensure that the HTTP michael@0: * responses underlying SyncStorageResponses are fully consumed to ensure that michael@0: * connections are returned to the pool, for example by calling michael@0: * BaseResource.consumeEntity(response). michael@0: */ michael@0: void handleRequestFailure(SyncStorageResponse response); michael@0: michael@0: void handleRequestError(Exception ex); michael@0: }