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: michael@0: public interface NodeAssignmentCallback { michael@0: /** michael@0: * If true, request node assignment from the server, i.e., fetch node/weave cluster URL. michael@0: */ michael@0: public boolean wantNodeAssignment(); michael@0: michael@0: /** michael@0: * Called when a new node is assigned. If there already was an old node, the michael@0: * new node is different from the old node assignment, indicating node michael@0: * reassignment. If there wasn't an old node, we've been freshly assigned. michael@0: * michael@0: * @param globalSession michael@0: * @param oldClusterURL michael@0: * The old node/weave cluster URL (possibly null). michael@0: * @param newClusterURL michael@0: * The new node/weave cluster URL (not null). michael@0: */ michael@0: public void informNodeAssigned(GlobalSession globalSession, URI oldClusterURL, URI newClusterURL); michael@0: michael@0: /** michael@0: * Called when wantNodeAssignment() is true, and the new node assignment is michael@0: * the same as the old node assignment, indicating a user authentication michael@0: * error. michael@0: * michael@0: * @param globalSession michael@0: * @param failedClusterURL michael@0: * The new node/weave cluster URL. michael@0: */ michael@0: public void informNodeAuthenticationFailed(GlobalSession globalSession, URI failedClusterURL); michael@0: michael@0: public String nodeWeaveURL(); michael@0: }