/**
* A listener to events related to endpoints being added, removed or updated.
- * @author readams
*/
public interface EndpointListener {
/**
* @param epKey the key for the affected endpoint
*/
public void endpointUpdated(EpKey epKey);
-
+
/**
* An endpoint attached to a particular node have been added, removed,
* or updated
* @param epKey the key for the affected endpoint
*/
public void nodeEndpointUpdated(NodeId nodeId, EpKey epKey);
-
+
/**
- * An endpoint for an endpoint group have been added, removed,
+ * An endpoint for an endpoint group have been added, removed,
* or updated.
* @param egKey the key for the affected endpoint group
* @param epKey the key for the affected endpoint
&& getLocationType(newL3Ep).equals(LocationType.External)) {
if (newL3Ep.getNetworkContainment() != null) {
arpTasker.addMacForL3EpAndCreateEp(newL3Ep);
- return;
} else {
LOG.error("Cannot generate MacAddress for L3Endpoint {}. NetworkContainment is null.", newL3Ep);
return;
}
}
+ if (newL3Ep.getL2Context() != null && newL3Ep.getMacAddress() != null) {
+ notifyEndpointUpdated(new EpKey(newL3Ep.getL2Context(), newL3Ep.getMacAddress()));
+ }
+ return;
} else {
LOG.error("{} is not a valid L3 Endpoint", newL3Ep);
return;
}
- return;
}
if (oldL3Ep != null && newL3Ep == null) {
// deleted L3Endpoint
+ notifyEndpointUpdated(new EpKey(oldL3Ep.getL2Context(), oldL3Ep.getMacAddress()));
return;
}
if (oldL3Ep != null && newL3Ep != null) {
LOG.trace("Updating L3 Endpoint {}");
// updated Endpoint
+ notifyEndpointUpdated(new EpKey(newL3Ep.getL2Context(), newL3Ep.getMacAddress()));
return;
}
if (newL3Ep.getAugmentation(OfOverlayL3Context.class) == null) {
// Get map of EPGs and their Endpoints for Node
ConcurrentMap<EgKey, Set<EpKey>> map = endpointsByGroupByNode.get(oldLoc);
// For each EPG in the removed endpoint...
- for (EndpointGroupId oldEpgId : newEpgIds) {
+ for (EndpointGroupId oldEpgId : oldEpgIds) {
EgKey oldEgKey = new EgKey(oldEp.getTenant(), oldEpgId);
// Get list of endpoints for EPG
Set<EpKey> eps = map.get(oldEgKey);