mobile/android/base/sync/delegates/NodeAssignmentCallback.java

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/mobile/android/base/sync/delegates/NodeAssignmentCallback.java	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,42 @@
     1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.7 +
     1.8 +package org.mozilla.gecko.sync.delegates;
     1.9 +
    1.10 +import java.net.URI;
    1.11 +
    1.12 +import org.mozilla.gecko.sync.GlobalSession;
    1.13 +
    1.14 +public interface NodeAssignmentCallback {
    1.15 +  /**
    1.16 +   * If true, request node assignment from the server, i.e., fetch node/weave cluster URL.
    1.17 +   */
    1.18 +  public boolean wantNodeAssignment();
    1.19 +
    1.20 +  /**
    1.21 +   * Called when a new node is assigned. If there already was an old node, the
    1.22 +   * new node is different from the old node assignment, indicating node
    1.23 +   * reassignment. If there wasn't an old node, we've been freshly assigned.
    1.24 +   *
    1.25 +   * @param globalSession
    1.26 +   * @param oldClusterURL
    1.27 +   *          The old node/weave cluster URL (possibly null).
    1.28 +   * @param newClusterURL
    1.29 +   *          The new node/weave cluster URL (not null).
    1.30 +   */
    1.31 +  public void informNodeAssigned(GlobalSession globalSession, URI oldClusterURL, URI newClusterURL);
    1.32 +
    1.33 +  /**
    1.34 +   * Called when wantNodeAssignment() is true, and the new node assignment is
    1.35 +   * the same as the old node assignment, indicating a user authentication
    1.36 +   * error.
    1.37 +   *
    1.38 +   * @param globalSession
    1.39 +   * @param failedClusterURL
    1.40 +   *          The new node/weave cluster URL.
    1.41 +   */
    1.42 +  public void informNodeAuthenticationFailed(GlobalSession globalSession, URI failedClusterURL);
    1.43 +
    1.44 +  public String nodeWeaveURL();
    1.45 +}

mercurial