+ }
+
+ }
+
+ private void createInterface(
+ final OvsdbTerminationPointAugmentation terminationPoint,
+ final Interface ovsInterface) {
+ ovsInterface.setName(terminationPoint.getName());
+
+ createInterfaceType(terminationPoint, ovsInterface);
+ createOfPort(terminationPoint, ovsInterface);
+ createOfPortRequest(terminationPoint, ovsInterface);
+ createInterfaceOptions(terminationPoint, ovsInterface);
+ createInterfaceOtherConfig(terminationPoint, ovsInterface);
+ createInterfaceExternalIds(terminationPoint, ovsInterface);
+ createInterfaceLldp(terminationPoint, ovsInterface);
+ }
+
+ private void createInterfaceType(final OvsdbTerminationPointAugmentation terminationPoint,
+ final Interface ovsInterface) {
+
+ Class<? extends InterfaceTypeBase> mdsaltype = terminationPoint.getInterfaceType();
+ if (mdsaltype != null) {
+ ovsInterface.setType(SouthboundMapper.createOvsdbInterfaceType(mdsaltype));
+ }
+ }
+
+ private void createPort(
+ final OvsdbTerminationPointAugmentation terminationPoint,
+ final Port port, final String interfaceUuid) {
+
+ port.setName(terminationPoint.getName());
+ port.setInterfaces(Sets.newHashSet(new UUID(interfaceUuid)));
+ createPortOtherConfig(terminationPoint, port);
+ createPortVlanTag(terminationPoint, port);
+ createPortVlanTrunk(terminationPoint, port);
+ createPortVlanMode(terminationPoint, port);
+ createPortExternalIds(terminationPoint, port);
+ }
+
+ private void createOfPort(
+ final OvsdbTerminationPointAugmentation terminationPoint,
+ final Interface ovsInterface) {
+
+ Long ofPort = terminationPoint.getOfport();
+ if (ofPort != null) {
+ ovsInterface.setOpenFlowPort(Sets.newHashSet(ofPort));
+ }
+ }
+
+ private void createOfPortRequest(
+ final OvsdbTerminationPointAugmentation terminationPoint,
+ final Interface ovsInterface) {
+
+ Integer ofPortRequest = terminationPoint.getOfportRequest();
+ if (ofPortRequest != null) {
+ ovsInterface.setOpenFlowPortRequest(Sets.newHashSet(ofPortRequest.longValue()));
+ }
+ }
+
+ private void createInterfaceOptions(
+ final OvsdbTerminationPointAugmentation terminationPoint,
+ final Interface ovsInterface) {
+
+ //Configure optional input
+ if (terminationPoint.getOptions() != null) {
+ try {
+ ovsInterface.setOptions(YangUtils.convertYangKeyValueListToMap(terminationPoint.getOptions(),
+ Options::getOption, Options::getValue));
+ } catch (NullPointerException e) {
+ LOG.warn("Incomplete OVSDB interface options", e);