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.fxa.sync; michael@0: michael@0: import java.io.IOException; michael@0: import java.net.URISyntaxException; michael@0: import java.util.Collections; michael@0: import java.util.HashMap; michael@0: michael@0: import org.json.simple.parser.ParseException; michael@0: import org.mozilla.gecko.sync.GlobalSession; michael@0: import org.mozilla.gecko.sync.NonObjectJSONException; michael@0: import org.mozilla.gecko.sync.SyncConfiguration; michael@0: import org.mozilla.gecko.sync.SyncConfigurationException; michael@0: import org.mozilla.gecko.sync.delegates.BaseGlobalSessionCallback; michael@0: import org.mozilla.gecko.sync.delegates.ClientsDataDelegate; michael@0: import org.mozilla.gecko.sync.stage.CheckPreconditionsStage; michael@0: import org.mozilla.gecko.sync.stage.GlobalSyncStage; michael@0: import org.mozilla.gecko.sync.stage.GlobalSyncStage.Stage; michael@0: michael@0: import android.content.Context; michael@0: michael@0: public class FxAccountGlobalSession extends GlobalSession { michael@0: public FxAccountGlobalSession(SyncConfiguration config, michael@0: BaseGlobalSessionCallback callback, michael@0: Context context, michael@0: ClientsDataDelegate clientsDelegate) michael@0: throws SyncConfigurationException, IllegalArgumentException, IOException, ParseException, NonObjectJSONException, URISyntaxException { michael@0: super(config, callback, context, clientsDelegate, null); michael@0: } michael@0: michael@0: @Override michael@0: public void prepareStages() { michael@0: super.prepareStages(); michael@0: HashMap stages = new HashMap(); michael@0: stages.putAll(this.stages); michael@0: stages.put(Stage.ensureClusterURL, new CheckPreconditionsStage()); michael@0: this.stages = Collections.unmodifiableMap(stages); michael@0: } michael@0: }