|
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.delegates; |
|
6 |
|
7 import java.net.URI; |
|
8 |
|
9 import org.mozilla.gecko.sync.GlobalSession; |
|
10 |
|
11 public interface NodeAssignmentCallback { |
|
12 /** |
|
13 * If true, request node assignment from the server, i.e., fetch node/weave cluster URL. |
|
14 */ |
|
15 public boolean wantNodeAssignment(); |
|
16 |
|
17 /** |
|
18 * Called when a new node is assigned. If there already was an old node, the |
|
19 * new node is different from the old node assignment, indicating node |
|
20 * reassignment. If there wasn't an old node, we've been freshly assigned. |
|
21 * |
|
22 * @param globalSession |
|
23 * @param oldClusterURL |
|
24 * The old node/weave cluster URL (possibly null). |
|
25 * @param newClusterURL |
|
26 * The new node/weave cluster URL (not null). |
|
27 */ |
|
28 public void informNodeAssigned(GlobalSession globalSession, URI oldClusterURL, URI newClusterURL); |
|
29 |
|
30 /** |
|
31 * Called when wantNodeAssignment() is true, and the new node assignment is |
|
32 * the same as the old node assignment, indicating a user authentication |
|
33 * error. |
|
34 * |
|
35 * @param globalSession |
|
36 * @param failedClusterURL |
|
37 * The new node/weave cluster URL. |
|
38 */ |
|
39 public void informNodeAuthenticationFailed(GlobalSession globalSession, URI failedClusterURL); |
|
40 |
|
41 public String nodeWeaveURL(); |
|
42 } |