Thomas Vachuska
Committed by Gerrit Code Review

Testing & fixing GUI fail-over code.

Change-Id: I64843186bf05020ce77a1508a300391e0db6bf48
......@@ -22,7 +22,6 @@ import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.ReferenceCardinality;
import org.onlab.packet.MacAddress;
import org.onlab.packet.VlanId;
import org.onosproject.cfg.ComponentConfigService;
import org.onosproject.cluster.ClusterService;
import org.onosproject.mastership.MastershipService;
import org.onosproject.net.Device;
......@@ -43,8 +42,8 @@ import org.onosproject.net.provider.AbstractProvider;
import org.onosproject.net.provider.ProviderId;
import org.slf4j.Logger;
import static org.slf4j.LoggerFactory.getLogger;
import static org.onlab.util.Tools.toHex;
import static org.slf4j.LoggerFactory.getLogger;
/**
* Null provider to advertise fake hosts.
......@@ -66,9 +65,6 @@ public class NullHostProvider extends AbstractProvider implements HostProvider {
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected HostProviderRegistry providerRegistry;
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
protected ComponentConfigService cfgService;
private HostProviderService providerService;
//make sure the device has enough ports to accomodate all of them.
......@@ -94,7 +90,6 @@ public class NullHostProvider extends AbstractProvider implements HostProvider {
@Activate
public void activate() {
cfgService.registerProperties(getClass());
providerService = providerRegistry.register(this);
for (Device dev : deviceService.getDevices()) {
addHosts(dev);
......@@ -106,7 +101,6 @@ public class NullHostProvider extends AbstractProvider implements HostProvider {
@Deactivate
public void deactivate() {
cfgService.unregisterProperties(getClass(), false);
providerRegistry.unregister(this);
deviceService.removeListener(hostProvider);
providerService = null;
......
......@@ -194,8 +194,8 @@ public class UiWebSocket
}
ObjectNode payload = mapper.createObjectNode();
payload.set("instances", instances);
sendMessage("onosInstances", 0, payload);
payload.set("clusterNodes", instances);
sendMessage("bootstrap", 0, payload);
}
}
......
......@@ -40,10 +40,12 @@
var builtinHandlers = {
bootstrap: function (data) {
clusterNodes = data.instances;
clusterNodes = data.clusterNodes;
clusterNodes.forEach(function (d, i) {
if (d.uiAttached) {
clusterIndex = i;
$log.info('Connected to cluster node ' + d.ip);
// TODO: add connect info to masthead somewhere
}
});
}
......@@ -228,7 +230,11 @@
wsock = _wsock_;
vs = _vs_;
bindHandlers(builtinHandlers);
// TODO: Consider how to simplify handler structure
// Now it is an object of key -> object that has a method named 'key'.
bindHandlers({
bootstrap: builtinHandlers
});
return {
resetSid: resetSid,
......