import javax.annotation.Nullable;
+import org.opendaylight.groupbasedpolicy.renderer.ofoverlay.node.SwitchListener;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
import org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode;
}
// When first endpoint is attached to switch, it can be ready
- public static void activateEndpoint(NodeId nodeId) {
- switches.get(nodeId).hasEndpoints=true;
+ public static void activatingSwitch(NodeId nodeId) {
+ switches.get(nodeId).setHasEndpoints(true);
switches.get(nodeId).updateStatus();
}
// When last endpoint is removed from switch, it is no longer ready
- public static void deactivateEndpoint(NodeId nodeId) {
- switches.get(nodeId).hasEndpoints=false;
+ public static void deactivatingSwitch(NodeId nodeId) {
+ switches.get(nodeId).setHasEndpoints(false);;
switches.get(nodeId).updateStatus();
}
private Map<InstanceIdentifier<NodeConnector>, FlowCapableNodeConnector> fcncByNcIid = Maps.newHashMap();
private boolean hasEndpoints=false;
+
+ public boolean isHasEndpoints() {
+ return hasEndpoints;
+ }
+
+
+ public void setHasEndpoints(boolean hasEndpoints) {
+ this.hasEndpoints = hasEndpoints;
+ }
+
Map<Class<? extends TunnelTypeBase>, TunnelBuilder> tunnelBuilderByType = new HashMap<>();
Set<NodeConnectorId> externalPorts = new HashSet<>();
private void updateStatus() {
boolean tunnelWithIpAndNcExists = tunnelWithIpAndNcExists();
if (fcNode != null) {
- if (tunnelWithIpAndNcExists && hasEndpoints) {
+ if (tunnelWithIpAndNcExists && isHasEndpoints()) {
setStatus(SwitchStatus.READY);
} else {
setStatus(SwitchStatus.PREPARING);
READY
}
+
+
}