@Override
public void deletePort(DeviceId deviceId, PortDescription basePortDescription) {
checkNotNull(deviceId, DEVICE_ID_NULL);
checkNotNull(basePortDescription, PORT_DESCRIPTION_NULL);
checkValidity();
if (!mastershipService.isLocalMaster(deviceId)) {
log.trace("Ignoring {} port update on standby node. {}", deviceId,
basePortDescription);
return;
}
Device device = getDevice(deviceId);
if (device == null) {
log.trace("Device not found: {}", deviceId);
}
PortDescription newPortDescription = DefaultPortDescription.builder(basePortDescription)
.isRemoved(true)
.build();
final DeviceEvent event = store.updatePortStatus(this.provider().id(),
deviceId,
newPortDescription);
if (event != null) {
log.info("Device {} port {} status changed", deviceId, event.port().number());
post(event);
}
}