package org.opendaylight.openflowplugin.openflow.md.core.translator;
import java.math.BigInteger;
+import java.util.Collections;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
+import org.opendaylight.openflowplugin.openflow.md.OFConstants;
import org.opendaylight.openflowplugin.openflow.md.core.IMDMessageTranslator;
import org.opendaylight.openflowplugin.openflow.md.core.SwitchConnectionDistinguisher;
import org.opendaylight.openflowplugin.openflow.md.core.session.SessionContext;
List<DataObject> list = new CopyOnWriteArrayList<DataObject>();
BigInteger datapathId = sc.getFeatures().getDatapathId();
Long portNo = port.getPortNo();
- LOG.error("PortStatusMessage: dataPathId {} portNo {}",datapathId,portNo);
- NodeConnectorUpdatedBuilder builder = InventoryDataServiceUtil
- .nodeConnectorUpdatedBuilderFromDatapathIdPortNo(datapathId,port.getPortNo());
- FlowCapableNodeConnectorUpdatedBuilder fcncub = new FlowCapableNodeConnectorUpdatedBuilder();
- fcncub.setAdvertisedFeatures(PortTranslatorUtil.translatePortFeatures(port.getAdvertisedFeatures()));
- fcncub.setConfiguration(PortTranslatorUtil.translatePortConfig(port.getConfig()));
- fcncub.setCurrentFeature(PortTranslatorUtil.translatePortFeatures(port.getCurrentFeatures()));
- fcncub.setCurrentSpeed(port.getCurrSpeed());
- fcncub.setHardwareAddress(port.getHwAddr());
- fcncub.setMaximumSpeed(port.getMaxSpeed());
- fcncub.setName(port.getName());
- fcncub.setPeerFeatures(PortTranslatorUtil.translatePortFeatures(port.getPeerFeatures()));
- fcncub.setPortNumber(port.getPortNo());
- fcncub.setState(PortTranslatorUtil.translatePortState(port.getState()));
- fcncub.setSupported(PortTranslatorUtil.translatePortFeatures(port.getSupportedFeatures()));
- builder.addAugmentation(FlowCapableNodeConnectorUpdated.class, fcncub.build());
- list.add(builder.build());
+ Short version = port.getVersion();
+ LOG.error("PortStatusMessage: version {} dataPathId {} portNo {}",version, datapathId,portNo);
+ list.add(PortTranslatorUtil.translatePort(version, datapathId, portNo, port));
return list;
} else {
// TODO - Do something smarter than returning null if translation fails... what Exception should we throw here?
- return null;
+ return Collections.emptyList();
}
}
}