1. Change hwvtep.yang based on https://git.opendaylight.org/gerrit/#/c/29797/.
2. Fix related code.
Change-Id: I314ddc23daebe59bd3ed241fa80803ce4845ef37
Signed-off-by: Peng Zhang <pzhang@ctbri.com.cn>
}
grouping hwvtep-physical-switch-attributes {
- container physical-switch-id {
- uses hwvtep-node-identification;
- }
+ uses hwvtep-node-identification;
list management-ips {
key "management-ips-key";
leaf management-ips-key {
}
}
list switches {
+ description "List of physical switches managed by this node";
key "switch-ref";
leaf switch-ref {
type hwvtep-physical-switch-ref;
}
}
+ list logical-switches {
+ key "hwvtep-node-name";
+ uses hwvtep-logical-switch-attributes;
+ }
}
identity encapsulation-type-base {
}
grouping hwvtep-physical-locator-set-attributes {
- list locators-ref {
+ list locator-set {
leaf locator-ref {
type hwvtep-physical-locator-ref;
}
description "Per Logical Switch tunnel key";
type string;
}
- leaf logical-switch-managed-by {
- description "The hwvtep global node to which this logical switch belongs to";
- type hwvtep-global-ref;
- }
+ uses hwvtep-physical-locator-set-attributes;
}
grouping hwvtep-physical-port-attributes {
- container physical-port-id {
- uses hwvtep-node-identification;
- }
+ uses hwvtep-node-identification;
list vlan-bindings {
description "A map of vlan ID to logical switch pairs";
key "vlan-id-key";
description "vlan ids in the range 0 - 4095";
type ethertype:vlan-id;
}
- leaf logical-switch {
+ leaf logical-switch-ref {
description "Reference to logical switch for the vlan";
type hwvtep-logical-switch-ref;
}
uses hwvtep-global-attributes;
}
- augment "/topo:network-topology/topo:topology/topo:node" {
- description "Augmentation for logical switches for a hwvtep node";
- ext:augment-identifier "hwvtep-logical-switch-augmentation";
- uses hwvtep-logical-switch-attributes;
- }
-
- augment "/topo:network-topology/topo:topology/topo:node" {
- description "Augmentation for physical locator set for a hwvtep node";
- ext:augment-identifier "hwvtep-physical-locator-set-augmentation";
- uses hwvtep-physical-locator-set-attributes;
- }
augment "/topo:network-topology/topo:topology/topo:node/topo:termination-point" {
description "Augment topology node termination-point for a hwvtep physical-locator";
ext:augment-identifier "hwvtep-physical-locator-augmentation";
uses hwvtep-physical-locator-attributes;
}
+
augment "/topo:network-topology/topo:topology/topo:node/topo:termination-point" {
description "Augment topology node termination-point for a hwvtep physical-port";
ext:augment-identifier "hwvtep-physical-port-augmentation";
uses hwvtep-physical-port-attributes;
}
-
}
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
import org.opendaylight.controller.md.sal.binding.api.DataBroker;
import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
import org.opendaylight.ovsdb.hwvtepsouthbound.transact.HwvtepOperationalState;
import org.opendaylight.ovsdb.hwvtepsouthbound.transact.TransactCommandAggregator;
import org.opendaylight.ovsdb.lib.OvsdbClient;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.IpAddress;
-import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.PortNumber;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentation;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepLogicalSwitchAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.ConnectionInfo;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.ConnectionInfoBuilder;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
-import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
return result;
}
- public static Optional<HwvtepGlobalAugmentation> getManagingNode(DataBroker db,
+/* public static Optional<HwvtepGlobalAugmentation> getManagingNode(DataBroker db,
HwvtepLogicalSwitchAttributes lNode) {
Preconditions.checkNotNull(lNode);
Optional<HwvtepGlobalAugmentation> result = null;
LOG.warn("Failed to find managing node for PhysicalSwitch {}",lNode);
}
return result;
- }
+ }*/
private static Optional<HwvtepGlobalAugmentation> getManagingNode(DataBroker db, HwvtepGlobalRef ref) {
try {
import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType;
import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
import org.opendaylight.controller.md.sal.common.api.data.ReadFailedException;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepLogicalSwitchAugmentation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentation;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorSetAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalPortAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.PhysicalSwitchAugmentation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitches;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.locator.set.attributes.LocatorSet;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPoint;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.node.TerminationPointKey;
return Optional.fromNullable(operationalNodes.get(nodeIid));
}
- public Optional<HwvtepLogicalSwitchAugmentation> getLogicalSwitchAugmentation(InstanceIdentifier<?> iid) {
+ public Optional<LogicalSwitches> getLogicalSwitches(InstanceIdentifier<?> iid) {
Optional<Node> nodeOptional = getGlobalNode(iid);
- if (nodeOptional.isPresent()) {
+ /*if (nodeOptional.isPresent()) {
return Optional.fromNullable(nodeOptional.get().getAugmentation(HwvtepLogicalSwitchAugmentation.class));
- }
+ }*/
return Optional.absent();
}
return Optional.absent();
}
- public Optional<HwvtepPhysicalLocatorSetAugmentation> getPhysicalLocatorSetAugmentation(InstanceIdentifier<?> iid) {
+ public Optional<LocatorSet> getPhysicalLocatorSet(InstanceIdentifier<?> iid) {
Optional<Node> nodeOptional = getGlobalNode(iid);
- if (nodeOptional.isPresent()) {
- return Optional.fromNullable(nodeOptional.get().getAugmentation(HwvtepPhysicalLocatorSetAugmentation.class));
- }
+ /*if (nodeOptional.isPresent()) {
+ return Optional.fromNullable(nodeOptional.get().getAugmentation(HwvtepGlobalAugmentation.class).getLogicalSwitches());
+ }*/
return Optional.absent();
}
import org.opendaylight.ovsdb.lib.schema.typed.TyperUtils;
import org.opendaylight.ovsdb.schema.hardwarevtep.Global;
import org.opendaylight.ovsdb.schema.hardwarevtep.LogicalSwitch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepLogicalSwitchAugmentation;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
import org.opendaylight.ovsdb.lib.schema.typed.TyperUtils;
import org.opendaylight.ovsdb.schema.hardwarevtep.LogicalSwitch;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepLogicalSwitchAugmentation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentation;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitches;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
@Override
public void execute(TransactionBuilder transaction) {
- Map<InstanceIdentifier<HwvtepLogicalSwitchAugmentation>, HwvtepLogicalSwitchAugmentation> created =
- extractCreated(getChanges(),HwvtepLogicalSwitchAugmentation.class);
- if(created != null) {
- for(Entry<InstanceIdentifier<HwvtepLogicalSwitchAugmentation>, HwvtepLogicalSwitchAugmentation> logicalSwitchEntry:
+ Map<InstanceIdentifier<LogicalSwitches>, LogicalSwitches> created =
+ extractCreated(getChanges(),LogicalSwitches.class);
+ if (!created.isEmpty()) {
+ for(Entry<InstanceIdentifier<LogicalSwitches>, LogicalSwitches> logicalSwitchEntry:
created.entrySet()) {
updateLogicalSwitch(transaction, logicalSwitchEntry.getKey(), logicalSwitchEntry.getValue());
}
}
+ Map<InstanceIdentifier<LogicalSwitches>, LogicalSwitches> updated =
+ extractUpdated(getChanges(),LogicalSwitches.class);
+ if(!updated.isEmpty()) {
+ for(Entry<InstanceIdentifier<LogicalSwitches>, LogicalSwitches> logicalSwitchEntry:
+ updated.entrySet()) {
+ updateLogicalSwitch(transaction, logicalSwitchEntry.getKey(), logicalSwitchEntry.getValue());
+ }
+ }
}
private void updateLogicalSwitch(TransactionBuilder transaction,
- InstanceIdentifier<HwvtepLogicalSwitchAugmentation> iid, HwvtepLogicalSwitchAugmentation logicalSwitchAugmentation) {
- LOG.debug("Creating a logical switch named: {}", logicalSwitchAugmentation.getHwvtepNodeName());
- Optional<HwvtepLogicalSwitchAugmentation> operationalLogicalSwitchOptional =
- getOperationalState().getLogicalSwitchAugmentation(iid);
+ InstanceIdentifier<LogicalSwitches> iid, LogicalSwitches logicalSwitches) {
+ LOG.debug("Creating a logical switch named: {}", logicalSwitches.getHwvtepNodeName());
+ Optional<LogicalSwitches> operationalLogicalSwitchOptional =
+ getOperationalState().getLogicalSwitches(iid);
DatabaseSchema dbSchema = transaction.getDatabaseSchema();
LogicalSwitch logicalSwitch = TyperUtils.getTypedRowWrapper(transaction.getDatabaseSchema(), LogicalSwitch.class);
if(!operationalLogicalSwitchOptional.isPresent()) {
- setName(logicalSwitch, logicalSwitchAugmentation, operationalLogicalSwitchOptional);
- setTunnelKey(logicalSwitch, logicalSwitchAugmentation, operationalLogicalSwitchOptional);
+ setName(logicalSwitch, logicalSwitches, operationalLogicalSwitchOptional);
+ setTunnelKey(logicalSwitch, logicalSwitches, operationalLogicalSwitchOptional);
transaction.add(op.insert(logicalSwitch));
} else {
String existingLogicalSwitchName = operationalLogicalSwitchOptional.get().getHwvtepNodeName().getValue();
}
}
- private void setName(LogicalSwitch logicalSwitch, HwvtepLogicalSwitchAugmentation logicalSwitchAugmentation,
- Optional<HwvtepLogicalSwitchAugmentation> operationalLogicalSwitchOptional) {
- if(logicalSwitchAugmentation.getHwvtepNodeName() != null) {
- logicalSwitch.setName(logicalSwitchAugmentation.getHwvtepNodeName().getValue());
+ private void setName(LogicalSwitch logicalSwitch, LogicalSwitches logicalSwitches,
+ Optional<LogicalSwitches> operationalLogicalSwitchOptional) {
+ if(logicalSwitches.getHwvtepNodeName() != null) {
+ logicalSwitch.setName(logicalSwitches.getHwvtepNodeName().getValue());
} else if(operationalLogicalSwitchOptional.isPresent() && operationalLogicalSwitchOptional.get().getHwvtepNodeName() != null) {
logicalSwitch.setName(operationalLogicalSwitchOptional.get().getHwvtepNodeName().getValue());
}
}
- private void setTunnelKey(LogicalSwitch logicalSwitch, HwvtepLogicalSwitchAugmentation logicalSwitchAugmentation,
- Optional<HwvtepLogicalSwitchAugmentation> operationalLogicalSwitchOptional) {
- if(logicalSwitchAugmentation.getTunnelKey() != null) {
+ private void setTunnelKey(LogicalSwitch logicalSwitch, LogicalSwitches logicalSwitches,
+ Optional<LogicalSwitches> operationalLogicalSwitchOptional) {
+ if(logicalSwitches.getTunnelKey() != null) {
Set<Long> tunnel = new HashSet<Long>();
- tunnel.add(Long.valueOf(logicalSwitchAugmentation.getTunnelKey()));
+ tunnel.add(Long.valueOf(logicalSwitches.getTunnelKey()));
logicalSwitch.setTunnelKey(tunnel);
} else if(operationalLogicalSwitchOptional.isPresent() && operationalLogicalSwitchOptional.get().getTunnelKey() != null) {
Set<Long> tunnel = new HashSet<Long>();
}
}
- private Node getCreated(DataObjectModification<Node> mod) {
- if((mod.getModificationType() == ModificationType.WRITE)
- && (mod.getDataBefore() == null)){
- return mod.getDataAfter();
+ private Map<InstanceIdentifier<LogicalSwitches>, LogicalSwitches> extractCreated(
+ Collection<DataTreeModification<Node>> changes, Class<LogicalSwitches> class1) {
+ Map<InstanceIdentifier<LogicalSwitches>, LogicalSwitches> result
+ = new HashMap<InstanceIdentifier<LogicalSwitches>, LogicalSwitches>();
+ if(changes != null && !changes.isEmpty()) {
+ for(DataTreeModification<Node> change : changes) {
+ final InstanceIdentifier<Node> key = change.getRootPath().getRootIdentifier();
+ final DataObjectModification<Node> mod = change.getRootNode();
+ Node created = TransactUtils.getCreated(mod);
+ if(created != null) {
+/* LogicalSwitches logicalSwitch = created.getAugmentation(HwvtepGlobalAugmentation.class).getLogicalSwitches();
+ InstanceIdentifier<LogicalSwitches> iid = change.getRootPath().getRootIdentifier().augmentation(LogicalSwitches.class);
+ if(logicalSwitch != null) {
+ result.put(iid, logicalSwitch);
+ }*/
+ }
+ }
}
- return null;
+ return result;
}
- private Map<InstanceIdentifier<HwvtepLogicalSwitchAugmentation>, HwvtepLogicalSwitchAugmentation> extractCreated(
- Collection<DataTreeModification<Node>> changes, Class<HwvtepLogicalSwitchAugmentation> class1) {
- Map<InstanceIdentifier<HwvtepLogicalSwitchAugmentation>, HwvtepLogicalSwitchAugmentation> result
- = new HashMap<InstanceIdentifier<HwvtepLogicalSwitchAugmentation>, HwvtepLogicalSwitchAugmentation>();
+ private Map<InstanceIdentifier<LogicalSwitches>, LogicalSwitches> extractUpdated(
+ Collection<DataTreeModification<Node>> changes, Class<LogicalSwitches> class1) {
+ Map<InstanceIdentifier<LogicalSwitches>, LogicalSwitches> result
+ = new HashMap<InstanceIdentifier<LogicalSwitches>, LogicalSwitches>();
if(changes != null && !changes.isEmpty()) {
for(DataTreeModification<Node> change : changes) {
final InstanceIdentifier<Node> key = change.getRootPath().getRootIdentifier();
final DataObjectModification<Node> mod = change.getRootNode();
- Node created = getCreated(mod);
- if(created != null) {
- HwvtepLogicalSwitchAugmentation logicalSwitch = created.getAugmentation(HwvtepLogicalSwitchAugmentation.class);
- InstanceIdentifier<HwvtepLogicalSwitchAugmentation> iid = change.getRootPath().getRootIdentifier().augmentation(HwvtepLogicalSwitchAugmentation.class);
+ Node updated = TransactUtils.getUpdated(mod);
+ if(updated != null) {
+/* LogicalSwitches logicalSwitch = updated.getAugmentation(HwvtepGlobalAugmentation.class).getLogicalSwitches();
+ InstanceIdentifier<LogicalSwitches> iid = change.getRootPath().getRootIdentifier().augmentation(LogicalSwitches.class);
if(logicalSwitch != null) {
result.put(iid, logicalSwitch);
- }
+ }*/
}
}
}
public TransactCommandAggregator(HwvtepOperationalState state, Collection<DataTreeModification<Node>> changes) {
commands.add(new LogicalSwitchUpdateCommand(state,changes));
- commands.add(new LogicalSwitchRemoveCommand(state,changes));
+/* commands.add(new LogicalSwitchRemoveCommand(state,changes));
commands.add(new PhysicalLocatorUpdateCommand(state,changes));
commands.add(new PhysicalLocatorRemoveCommand(state,changes));
commands.add(new PhysicalPortUpdateCommand(state,changes));
- commands.add(new PhysicalPortRemoveCommand(state,changes));
+ commands.add(new PhysicalPortRemoveCommand(state,changes));*/
}
@Override
import org.opendaylight.controller.md.sal.binding.api.DataObjectModification;
import org.opendaylight.controller.md.sal.binding.api.DataTreeModification;
import org.opendaylight.controller.md.sal.binding.api.DataObjectModification.ModificationType;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepLogicalSwitchAugmentation;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
-import org.opendaylight.yangtools.yang.binding.Augmentation;
-import org.opendaylight.yangtools.yang.binding.DataObject;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.opendaylight.ovsdb.schema.hardwarevtep.LogicalSwitch;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentationBuilder;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepLogicalSwitchAugmentation;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepLogicalSwitchAugmentationBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepNodeName;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalSwitchRef;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitches;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitchesBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.Switches;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.SwitchesBuilder;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
}
private Node buildLogicalSwitchNode(LogicalSwitch lSwitch) {
- NodeBuilder lsNodeBuilder = new NodeBuilder();
+ return null;
+/* NodeBuilder lsNodeBuilder = new NodeBuilder();
NodeId psNodeId = getNodeId(lSwitch);
lsNodeBuilder.setNodeId(psNodeId);
- HwvtepLogicalSwitchAugmentationBuilder lsAugBuilder = new HwvtepLogicalSwitchAugmentationBuilder();
- setManagedBy(lsAugBuilder, lSwitch);
+ LogicalSwitchesBuilder lsAugBuilder = new LogicalSwitchesBuilder();
setLogicalSwitchId(lsAugBuilder, lSwitch);
-
- lsNodeBuilder.addAugmentation(HwvtepLogicalSwitchAugmentation.class, lsAugBuilder.build());
+ lsNodeBuilder.addAugmentation(LogicalSwitches.class, lsAugBuilder.build());
LOG.trace("Built with the intent to store PhysicalSwitch data {}",
lsAugBuilder.build());
- return lsNodeBuilder.build();
- }
-
- private void setManagedBy(HwvtepLogicalSwitchAugmentationBuilder lsAugBuilder, LogicalSwitch lSwitch) {
- // TODO This requires change to yang file
+ return lsNodeBuilder.build();*/
}
-
- private void setLogicalSwitchId(HwvtepLogicalSwitchAugmentationBuilder lsAugBuilder, LogicalSwitch lSwitch) {
+ private void setLogicalSwitchId(LogicalSwitchesBuilder lsAugBuilder, LogicalSwitch lSwitch) {
lsAugBuilder.setHwvtepNodeName(new HwvtepNodeName(lSwitch.getName()));
if(lSwitch.getDescription() != null) {
lsAugBuilder.setHwvtepNodeDescription(lSwitch.getDescription());
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalPortAugmentationBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.PhysicalSwitchAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.Switches;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.port.attributes.PhysicalPortIdBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.port.attributes.VlanBindings;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.port.attributes.VlanBindingsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical.port.attributes.VlanBindingsKey;
private void updatePhysicalPortId(PhysicalPort portUpdate,
HwvtepPhysicalPortAugmentationBuilder tpAugmentationBuilder) {
- PhysicalPortIdBuilder portIdBuilder = new PhysicalPortIdBuilder();
- portIdBuilder.setHwvtepNodeName(new HwvtepNodeName(portUpdate.getName()));
+ tpAugmentationBuilder.setHwvtepNodeName(new HwvtepNodeName(portUpdate.getName()));
if(portUpdate.getDescription() != null) {
- portIdBuilder.setHwvtepNodeDescription(portUpdate.getDescription());
+ tpAugmentationBuilder.setHwvtepNodeDescription(portUpdate.getDescription());
}
-
- tpAugmentationBuilder.setPhysicalPortId(portIdBuilder.build());
}
private void updateVlanBindings(PhysicalPort portUpdate,
vbBuilder.setKey(vbKey);
vbBuilder.setVlanIdKey(vbKey.getVlanIdKey());
HwvtepLogicalSwitchRef lSwitchRef = this.getLogicalSwitchRef(value, portUpdate.getUuid());
- vbBuilder.setLogicalSwitch(lSwitchRef);
+ vbBuilder.setLogicalSwitchRef(lSwitchRef);
return vbBuilder.build();
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.ManagementIps;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.ManagementIpsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.ManagementIpsKey;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.PhysicalSwitchIdBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.TunnelIps;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.TunnelIpsBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.physical._switch.attributes.TunnelIpsKey;
}
private void setPhysicalSwitchId(PhysicalSwitchAugmentationBuilder psAugmentationBuilder, PhysicalSwitch pSwitch) {
- PhysicalSwitchIdBuilder psIdBuilder = new PhysicalSwitchIdBuilder();
if(pSwitch.getName() != null) {
- psIdBuilder.setHwvtepNodeName(new HwvtepNodeName(pSwitch.getName()));
+ psAugmentationBuilder.setHwvtepNodeName(new HwvtepNodeName(pSwitch.getName()));
}
-
if(pSwitch.getDescription() != null) {
- psIdBuilder.setHwvtepNodeDescription(pSwitch.getDescription());
+ psAugmentationBuilder.setHwvtepNodeDescription(pSwitch.getDescription());
}
- psAugmentationBuilder.setPhysicalSwitchId(psIdBuilder.build());
}
private void setManagementIps(PhysicalSwitchAugmentationBuilder psAugmentationBuilder, PhysicalSwitch pSwitch) {