@TypedColumn(name="error", method=MethodType.SETDATA, fromVersion="7.7.0")
void setError(Set<String> error);
+ @TypedColumn(name="lldp", method=MethodType.GETCOLUMN, fromVersion="7.11.2")
+ Column<GenericTableSchema, Map<String, String>> getLldpColumn();
+ @TypedColumn(name="lldp", method=MethodType.SETDATA, fromVersion="7.11.2")
+ void setLldp(Map<String, String> lldp);
+
}
}
}
+ list interface-lldp {
+ description "Auto Attach configuration for a particular interface.
+ If LLDP is enabled on an interface, the interface processes received
+ LLDP packets and never passes them to OpenFlow or forwards them.
+
+ lldp : enable: optional string, either true or false
+ True to enable LLDP on this Interface. If not specified, LLDP
+ will be disabled by default.";
+
+ key "lldp-key";
+ leaf lldp-key {
+ description "lldp name/key";
+ type string;
+ }
+ leaf lldp-value {
+ description "lldp value";
+ type string;
+ }
+ }
+
leaf qos {
description "The unique identifier of the QoS entry for this port.";
type yang:uuid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbPortInterfaceAttributes.VlanMode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceExternalIds;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceLldp;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceOtherConfigs;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.Options;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.PortExternalIds;
createInterfaceOptions(terminationPoint, ovsInterface);
createInterfaceOtherConfig(terminationPoint, ovsInterface);
createInterfaceExternalIds(terminationPoint, ovsInterface);
+ createInterfaceLldp(terminationPoint, ovsInterface);
}
private void createInterfaceType(final OvsdbTerminationPointAugmentation terminationPoint,
}
}
+ private void createInterfaceLldp(
+ final OvsdbTerminationPointAugmentation terminationPoint,
+ final Interface ovsInterface) {
+
+ List<InterfaceLldp> interfaceLldpList =
+ terminationPoint.getInterfaceLldp();
+ if (interfaceLldpList != null && !interfaceLldpList.isEmpty()) {
+ Map<String, String> interfaceLldpMap = new HashMap<>();
+ for (InterfaceLldp interfaceLldp : interfaceLldpList) {
+ interfaceLldpMap.put(interfaceLldp.getLldpKey(), interfaceLldp.getLldpValue());
+ }
+ try {
+ ovsInterface.setLldp(ImmutableMap.copyOf(interfaceLldpMap));
+ } catch (NullPointerException e) {
+ LOG.warn("Incomplete OVSDB interface lldp");
+ }
+ }
+ }
+
private void createPortExternalIds(
final OvsdbTerminationPointAugmentation terminationPoint,
final Port port) {
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbPortInterfaceAttributes.VlanMode;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbTerminationPointAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceExternalIds;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceLldp;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceOtherConfigs;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.Options;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.PortExternalIds;
updateInterfaceOptions(terminationPoint, ovsInterface);
updateInterfaceOtherConfig(terminationPoint, ovsInterface);
updateInterfaceExternalIds(terminationPoint, ovsInterface);
+ updateInterfaceLldp(terminationPoint, ovsInterface);
}
private void updatePort(
}
}
+ private void updateInterfaceLldp(
+ final OvsdbTerminationPointAugmentation terminationPoint,
+ final Interface ovsInterface) {
+
+ List<InterfaceLldp> interfaceLldpList =
+ terminationPoint.getInterfaceLldp();
+ if (interfaceLldpList != null && !interfaceLldpList.isEmpty()) {
+ Map<String, String> interfaceLldpMap = new HashMap<>();
+ for (InterfaceLldp interfaceLldp : interfaceLldpList) {
+ interfaceLldpMap.put(interfaceLldp.getLldpKey(), interfaceLldp.getLldpValue());
+ }
+ try {
+ ovsInterface.setLldp(ImmutableMap.copyOf(interfaceLldpMap));
+ } catch (NullPointerException e) {
+ LOG.warn("Incomplete OVSDB interface lldp");
+ }
+ }
+ }
+
private void updateInterfaceOtherConfig(
final OvsdbTerminationPointAugmentation terminationPoint,
final Interface ovsInterface) {
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.ManagedNodeEntry;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceExternalIds;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceExternalIdsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceLldp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceLldpBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceLldpKey;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceOtherConfigs;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceOtherConfigsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.Options;
updateInterfaceExternalIds(interf, ovsdbTerminationPointBuilder);
updateOptions(interf, ovsdbTerminationPointBuilder);
updateInterfaceOtherConfig(interf, ovsdbTerminationPointBuilder);
+ updateInterfaceLldp(interf, ovsdbTerminationPointBuilder);
}
private void updateVlan(final Port port,
}
}
+ private void updateInterfaceLldp(final Interface interf,
+ final OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) {
+
+ Map<String, String> interfaceLldpMap = interf.getLldpColumn().getData();
+ if (interfaceLldpMap != null && !interfaceLldpMap.isEmpty()) {
+ List<InterfaceLldp> interfaceLldpList = new ArrayList<>();
+ for (String interfaceLldpKeyString : interfaceLldpMap.keySet()) {
+ String interfaceLldpValueString = interfaceLldpMap.get(interfaceLldpKeyString);
+ if (interfaceLldpKeyString != null && interfaceLldpValueString!=null) {
+ interfaceLldpList.add(new InterfaceLldpBuilder()
+ .setKey(new InterfaceLldpKey(interfaceLldpKeyString))
+ .setLldpKey(interfaceLldpKeyString)
+ .setLldpValue(interfaceLldpValueString)
+ .build());
+ }
+ }
+ ovsdbTerminationPointBuilder.setInterfaceLldp(interfaceLldpList);
+ }
+ }
+
private void updateInterfaceOtherConfig(final Interface interf,
final OvsdbTerminationPointAugmentationBuilder ovsdbTerminationPointBuilder) {
MemberModifier.suppress(MemberMatcher.method(OvsdbPortUpdateCommand.class, "updateInterfaceExternalIds", Interface.class, OvsdbTerminationPointAugmentationBuilder.class));
MemberModifier.suppress(MemberMatcher.method(OvsdbPortUpdateCommand.class, "updateOptions", Interface.class, OvsdbTerminationPointAugmentationBuilder.class));
MemberModifier.suppress(MemberMatcher.method(OvsdbPortUpdateCommand.class, "updateInterfaceOtherConfig", Interface.class, OvsdbTerminationPointAugmentationBuilder.class));
+ MemberModifier.suppress(MemberMatcher.method(OvsdbPortUpdateCommand.class, "updateInterfaceLldp", Interface.class, OvsdbTerminationPointAugmentationBuilder.class));
Whitebox.invokeMethod(ovsdbPortUpdateCommand, "updateInterface", interf, OVSDB_INTERFACE_TYPE, ovsdbTerminationPointBuilder);
verify(ovsdbTerminationPointBuilder).setInterfaceUuid(any(Uuid.class));
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.node.attributes.OpenvswitchOtherConfigs;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceExternalIds;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceExternalIdsBuilder;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceLldp;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceLldpBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceOtherConfigs;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.InterfaceOtherConfigsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.port._interface.attributes.Options;
new InterfaceExternalIdsSouthboundHelper());
}
+ /*
+ * Tests the CRUD operations for <code>Interface</code> <code>lldp</code>.
+ *
+ * @see <code>SouthboundIT.generateInterfaceLldpTestCases()</code> for specific test case information
+ */
+ @Test
+ public void testCRUDTerminationPointInterfaceLldp() throws InterruptedException {
+ testCRUDTerminationPoint(new SouthboundInterfaceLldpBuilder(), "TPInterfaceLldp",
+ new InterfaceLldpSouthboundHelper());
+ }
+
/*
* Tests the CRUD operations for <code>TerminationPoint</code> <code>options</code>.
*
}
}
+ private static final class SouthboundInterfaceLldpBuilder extends KeyValueBuilder<InterfaceLldp> {
+ @Override
+ protected Builder<InterfaceLldp> builder() {
+ return new InterfaceLldpBuilder();
+ }
+
+ @Override
+ protected void setKey(Builder<InterfaceLldp> builder, String key) {
+ ((InterfaceLldpBuilder) builder).setLldpKey((key));
+ }
+
+ @Override
+ protected void setValue(Builder<InterfaceLldp> builder, String value) {
+ ((InterfaceLldpBuilder) builder).setLldpValue(value);
+ }
+
+ @Override
+ protected boolean isValueMandatory() {
+ return true;
+ }
+ }
+
private static final class SouthboundOptionsBuilder extends KeyValueBuilder<Options> {
@Override
protected Builder<Options> builder() {
}
}
+ private static class InterfaceLldpSouthboundHelper implements
+ SouthboundTerminationPointHelper<InterfaceLldp> {
+ @Override
+ public void writeValues(
+ OvsdbTerminationPointAugmentationBuilder builder, List<InterfaceLldp> values) {
+ builder.setInterfaceLldp(values);
+ }
+
+ @Override
+ public List<InterfaceLldp> readValues(OvsdbTerminationPointAugmentation augmentation) {
+ return augmentation.getInterfaceLldp();
+ }
+ }
+
private static class OptionsSouthboundHelper implements SouthboundTerminationPointHelper<Options> {
@Override
public void writeValues(