|
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/. */ |
|
4 |
|
5 package org.mozilla.gecko.sync.net; |
|
6 |
|
7 public interface SyncStorageRequestDelegate { |
|
8 public AuthHeaderProvider getAuthHeaderProvider(); |
|
9 |
|
10 String ifUnmodifiedSince(); |
|
11 |
|
12 // TODO: at this point we can access X-Weave-Timestamp, compare |
|
13 // that to our local timestamp, and compute an estimate of clock |
|
14 // skew. Bug 721887. |
|
15 |
|
16 /** |
|
17 * Override this to handle a successful SyncStorageRequest. |
|
18 * |
|
19 * SyncStorageResourceDelegate implementers <b>must</b> ensure that the HTTP |
|
20 * responses underlying SyncStorageResponses are fully consumed to ensure that |
|
21 * connections are returned to the pool, for example by calling |
|
22 * <code>BaseResource.consumeEntity(response)</code>. |
|
23 */ |
|
24 void handleRequestSuccess(SyncStorageResponse response); |
|
25 |
|
26 /** |
|
27 * Override this to handle a failed SyncStorageRequest. |
|
28 * |
|
29 * |
|
30 * SyncStorageResourceDelegate implementers <b>must</b> ensure that the HTTP |
|
31 * responses underlying SyncStorageResponses are fully consumed to ensure that |
|
32 * connections are returned to the pool, for example by calling |
|
33 * <code>BaseResource.consumeEntity(response)</code>. |
|
34 */ |
|
35 void handleRequestFailure(SyncStorageResponse response); |
|
36 |
|
37 void handleRequestError(Exception ex); |
|
38 } |