//fire removal of local ucast macs so that logical switches will be deleted
fillLocalMacsToBeRemoved(oldAugmentation, configNode, opNode);
- newNodeBuilder.addAugmentation(HwvtepGlobalAugmentation.class, newAugmentation.build());
- oldNodeBuilder.addAugmentation(HwvtepGlobalAugmentation.class, oldAugmentation.build());
+ newNodeBuilder.addAugmentation(newAugmentation.build());
+ oldNodeBuilder.addAugmentation(oldAugmentation.build());
return new DataTreeModificationImpl<>(nodeId, newNodeBuilder.build(), oldNodeBuilder.build());
}
if (augmentation != null && augmentation.getVlanBindings() != null
&& !augmentation.getVlanBindings().isEmpty()) {
builder.setVlanBindings(augmentation.getVlanBindings());
- terminationPointBuilder.addAugmentation(HwvtepPhysicalPortAugmentation.class, builder.build());
+ terminationPointBuilder.addAugmentation(builder.build());
final TerminationPoint newTp = terminationPointBuilder.build();
result.put(newTp.key(), newTp);
NodeBuilder nodeBuilder = new NodeBuilder();
nodeBuilder.setNodeId(getNodeId(hwvtepGlobal));
HwvtepGlobalAugmentation hwvtepGlobalAugmentation = hwvtepGlobalBuilder.build();
- nodeBuilder.addAugmentation(HwvtepGlobalAugmentation.class, hwvtepGlobalAugmentation);
+ nodeBuilder.addAugmentation(hwvtepGlobalAugmentation);
transaction.merge(LogicalDatastoreType.OPERATIONAL, nodePath, nodeBuilder.build());
getOvsdbConnectionInstance().setHwvtepGlobalAugmentation(hwvtepGlobalAugmentation);
addToDeviceUpdate(TransactionType.ADD, hwvtepGlobal);
List<LogicalRouters> routers = new ArrayList<>();
routers.add(lrBuilder.build());
- HwvtepGlobalAugmentationBuilder hgAugmentationBuilder = new HwvtepGlobalAugmentationBuilder();
- hgAugmentationBuilder.setLogicalRouters(routers);
- connectionNode.addAugmentation(HwvtepGlobalAugmentation.class, hgAugmentationBuilder.build());
+ connectionNode.addAugmentation(new HwvtepGlobalAugmentationBuilder().setLogicalRouters(routers).build());
return connectionNode.build();
}
List<LogicalSwitches> switches = new ArrayList<>();
switches.add(lsBuilder.build());
- HwvtepGlobalAugmentationBuilder hgAugmentationBuilder = new HwvtepGlobalAugmentationBuilder();
- hgAugmentationBuilder.setLogicalSwitches(switches);
- connectionNode.addAugmentation(HwvtepGlobalAugmentation.class, hgAugmentationBuilder.build());
+ connectionNode.addAugmentation(new HwvtepGlobalAugmentationBuilder().setLogicalSwitches(switches).build());
return connectionNode.build();
}
-
}
import org.opendaylight.ovsdb.utils.mdsal.utils.TransactionType;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
-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.hwvtep.global.attributes.Managers;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.ManagersBuilder;
List<Managers> managersList = new ArrayList<>();
managersList.add(managersBuilder.build());
- HwvtepGlobalAugmentationBuilder hgAugmentationBuilder = new HwvtepGlobalAugmentationBuilder();
- hgAugmentationBuilder.setManagers(managersList);
- connectionNode.addAugmentation(HwvtepGlobalAugmentation.class, hgAugmentationBuilder.build());
+ connectionNode.addAugmentation(new HwvtepGlobalAugmentationBuilder().setManagers(managersList).build());
return connectionNode.build();
// TODO Deletion of other config
}
import org.opendaylight.ovsdb.schema.hardwarevtep.PhysicalLocator;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
-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.HwvtepPhysicalLocatorAugmentationBuilder;
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;
tpAugmentationBuilder.setPhysicalLocatorUuid(new Uuid(locator.getUuid().toString()));
setEncapsType(tpAugmentationBuilder, locator);
setDstIp(tpAugmentationBuilder, locator);
- tpBuilder.addAugmentation(HwvtepPhysicalLocatorAugmentation.class, tpAugmentationBuilder.build());
+ tpBuilder.addAugmentation(tpAugmentationBuilder.build());
if (oldPLocRows.containsKey(locUpdate.getKey())) {
transaction.merge(LogicalDatastoreType.OPERATIONAL,
tpPath, tpBuilder.build());
new HwvtepPhysicalPortAugmentationBuilder();
buildTerminationPoint(tpAugmentationBuilder, portUpdate);
setPortFaultStatus(tpAugmentationBuilder, portUpdate);
- tpBuilder.addAugmentation(HwvtepPhysicalPortAugmentation.class, tpAugmentationBuilder.build());
+ tpBuilder.addAugmentation(tpAugmentationBuilder.build());
if (oldPPRows.containsKey(portUpdateEntry.getKey())) {
transaction.merge(LogicalDatastoreType.OPERATIONAL, tpPath, tpBuilder.build());
} else {
setTunnels(psAugmentationBuilder, phySwitch);
setSwitchFaultStatus(psAugmentationBuilder, phySwitch);
- psNodeBuilder.addAugmentation(PhysicalSwitchAugmentation.class, psAugmentationBuilder.build());
+ psNodeBuilder.addAugmentation(psAugmentationBuilder.build());
LOG.trace("Built with the intent to store PhysicalSwitch data {}", psAugmentationBuilder.build());
return psNodeBuilder.build();
//Update node with UcastMacsLocal reference
NodeBuilder connectionNode = new NodeBuilder();
connectionNode.setNodeId(getOvsdbConnectionInstance().getNodeId());
- HwvtepGlobalAugmentationBuilder hgAugmentationBuilder = new HwvtepGlobalAugmentationBuilder();
List<LocalUcastMacs> umclList = new ArrayList<>();
ucml.forEach(mac -> umclList.add(buildLocalUcastMac(mac)));
- hgAugmentationBuilder.setLocalUcastMacs(umclList);
- connectionNode.addAugmentation(HwvtepGlobalAugmentation.class, hgAugmentationBuilder.build());
+ connectionNode.addAugmentation(new HwvtepGlobalAugmentationBuilder().setLocalUcastMacs(umclList).build());
return connectionNode.build();
}
UUID plocUUID = ucml.getLocatorColumn().getData();
PhysicalLocator physicalLocator = updatedPLocRows.get(plocUUID);
if (physicalLocator == null) {
- physicalLocator = (PhysicalLocator) getOvsdbConnectionInstance()
+ physicalLocator = getOvsdbConnectionInstance()
.getDeviceInfo().getPhysicalLocator(plocUUID);
}
if (physicalLocator != null) {
private Node buildConnectionNode(final Collection<UcastMacsRemote> macRemotes) {
NodeBuilder connectionNode = new NodeBuilder();
connectionNode.setNodeId(getOvsdbConnectionInstance().getNodeId());
- HwvtepGlobalAugmentationBuilder hgAugmentationBuilder = new HwvtepGlobalAugmentationBuilder();
List<RemoteUcastMacs> remoteUMacs = new ArrayList<>();
macRemotes.forEach(mac -> remoteUMacs.add(buildRemoteUcast(mac)));
- hgAugmentationBuilder.setRemoteUcastMacs(remoteUMacs);
- connectionNode.addAugmentation(HwvtepGlobalAugmentation.class, hgAugmentationBuilder.build());
+ connectionNode.addAugmentation(new HwvtepGlobalAugmentationBuilder().setRemoteUcastMacs(remoteUMacs).build());
return connectionNode.build();
}
UUID locUUID = macRemote.getLocatorColumn().getData();
PhysicalLocator physicalLocator = updatedPLocRows.get(locUUID);
if (physicalLocator == null) {
- physicalLocator = (PhysicalLocator) getOvsdbConnectionInstance()
- .getDeviceInfo().getPhysicalLocator(locUUID);
+ physicalLocator = getOvsdbConnectionInstance().getDeviceInfo().getPhysicalLocator(locUUID);
}
if (physicalLocator != null) {
InstanceIdentifier<TerminationPoint> plIid = HwvtepSouthboundMapper.createInstanceIdentifier(nodeIid,
}
void addNode(final LogicalDatastoreType logicalDatastoreType) throws Exception {
- NodeBuilder nodeBuilder = prepareNode(nodeIid);
- HwvtepGlobalAugmentationBuilder builder = new HwvtepGlobalAugmentationBuilder();
- nodeBuilder.addAugmentation(HwvtepGlobalAugmentation.class, builder.build());
+ NodeBuilder nodeBuilder = prepareNode(nodeIid).addAugmentation(new HwvtepGlobalAugmentationBuilder().build());
WriteTransaction transaction = dataBroker.newWriteOnlyTransaction();
transaction.mergeParentStructurePut(logicalDatastoreType, nodeIid, nodeBuilder.build());
transaction.commit();
if (RemoteMcastMacs.class == dataObject) {
TestBuilders.addRemoteMcastMacs(nodeIid, builder, data);
}
- nodeBuilder.addAugmentation(HwvtepGlobalAugmentation.class, builder.build());
+ nodeBuilder.addAugmentation(builder.build());
return mergeNode(logicalDatastoreType, nodeIid, nodeBuilder);
}
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.HwvtepLogicalSwitchRef;
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.HwvtepPhysicalLocatorAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorAugmentationBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalLocatorRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.LogicalSwitches;
if (nodeIid != null) {
tpBuilder.withKey(tpKey);
tpBuilder.setTpId(tpKey.getTpId());
- HwvtepPhysicalLocatorAugmentationBuilder tpAugmentationBuilder =
- new HwvtepPhysicalLocatorAugmentationBuilder();
- tpAugmentationBuilder.setPhysicalLocatorUuid(getUUid(ip));
- tpAugmentationBuilder.setEncapsulationType(HwvtepSouthboundMapper.createEncapsulationType(VXLAN_OVER_IPV4));
- tpAugmentationBuilder.setDstIp(IpAddressBuilder.getDefaultInstance(ip));
- tpBuilder.addAugmentation(HwvtepPhysicalLocatorAugmentation.class, tpAugmentationBuilder.build());
+ tpBuilder.addAugmentation(new HwvtepPhysicalLocatorAugmentationBuilder()
+ .setPhysicalLocatorUuid(getUUid(ip))
+ .setEncapsulationType(HwvtepSouthboundMapper.createEncapsulationType(VXLAN_OVER_IPV4))
+ .setDstIp(IpAddressBuilder.getDefaultInstance(ip))
+ .build());
}
return tpBuilder.build();
}
import org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md.TransactionCommand;
import org.opendaylight.ovsdb.hwvtepsouthbound.transactions.md.TransactionInvokerImpl;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
-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.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;
public void execute(final ReadWriteTransaction transaction) {
NodeBuilder nodeBuilder = new NodeBuilder();
nodeBuilder.setNodeId(iid.firstKeyOf(Node.class).getNodeId());
- HwvtepGlobalAugmentationBuilder builder = new HwvtepGlobalAugmentationBuilder();
- nodeBuilder.addAugmentation(HwvtepGlobalAugmentation.class, builder.build());
+ nodeBuilder.addAugmentation(new HwvtepGlobalAugmentationBuilder().build());
transaction.mergeParentStructurePut(LogicalDatastoreType.CONFIGURATION, iid, nodeBuilder.build());
-
}
}
class ReconciliationTaskManager {
private static final Logger LOG = LoggerFactory.getLogger(ReconciliationTaskManager.class);
- private final ConcurrentHashMap<ReconciliationTask,Future<?>> reconciliationTaskCache
- = new ConcurrentHashMap();
+ private final ConcurrentHashMap<ReconciliationTask, Future<?>> reconciliationTaskCache
+ = new ConcurrentHashMap<>();
public boolean isTaskQueued(ReconciliationTask task) {
return reconciliationTaskCache.containsKey(task);
setOtherConfig(transaction, ovsdbNodeBuilder, oldEntry, openVSwitch);
ovsdbNodeBuilder.setConnectionInfo(getConnectionInfo());
- NodeBuilder nodeBuilder = new NodeBuilder();
- nodeBuilder.setNodeId(getNodeId(openVSwitch));
- nodeBuilder.addAugmentation(OvsdbNodeAugmentation.class,
- ovsdbNodeBuilder.build());
- transaction.merge(LogicalDatastoreType.OPERATIONAL, nodePath,
- nodeBuilder.build());
+ transaction.merge(LogicalDatastoreType.OPERATIONAL, nodePath, new NodeBuilder()
+ .setNodeId(getNodeId(openVSwitch))
+ .addAugmentation(ovsdbNodeBuilder.build())
+ .build());
}
}
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeName;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeProtocolBase;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbBridgeRef;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeAugmentationBuilder;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.OvsdbNodeRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.rev150105.ovsdb.bridge.attributes.BridgeExternalIds;
managedBridges.add(managedBridge);
ovsdbConnectionAugmentationBuilder.setManagedNodeEntry(managedBridges);
- connectionNode.addAugmentation(OvsdbNodeAugmentation.class, ovsdbConnectionAugmentationBuilder.build());
+ connectionNode.addAugmentation(ovsdbConnectionAugmentationBuilder.build());
LOG.debug("Update node with bridge node ref {}",
ovsdbConnectionAugmentationBuilder.getManagedNodeEntry().values().iterator().next());
setManagedBy(ovsdbBridgeAugmentationBuilder);
setAutoAttach(ovsdbBridgeAugmentationBuilder, bridge);
setStpEnalbe(ovsdbBridgeAugmentationBuilder,bridge);
- bridgeNodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class, ovsdbBridgeAugmentationBuilder.build());
+ bridgeNodeBuilder.addAugmentation(ovsdbBridgeAugmentationBuilder.build());
LOG.debug("Built with the intent to store bridge data {}",
ovsdbBridgeAugmentationBuilder.build());
interfaceUpdatedRows.remove(interfaceUuid);
interfaceOldRows.remove(interfaceUuid);
}
- tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
+ tpBuilder.addAugmentation(tpAugmentationBuilder.build());
if (portOldRows.containsKey(portUpdate.getKey()) && !portQosCleared(portUpdate)) {
updateToDataStore(transaction, tpBuilder, tpPath, true);
LOG.info("DEVICE - {} TerminationPoint : {} to Bridge : {}", TransactionType.ADD,
OvsdbTerminationPointAugmentationBuilder tpAugmentationBuilder =
new OvsdbTerminationPointAugmentationBuilder();
buildTerminationPoint(tpAugmentationBuilder, interfaceUpdate.getValue());
- tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
+ tpBuilder.addAugmentation(tpAugmentationBuilder.build());
NodeId bridgeId = SouthboundMapper.createManagedNodeId(bridgeIid.get());
InstanceIdentifier<TerminationPoint> tpPath = InstanceIdentifier
.create(NetworkTopology.class)
field(OvsdbConnectionManager.class, "entityOwnershipService").set(ovsdbConnManager, entityOwnershipService);
field(OvsdbConnectionManager.class, "reconciliationManager").set(ovsdbConnManager, reconciliationManager);
field(OvsdbConnectionManager.class, "ovsdbConnection").set(ovsdbConnManager, ovsdbConnection);
- field(OvsdbConnectionManager.class, "alreadyProcessedClients").set(ovsdbConnManager, new HashMap());
+ field(OvsdbConnectionManager.class, "alreadyProcessedClients").set(ovsdbConnManager, new HashMap<>());
entityConnectionMap = new ConcurrentHashMap<>();
OvsdbConnectionInfo info = mock(OvsdbConnectionInfo.class);
OpenVSwitch.class));
when(nodeBuilder.setNodeId(any(NodeId.class))).thenReturn(nodeBuilder);
when(ovsdbNodeBuilder.build()).thenReturn(mock(OvsdbNodeAugmentation.class));
- when(nodeBuilder.addAugmentation(eq(OvsdbNodeAugmentation.class), any(OvsdbNodeAugmentation.class)))
- .thenReturn(nodeBuilder);
+ when(nodeBuilder.addAugmentation(any(OvsdbNodeAugmentation.class))).thenReturn(nodeBuilder);
when(nodeBuilder.build()).thenReturn(mock(Node.class));
ReadWriteTransaction transaction = mock(ReadWriteTransaction.class);
doNothing().when(transaction).merge(any(LogicalDatastoreType.class), any(InstanceIdentifier.class),
.thenReturn(ovsdbConnectionAugmentationBuilder);
when(ovsdbConnectionAugmentationBuilder.build()).thenReturn(mock(OvsdbNodeAugmentation.class));
- when(connectionNode.addAugmentation(eq(OvsdbNodeAugmentation.class), any(OvsdbNodeAugmentation.class)))
- .thenReturn(connectionNode);
+ when(connectionNode.addAugmentation(any(OvsdbNodeAugmentation.class))).thenReturn(connectionNode);
//for logger
when(ovsdbConnectionAugmentationBuilder.getManagedNodeEntry())
OvsdbBridgeAugmentationBuilder.class));
when(ovsdbBridgeAugmentationBuilder.build()).thenReturn(mock(OvsdbBridgeAugmentation.class));
- when(bridgeNodeBuilder.addAugmentation(eq(OvsdbBridgeAugmentation.class), any(OvsdbBridgeAugmentation.class)))
- .thenReturn(bridgeNodeBuilder);
+ when(bridgeNodeBuilder.addAugmentation(any(OvsdbBridgeAugmentation.class))).thenReturn(bridgeNodeBuilder);
Node node = mock(Node.class);
when(bridgeNodeBuilder.build()).thenReturn(node);
assertEquals(node, Whitebox.invokeMethod(ovsdbBridgeUpdateCommand, "buildBridgeNode", bridge));
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
-import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
OvsdbTerminationPointAugmentationBuilder.class, Interface.class));
when(tpAugmentationBuilder.build()).thenReturn(mock(OvsdbTerminationPointAugmentation.class));
- when(tpBuilder.addAugmentation(eq(OvsdbTerminationPointAugmentation.class),
- any(OvsdbTerminationPointAugmentation.class))).thenReturn(tpBuilder);
+ when(tpBuilder.addAugmentation(any(OvsdbTerminationPointAugmentation.class))).thenReturn(tpBuilder);
when(tpBuilder.build()).thenReturn(mock(TerminationPoint.class));
portOldRows = new HashMap<>();
portOldRows.put(uuid, port);
NodeBuilder portNodeBuilder = new NodeBuilder();
NodeId portNodeId = SouthboundMapper.createManagedNodeId(portIid);
portNodeBuilder.setNodeId(portNodeId);
- TerminationPointBuilder entry = new TerminationPointBuilder();
- entry.withKey(new TerminationPointKey(new TpId(portName)));
- entry.addAugmentation(
- OvsdbTerminationPointAugmentation.class,
- ovsdbTerminationPointAugmentationBuilder.build());
+ TerminationPointBuilder entry = new TerminationPointBuilder()
+ .withKey(new TerminationPointKey(new TpId(portName)))
+ .addAugmentation(ovsdbTerminationPointAugmentationBuilder.build());
portNodeBuilder.setTerminationPoint(Collections.singletonList(entry.build()));
boolean result = mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION,
portIid, portNodeBuilder.build());
ovsdbBridgeAugmentationBuilder.setBridgeExternalIds(externalIds);
ovsdbBridgeAugmentationBuilder.setControllerEntry(controllerEntries);
ovsdbBridgeAugmentationBuilder.setBridgeOtherConfigs(otherConfigs);
- bridgeNodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class, ovsdbBridgeAugmentationBuilder.build());
+ bridgeNodeBuilder.addAugmentation(ovsdbBridgeAugmentationBuilder.build());
LOG.debug("Built with the intent to store bridge data {}", ovsdbBridgeAugmentationBuilder);
Assert.assertTrue(
mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION, bridgeIid, bridgeNodeBuilder.build()));
portUpdateNodeBuilder.setNodeId(portUpdateNodeId);
TerminationPointBuilder tpUpdateBuilder = new TerminationPointBuilder();
tpUpdateBuilder.withKey(new TerminationPointKey(new TpId(testBridgeAndPortName)));
- tpUpdateBuilder.addAugmentation(
- OvsdbTerminationPointAugmentation.class,
- tpUpdateAugmentationBuilder.build());
+ tpUpdateBuilder.addAugmentation(tpUpdateAugmentationBuilder.build());
portUpdateNodeBuilder.setTerminationPoint(Collections.singletonList(tpUpdateBuilder.build()));
Assert.assertTrue(mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION,
portIid, portUpdateNodeBuilder.build()));
portUpdateNodeBuilder.setNodeId(portUpdateNodeId);
TerminationPointBuilder tpUpdateBuilder = new TerminationPointBuilder();
tpUpdateBuilder.withKey(new TerminationPointKey(new TpId(portName)));
- tpUpdateBuilder.addAugmentation(
- OvsdbTerminationPointAugmentation.class,
- tpUpdateAugmentationBuilder.build());
+ tpUpdateBuilder.addAugmentation(tpUpdateAugmentationBuilder.build());
tpUpdateBuilder.setTpId(new TpId(portName));
portUpdateNodeBuilder.setTerminationPoint(Collections.singletonList(tpUpdateBuilder.build()));
Assert.assertTrue(
portUpdateNodeBuilder.setNodeId(portUpdateNodeId);
TerminationPointBuilder tpUpdateBuilder = new TerminationPointBuilder();
tpUpdateBuilder.withKey(new TerminationPointKey(new TpId(portName)));
- tpUpdateBuilder.addAugmentation(
- OvsdbTerminationPointAugmentation.class,
- tpUpdateAugmentationBuilder.build());
+ tpUpdateBuilder.addAugmentation(tpUpdateAugmentationBuilder.build());
tpUpdateBuilder.setTpId(new TpId(portName));
portUpdateNodeBuilder.setTerminationPoint(Collections.singletonList(tpUpdateBuilder.build()));
Assert.assertTrue(
portUpdateNodeBuilder.setNodeId(portUpdateNodeId);
TerminationPointBuilder tpUpdateBuilder = new TerminationPointBuilder();
tpUpdateBuilder.withKey(new TerminationPointKey(new TpId(portName)));
- tpUpdateBuilder.addAugmentation(
- OvsdbTerminationPointAugmentation.class,
- tpUpdateAugmentationBuilder.build());
+ tpUpdateBuilder.addAugmentation(tpUpdateAugmentationBuilder.build());
tpUpdateBuilder.setTpId(new TpId(portName));
portUpdateNodeBuilder.setTerminationPoint(Collections.singletonList(tpUpdateBuilder.build()));
Assert.assertTrue(
tpUpdateAugmentationBuilder.setName(portName);
TerminationPointBuilder tpUpdateBuilder = new TerminationPointBuilder();
tpUpdateBuilder.withKey(new TerminationPointKey(new TpId(portName)));
- tpUpdateBuilder.addAugmentation(
- OvsdbTerminationPointAugmentation.class,
- tpUpdateAugmentationBuilder.build());
+ tpUpdateBuilder.addAugmentation(tpUpdateAugmentationBuilder.build());
tpUpdateBuilder.setTpId(new TpId(portName));
Assert.assertTrue(
SouthboundConstants.OVSDB_FAIL_MODE_MAP.inverse().get("secure"));
setManagedBy(bridgeCreateAugmentationBuilder, connectionInfo);
helper.writeValues(bridgeCreateAugmentationBuilder, updateFromTestCase.inputValues);
- bridgeCreateNodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class,
- bridgeCreateAugmentationBuilder.build());
+ bridgeCreateNodeBuilder.addAugmentation(bridgeCreateAugmentationBuilder.build());
LOG.debug("Built with the intent to store bridge data {}", bridgeCreateAugmentationBuilder);
Assert.assertTrue(mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION, bridgeIid,
bridgeCreateNodeBuilder.build()));
final Node bridgeNode = getBridgeNode(connectionInfo, testBridgeName);
bridgeUpdateNodeBuilder.setNodeId(bridgeNode.getNodeId());
bridgeUpdateNodeBuilder.withKey(bridgeNode.key());
- bridgeUpdateNodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class,
- bridgeUpdateAugmentationBuilder.build());
+ bridgeUpdateNodeBuilder.addAugmentation(bridgeUpdateAugmentationBuilder.build());
Assert.assertTrue(mdsalUtils.merge(LogicalDatastoreType.CONFIGURATION, bridgeIid,
bridgeUpdateNodeBuilder.build()));
Thread.sleep(OVSDB_UPDATE_TIMEOUT);
}
public static Node createNode(ConnectionInfo key) {
- NodeBuilder nodeBuilder = new NodeBuilder();
- nodeBuilder.setNodeId(createNodeId(key.getRemoteIp(), key.getRemotePort()));
- nodeBuilder.addAugmentation(OvsdbNodeAugmentation.class, createOvsdbAugmentation(key));
- return nodeBuilder.build();
+ return new NodeBuilder()
+ .setNodeId(createNodeId(key.getRemoteIp(), key.getRemotePort()))
+ .addAugmentation(createOvsdbAugmentation(key))
+ .build();
}
public static OvsdbNodeAugmentation createOvsdbAugmentation(ConnectionInfo key) {
- OvsdbNodeAugmentationBuilder ovsdbNodeBuilder = new OvsdbNodeAugmentationBuilder();
- ovsdbNodeBuilder.setConnectionInfo(key);
- return ovsdbNodeBuilder.build();
+ return new OvsdbNodeAugmentationBuilder().setConnectionInfo(key).build();
}
public static InstanceIdentifier<Node> createInstanceIdentifier(NodeId nodeId) {
DatapathId datapathId = new DatapathId(dpid);
ovsdbBridgeAugmentationBuilder.setDatapathId(datapathId);
}
- bridgeNodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class, ovsdbBridgeAugmentationBuilder.build());
+ bridgeNodeBuilder.addAugmentation(ovsdbBridgeAugmentationBuilder.build());
LOG.debug("Built with the intent to store bridge data {}",
ovsdbBridgeAugmentationBuilder.toString());
boolean result = provider.merge(LogicalDatastoreType.CONFIGURATION,
if (isOvsdbNodeDpdk(ovsdbNode)) {
ovsdbBridgeAugmentationBuilder.setDatapathType(DatapathTypeNetdev.class);
}
- bridgeNodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class, ovsdbBridgeAugmentationBuilder.build());
+ bridgeNodeBuilder.addAugmentation(ovsdbBridgeAugmentationBuilder.build());
Node node = bridgeNodeBuilder.build();
result = provider.put(LogicalDatastoreType.CONFIGURATION, bridgeIid, node);
return true;
}
- NodeBuilder nodeBuilder = new NodeBuilder(bridgeNode);
- OvsdbBridgeAugmentationBuilder augBuilder = new OvsdbBridgeAugmentationBuilder(bridgeAug);
-
- augBuilder.setControllerEntry(newControllerEntries);
- nodeBuilder.addAugmentation(OvsdbBridgeAugmentation.class, augBuilder.build());
InstanceIdentifier<Node> bridgeIid = createInstanceIdentifier(ovsdbNode.key(), bridgeName);
- return provider.merge(LogicalDatastoreType.CONFIGURATION, bridgeIid, nodeBuilder.build());
+ return provider.merge(LogicalDatastoreType.CONFIGURATION, bridgeIid, new NodeBuilder(bridgeNode)
+ .addAugmentation(new OvsdbBridgeAugmentationBuilder(bridgeAug)
+ .setControllerEntry(newControllerEntries)
+ .build())
+ .build());
}
private static void setManagedBy(final OvsdbBridgeAugmentationBuilder ovsdbBridgeAugmentationBuilder,
tpAugmentationBuilder.setInterfaceExternalIds(externalIdsList);
}
- TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
InstanceIdentifier<TerminationPoint> tpIid = createTerminationPointInstanceIdentifier(bridgeNode, portName);
- tpBuilder.withKey(InstanceIdentifier.keyOf(tpIid));
- tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
- return provider.merge(LogicalDatastoreType.CONFIGURATION, tpIid, tpBuilder.build());
+ return provider.merge(LogicalDatastoreType.CONFIGURATION, tpIid, new TerminationPointBuilder()
+ .withKey(InstanceIdentifier.keyOf(tpIid))
+ .addAugmentation(tpAugmentationBuilder.build())
+ .build());
}
public Boolean addTerminationPoint(Node bridgeNode, String portName, String type) {
}
tpAugmentationBuilder.setOptions(optionsList);
- TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
InstanceIdentifier<TerminationPoint> tpIid = createTerminationPointInstanceIdentifier(bridgeNode, portName);
- tpBuilder.withKey(InstanceIdentifier.keyOf(tpIid));
- tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
- return provider.merge(LogicalDatastoreType.CONFIGURATION, tpIid, tpBuilder.build());
+ return provider.merge(LogicalDatastoreType.CONFIGURATION, tpIid, new TerminationPointBuilder()
+ .withKey(InstanceIdentifier.keyOf(tpIid))
+ .addAugmentation(tpAugmentationBuilder.build())
+ .build());
}
public Boolean addTerminationPoint(Node bridgeNode, String bridgeName, String portName, String type) {
if (type != null) {
tpAugmentationBuilder.setInterfaceType(OVSDB_INTERFACE_TYPE_MAP.get(type));
}
- TerminationPointBuilder tpBuilder = new TerminationPointBuilder();
- tpBuilder.withKey(InstanceIdentifier.keyOf(tpIid));
- tpBuilder.addAugmentation(OvsdbTerminationPointAugmentation.class, tpAugmentationBuilder.build());
- return provider.merge(LogicalDatastoreType.CONFIGURATION, tpIid, tpBuilder.build());
+ return provider.merge(LogicalDatastoreType.CONFIGURATION, tpIid, new TerminationPointBuilder()
+ .withKey(InstanceIdentifier.keyOf(tpIid))
+ .addAugmentation(tpAugmentationBuilder.build())
+ .build());
}
public Boolean addPatchTerminationPoint(Node node, String bridgeName, String portName, String peerPortName) {