public static Flow buildFlow(Short tableId, String flowId, Match match) {
FlowBuilder flowBuilder = new FlowBuilder();
- flowBuilder.setKey(new FlowKey(new FlowId(flowId)));
+ flowBuilder.withKey(new FlowKey(new FlowId(flowId)));
flowBuilder.setTableId(tableId);
flowBuilder.setMatch(match);
return flowBuilder.build();
String dpId = BulkOMaticUtils.DEVICE_TYPE_PREFIX + String.valueOf(dpn);
for (short tableId = startTableId; tableId <= endTableId; tableId++) {
WriteTransaction wtx = dataBroker.newWriteOnlyTransaction();
- Table table = new TableBuilder().setKey(new TableKey(tableId)).setId(tableId).build();
+ Table table = new TableBuilder().withKey(new TableKey(tableId)).setId(tableId).build();
InstanceIdentifier<Table> tableIId = BulkOMaticUtils.getTableId(tableId, dpId);
if (isAdd) {
if (rpcResult.isSuccessful()) {
for (Meter meter : meters) {
final KeyedInstanceIdentifier<Meter, MeterKey> meterIdent = nodeIdentity
- .child(Meter.class, meter.getKey());
+ .child(Meter.class, meter.key());
provider.getMeterCommiter().add(meterIdent, meter, nodeIdentity);
}
}
? flowNode.get().getTableFeatures()
: Collections.<TableFeatures>emptyList();
for (TableFeatures tableFeaturesItem : tableList) {
- TableFeaturesKey tableKey = tableFeaturesItem.getKey();
+ TableFeaturesKey tableKey = tableFeaturesItem.key();
KeyedInstanceIdentifier<TableFeatures, TableFeaturesKey> tableFeaturesII = nodeIdentity
.child(TableFeatures.class, new TableFeaturesKey(tableKey.getTableId()));
provider.getTableFeaturesCommiter().update(tableFeaturesII, tableFeaturesItem, null, nodeIdentity);
: Collections.<Meter>emptyList();
for (Meter meter : meters) {
final KeyedInstanceIdentifier<Meter, MeterKey> meterIdent = nodeIdentity.child(Meter.class,
- meter.getKey());
+ meter.key());
provider.getMeterCommiter().add(meterIdent, meter, nodeIdentity);
}
: Collections.<Table>emptyList();
for (Table table : tables) {
final KeyedInstanceIdentifier<Table, TableKey> tableIdent = nodeIdentity.child(Table.class,
- table.getKey());
+ table.key());
List<Flow> flows = table.getFlow() != null ? table.getFlow() : Collections.<Flow>emptyList();
for (Flow flow : flows) {
final KeyedInstanceIdentifier<Flow, FlowKey> flowIdent = tableIdent.child(Flow.class,
- flow.getKey());
+ flow.key());
provider.getFlowCommiter().add(flowIdent, flow, nodeIdentity);
}
}
* The group to add.
*/
private void addGroup(Map<Long, ListenableFuture<?>> map, Group group) {
- KeyedInstanceIdentifier<Group, GroupKey> groupIdent = nodeIdentity.child(Group.class, group.getKey());
+ KeyedInstanceIdentifier<Group, GroupKey> groupIdent = nodeIdentity.child(Group.class, group.key());
final Long groupId = group.getGroupId().getValue();
ListenableFuture<?> future = JdkFutureAdapters
.listenInPoolThread(provider.getGroupCommiter().add(groupIdent, group, nodeIdentity));
: Collections.<Table>emptyList();
for (Table table : tables) {
final KeyedInstanceIdentifier<Table, TableKey> tableIdent = nodeIdent.child(Table.class,
- table.getKey());
+ table.key());
List<StaleFlow> staleFlows = table.getStaleFlow() != null ? table.getStaleFlow()
: Collections.<StaleFlow>emptyList();
for (StaleFlow staleFlow : staleFlows) {
Flow toBeDeletedFlow = flowBuilder.setId(staleFlow.getId()).build();
final KeyedInstanceIdentifier<Flow, FlowKey> flowIdent = tableIdent.child(Flow.class,
- toBeDeletedFlow.getKey());
+ toBeDeletedFlow.key());
this.provider.getFlowCommiter().remove(flowIdent, toBeDeletedFlow, nodeIdent);
Group toBeDeletedGroup = groupBuilder.setGroupId(staleGroup.getGroupId()).build();
final KeyedInstanceIdentifier<Group, GroupKey> groupIdent = nodeIdent.child(Group.class,
- toBeDeletedGroup.getKey());
+ toBeDeletedGroup.key());
this.provider.getGroupCommiter().remove(groupIdent, toBeDeletedGroup, nodeIdent);
Meter toBeDeletedMeter = meterBuilder.setMeterId(staleMeter.getMeterId()).build();
final KeyedInstanceIdentifier<Meter, MeterKey> meterIdent = nodeIdent.child(Meter.class,
- toBeDeletedMeter.getKey());
+ toBeDeletedMeter.key());
this.provider.getMeterCommiter().remove(meterIdent, toBeDeletedMeter, nodeIdent);
private Node buildNode(long nodeIid) {
NodeId nodeId = new NodeId("openflow:" + nodeIid);
- Node nodeDpn = new NodeBuilder().setId(nodeId).setKey(new NodeKey(nodeId)).build();
+ Node nodeDpn = new NodeBuilder().setId(nodeId).withKey(new NodeKey(nodeId)).build();
return nodeDpn;
}
LOG.debug("Triggering reconciliation for node: {}", input.getNodeId().toString());
Node nodeDpn = buildNode(input.getNodeId().longValue());
InstanceIdentifier<FlowCapableNode> connectedNode = InstanceIdentifier.builder(Nodes.class)
- .child(Node.class, nodeDpn.getKey()).augmentation(FlowCapableNode.class).build();
+ .child(Node.class, nodeDpn.key()).augmentation(FlowCapableNode.class).build();
SettableFuture<RpcResult<ReconcileNodeOutput>> rpcResult = SettableFuture.create();
ListenableFuture<Boolean> futureResult = forwardingRulesManagerImpl
.getNodeListener().reconcileConfiguration(connectedNode);
.augmentation(FlowCapableNode.class).child(Table.class, tableKey);
InstanceIdentifier<Flow> flowII = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY)
.augmentation(FlowCapableNode.class).child(Table.class, tableKey).child(Flow.class, flowKey);
- Table table = new TableBuilder().setKey(tableKey).setFlow(Collections.<Flow>emptyList()).build();
- Flow flow = new FlowBuilder().setKey(flowKey).setTableId((short) 2).build();
+ Table table = new TableBuilder().withKey(tableKey).setFlow(Collections.<Flow>emptyList()).build();
+ Flow flow = new FlowBuilder().withKey(flowKey).setTableId((short) 2).build();
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, tableII, table);
flowKey = new FlowKey(new FlowId("test_Flow2"));
flowII = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY).augmentation(FlowCapableNode.class)
.child(Table.class, tableKey).child(Flow.class, flowKey);
- flow = new FlowBuilder().setKey(flowKey).setTableId((short) 2).build();
+ flow = new FlowBuilder().withKey(flowKey).setTableId((short) 2).build();
writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, flowII, flow);
assertCommit(writeTx.submit());
.augmentation(FlowCapableNode.class).child(Table.class, tableKey);
InstanceIdentifier<Flow> flowII = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY)
.augmentation(FlowCapableNode.class).child(Table.class, tableKey).child(Flow.class, flowKey);
- Table table = new TableBuilder().setKey(tableKey).setFlow(Collections.<Flow>emptyList()).build();
- Flow flow = new FlowBuilder().setKey(flowKey).setTableId((short) 2).build();
+ Table table = new TableBuilder().withKey(tableKey).setFlow(Collections.<Flow>emptyList()).build();
+ Flow flow = new FlowBuilder().withKey(flowKey).setTableId((short) 2).build();
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, tableII, table);
flowKey = new FlowKey(new FlowId("test_Flow"));
flowII = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY).augmentation(FlowCapableNode.class)
.child(Table.class, tableKey).child(Flow.class, flowKey);
- flow = new FlowBuilder().setKey(flowKey).setTableId((short) 2).setOutGroup((long) 5).build();
+ flow = new FlowBuilder().withKey(flowKey).setTableId((short) 2).setOutGroup((long) 5).build();
writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, flowII, flow);
assertCommit(writeTx.submit());
.augmentation(FlowCapableNode.class).child(Table.class, tableKey);
InstanceIdentifier<Flow> flowII = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY)
.augmentation(FlowCapableNode.class).child(Table.class, tableKey).child(Flow.class, flowKey);
- Table table = new TableBuilder().setKey(tableKey).setFlow(Collections.<Flow>emptyList()).build();
+ Table table = new TableBuilder().withKey(tableKey).setFlow(Collections.<Flow>emptyList()).build();
IpMatch ipMatch = new IpMatchBuilder().setIpDscp(new Dscp((short) 4)).build();
Match match = new MatchBuilder().setIpMatch(ipMatch).build();
- Flow flow = new FlowBuilder().setMatch(match).setKey(flowKey).setTableId((short) 2).build();
+ Flow flow = new FlowBuilder().setMatch(match).withKey(flowKey).setTableId((short) 2).build();
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, tableII, table);
.child(Table.class, tableKey).child(Flow.class, flowKey);
ipMatch = new IpMatchBuilder().setIpDscp(new Dscp((short) 5)).build();
match = new MatchBuilder().setIpMatch(ipMatch).build();
- flow = new FlowBuilder().setMatch(match).setKey(flowKey).setTableId((short) 2).build();
+ flow = new FlowBuilder().setMatch(match).withKey(flowKey).setTableId((short) 2).build();
writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, flowII, flow);
assertCommit(writeTx.submit());
.augmentation(FlowCapableNode.class).child(Table.class, tableKey);
InstanceIdentifier<Flow> flowII = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY)
.augmentation(FlowCapableNode.class).child(Table.class, tableKey).child(Flow.class, flowKey);
- Table table = new TableBuilder().setKey(tableKey).setFlow(Collections.<Flow>emptyList()).build();
- Flow flow = new FlowBuilder().setKey(flowKey).setTableId((short) 2).build();
+ Table table = new TableBuilder().withKey(tableKey).setFlow(Collections.<Flow>emptyList()).build();
+ Flow flow = new FlowBuilder().withKey(flowKey).setTableId((short) 2).build();
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, tableII, table);
.augmentation(FlowCapableNode.class).child(Table.class, tableKey);
InstanceIdentifier<StaleFlow> flowII = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY)
.augmentation(FlowCapableNode.class).child(Table.class, tableKey).child(StaleFlow.class, flowKey);
- Table table = new TableBuilder().setKey(tableKey).setStaleFlow(Collections.<StaleFlow>emptyList()).build();
- StaleFlow flow = new StaleFlowBuilder().setKey(flowKey).setTableId((short) 2).build();
+ Table table = new TableBuilder().withKey(tableKey).setStaleFlow(Collections.<StaleFlow>emptyList()).build();
+ StaleFlow flow = new StaleFlowBuilder().withKey(flowKey).setTableId((short) 2).build();
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, tableII, table);
GroupKey groupKey = new GroupKey(new GroupId((long) 255));
InstanceIdentifier<Group> groupII = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY)
.augmentation(FlowCapableNode.class).child(Group.class, groupKey);
- Group group = new GroupBuilder().setKey(groupKey).setGroupName("Group1").build();
+ Group group = new GroupBuilder().withKey(groupKey).setGroupName("Group1").build();
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, groupII, group);
groupKey = new GroupKey(new GroupId((long) 256));
groupII = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY)
.augmentation(FlowCapableNode.class).child(Group.class, groupKey);
- group = new GroupBuilder().setKey(groupKey).setGroupName("Group1").build();
+ group = new GroupBuilder().withKey(groupKey).setGroupName("Group1").build();
writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, groupII, group);
assertCommit(writeTx.submit());
GroupKey groupKey = new GroupKey(new GroupId((long) 255));
InstanceIdentifier<Group> groupII = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY)
.augmentation(FlowCapableNode.class).child(Group.class, groupKey);
- Group group = new GroupBuilder().setKey(groupKey).setGroupName("Group1").build();
+ Group group = new GroupBuilder().withKey(groupKey).setGroupName("Group1").build();
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, groupII, group);
assertEquals(1, addGroupCalls.size());
assertEquals("DOM-0", addGroupCalls.get(0).getTransactionUri().getValue());
- group = new GroupBuilder().setKey(groupKey).setGroupName("Group2").build();
+ group = new GroupBuilder().withKey(groupKey).setGroupName("Group2").build();
writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, groupII, group);
assertCommit(writeTx.submit());
GroupKey groupKey = new GroupKey(new GroupId((long) 255));
InstanceIdentifier<Group> groupII = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY)
.augmentation(FlowCapableNode.class).child(Group.class, groupKey);
- Group group = new GroupBuilder().setKey(groupKey).setGroupName("Group1").build();
+ Group group = new GroupBuilder().withKey(groupKey).setGroupName("Group1").build();
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, groupII, group);
StaleGroupKey groupKey = new StaleGroupKey(new GroupId((long) 255));
InstanceIdentifier<StaleGroup> groupII = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY)
.augmentation(FlowCapableNode.class).child(StaleGroup.class, groupKey);
- StaleGroup group = new StaleGroupBuilder().setKey(groupKey).setGroupName("Stale_Group1").build();
+ StaleGroup group = new StaleGroupBuilder().withKey(groupKey).setGroupName("Stale_Group1").build();
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, groupII, group);
MeterKey meterKey = new MeterKey(new MeterId((long) 2000));
InstanceIdentifier<Meter> meterII = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY)
.augmentation(FlowCapableNode.class).child(Meter.class, meterKey);
- Meter meter = new MeterBuilder().setKey(meterKey).setMeterName("meter_one").build();
+ Meter meter = new MeterBuilder().withKey(meterKey).setMeterName("meter_one").build();
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, meterII, meter);
meterKey = new MeterKey(new MeterId((long) 2001));
meterII = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY)
.augmentation(FlowCapableNode.class).child(Meter.class, meterKey);
- meter = new MeterBuilder().setKey(meterKey).setMeterName("meter_two").setBarrier(true).build();
+ meter = new MeterBuilder().withKey(meterKey).setMeterName("meter_two").setBarrier(true).build();
writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, meterII, meter);
assertCommit(writeTx.submit());
MeterKey meterKey = new MeterKey(new MeterId((long) 2000));
InstanceIdentifier<Meter> meterII = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY)
.augmentation(FlowCapableNode.class).child(Meter.class, meterKey);
- Meter meter = new MeterBuilder().setKey(meterKey).setMeterName("meter_one").setBarrier(false).build();
+ Meter meter = new MeterBuilder().withKey(meterKey).setMeterName("meter_one").setBarrier(false).build();
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, meterII, meter);
assertEquals(1, addMeterCalls.size());
assertEquals("DOM-0", addMeterCalls.get(0).getTransactionUri().getValue());
- meter = new MeterBuilder().setKey(meterKey).setMeterName("meter_two").setBarrier(true).build();
+ meter = new MeterBuilder().withKey(meterKey).setMeterName("meter_two").setBarrier(true).build();
writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, meterII, meter);
assertCommit(writeTx.submit());
MeterKey meterKey = new MeterKey(new MeterId((long) 2000));
InstanceIdentifier<Meter> meterII = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY)
.augmentation(FlowCapableNode.class).child(Meter.class, meterKey);
- Meter meter = new MeterBuilder().setKey(meterKey).setMeterName("meter_one").build();
+ Meter meter = new MeterBuilder().withKey(meterKey).setMeterName("meter_one").build();
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, meterII, meter);
StaleMeterKey meterKey = new StaleMeterKey(new MeterId((long) 2000));
InstanceIdentifier<StaleMeter> meterII = InstanceIdentifier.create(Nodes.class).child(Node.class, NODE_KEY)
.augmentation(FlowCapableNode.class).child(StaleMeter.class, meterKey);
- StaleMeter meter = new StaleMeterBuilder().setKey(meterKey).setMeterName("stale_meter_one").build();
+ StaleMeter meter = new StaleMeterBuilder().withKey(meterKey).setMeterName("stale_meter_one").build();
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, meterII, meter);
addTable(tableKey, NODE_KEY);
- TableFeatures tableFeaturesData = new TableFeaturesBuilder().setKey(tableFeaturesKey).build();
+ TableFeatures tableFeaturesData = new TableFeaturesBuilder().withKey(tableFeaturesKey).build();
InstanceIdentifier<TableFeatures> tableFeaturesII = InstanceIdentifier.create(Nodes.class)
.child(Node.class, NODE_KEY).augmentation(FlowCapableNode.class)
.child(TableFeatures.class, tableFeaturesKey);
writeTx.put(LogicalDatastoreType.CONFIGURATION, tableFeaturesII, tableFeaturesData);
assertCommit(writeTx.submit());
- tableFeaturesData = new TableFeaturesBuilder().setKey(tableFeaturesKey).setName("dummy name").build();
+ tableFeaturesData = new TableFeaturesBuilder().withKey(tableFeaturesKey).setName("dummy name").build();
writeTx = getDataBroker().newWriteOnlyTransaction();
writeTx.put(LogicalDatastoreType.CONFIGURATION, tableFeaturesII, tableFeaturesData);
assertCommit(writeTx.submit());
FlowCapableNodeBuilder fcnBuilder = new FlowCapableNodeBuilder();
NodeBuilder nodeBuilder = new NodeBuilder();
- nodeBuilder.setKey(nodeKey);
+ nodeBuilder.withKey(nodeKey);
nodeBuilder.addAugmentation(FlowCapableNode.class, fcnBuilder.build());
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
public void addTable(final TableKey tableKey, final NodeKey nodeKey) {
addFlowCapableNode(nodeKey);
- final Table table = new TableBuilder().setKey(tableKey).setFlow(Collections.<Flow>emptyList()).build();
+ final Table table = new TableBuilder().withKey(tableKey).setFlow(Collections.<Flow>emptyList()).build();
WriteTransaction writeTx = getDataBroker().newWriteOnlyTransaction();
InstanceIdentifier<Table> tableII = InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey)
.augmentation(FlowCapableNode.class).child(Table.class, tableKey);
private boolean isConsistentForReconcile(final DataTreeModification<Node> modification) {
final NodeId nodeId = PathUtil.digNodeId(modification.getRootPath().getRootIdentifier());
final FlowCapableStatisticsGatheringStatus gatheringStatus = modification.getRootNode().getDataAfter()
- .getAugmentation(FlowCapableStatisticsGatheringStatus.class);
+ .augmentation(FlowCapableStatisticsGatheringStatus.class);
if (gatheringStatus == null) {
LOG.trace("Statistics gathering never started: {}", nodeId.getValue());
final KeyedInstanceIdentifier<Table, TableKey> tableIdent = nodeIdent.child(Table.class, tableKey);
for (final Flow flow : flowSyncBox.getItemsToPush()) {
- final KeyedInstanceIdentifier<Flow, FlowKey> flowIdent = tableIdent.child(Flow.class, flow.getKey());
+ final KeyedInstanceIdentifier<Flow, FlowKey> flowIdent = tableIdent.child(Flow.class, flow.key());
LOG.trace("adding flow {} in table {} - absent on device {} match{}",
flow.getId(), tableKey, nodeId, flow.getMatch());
final Flow updatedFlow = flowUpdate.getUpdated();
final KeyedInstanceIdentifier<Flow, FlowKey> flowIdent = tableIdent.child(Flow.class,
- updatedFlow.getKey());
+ updatedFlow.key());
LOG.trace("flow {} in table {} - needs update on device {} match{}",
updatedFlow.getId(), tableKey, nodeId, updatedFlow.getMatch());
// loop flows on device and check if the are configured
for (final Flow flow : flowsPerTable.getValue().getItemsToPush()) {
final KeyedInstanceIdentifier<Flow, FlowKey> flowIdent =
- tableIdent.child(Flow.class, flow.getKey());
+ tableIdent.child(Flow.class, flow.key());
allResults.add(JdkFutureAdapters.listenInPoolThread(
flowForwarder.remove(flowIdent, flow, nodeIdent)));
flowCrudCounts.incRemoved();
LOG.trace("removing meter {} - absent in config {}",
meter.getMeterId(), nodeId);
final KeyedInstanceIdentifier<Meter, MeterKey> meterIdent =
- nodeIdent.child(Meter.class, meter.getKey());
+ nodeIdent.child(Meter.class, meter.key());
allResults.add(JdkFutureAdapters.listenInPoolThread(
meterForwarder.remove(meterIdent, meter, nodeIdent)));
meterCrudCounts.incRemoved();
final ItemSyncBox<Group> groupsPortion) {
List<ListenableFuture<RpcResult<RemoveGroupOutput>>> allResults = new ArrayList<>();
for (Group group : groupsPortion.getItemsToPush()) {
- final KeyedInstanceIdentifier<Group, GroupKey> groupIdent = nodeIdent.child(Group.class, group.getKey());
+ final KeyedInstanceIdentifier<Group, GroupKey> groupIdent = nodeIdent.child(Group.class, group.key());
allResults.add(JdkFutureAdapters.listenInPoolThread(groupForwarder.remove(groupIdent, group, nodeIdent)));
}
final List<ListenableFuture<RpcResult<UpdateGroupOutput>>> allUpdateResults = new ArrayList<>();
for (Group group : groupsPortion.getItemsToPush()) {
- final KeyedInstanceIdentifier<Group, GroupKey> groupIdent = nodeIdent.child(Group.class, group.getKey());
+ final KeyedInstanceIdentifier<Group, GroupKey> groupIdent = nodeIdent.child(Group.class, group.key());
allResults.add(JdkFutureAdapters.listenInPoolThread(groupForwarder.add(groupIdent, group, nodeIdent)));
}
final Group existingGroup = groupTuple.getOriginal();
final Group group = groupTuple.getUpdated();
- final KeyedInstanceIdentifier<Group, GroupKey> groupIdent = nodeIdent.child(Group.class, group.getKey());
+ final KeyedInstanceIdentifier<Group, GroupKey> groupIdent = nodeIdent.child(Group.class, group.key());
allUpdateResults.add(JdkFutureAdapters.listenInPoolThread(
groupForwarder.update(groupIdent, existingGroup, group, nodeIdent)));
}
final List<ListenableFuture<RpcResult<AddMeterOutput>>> allResults = new ArrayList<>();
final List<ListenableFuture<RpcResult<UpdateMeterOutput>>> allUpdateResults = new ArrayList<>();
for (Meter meter : syncBox.getItemsToPush()) {
- final KeyedInstanceIdentifier<Meter, MeterKey> meterIdent = nodeIdent.child(Meter.class, meter.getKey());
+ final KeyedInstanceIdentifier<Meter, MeterKey> meterIdent = nodeIdent.child(Meter.class, meter.key());
LOG.debug("adding meter {} - absent on device {}",
meter.getMeterId(), nodeId);
allResults.add(JdkFutureAdapters.listenInPoolThread(
for (ItemSyncBox.ItemUpdateTuple<Meter> meterTuple : syncBox.getItemsToUpdate()) {
final Meter existingMeter = meterTuple.getOriginal();
final Meter updated = meterTuple.getUpdated();
- final KeyedInstanceIdentifier<Meter, MeterKey> meterIdent = nodeIdent.child(Meter.class, updated.getKey());
+ final KeyedInstanceIdentifier<Meter, MeterKey> meterIdent = nodeIdent.child(Meter.class, updated.key());
LOG.trace("meter {} - needs update on device {}", updated.getMeterId(), nodeId);
allUpdateResults.add(JdkFutureAdapters.listenInPoolThread(
meterForwarder.update(meterIdent, existingMeter, updated, nodeIdent)));
if (dataAfter == null) {
return null;
}
- return dataAfter.getAugmentation(FlowCapableNode.class);
+ return dataAfter.augmentation(FlowCapableNode.class);
}
}
final ItemSyncBox<Flow> flowsSyncBox = resolveFlowDiffsInTable(
flowsConfigured, flowOperationalMap, gatherUpdates);
if (!flowsSyncBox.isEmpty()) {
- tableFlowSyncBoxes.put(tableConfigured.getKey(), flowsSyncBox);
+ tableFlowSyncBoxes.put(tableConfigured.key(), flowsSyncBox);
}
}
return tableFlowSyncBoxes;
Mockito.when(operationalNode.getId()).thenReturn(NODE_ID);
Mockito.when(dataTreeModification.getRootPath()).thenReturn(dataTreeIdentifier);
Mockito.when(dataTreeModification.getRootNode()).thenReturn(operationalModification);
- Mockito.when(operationalNode.getAugmentation(FlowCapableNode.class)).thenReturn(fcOperationalNode);
+ Mockito.when(operationalNode.augmentation(FlowCapableNode.class)).thenReturn(fcOperationalNode);
}
@Test
public void testOnDataTreeChangedReconcileButStaticsGatheringNotStarted() {
Mockito.when(reconciliationRegistry.isRegistered(NODE_ID)).thenReturn(true);
operationalUpdate();
- Mockito.when(operationalNode.getAugmentation(FlowCapableStatisticsGatheringStatus.class)).thenReturn(null);
+ Mockito.when(operationalNode.augmentation(FlowCapableStatisticsGatheringStatus.class)).thenReturn(null);
nodeListenerOperational.onDataTreeChanged(Collections.singleton(dataTreeModification));
public void testOnDataTreeChangedReconcileButStaticsGatheringNotFinished() {
Mockito.when(reconciliationRegistry.isRegistered(NODE_ID)).thenReturn(true);
operationalUpdate();
- Mockito.when(operationalNode.getAugmentation(FlowCapableStatisticsGatheringStatus.class))
+ Mockito.when(operationalNode.augmentation(FlowCapableStatisticsGatheringStatus.class))
.thenReturn(statisticsGatheringStatus);
Mockito.when(statisticsGatheringStatus.getSnapshotGatheringStatusEnd()).thenReturn(null);
public void testOnDataTreeChangedReconcileButStaticsGatheringNotSuccessful() {
Mockito.when(reconciliationRegistry.isRegistered(NODE_ID)).thenReturn(true);
operationalUpdate();
- Mockito.when(operationalNode.getAugmentation(FlowCapableStatisticsGatheringStatus.class))
+ Mockito.when(operationalNode.augmentation(FlowCapableStatisticsGatheringStatus.class))
.thenReturn(statisticsGatheringStatus);
Mockito.when(statisticsGatheringStatus.getSnapshotGatheringStatusEnd()).thenReturn(snapshotGatheringStatusEnd);
Mockito.when(snapshotGatheringStatusEnd.isSucceeded()).thenReturn(false);
}
private void prepareFreshOperational(final boolean afterRegistration) throws ParseException {
- Mockito.when(operationalNode.getAugmentation(FlowCapableStatisticsGatheringStatus.class))
+ Mockito.when(operationalNode.augmentation(FlowCapableStatisticsGatheringStatus.class))
.thenReturn(statisticsGatheringStatus);
Mockito.when(statisticsGatheringStatus.getSnapshotGatheringStatusEnd()).thenReturn(snapshotGatheringStatusEnd);
Mockito.when(snapshotGatheringStatusEnd.isSucceeded()).thenReturn(true);
final Node operationalNode = Mockito.mock(Node.class);
Mockito.when(operationalNode.getId()).thenReturn(NODE_ID);
- Mockito.when(operationalNode.getAugmentation(FlowCapableNode.class)).thenReturn(fcOperationalNode);
+ Mockito.when(operationalNode.augmentation(FlowCapableNode.class)).thenReturn(fcOperationalNode);
}
@Test
Assert.assertEquals(1, plan.size());
Assert.assertEquals(1, plan.get(0).getItemsToPush().size());
- Assert.assertEquals(4L, plan.get(0).getItemsToPush().iterator().next().getKey()
+ Assert.assertEquals(4L, plan.get(0).getItemsToPush().iterator().next().key()
.getGroupId().getValue().longValue());
Assert.assertEquals(0, plan.get(0).getItemsToUpdate().size());
}
Assert.assertEquals(3, plan.size());
Assert.assertEquals(1, plan.get(0).getItemsToPush().size());
- Assert.assertEquals(2L, plan.get(0).getItemsToPush().iterator().next().getKey()
+ Assert.assertEquals(2L, plan.get(0).getItemsToPush().iterator().next().key()
.getGroupId().getValue().longValue());
Assert.assertEquals(0, plan.get(0).getItemsToUpdate().size());
Assert.assertEquals(1, plan.get(1).getItemsToPush().size());
- Assert.assertEquals(4L, plan.get(1).getItemsToPush().iterator().next().getKey()
+ Assert.assertEquals(4L, plan.get(1).getItemsToPush().iterator().next().key()
.getGroupId().getValue().longValue());
Assert.assertEquals(0, plan.get(1).getItemsToUpdate().size());
Assert.assertEquals(1, plan.get(2).getItemsToPush().size());
- Assert.assertEquals(3L, plan.get(2).getItemsToPush().iterator().next().getKey()
+ Assert.assertEquals(3L, plan.get(2).getItemsToPush().iterator().next().key()
.getGroupId().getValue().longValue());
Assert.assertEquals(0, plan.get(2).getItemsToUpdate().size());
}
Preconditions.checkArgument(path != null);
final FlowTableAndStatisticsMapBuilder ftsmBuilder = new FlowTableAndStatisticsMapBuilder(flowTableStatistics);
- ftsmBuilder.setKey(new FlowTableAndStatisticsMapKey(
+ ftsmBuilder.withKey(new FlowTableAndStatisticsMapKey(
new TableId(path.firstKeyOf(Table.class, TableKey.class).getId())));
final FlowTableStatisticsUpdateBuilder builder = new FlowTableStatisticsUpdateBuilder();
final NodeConnectorBuilder ncBuilder = new NodeConnectorBuilder();
final NodeConnectorKey ncKey = path.firstKeyOf(NodeConnector.class, NodeConnectorKey.class);
ncBuilder.setId(ncKey.getId());
- ncBuilder.setKey(ncKey);
+ ncBuilder.withKey(ncKey);
final NodeConnectorStatisticsUpdateBuilder builder = new NodeConnectorStatisticsUpdateBuilder();
builder.setId(getNodeId(path));
final NodeConnectorBuilder connBuilder = new NodeConnectorBuilder();
final NodeConnectorKey key = path.firstKeyOf(NodeConnector.class, NodeConnectorKey.class);
connBuilder.setId(key.getId());
- connBuilder.setKey(key);
+ connBuilder.withKey(key);
final QueueIdAndStatisticsMapBuilder queueStatMapBuilder = new QueueIdAndStatisticsMapBuilder(
statisticsDataTreeItem.getFlowCapableNodeConnectorQueueStatistics());
ReadWriteTransaction tx = broker.newReadWriteTransaction();
Optional<ReconcileCounter> optional = readReconcileCounterFromDS(tx, instanceIdentifier, nodeId);
ReconcileCounterBuilder counterBuilder = new ReconcileCounterBuilder()
- .setKey(new ReconcileCounterKey(nodeId)).setNodeId(nodeId)
+ .withKey(new ReconcileCounterKey(nodeId)).setNodeId(nodeId)
.setLastRequestTime(LocalDateTime.now().toString());
if (reconcileState) {
counterBuilder.setSuccessCount(startCount);
for (Node node : nodes) {
String[] nodeId = node.getId().getValue().split(":");
String name = null;
- FlowCapableNode flowCapableNode = node.<FlowCapableNode>getAugmentation(FlowCapableNode.class);
+ FlowCapableNode flowCapableNode = node.<FlowCapableNode>augmentation(FlowCapableNode.class);
if (flowCapableNode != null) {
- name = node.<FlowCapableNode>getAugmentation(FlowCapableNode.class).getDescription();
+ name = node.<FlowCapableNode>augmentation(FlowCapableNode.class).getDescription();
} else {
LOG.error("Error while converting OFNode: {} to FlowCapableNode", node.getId());
return Collections.emptyList();
String name = null;
List<NodeConnector> nodeConnectors = null;
List<String> portList = new ArrayList<>();
- FlowCapableNode flowCapableNode = node.<FlowCapableNode>getAugmentation(FlowCapableNode.class);
+ FlowCapableNode flowCapableNode = node.<FlowCapableNode>augmentation(FlowCapableNode.class);
if (flowCapableNode != null) {
- name = node.<FlowCapableNode>getAugmentation(FlowCapableNode.class).getDescription();
+ name = node.<FlowCapableNode>augmentation(FlowCapableNode.class).getDescription();
} else {
LOG.error("Error while converting OFNode:{} to FlowCapableNode: {}", node.getId());
return null;
nodeConnectors = node.getNodeConnector();
for (NodeConnector nodeConnector : nodeConnectors) {
FlowCapableNodeConnector flowCapableNodeConnector =
- nodeConnector.getAugmentation(FlowCapableNodeConnector.class);
+ nodeConnector.augmentation(FlowCapableNodeConnector.class);
if (flowCapableNodeConnector == null) {
LOG.error("Error for OFNode:{} while reading nodeConnectors {}", node.getId());
return null;
flowBuilder.setFlags(new FlowModFlags(false, false, false, false, true));
flowBuilder.setId(new FlowId("12"));
flowBuilder.setTableId(TABLE_ID);
- flowBuilder.setKey(key);
+ flowBuilder.withKey(key);
flowBuilder.setFlowName(LLDP_PUNT_WHOLE_PACKET_FLOW);
return flowBuilder.build();
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setOrder(0);
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
ApplyActionsBuilder aab = new ApplyActionsBuilder();
InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
if (!isFlowTopologyExist(path)) {
transactionChainManager.writeToTransaction(LogicalDatastoreType.OPERATIONAL, path,
- new TopologyBuilder().setKey(key).build(), true);
+ new TopologyBuilder().withKey(key).build(), true);
transactionChainManager.submitTransaction();
}
}
static InstanceIdentifier<Link> linkPath(final Link link, final InstanceIdentifier<Topology> topology) {
- return topology.child(Link.class, link.getKey());
+ return topology.child(Link.class, link.key());
}
public void testOnNodeRemoved() {
NodeKey topoNodeKey = new NodeKey(new NodeId("node1"));
final InstanceIdentifier<Node> topoNodeII = topologyIID.child(Node.class, topoNodeKey);
- Node topoNode = new NodeBuilder().setKey(topoNodeKey).build();
+ Node topoNode = new NodeBuilder().withKey(topoNodeKey).build();
org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819
.nodes.NodeKey nodeKey = newInvNodeKey(topoNodeKey.getNodeId().getValue());
final Topology topology = new TopologyBuilder().setLink(linkList).build();
final InstanceIdentifier[] expDeletedIIDs = {
- topologyIID.child(Link.class, linkList.get(0).getKey()),
- topologyIID.child(Link.class, linkList.get(1).getKey()),
+ topologyIID.child(Link.class, linkList.get(0).key()),
+ topologyIID.child(Link.class, linkList.get(1).key()),
topologyIID.child(Node.class, new NodeKey(new NodeId("node1")))
};
NodeKey topoNodeKey = new NodeKey(new NodeId("node1"));
InstanceIdentifier<Node> topoNodeII = topologyIID.child(Node.class, topoNodeKey);
- Node topoNode = new NodeBuilder().setKey(topoNodeKey).build();
+ Node topoNode = new NodeBuilder().withKey(topoNodeKey).build();
org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
nodeKey = newInvNodeKey(topoNodeKey.getNodeId().getValue());
verify(mockTx).merge(eq(LogicalDatastoreType.OPERATIONAL), eq(topologyIID.child(Node.class,
new NodeKey(expNodeId))), mergedNode.capture(), eq(true));
assertEquals("getNodeId", expNodeId, mergedNode.getValue().getNodeId());
- InventoryNode augmentation = mergedNode.getValue().getAugmentation(InventoryNode.class);
+ InventoryNode augmentation = mergedNode.getValue().augmentation(InventoryNode.class);
assertNotNull("Missing augmentation", augmentation);
assertEquals("getInventoryNodeRef", new NodeRef(invNodeID), augmentation.getInventoryNodeRef());
}
TerminationPointKey terminationPointKey = new TerminationPointKey(new TpId("tp1"));
final InstanceIdentifier<Node> topoNodeII = topologyIID.child(Node.class, topoNodeKey);
- Node topoNode = new NodeBuilder().setKey(topoNodeKey).build();
+ Node topoNode = new NodeBuilder().withKey(topoNodeKey).build();
org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes
.NodeKey nodeKey = newInvNodeKey(topoNodeKey.getNodeId().getValue());
final Topology topology = new TopologyBuilder().setLink(linkList).build();
final InstanceIdentifier[] expDeletedIIDs = {
- topologyIID.child(Link.class, linkList.get(0).getKey()),
- topologyIID.child(Link.class, linkList.get(1).getKey()),
+ topologyIID.child(Link.class, linkList.get(0).key()),
+ topologyIID.child(Link.class, linkList.get(1).key()),
topologyIID.child(Node.class, new NodeKey(new NodeId("node1")))
.child(TerminationPoint.class, new TerminationPointKey(new TpId("tp1")))
};
TerminationPointKey terminationPointKey = new TerminationPointKey(new TpId("tp1"));
InstanceIdentifier<Node> topoNodeII = topologyIID.child(Node.class, topoNodeKey);
- Node topoNode = new NodeBuilder().setKey(topoNodeKey).build();
+ Node topoNode = new NodeBuilder().withKey(topoNodeKey).build();
org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey
nodeKey = newInvNodeKey(topoNodeKey.getNodeId().getValue());
verify(mockTx).merge(eq(LogicalDatastoreType.OPERATIONAL), eq(expTpPath),
mergedNode.capture(), eq(true));
assertEquals("getTpId", expTpId, mergedNode.getValue().getTpId());
- InventoryNodeConnector augmentation = mergedNode.getValue().getAugmentation(
+ InventoryNodeConnector augmentation = mergedNode.getValue().augmentation(
InventoryNodeConnector.class);
assertNotNull("Missing augmentation", augmentation);
assertEquals("getInventoryNodeConnectorRef", new NodeConnectorRef(invNodeConnID),
any(TerminationPoint.class), eq(true));
assertDeletedIDs(new InstanceIdentifier[]{topologyIID.child(Link.class,
- linkList.get(0).getKey())}, deletedLinkIDs);
+ linkList.get(0).key())}, deletedLinkIDs);
}
@SuppressWarnings("rawtypes")
any(TerminationPoint.class), eq(true));
assertDeletedIDs(new InstanceIdentifier[]{topologyIID.child(Link.class,
- linkList.get(0).getKey())}, deletedLinkIDs);
+ linkList.get(0).key())}, deletedLinkIDs);
}
}
for (Class<? extends Augmentation<?>> cls : classes) {
Augmentation<T> potential = guessData
- .getAugmentation((Class<Augmentation<T>>) cls);
+ .augmentation((Class<Augmentation<T>>) cls);
if (potential != null) {
return Optional.of((G) potential);
}
@SuppressWarnings("unchecked")
public Optional<G> getExtension(T data) {
for (Class<? extends Augmentation<T>> cls : classes) {
- Augmentation<T> potential = data.getAugmentation(cls);
+ Augmentation<T> potential = data.augmentation(cls);
if (potential != null) {
return Optional.of((G) potential);
}
nxAugMatchRpcAddFlowBuilder.setNxmOfArpOp(nxmOfArpOpBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
- when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
final MatchEntry converted = arpOpConvertor.convert(extension);
.setNxmNxArpSha(nxmNxArpShaBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
- when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
arpShaConvertor = new ArpShaConvertor();
nxAugMatchRpcAddFlowBuilder.setNxmOfArpSpa(nxmOfArpSpaBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
- when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
final MatchEntry converted = arpSpaConvertor.convert(extension);
.setNxmNxArpTha(nxArpThaBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
- when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
arpThaConvertor = new ArpThaConvertor();
nxAugMatchRpcAddFlowBuilder.setNxmOfArpTpa(nxmOfArpTpaBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchRpcAddFlowBuilder.build();
- when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
arpTpaConvertor = new ArpTpaConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxCtState(nxmNxCtStateBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
ctStateConvertor = new CtStateConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxCtZone(nxmNxCtZoneBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
ctZoneConvertor = new CtZoneConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfEthDst(nxmOfEthDstBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
ethDstConvertor = new EthDstConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfEthSrc(nxmOfEthSrcBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
ethSrcConvertor = new EthSrcConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfEthType(nxmOfEthTypeBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
ethTypeConvertor = new EthTypeConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxNshc1(nxmNxNshc1Builder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
nshc1Convertor = new Nshc1Convertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxNshc2(nxmNxNshc2Builder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
nshc2Convertor = new Nshc2Convertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxNshc3(nxmNxNshc3Builder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
nshc3Convertor = new Nshc3Convertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxNshc4(nxmNxNshc4Builder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
nshc4Convertor = new Nshc4Convertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxNsi(nxmNxNsiBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
nsiConvertor = new NsiConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxNsp(nxmNxNspBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
nspConvertor = new NspConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfTcpDst(nxmOfTcpDstBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
tcpDstConvertor = new TcpDstConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfTcpSrc(nxmOfTcpSrcBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
tcpSrcConvertor = new TcpSrcConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxTunIpv4Dst(nxmNxTunIpv4DstBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
tunIPv4DstConvertor = new TunIPv4DstConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxTunIpv4Src(nxmNxTunIpv4SrcBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
tunIPv4DstConvertor = new TunIPv4SrcConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmNxTunId(nxmNxTunIdBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
tunIdConvertor = new TunIdConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfUdpDst(nxmOfUdpDstBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
udpDstConvertor = new UdpDstConvertor();
nxAugMatchNotifUpdateFlowStatsBuilder.setNxmOfUdpSrc(nxmOfUdpSrcBuilder.build());
final Augmentation<Extension> extensionAugmentation = nxAugMatchNotifUpdateFlowStatsBuilder.build();
- when(extension.getAugmentation(Matchers.<Class<Augmentation<Extension>>>any()))
+ when(extension.augmentation(Matchers.<Class<Augmentation<Extension>>>any()))
.thenReturn(extensionAugmentation);
udpSrcConvertor = new UdpSrcConvertor();
Assert.assertEquals("Wrong type", EncodeConstants.EXPERIMENTER_VALUE, builtByFactory.getType().intValue());
Assert.assertEquals("Wrong type string", "EXPERIMENTER", builtByFactory.getTypeString());
Assert.assertEquals("Wrong experimenter ID", EncodeConstants.ONF_EXPERIMENTER_ID,
- builtByFactory.getAugmentation(ExperimenterIdError.class).getExperimenter().getValue().intValue());
+ builtByFactory.augmentation(ExperimenterIdError.class).getExperimenter().getValue().intValue());
Assert.assertNotNull("Data is null", builtByFactory.getData());
}
// Wrap our Apply Action in an Instruction
InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setOrder(0);
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
isb.setInstruction(instructions);
return isb;
}
DecNwTtl decNwTtl = ta.build();
ActionBuilder ab = new ActionBuilder();
ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(decNwTtl).build());
- ab.setKey(new ActionKey(actionKeyVal));
+ ab.withKey(new ActionKey(actionKeyVal));
return ab;
}
// base part
ActionBuilder abExt = new ActionBuilder();
- abExt.setKey(new ActionKey(actionKeyVal));
+ abExt.withKey(new ActionKey(actionKeyVal));
abExt.setAction(topNxActionCaseBld.build());
return abExt;
}
MeterBandExperimenterCase experimenterBandCase = (MeterBandExperimenterCase) meterBand;
MeterBandExperimenter experimenterBand = experimenterBandCase.getMeterBandExperimenter();
ExperimenterIdMeterBand expIdMeterBand =
- experimenterBand.getAugmentation(ExperimenterIdMeterBand.class);
+ experimenterBand.augmentation(ExperimenterIdMeterBand.class);
if (expIdMeterBand != null) {
long expId = expIdMeterBand.getExperimenter().getValue();
Class<? extends ExperimenterMeterBandSubType> meterBandSubType = expIdMeterBand.getSubType();
}
private void writeExperimenterRelatedTableProperty(final ByteBuf output, final TableFeatureProperties property) {
- long expId = property.getAugmentation(ExperimenterIdTableFeatureProperty.class).getExperimenter().getValue();
+ long expId = property.augmentation(ExperimenterIdTableFeatureProperty.class).getExperimenter().getValue();
OFSerializer<TableFeatureProperties> serializer = registry.getSerializer(ExperimenterSerializerKeyFactory
.createMultipartRequestTFSerializerKey(EncodeConstants.OF13_VERSION_ID, expId));
serializer.serialize(property, output);
output.writeShort(code);
int lengthIndex = output.writerIndex();
output.writeShort(EncodeConstants.EMPTY_LENGTH);
- List<MatchEntry> entries = property.getAugmentation(OxmRelatedTableFeatureProperty.class).getMatchEntry();
+ List<MatchEntry> entries = property.augmentation(OxmRelatedTableFeatureProperty.class).getMatchEntry();
if (entries != null) {
TypeKeyMaker<MatchEntry> keyMaker = TypeKeyMakerFactory
.createMatchEntriesKeyMaker(EncodeConstants.OF13_VERSION_ID);
output.writeShort(code);
int lengthIndex = output.writerIndex();
output.writeShort(EncodeConstants.EMPTY_LENGTH);
- List<Action> actions = property.getAugmentation(ActionRelatedTableFeatureProperty.class).getAction();
+ List<Action> actions = property.augmentation(ActionRelatedTableFeatureProperty.class).getAction();
if (actions != null) {
TypeKeyMaker<Action> keyMaker = TypeKeyMakerFactory.createActionKeyMaker(EncodeConstants.OF13_VERSION_ID);
ListSerializer.serializeHeaderList(actions, keyMaker, registry, output);
output.writeShort(code);
int lengthIndex = output.writerIndex();
output.writeShort(EncodeConstants.EMPTY_LENGTH);
- List<NextTableIds> nextTableIds = property.getAugmentation(NextTableRelatedTableFeatureProperty.class)
+ List<NextTableIds> nextTableIds = property.augmentation(NextTableRelatedTableFeatureProperty.class)
.getNextTableIds();
if (nextTableIds != null) {
for (NextTableIds next : nextTableIds) {
output.writeShort(code);
int lengthIndex = output.writerIndex();
output.writeShort(EncodeConstants.EMPTY_LENGTH);
- List<Instruction> instructions = property.getAugmentation(InstructionRelatedTableFeatureProperty.class)
+ List<Instruction> instructions = property.augmentation(InstructionRelatedTableFeatureProperty.class)
.getInstruction();
if (instructions != null) {
TypeKeyMaker<Instruction> keyMaker = TypeKeyMakerFactory
output.writeShort(code);
int lengthIndex = output.writerIndex();
output.writeShort(EncodeConstants.EMPTY_LENGTH);
- List<Instruction> instructions = property.getAugmentation(
+ List<Instruction> instructions = property.augmentation(
InstructionRelatedTableFeatureProperty.class).getInstruction();
if (instructions != null) {
TypeKeyMaker<Instruction> keyMaker = TypeKeyMakerFactory
output.writeShort(code);
int lengthIndex = output.writerIndex();
output.writeShort(EncodeConstants.EMPTY_LENGTH);
- List<NextTableIds> nextTableIds = property.getAugmentation(
+ List<NextTableIds> nextTableIds = property.augmentation(
NextTableRelatedTableFeatureProperty.class).getNextTableIds();
if (nextTableIds != null) {
for (NextTableIds next : nextTableIds) {
output.writeShort(code);
int lengthIndex = output.writerIndex();
output.writeShort(EncodeConstants.EMPTY_LENGTH);
- List<Action> actions = property.getAugmentation(ActionRelatedTableFeatureProperty.class).getAction();
+ List<Action> actions = property.augmentation(ActionRelatedTableFeatureProperty.class).getAction();
if (actions != null) {
TypeKeyMaker<Action> keyMaker = TypeKeyMakerFactory
.createActionKeyMaker(EncodeConstants.OF13_VERSION_ID);
output.writeShort(code);
int lengthIndex = output.writerIndex();
output.writeShort(EncodeConstants.EMPTY_LENGTH);
- List<MatchEntry> entries = property.getAugmentation(OxmRelatedTableFeatureProperty.class).getMatchEntry();
+ List<MatchEntry> entries = property.augmentation(OxmRelatedTableFeatureProperty.class).getMatchEntry();
if (entries != null) {
TypeKeyMaker<MatchEntry> keyMaker = TypeKeyMakerFactory
.createMatchEntriesKeyMaker(EncodeConstants.OF13_VERSION_ID);
private void writeExperimenterRelatedTableProperty(final ByteBuf output,
final TableFeatureProperties property) {
- long expId = property.getAugmentation(ExperimenterIdTableFeatureProperty.class).getExperimenter().getValue();
+ long expId = property.augmentation(ExperimenterIdTableFeatureProperty.class).getExperimenter().getValue();
OFSerializer<TableFeatureProperties> serializer = registry.getSerializer(
ExperimenterSerializerKeyFactory.createMultipartRequestTFSerializerKey(
EncodeConstants.OF13_VERSION_ID, expId));
queuePropertyBuff.writeShort(EncodeConstants.EMPTY_LENGTH);
queuePropertyBuff.writeZero(4);
if (queueProperty.getProperty() == QueueProperties.OFPQTMINRATE) {
- RateQueueProperty body = queueProperty.getAugmentation(RateQueueProperty.class);
+ RateQueueProperty body = queueProperty.augmentation(RateQueueProperty.class);
queuePropertyBuff.writeShort(body.getRate().intValue());
queuePropertyBuff.writeZero(QUEUE_PROPERTY_PADDING);
}
switch (property.getProperty()) {
case OFPQTMINRATE:
case OFPQTMAXRATE:
- serializeRateBody(property.getAugmentation(RateQueueProperty.class), propertyBuff);
+ serializeRateBody(property.augmentation(RateQueueProperty.class), propertyBuff);
break;
case OFPQTEXPERIMENTER:
- serializeExperimenterBody(property.getAugmentation(ExperimenterIdQueueProperty.class),
+ serializeExperimenterBody(property.augmentation(ExperimenterIdQueueProperty.class),
propertyBuff);
break;
default:
public void serialize(MatchEntry entry, ByteBuf outBuffer) {
super.serialize(entry, outBuffer);
ExperimenterIdCase expCase = serializeExperimenterId(entry, outBuffer);
- TcpFlags tcpFlags = expCase.getAugmentation(TcpFlagsContainer.class).getTcpFlags();
+ TcpFlags tcpFlags = expCase.augmentation(TcpFlagsContainer.class).getTcpFlags();
outBuffer.writeShort(tcpFlags.getFlags());
if (entry.isHasMask()) {
outBuffer.writeBytes(tcpFlags.getMask());
queue2.getQueueProperty().get(0).getProperty());
Assert.assertEquals("Wrong queue - wrong property", QueueProperties.OFPQTMINRATE,
queue2.getQueueProperty().get(1).getProperty());
- RateQueueProperty rate1 = queue2.getQueueProperty().get(0).getAugmentation(RateQueueProperty.class);
- RateQueueProperty rate2 = queue2.getQueueProperty().get(1).getAugmentation(RateQueueProperty.class);
+ RateQueueProperty rate1 = queue2.getQueueProperty().get(0).augmentation(RateQueueProperty.class);
+ RateQueueProperty rate2 = queue2.getQueueProperty().get(1).augmentation(RateQueueProperty.class);
Assert.assertEquals("Wrong queue - wrong property rate", 32, rate1.getRate().intValue());
Assert.assertEquals("Wrong queue - wrong property rate", 48, rate2.getRate().intValue());
}
TableFeatureProperties property = feature.getTableFeatureProperties().get(2);
Assert.assertEquals("Wrong property type", TableFeaturesPropType.OFPTFPTNEXTTABLES,
property.getType());
- List<NextTableIds> tableIds = property.getAugmentation(NextTableRelatedTableFeatureProperty.class)
+ List<NextTableIds> tableIds = property.augmentation(NextTableRelatedTableFeatureProperty.class)
.getNextTableIds();
Assert.assertEquals("Wrong next table id size", 4, tableIds.size());
Assert.assertEquals("Wrong next table id", 1, tableIds.get(0).getTableId().intValue());
property = feature.getTableFeatureProperties().get(3);
Assert.assertEquals("Wrong property type", TableFeaturesPropType.OFPTFPTNEXTTABLESMISS,
property.getType());
- tableIds = property.getAugmentation(NextTableRelatedTableFeatureProperty.class)
+ tableIds = property.augmentation(NextTableRelatedTableFeatureProperty.class)
.getNextTableIds();
Assert.assertEquals("Wrong next table id size", 3, tableIds.size());
Assert.assertEquals("Wrong next table id", 5, tableIds.get(0).getTableId().intValue());
serializedBuffer.readShort());
Assert.assertEquals("Wrong property length", 16, serializedBuffer.readShort());
serializedBuffer.skipBytes(4);
- RateQueueProperty rateQueueProperty = properties.get(0).getAugmentation(RateQueueProperty.class);
+ RateQueueProperty rateQueueProperty = properties.get(0).augmentation(RateQueueProperty.class);
Assert.assertEquals("Wrong rate", rateQueueProperty.getRate().intValue(), serializedBuffer.readShort());
serializedBuffer.skipBytes(6);
}
serializedBuffer.readShort());
Assert.assertEquals("Wrong property length", 16, serializedBuffer.readShort());
serializedBuffer.skipBytes(PROPERTY_HEADER_PADDING);
- RateQueueProperty rateQueueProperty = properties.get(0).getAugmentation(RateQueueProperty.class);
+ RateQueueProperty rateQueueProperty = properties.get(0).augmentation(RateQueueProperty.class);
Assert.assertEquals("Wrong rate", rateQueueProperty.getRate().intValue(), serializedBuffer.readShort());
serializedBuffer.skipBytes(PROPERTY_RATE_PADDING);
serializedBuffer.readShort());
Assert.assertEquals("Wrong property length", 16, serializedBuffer.readShort());
serializedBuffer.skipBytes(PROPERTY_HEADER_PADDING);
- RateQueueProperty rateQueuePropertyTwo = propertiesTwo.get(0).getAugmentation(RateQueueProperty.class);
+ RateQueueProperty rateQueuePropertyTwo = propertiesTwo.get(0).augmentation(RateQueueProperty.class);
Assert.assertEquals("Wrong rate", rateQueuePropertyTwo.getRate().intValue(), serializedBuffer.readShort());
serializedBuffer.skipBytes(PROPERTY_RATE_PADDING);
}
statsBuilder.setDuration(durationBuilder.build());
statsBuilder.setCollisionCount(portStats.getCollisions());
- statsBuilder.setKey(new NodeConnectorStatisticsAndPortNumberMapKey(statsBuilder.getNodeConnectorId()));
+ statsBuilder.withKey(new NodeConnectorStatisticsAndPortNumberMapKey(statsBuilder.getNodeConnectorId()));
statsBuilder.setReceiveCrcError(portStats.getRxCrcErr());
statsBuilder.setReceiveDrops(portStats.getRxDropped());
statsBuilder.setReceiveErrors(portStats.getRxErrors());
@Override
public <E extends Augmentation<org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang
- .openflow.provider.config.rev160510.OpenflowProviderConfig>> E getAugmentation(
+ .openflow.provider.config.rev160510.OpenflowProviderConfig>> E augmentation(
java.lang.Class<E> augmentationType) {
return null;
}
.child(Flow.class, key),
flow
.setId(key.getId())
- .setKey(key)
+ .withKey(key)
.build(),
withParents);
}
.augmentation(FlowCapableNode.class)
.child(Group.class, new GroupKey(stat.getGroupId())),
new GroupBuilder(stat)
- .setKey(new GroupKey(stat.getGroupId()))
+ .withKey(new GroupKey(stat.getGroupId()))
.addAugmentation(NodeGroupStatistics.class, new NodeGroupStatisticsBuilder().build())
.build(),
withParents);
.augmentation(FlowCapableNode.class)
.child(Meter.class, new MeterKey(stat.getMeterId())),
new MeterBuilder(stat)
- .setKey(new MeterKey(stat.getMeterId()))
+ .withKey(new MeterKey(stat.getMeterId()))
.addAugmentation(NodeMeterStatistics.class, new NodeMeterStatisticsBuilder().build())
.build(),
withParents);
.augmentation(FlowCapableNodeConnector.class)
.child(Queue.class, new QueueKey(stat.getQueueId())),
new QueueBuilder()
- .setKey(new QueueKey(stat.getQueueId()))
+ .withKey(new QueueKey(stat.getQueueId()))
.setQueueId(stat.getQueueId())
.addAugmentation(
FlowCapableNodeConnectorQueueStatisticsData.class,
OpenflowVersion.get(deviceInfo.getVersion()))));
writeToTransaction(LogicalDatastoreType.OPERATIONAL, iiToNodeConnector, new NodeConnectorBuilder()
- .setKey(iiToNodeConnector.getKey())
+ .withKey(iiToNodeConnector.getKey())
.addAugmentation(FlowCapableNodeConnectorStatisticsData.class, new
FlowCapableNodeConnectorStatisticsDataBuilder().build())
.addAugmentation(FlowCapableNodeConnector.class, flowCapableNodeConnector)
while ((message.readerIndex() - startIndex) < instrLength) {
actions.add(new ActionBuilder()
- .setKey(new ActionKey(offset))
+ .withKey(new ActionKey(offset))
.setOrder(offset)
.setAction(ActionUtil
.readAction(EncodeConstants.OF13_VERSION_ID, message, registry, actionPath))
}
instructions.add(new InstructionBuilder()
- .setKey(new InstructionKey(offset))
+ .withKey(new InstructionKey(offset))
.setOrder(offset)
.setInstruction(deserializer.deserialize(message))
.build());
while (message.readerIndex() - startIndex < bucketLength) {
actions.add(new ActionBuilder()
- .setKey(new ActionKey(offset))
+ .withKey(new ActionKey(offset))
.setOrder(offset)
.setAction(ActionUtil.readAction(EncodeConstants.OF13_VERSION_ID, message, registry,
ActionPath.GROUP_DESC_STATS_UPDATED_BUCKET_ACTION))
while (itemMessage.readerIndex() - startIndex < length) {
instructions.add(new InstructionBuilder()
- .setKey(new InstructionKey(offset))
+ .withKey(new InstructionKey(offset))
.setOrder(offset)
.setInstruction(InstructionUtil
.readInstruction(EncodeConstants.OF13_VERSION_ID, itemMessage, registry))
message.skipBytes(PADDING_IN_TABLE_HEADER);
itemBuilder
- .setKey(new FlowTableAndStatisticsMapKey(itemBuilder.getTableId()))
+ .withKey(new FlowTableAndStatisticsMapKey(itemBuilder.getTableId()))
.setActiveFlows(new Counter32(message.readUnsignedInt()));
final byte[] packetsLooked = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
message.skipBytes(PADDING_IN_GROUP_DESC_HEADER);
itemBuilder.setGroupId(new GroupId(message.readUnsignedInt()));
- itemBuilder.setKey(new GroupDescStatsKey(itemBuilder.getGroupId()));
+ itemBuilder.withKey(new GroupDescStatsKey(itemBuilder.getGroupId()));
final List<Bucket> subItems = new ArrayList<>();
int actualLength = GROUP_DESC_HEADER_LENGTH;
final BucketBuilder bucketBuilder = new BucketBuilder()
.setBucketId(new BucketId(bucketKey))
- .setKey(new BucketKey(new BucketId(bucketKey)))
+ .withKey(new BucketKey(new BucketId(bucketKey)))
.setWeight(message.readUnsignedShort())
.setWatchPort(message.readUnsignedInt())
.setWatchGroup(message.readUnsignedInt());
while (message.readerIndex() - startIndex < bucketLength) {
actions.add(new ActionBuilder()
- .setKey(new ActionKey(offset))
+ .withKey(new ActionKey(offset))
.setOrder(offset)
.setAction(ActionUtil.readAction(EncodeConstants.OF13_VERSION_ID, message, registry,
ActionPath.GROUP_DESC_STATS_UPDATED_BUCKET_ACTION))
message.readBytes(byteCountg);
itemBuilder
- .setKey(new GroupStatsKey(itemBuilder.getGroupId()))
+ .withKey(new GroupStatsKey(itemBuilder.getGroupId()))
.setPacketCount(new Counter64(new BigInteger(1, packetCountg)))
.setByteCount(new Counter64(new BigInteger(1, byteCountg)))
.setDuration(new DurationBuilder()
subItems.add(new BucketCounterBuilder()
.setBucketId(new BucketId(bucketKey))
- .setKey(new BucketCounterKey(new BucketId(bucketKey)))
+ .withKey(new BucketCounterKey(new BucketId(bucketKey)))
.setPacketCount(new Counter64(new BigInteger(1, packetCount)))
.setByteCount(new Counter64(new BigInteger(1, byteCount)))
.build());
}
items.add(itemBuilder
- .setKey(new MeterConfigStatsKey(itemBuilder.getMeterId()))
+ .withKey(new MeterConfigStatsKey(itemBuilder.getMeterId()))
.setMeterBandHeaders(new MeterBandHeadersBuilder()
.setMeterBandHeader(subItems)
.build())
message.skipBytes(PADDING_IN_METER_STATS_HEADER);
itemBuilder
- .setKey(new MeterStatsKey(itemBuilder.getMeterId()))
+ .withKey(new MeterStatsKey(itemBuilder.getMeterId()))
.setFlowCount(new Counter32(message.readUnsignedInt()));
final byte[] packetCount = new byte[EncodeConstants.SIZE_OF_LONG_IN_BYTES];
subItems.add(new BandStatBuilder()
.setBandId(new BandId(bandKey))
- .setKey(new BandStatKey(new BandId(bandKey)))
+ .withKey(new BandStatKey(new BandId(bandKey)))
.setPacketBandCount(new Counter64(new BigInteger(1, packetCountB)))
.setByteBandCount(new Counter64(new BigInteger(1, byteCountB)))
.build());
message.readBytes(collisionCount);
items.add(itemBuilder
- .setKey(new NodeConnectorStatisticsAndPortNumberMapKey(itemBuilder.getNodeConnectorId()))
+ .withKey(new NodeConnectorStatisticsAndPortNumberMapKey(itemBuilder.getNodeConnectorId()))
.setPackets(new PacketsBuilder()
.setReceived(new BigInteger(1, recPack))
.setTransmitted(new BigInteger(1, txPack))
message.readBytes(txErrors);
items.add(new QueueIdAndStatisticsMapBuilder()
- .setKey(new QueueIdAndStatisticsMapKey(nodeConnectorId, queueId))
+ .withKey(new QueueIdAndStatisticsMapKey(nodeConnectorId, queueId))
.setNodeConnectorId(nodeConnectorId)
.setQueueId(queueId)
.setTransmittedBytes(new Counter64(new BigInteger(1, txBytes)))
message.readBytes(write);
items.add(itemBuilder
- .setKey(new TableFeaturesKey(itemBuilder.getTableId()))
+ .withKey(new TableFeaturesKey(itemBuilder.getTableId()))
.setName(name)
.setMetadataMatch(new BigInteger(1, match))
.setMetadataWrite(new BigInteger(1, write))
final int commonPropertyLength = propertyLength - COMMON_PROPERTY_LENGTH;
final TableFeaturePropertiesBuilder propBuilder = new TableFeaturePropertiesBuilder()
.setOrder(order)
- .setKey(new TableFeaturePropertiesKey(order));
+ .withKey(new TableFeaturePropertiesKey(order));
switch (propType) {
case OFPTFPTINSTRUCTIONS:
while (message.readerIndex() - startIndex < length) {
try {
instructions.add(new InstructionBuilder()
- .setKey(new InstructionKey(offset))
+ .withKey(new InstructionKey(offset))
.setOrder(offset)
.setInstruction(InstructionUtil
.readInstructionHeader(EncodeConstants.OF13_VERSION_ID, message, registry))
while (message.readerIndex() - startIndex < length) {
try {
actions.add(new ActionBuilder()
- .setKey(new ActionKey(offset))
+ .withKey(new ActionKey(offset))
.setOrder(offset)
.setAction(ActionUtil.readActionHeader(EncodeConstants.OF13_VERSION_ID, message, registry,
ActionPath.FLOWS_STATISTICS_UPDATE_APPLY_ACTIONS))
return Optional
.ofNullable(codeToFieldMap.get(key))
.map(clazz -> processHeader(message)
- .setKey(new SetFieldMatchKey(clazz))
+ .withKey(new SetFieldMatchKey(clazz))
.setMatchType(clazz)
.build());
}
.setTag(PUSH_VLAN)
.build())
.build())
- .setKey(action.getKey())
+ .withKey(action.key())
.setOrder(action.getOrder() + offset[0])
.build());
}
private FlowRegistryKey getExistingKey(final FlowRegistryKey flowRegistryKey) {
- if (flowRegistryKey.getMatch().getAugmentation(GeneralAugMatchNodesNodeTableFlow.class) == null) {
+ if (flowRegistryKey.getMatch().augmentation(GeneralAugMatchNodesNodeTableFlow.class) == null) {
if (flowRegistry.containsKey(flowRegistryKey)) {
return flowRegistryKey;
}
}
private boolean equalMatch(final Match input) {
- GeneralAugMatchNodesNodeTableFlow thisAug = match.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class);
- GeneralAugMatchNodesNodeTableFlow inputAug = input.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class);
+ GeneralAugMatchNodesNodeTableFlow thisAug = match.augmentation(GeneralAugMatchNodesNodeTableFlow.class);
+ GeneralAugMatchNodesNodeTableFlow inputAug = input.augmentation(GeneralAugMatchNodesNodeTableFlow.class);
if (thisAug != inputAug) {
if (thisAug != null) {
if (inputAug == null) {
for (final Table tableData : flowCapNodeOpt.get().getTable()) {
final Table table = new TableBuilder(tableData).setFlow(Collections.emptyList()).build();
final InstanceIdentifier<Table> iiToTable = instanceIdentifier
- .child(Table.class, tableData.getKey());
+ .child(Table.class, tableData.key());
txFacade.writeToTransaction(LogicalDatastoreType.OPERATIONAL, iiToTable, table);
}
}
}
statsBuilder.setDuration(durationBuilder.build());
statsBuilder.setCollisionCount(portStats.getCollisions());
- statsBuilder.setKey(new NodeConnectorStatisticsAndPortNumberMapKey(statsBuilder.getNodeConnectorId()));
+ statsBuilder.withKey(new NodeConnectorStatisticsAndPortNumberMapKey(statsBuilder.getNodeConnectorId()));
statsBuilder.setReceiveCrcError(portStats.getRxCrcErr());
statsBuilder.setReceiveDrops(portStats.getRxDropped());
statsBuilder.setReceiveErrors(portStats.getRxErrors());
for (final FlowAndStatisticsMapList part : flowAndStatisticsMapLists) {
final FlowId flowId = new FlowId(generateFlowId(part).getValue());
statsList.add(new FlowAndStatisticsMapListBuilder(part)
- .setKey(new FlowAndStatisticsMapListKey(flowId))
+ .withKey(new FlowAndStatisticsMapListKey(flowId))
.setFlowId(flowId)
.build());
}
.setNodeConnectorId(nodeConnectorId)
.setDuration(durationBuilder.build())
.setCollisionCount(portStats.getCollisions())
- .setKey(new NodeConnectorStatisticsAndPortNumberMapKey(nodeConnectorId))
+ .withKey(new NodeConnectorStatisticsAndPortNumberMapKey(nodeConnectorId))
.setReceiveCrcError(portStats.getRxCrcErr()).setReceiveDrops(portStats.getRxDropped())
.setReceiveErrors(portStats.getRxErrors())
.setReceiveFrameError(portStats.getRxFrameErr())
getDatapathId(), queueStats.getPortNo(), getOfVersion());
final QueueIdAndStatisticsMapBuilder statsBuilder = new QueueIdAndStatisticsMapBuilder()
- .setKey(new QueueIdAndStatisticsMapKey(nodeConnectorId, queueId))
+ .withKey(new QueueIdAndStatisticsMapKey(nodeConnectorId, queueId))
.setNodeConnectorId(nodeConnectorId)
.setTransmissionErrors(new Counter64(queueStats.getTxErrors()))
.setTransmittedBytes(new Counter64(queueStats.getTxBytes()))
.map(flowAndStatisticsMapList -> {
final FlowId flowId = new FlowId(generateFlowId(flowAndStatisticsMapList));
return new FlowAndStatisticsMapListBuilder(flowAndStatisticsMapList)
- .setKey(new FlowAndStatisticsMapListKey(flowId))
+ .withKey(new FlowAndStatisticsMapListKey(flowId))
.setFlowId(flowId)
.build();
})
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ARP_OP);
Optional<SetFieldMatch> fieldMatch = deserializer.deserialize(buffer);
- assertEquals(ArpOp.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(ArpOp.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ARP_SHA);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(ArpSha.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(ArpSha.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ARP_SPA);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(ArpSpa.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(ArpSpa.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ARP_THA);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(ArpTha.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(ArpTha.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ARP_TPA);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(ArpTpa.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(ArpTpa.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ETH_DST);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(EthDst.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(EthDst.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ETH_SRC);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(EthSrc.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(EthSrc.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ICMPV4_CODE);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(Icmpv4Code.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(Icmpv4Code.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ICMPV4_TYPE);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(Icmpv4Type.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(Icmpv4Type.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ICMPV6_CODE);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(Icmpv6Code.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(Icmpv6Code.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.ICMPV6_TYPE);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(Icmpv6Type.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(Icmpv6Type.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IN_PHY_PORT);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(InPhyPort.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(InPhyPort.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IN_PORT);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(InPort.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(InPort.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IP_DSCP);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(IpDscp.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(IpDscp.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IP_ECN);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(IpEcn.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(IpEcn.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IP_PROTO);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(IpProto.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(IpProto.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV4_SRC);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(Ipv4Src.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(Ipv4Src.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV4_DST);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(Ipv4Dst.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(Ipv4Dst.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_SRC);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(Ipv6Src.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(Ipv6Src.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_DST);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(Ipv6Dst.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(Ipv6Dst.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_EXTHDR);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(Ipv6Exthdr.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(Ipv6Exthdr.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_FLABEL);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(Ipv6Flabel.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(Ipv6Flabel.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_ND_SLL);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(Ipv6NdSll.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(Ipv6NdSll.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_ND_TLL);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(Ipv6NdTll.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(Ipv6NdTll.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.IPV6_ND_TARGET);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(Ipv6NdTarget.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(Ipv6NdTarget.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.METADATA);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(Metadata.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(Metadata.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.MPLS_BOS);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(MplsBos.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(MplsBos.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.MPLS_LABEL);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(MplsLabel.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(MplsLabel.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.MPLS_TC);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(MplsTc.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(MplsTc.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.PBB_ISID);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(PbbIsid.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(PbbIsid.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.SCTP_SRC);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(SctpSrc.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(SctpSrc.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.SCTP_DST);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(SctpDst.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(SctpDst.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.TCP_SRC);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(TcpSrc.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(TcpSrc.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.TCP_DST);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(TcpDst.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(TcpDst.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.TUNNEL_ID);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(TunnelId.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(TunnelId.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.UDP_SRC);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(UdpSrc.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(UdpSrc.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.UDP_DST);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(UdpDst.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(UdpDst.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.VLAN_PCP);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(VlanPcp.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(VlanPcp.class, fieldMatch.get().key().getMatchType());
addValues(buffer, OxmMatchConstants.OPENFLOW_BASIC_CLASS, OxmMatchConstants.VLAN_VID);
fieldMatch = deserializer.deserialize(buffer);
- assertEquals(VlanVid.class, fieldMatch.get().getKey().getMatchType());
+ assertEquals(VlanVid.class, fieldMatch.get().key().getMatchType());
assertEquals(0, buffer.readableBytes());
}
.setApplyActions(new ApplyActionsBuilder()
.setAction(Collections.singletonList(new ActionBuilder()
.setOrder(order)
- .setKey(new ActionKey(order))
+ .withKey(new ActionKey(order))
.setAction(new SetNwSrcActionCaseBuilder()
.setSetNwSrcAction(new SetNwSrcActionBuilder()
.setAddress(new Ipv4Builder()
.setWriteActions(new WriteActionsBuilder()
.setAction(Collections.singletonList(new ActionBuilder()
.setOrder(order)
- .setKey(new ActionKey(order))
+ .withKey(new ActionKey(order))
.setAction(new SetNwSrcActionCaseBuilder()
.setSetNwSrcAction(new SetNwSrcActionBuilder()
.setAddress(new Ipv4Builder()
.setInstruction(Arrays.asList(
new InstructionBuilder()
.setOrder(0)
- .setKey(new InstructionKey(0))
+ .withKey(new InstructionKey(0))
.setInstruction(new ApplyActionsCaseBuilder()
.setApplyActions(new ApplyActionsBuilder()
.setAction(Collections.singletonList(new ActionBuilder()
.setOrder(0)
- .setKey(new ActionKey(0))
+ .withKey(new ActionKey(0))
.setAction(new SetVlanIdActionCaseBuilder()
.setSetVlanIdAction(new SetVlanIdActionBuilder()
.setVlanId(new VlanId(VLAN_ID))
.build(),
new InstructionBuilder()
.setOrder(2)
- .setKey(new InstructionKey(2))
+ .withKey(new InstructionKey(2))
.setInstruction(new ApplyActionsCaseBuilder()
.setApplyActions(new ApplyActionsBuilder()
.setAction(Collections.singletonList(new ActionBuilder()
.setOrder(0)
- .setKey(new ActionKey(0))
+ .withKey(new ActionKey(0))
.setAction(new SetTpDstActionCaseBuilder()
.setSetTpDstAction(new SetTpDstActionBuilder()
.setIpProtocol(IP_PROTOCOL)
.build(),
new InstructionBuilder()
.setOrder(1)
- .setKey(new InstructionKey(1))
+ .withKey(new InstructionKey(1))
.setInstruction(new ApplyActionsCaseBuilder()
.setApplyActions(new ApplyActionsBuilder()
.setAction(Collections.singletonList(new ActionBuilder()
.setOrder(0)
- .setKey(new ActionKey(0))
+ .withKey(new ActionKey(0))
.setAction(new SetTpSrcActionCaseBuilder()
.setSetTpSrcAction(new SetTpSrcActionBuilder()
.setIpProtocol(IP_PROTOCOL)
.build())
.build())
.setOrder(ACTION_ORDER)
- .setKey(ACTION_KEY)
+ .withKey(ACTION_KEY)
.build()
);
private static final Buckets BUCKETS = new BucketsBuilder()
.setBucket(Collections.singletonList(new BucketBuilder()
.setBucketId(BUCKET_ID)
- .setKey(BUCKET_KEY)
+ .withKey(BUCKET_KEY)
.setWatchGroup(BUCKET_WATCH_GROUP)
.setWatchPort(BUCKET_WATCH_PORT)
.setWeight(BUCKET_WEIGHT)
.setTableProperties(new TablePropertiesBuilder()
.setTableFeatureProperties(Collections.singletonList(new TableFeaturePropertiesBuilder()
.setOrder(0)
- .setKey(new TableFeaturePropertiesKey(0))
+ .withKey(new TableFeaturePropertiesKey(0))
.setTableFeaturePropType(NEXT_TABLE)
.build()))
.build())
flow.setId(flowId);
flow.setTableId(tableId);
- flow.setKey(key);
+ flow.withKey(key);
flow.setFlowName("Foo" + "X" + "f1");
return flow;
DecNwTtl decNwTtl = ta.build();
ActionBuilder ab = new ActionBuilder();
ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(decNwTtl).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
// Add our drop action to a list
List<Action> actionList = new ArrayList<Action>();
actionList.add(ab.build());
// Wrap our Apply Action in an Instruction
InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setOrder(0);
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
List<Instruction> instructions = new ArrayList<Instruction>();
instructions.add(ib.build());
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
isb.setInstruction(instructions);
return isb;
}
}
final GeneralAugMatchNodesNodeTableFlowBuilder builder = Optional
- .ofNullable(matchBuilder.getAugmentation(GeneralAugMatchNodesNodeTableFlow.class))
+ .ofNullable(matchBuilder.augmentation(GeneralAugMatchNodesNodeTableFlow.class))
.map(GeneralAugMatchNodesNodeTableFlowBuilder::new)
.orElse(new GeneralAugMatchNodesNodeTableFlowBuilder().setExtensionList(new ArrayList<>()));
convertedSalActions.get()) {
ActionBuilder wrappedAction = new ActionBuilder();
wrappedAction.setAction(action);
- wrappedAction.setKey(new ActionKey(actionKey));
+ wrappedAction.withKey(new ActionKey(actionKey));
wrappedAction.setOrder(actionKey);
actions.add(wrappedAction.build());
actionKey++;
bucketDesc.setWatchGroup(bucketDetails.getWatchGroup());
BucketId bucketId = new BucketId((long) bucketKey);
bucketDesc.setBucketId(bucketId);
- bucketDesc.setKey(new BucketKey(bucketId));
+ bucketDesc.withKey(new BucketKey(bucketId));
bucketKey++;
allBuckets.add(bucketDesc.build());
}
salGroupDescStats.setBuckets(toSALBucketsDesc(groupDesc.getBucketsList(), data.getVersion()));
salGroupDescStats.setGroupId(new GroupId(groupDesc.getGroupId().getValue()));
salGroupDescStats.setGroupType(GroupTypes.forValue(groupDesc.getType().getIntValue()));
- salGroupDescStats.setKey(new GroupDescStatsKey(salGroupDescStats.getGroupId()));
+ salGroupDescStats.withKey(new GroupDescStatsKey(salGroupDescStats.getGroupId()));
convertedSALGroupsDesc.add(salGroupDescStats.build());
}
bucketCounter.setByteCount(new Counter64(bucketStat.getByteCount()));
bucketCounter.setPacketCount(new Counter64(bucketStat.getPacketCount()));
BucketId bucketId = new BucketId((long) bucketKey);
- bucketCounter.setKey(new BucketCounterKey(bucketId));
+ bucketCounter.withKey(new BucketCounterKey(bucketId));
bucketCounter.setBucketId(bucketId);
bucketKey++;
allBucketStats.add(bucketCounter.build());
salGroupStats.setGroupId(new GroupId(groupStats.getGroupId().getValue()));
salGroupStats.setPacketCount(new Counter64(groupStats.getPacketCount()));
salGroupStats.setRefCount(new Counter32(groupStats.getRefCount()));
- salGroupStats.setKey(new GroupStatsKey(salGroupStats.getGroupId()));
+ salGroupStats.withKey(new GroupStatsKey(salGroupStats.getGroupId()));
convertedSALGroups.add(salGroupStats.build());
}
for (MeterConfig meterConfig : source) {
MeterConfigStatsBuilder meterConfigStatsBuilder = new MeterConfigStatsBuilder();
meterConfigStatsBuilder.setMeterId(new MeterId(meterConfig.getMeterId().getValue()));
- meterConfigStatsBuilder.setKey(new MeterConfigStatsKey(meterConfigStatsBuilder.getMeterId()));
+ meterConfigStatsBuilder.withKey(new MeterConfigStatsKey(meterConfigStatsBuilder.getMeterId()));
MeterBandHeadersBuilder meterBandHeadersBuilder = new MeterBandHeadersBuilder();
List<Bands> bands = meterConfig.getBands();
meterBandHeaderBuilder.setBandBurstSize(dropBand.getBurstSize());
meterBandHeaderBuilder.setBandRate(dropBand.getRate());
BandId bandId = new BandId((long) bandKey);
- meterBandHeaderBuilder.setKey(new MeterBandHeaderKey(bandId));
+ meterBandHeaderBuilder.withKey(new MeterBandHeaderKey(bandId));
meterBandHeaderBuilder.setBandId(bandId);
MeterBandTypesBuilder meterBandTypesBuilder = new MeterBandTypesBuilder();
meterBandHeaderBuilder.setBandBurstSize(dscpRemarkBand.getBurstSize());
meterBandHeaderBuilder.setBandRate(dscpRemarkBand.getRate());
BandId bandId = new BandId((long) bandKey);
- meterBandHeaderBuilder.setKey(new MeterBandHeaderKey(bandId));
+ meterBandHeaderBuilder.withKey(new MeterBandHeaderKey(bandId));
meterBandHeaderBuilder.setBandId(bandId);
MeterBandTypesBuilder meterBandTypesBuilder = new MeterBandTypesBuilder();
meterBandHeaderBuilder.setBandBurstSize(experimenterBand.getBurstSize());
meterBandHeaderBuilder.setBandRate(experimenterBand.getRate());
BandId bandId = new BandId((long) bandKey);
- meterBandHeaderBuilder.setKey(new MeterBandHeaderKey(bandId));
+ meterBandHeaderBuilder.withKey(new MeterBandHeaderKey(bandId));
meterBandHeaderBuilder.setBandId(bandId);
MeterBandTypesBuilder meterBandTypesBuilder = new MeterBandTypesBuilder();
salMeterStats.setFlowCount(new Counter32(meterStats.getFlowCount()));
salMeterStats.setMeterId(new MeterId(meterStats.getMeterId().getValue()));
salMeterStats.setPacketInCount(new Counter64(meterStats.getPacketInCount()));
- salMeterStats.setKey(new MeterStatsKey(salMeterStats.getMeterId()));
+ salMeterStats.withKey(new MeterStatsKey(salMeterStats.getMeterId()));
List<MeterBandStats> allMeterBandStats = meterStats.getMeterBandStats();
bandStatBuilder.setByteBandCount(new Counter64(meterBandStats.getByteBandCount()));
bandStatBuilder.setPacketBandCount(new Counter64(meterBandStats.getPacketBandCount()));
BandId bandId = new BandId((long) bandKey);
- bandStatBuilder.setKey(new BandStatKey(bandId));
+ bandStatBuilder.withKey(new BandStatKey(bandId));
bandStatBuilder.setBandId(bandId);
bandKey++;
listAllBandStats.add(bandStatBuilder.build());
for (org.opendaylight.yang.gen.v1.urn.opendaylight.openflow.common.instruction.rev130731
.instructions.grouping.Instruction currInstruction : properties
- .getAugmentation(InstructionRelatedTableFeatureProperty.class).getInstruction()) {
+ .augmentation(InstructionRelatedTableFeatureProperty.class).getInstruction()) {
InstructionChoice currInstructionType = currInstruction.getInstructionChoice();
if (currInstructionType instanceof GotoTableCase) {
}
private static List<Short> setNextTableFeatureProperty(final TableFeatureProperties properties) {
- return properties.getAugmentation(NextTableRelatedTableFeatureProperty.class)
+ return properties.augmentation(NextTableRelatedTableFeatureProperty.class)
.getNextTableIds().stream().map(NextTableIds::getTableId).collect(Collectors.toList());
}
int order = 0;
for (Action action : properties
- .getAugmentation(ActionRelatedTableFeatureProperty.class).getAction()) {
+ .augmentation(ActionRelatedTableFeatureProperty.class).getAction()) {
if (action != null && null != action.getActionChoice()) {
org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.ActionBuilder
actionBuilder = new org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action
SetFieldMatchBuilder setFieldMatchBuilder = new SetFieldMatchBuilder();
// This handles only OpenflowBasicClass oxm class.
- for (MatchEntry currMatch : properties.getAugmentation(OxmRelatedTableFeatureProperty.class)
+ for (MatchEntry currMatch : properties.augmentation(OxmRelatedTableFeatureProperty.class)
.getMatchEntry()) {
Class<? extends MatchField> ofMatchField = currMatch.getOxmMatchField();
ActionBuilder actionBuilder = new ActionBuilder();
actionBuilder.setAction(injectedAction)
- .setKey(actionItem.getKey())
+ .withKey(actionItem.key())
.setOrder(actionItem.getOrder() + offset);
targetActionList.add(actionBuilder.build());
}
instructionBuilder
- .setKey(srcInstruction.getKey())
+ .withKey(srcInstruction.key())
.setOrder(srcInstruction.getOrder());
targetInstructionList.add(instructionBuilder.build());
for (org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.Action action : actionList) {
ActionBuilder wrappedAction = new ActionBuilder();
wrappedAction.setAction(action);
- wrappedAction.setKey(new ActionKey(actionKey));
+ wrappedAction.withKey(new ActionKey(actionKey));
wrappedAction.setOrder(actionKey);
actions.add(wrappedAction.build());
actionKey++;
InstructionBuilder instBuilder = new InstructionBuilder();
instBuilder.setInstruction(salInstruction);
- instBuilder.setKey(new InstructionKey(instructionTreeNodekey));
+ instBuilder.withKey(new InstructionKey(instructionTreeNodekey));
instBuilder.setOrder(instructionTreeNodekey);
instructionTreeNodekey++;
salInstructionList.add(instBuilder.build());
InstructionBuilder instBuilder = new InstructionBuilder();
instBuilder.setInstruction(applyActionsCaseBuilder.build());
- instBuilder.setKey(new InstructionKey(0));
+ instBuilder.withKey(new InstructionKey(0));
instBuilder.setOrder(0);
List<Instruction> salInstructionList = new ArrayList<>();
salInstructionList.add(instBuilder.build());
if (data.getOxmMatchField().equals(TcpFlags.class)) {
final TcpFlagsMatchBuilder tcpFlagsMatchBuilder = data.getTcpFlagsMatchBuilder();
- final TcpFlagsContainer tcpFlagsContainer = source.getAugmentation(TcpFlagsContainer.class);
+ final TcpFlagsContainer tcpFlagsContainer = source.augmentation(TcpFlagsContainer.class);
if (tcpFlagsContainer != null) {
org.opendaylight.yang.gen.v1.urn.opendaylight.openflow
GroupDescStats stat = statsList.get(0);
Assert.assertEquals("Wrong type", GroupTypes.GroupAll, stat.getGroupType());
Assert.assertEquals("Wrong group-id", 42, stat.getGroupId().getValue().intValue());
- Assert.assertEquals("Wrong key", 42, stat.getKey().getGroupId().getValue().intValue());
+ Assert.assertEquals("Wrong key", 42, stat.key().getGroupId().getValue().intValue());
Assert.assertEquals("Wrong buckets size", 0, stat.getBuckets().getBucket().size());
}
GroupDescStats stat = statsList.get(0);
Assert.assertEquals("Wrong type", GroupTypes.GroupFf, stat.getGroupType());
Assert.assertEquals("Wrong group-id", 42, stat.getGroupId().getValue().intValue());
- Assert.assertEquals("Wrong key", 42, stat.getKey().getGroupId().getValue().intValue());
+ Assert.assertEquals("Wrong key", 42, stat.key().getGroupId().getValue().intValue());
Assert.assertEquals("Wrong buckets size", 1, stat.getBuckets().getBucket().size());
// Test first bucket for first group desc
Bucket bucket = stat.getBuckets().getBucket().get(0);
- Assert.assertEquals("Wrong type", 0, bucket.getKey().getBucketId().getValue().intValue());
+ Assert.assertEquals("Wrong type", 0, bucket.key().getBucketId().getValue().intValue());
Assert.assertEquals("Wrong type", 0, bucket.getBucketId().getValue().intValue());
Assert.assertEquals("Wrong type", 16, bucket.getWeight().intValue());
Assert.assertEquals("Wrong type", 168, bucket.getWatchGroup().intValue());
stat = statsList.get(1);
Assert.assertEquals("Wrong type", GroupTypes.GroupIndirect, stat.getGroupType());
Assert.assertEquals("Wrong group-id", 50, stat.getGroupId().getValue().intValue());
- Assert.assertEquals("Wrong key", 50, stat.getKey().getGroupId().getValue().intValue());
+ Assert.assertEquals("Wrong key", 50, stat.key().getGroupId().getValue().intValue());
Assert.assertEquals("Wrong buckets size", 2, stat.getBuckets().getBucket().size());
// Test first bucket for second group desc
bucket = stat.getBuckets().getBucket().get(0);
- Assert.assertEquals("Wrong type", 0, bucket.getKey().getBucketId().getValue().intValue());
+ Assert.assertEquals("Wrong type", 0, bucket.key().getBucketId().getValue().intValue());
Assert.assertEquals("Wrong type", 0, bucket.getBucketId().getValue().intValue());
Assert.assertEquals("Wrong type", 100, bucket.getWeight().intValue());
Assert.assertEquals("Wrong type", 400, bucket.getWatchGroup().intValue());
// Test second bucket for second group desc
bucket = stat.getBuckets().getBucket().get(1);
- Assert.assertEquals("Wrong type", 1, bucket.getKey().getBucketId().getValue().intValue());
+ Assert.assertEquals("Wrong type", 1, bucket.key().getBucketId().getValue().intValue());
Assert.assertEquals("Wrong type", 1, bucket.getBucketId().getValue().intValue());
Assert.assertEquals("Wrong type", 5, bucket.getWeight().intValue());
Assert.assertEquals("Wrong type", 15, bucket.getWatchGroup().intValue());
org.opendaylight.yang.gen.v1.urn.opendaylight.group.types.rev131018.group.statistics.reply
.GroupStats stat = salGroupStats.get(0);
Assert.assertEquals("Wrong group-id", 42, stat.getGroupId().getValue().intValue());
- Assert.assertEquals("Wrong key", 42, stat.getKey().getGroupId().getValue().intValue());
+ Assert.assertEquals("Wrong key", 42, stat.key().getGroupId().getValue().intValue());
Assert.assertEquals("Wrong ref-count", 24, stat.getRefCount().getValue().intValue());
Assert.assertEquals("Wrong packet count", 54321, stat.getPacketCount().getValue().intValue());
Assert.assertEquals("Wrong byte count", 12345, stat.getByteCount().getValue().intValue());
Assert.assertEquals("Wrong bucket stats", 0, stat.getBuckets().getBucketCounter().size());
stat = salGroupStats.get(1);
Assert.assertEquals("Wrong group-id", 4, stat.getGroupId().getValue().intValue());
- Assert.assertEquals("Wrong key", 4, stat.getKey().getGroupId().getValue().intValue());
+ Assert.assertEquals("Wrong key", 4, stat.key().getGroupId().getValue().intValue());
Assert.assertEquals("Wrong ref-count", 6, stat.getRefCount().getValue().intValue());
Assert.assertEquals("Wrong packet count", 5, stat.getPacketCount().getValue().intValue());
Assert.assertEquals("Wrong byte count", 1, stat.getByteCount().getValue().intValue());
assertEquals(expRate,
(long) ((MeterBandExperimenterCase) meterBand).getMeterBandExperimenter().getRate());
ExperimenterIdMeterBand expBand = ((MeterBandExperimenterCase) meterBand).getMeterBandExperimenter()
- .getAugmentation(ExperimenterIdMeterBand.class);
+ .augmentation(ExperimenterIdMeterBand.class);
assertEquals(expExperimenter, (long) expBand.getExperimenter().getValue());
}
}
assertEquals(expRate,
(long) ((MeterBandExperimenterCase) meterBand).getMeterBandExperimenter().getRate());
ExperimenterIdMeterBand expBand = ((MeterBandExperimenterCase) meterBand).getMeterBandExperimenter()
- .getAugmentation(ExperimenterIdMeterBand.class);
+ .augmentation(ExperimenterIdMeterBand.class);
assertEquals(expExperimenter, (long) expBand.getExperimenter().getValue());
}
}
assertEquals((long) 22,
(long) ((MeterBandExperimenterCase) meterBand).getMeterBandExperimenter().getRate());
ExperimenterIdMeterBand expBand = ((MeterBandExperimenterCase) meterBand).getMeterBandExperimenter()
- .getAugmentation(ExperimenterIdMeterBand.class);
+ .augmentation(ExperimenterIdMeterBand.class);
assertEquals((long) 23, (long) expBand.getExperimenter().getValue());
}
}
int cnt = 0;
for (MeterStats meterStats : meterStatsList) {
assertEquals(new MeterStatsKey(new org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918
- .MeterId((long) cnt)).getMeterId(), meterStats.getKey().getMeterId());
+ .MeterId((long) cnt)).getMeterId(), meterStats.key().getMeterId());
assertEquals(BigInteger.valueOf(cnt), meterStats.getByteInCount().getValue());
assertEquals(new Long(1000 * cnt), meterStats.getDuration().getNanosecond().getValue());
assertEquals(new Long(10 * cnt), meterStats.getDuration().getSecond().getValue());
ab.setAction(new OutputActionCaseBuilder().setOutputAction(
output.build()).build());
ab.setOrder(0);
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
List<org.opendaylight.yang.gen.v1.urn.opendaylight.action.types.rev131112.action.list.Action> actionList =
new ArrayList<>();
}
@Override
- public <E extends Augmentation<AddFlowInput>> E getAugmentation(final Class<E> augmentationType) {
+ public <E extends Augmentation<AddFlowInput>> E augmentation(final Class<E> augmentationType) {
return null;
}
ActionBuilder ab = new ActionBuilder();
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setOrder(0);
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
List<Action> actionList = new ArrayList<>();
actionList.add(ab.build());
InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
MatchBuilder matchBuilder = new MatchBuilder();
FlowBuilder allToCtrlFlow = new FlowBuilder().setTableId(tableId).setFlowName("allPacketsToCtrl").setId(flowId)
- .setKey(new FlowKey(flowId));
+ .withKey(new FlowKey(flowId));
allToCtrlFlow
.setMatch(matchBuilder.build())
.setInstructions(isb.build())
flowBuilder.setContainerName(null);
flowBuilder.setId(new FlowId(flowId));
flowBuilder.setTableId(tableId);
- flowBuilder.setKey(key);
+ flowBuilder.withKey(key);
flowBuilder.setFlowName("FlowWithGroupInstruction");
return flowBuilder.build();
private static Group createGroup(long groupId) {
GroupBuilder groupBuilder = new GroupBuilder();
GroupKey groupKey = new GroupKey(new GroupId(groupId));
- groupBuilder.setKey(groupKey);
+ groupBuilder.withKey(groupKey);
groupBuilder.setGroupId(groupKey.getGroupId());
groupBuilder.setBarrier(false);
groupBuilder.setGroupName("Foo");
actionBuilder.setAction(new GroupActionCaseBuilder().setGroupAction(groupActionBuilder.build()).build());
actionBuilder.setOrder(1);
- actionBuilder.setKey(new ActionKey(0));
+ actionBuilder.withKey(new ActionKey(0));
List<Action> actionList = new ArrayList<>();
actionList.add(actionBuilder.build());
instructionBuilder.setInstruction(new ApplyActionsCaseBuilder()
.setApplyActions(applyActionsBuilder.build()).build());
instructionBuilder.setOrder(0);
- instructionBuilder.setKey(new InstructionKey(0));
+ instructionBuilder.withKey(new InstructionKey(0));
InstructionsBuilder instructionsBuilder = new InstructionsBuilder();
List<Instruction> instructions = new ArrayList<>();
}
NodeBuilder builder = new NodeBuilder();
builder.setId(new NodeId(nodeId));
- builder.setKey(new NodeKey(builder.getId()));
+ builder.withKey(new NodeKey(builder.getId()));
return builder;
}
private void createTestNode() {
NodeBuilder builder = new NodeBuilder();
builder.setId(new NodeId(OpenflowpluginTestActivator.NODE_ID));
- builder.setKey(new NodeKey(builder.getId()));
+ builder.withKey(new NodeKey(builder.getId()));
testNode12 = builder.build();
}
// Wrap our Apply Action in an Instruction
InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setOrder(0);
// Put our Instruction in a list of Instructions
// flow
flow.setOutPort(outputPort);
- flow.setKey(key);
+ flow.withKey(key);
flow.setPriority(2);
flow.setFlowName(originalFlowName + "X" + flowType);
return flow;
private void createUserNode(String nodeRef) {
NodeBuilder builder = new NodeBuilder();
builder.setId(new NodeId(nodeRef));
- builder.setKey(new NodeKey(builder.getId()));
+ builder.withKey(new NodeKey(builder.getId()));
testNode12 = builder.build();
}
}
private InstanceIdentifier<Node> nodeToInstanceId(Node node) {
- return InstanceIdentifier.create(Nodes.class).child(Node.class, node.getKey());
+ return InstanceIdentifier.create(Nodes.class).child(Node.class, node.key());
}
public void _removeGroups(CommandInterpreter ci) {
ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
InstanceIdentifier<Group> path1 = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, testNode12.getKey()).augmentation(FlowCapableNode.class)
+ .child(Node.class, testNode12.key()).augmentation(FlowCapableNode.class)
.child(Group.class, new GroupKey(group.getGroupId()));
modification.merge(LogicalDatastoreType.CONFIGURATION, nodeToInstanceId(testNode12), testNode12, true);
modification.merge(LogicalDatastoreType.CONFIGURATION, path1, group, true);
InstanceIdentifier<Group> path2 = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, testNode12.getKey()).augmentation(FlowCapableNode.class)
+ .child(Node.class, testNode12.key()).augmentation(FlowCapableNode.class)
.child(Group.class, new GroupKey(group1.getGroupId()));
modification.merge(LogicalDatastoreType.CONFIGURATION, nodeToInstanceId(testNode12), testNode12, true);
modification.merge(LogicalDatastoreType.CONFIGURATION, path2, group1, true);
private void deleteGroup(final CommandInterpreter ci, Group group, Group group1) {
ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
InstanceIdentifier<Group> path1 = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, testNode12.getKey()).augmentation(FlowCapableNode.class)
+ .child(Node.class, testNode12.key()).augmentation(FlowCapableNode.class)
.child(Group.class, new GroupKey(group.getGroupId()));
modification.delete(LogicalDatastoreType.OPERATIONAL, path1);
modification.delete(LogicalDatastoreType.CONFIGURATION, path1);
InstanceIdentifier<Group> path2 = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, testNode12.getKey()).augmentation(FlowCapableNode.class)
+ .child(Node.class, testNode12.key()).augmentation(FlowCapableNode.class)
.child(Group.class, new GroupKey(group1.getGroupId()));
modification.delete(LogicalDatastoreType.OPERATIONAL, path2);
modification.delete(LogicalDatastoreType.CONFIGURATION, path2);
GroupBuilder group = new GroupBuilder();
BucketBuilder bucket = new BucketBuilder();
bucket.setBucketId(new BucketId((long) 12));
- bucket.setKey(new BucketKey(new BucketId((long) 12)));
+ bucket.withKey(new BucketKey(new BucketId((long) 12)));
if (groupType == null) {
groupType = "g1";
long id = Long.parseLong(strId);
GroupKey key = new GroupKey(new GroupId(id));
- group.setKey(key);
+ group.withKey(key);
// group.setInstall(false);
group.setGroupId(new GroupId(id));
group.setGroupName(originalGroupName);
PopVlanActionBuilder vlanAction = new PopVlanActionBuilder();
ActionBuilder action = new ActionBuilder();
action.setAction(new PopVlanActionCaseBuilder().setPopVlanAction(vlanAction.build()).build());
- action.setKey(new ActionKey(0));
+ action.withKey(new ActionKey(0));
List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
groupActionB.setGroup("0");
ActionBuilder action = new ActionBuilder();
action.setAction(new GroupActionCaseBuilder().setGroupAction(groupActionB.build()).build());
- action.setKey(new ActionKey(0));
+ action.withKey(new ActionKey(0));
List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
NodeBuilder builder = new NodeBuilder();
builder.setId(new NodeId(nodeId));
- builder.setKey(new NodeKey(builder.getId()));
+ builder.withKey(new NodeKey(builder.getId()));
return builder;
}
flow.setOutPort(outputPort);
FlowKey key = new FlowKey(new FlowId(Long.toString(id)));
- flow.setKey(key);
+ flow.withKey(key);
flow.setPriority(2);
flow.setFlowName(originalFlowName + "X" + flowType);
return flow;
}
private InstanceIdentifier<Node> nodeBuilderToInstanceId(NodeBuilder node) {
- return InstanceIdentifier.create(Nodes.class).child(Node.class, node.getKey());
+ return InstanceIdentifier.create(Nodes.class).child(Node.class, node.key());
}
public void _modifyFlows(CommandInterpreter ci) {
throw new IllegalArgumentException("Invalid flowtype: " + flowtype);
}
- InstanceIdentifier<Flow> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, tn.getKey())
+ InstanceIdentifier<Flow> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, tn.key())
.augmentation(FlowCapableNode.class).child(Table.class, new TableKey(tf.getTableId()))
- .child(Flow.class, tf.getKey());
+ .child(Flow.class, tf.key());
modification.delete(LogicalDatastoreType.OPERATIONAL, path1);
modification.delete(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(tn));
modification.delete(LogicalDatastoreType.CONFIGURATION, path1);
- InstanceIdentifier<Flow> path2 = InstanceIdentifier.create(Nodes.class).child(Node.class, tn.getKey())
+ InstanceIdentifier<Flow> path2 = InstanceIdentifier.create(Nodes.class).child(Node.class, tn.key())
.augmentation(FlowCapableNode.class).child(Table.class, new TableKey(tf1.getTableId()))
- .child(Flow.class, tf1.getKey());
+ .child(Flow.class, tf1.key());
modification.delete(LogicalDatastoreType.OPERATIONAL, path2);
modification.delete(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(tn));
modification.delete(LogicalDatastoreType.CONFIGURATION, path2);
- InstanceIdentifier<Flow> path3 = InstanceIdentifier.create(Nodes.class).child(Node.class, tn.getKey())
+ InstanceIdentifier<Flow> path3 = InstanceIdentifier.create(Nodes.class).child(Node.class, tn.key())
.augmentation(FlowCapableNode.class).child(Table.class, new TableKey(tf2.getTableId()))
- .child(Flow.class, tf2.getKey());
+ .child(Flow.class, tf2.key());
modification.delete(LogicalDatastoreType.OPERATIONAL, path3);
modification.delete(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(tn));
modification.delete(LogicalDatastoreType.CONFIGURATION, path3);
- InstanceIdentifier<Flow> path4 = InstanceIdentifier.create(Nodes.class).child(Node.class, tn.getKey())
+ InstanceIdentifier<Flow> path4 = InstanceIdentifier.create(Nodes.class).child(Node.class, tn.key())
.augmentation(FlowCapableNode.class).child(Table.class, new TableKey(tf3.getTableId()))
- .child(Flow.class, tf3.getKey());
+ .child(Flow.class, tf3.key());
modification.delete(LogicalDatastoreType.OPERATIONAL, path4);
modification.delete(LogicalDatastoreType.CONFIGURATION, nodeBuilderToInstanceId(tn));
modification.delete(LogicalDatastoreType.CONFIGURATION, path4);
FlowBuilder flow3, NodeBuilder nodeBuilder) {
ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
InstanceIdentifier<Flow> path1 = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, nodeBuilder.getKey()).augmentation(FlowCapableNode.class)
- .child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flow.getKey());
+ .child(Node.class, nodeBuilder.key()).augmentation(FlowCapableNode.class)
+ .child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flow.key());
modification.merge(LogicalDatastoreType.OPERATIONAL, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(),
true);
modification.merge(LogicalDatastoreType.OPERATIONAL, path1, flow.build(), true);
nodeBuilder.build(), true);
modification.merge(LogicalDatastoreType.CONFIGURATION, path1, flow.build(), true);
InstanceIdentifier<Flow> path2 = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, nodeBuilder.getKey()).augmentation(FlowCapableNode.class)
- .child(Table.class, new TableKey(flow1.getTableId())).child(Flow.class, flow1.getKey());
+ .child(Node.class, nodeBuilder.key()).augmentation(FlowCapableNode.class)
+ .child(Table.class, new TableKey(flow1.getTableId())).child(Flow.class, flow1.key());
modification.merge(LogicalDatastoreType.OPERATIONAL, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(),
true);
modification.merge(LogicalDatastoreType.OPERATIONAL, path2, flow1.build(), true);
modification.merge(LogicalDatastoreType.CONFIGURATION, path2, flow1.build(), true);
InstanceIdentifier<Flow> path3 = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, nodeBuilder.getKey()).augmentation(FlowCapableNode.class)
- .child(Table.class, new TableKey(flow2.getTableId())).child(Flow.class, flow2.getKey());
+ .child(Node.class, nodeBuilder.key()).augmentation(FlowCapableNode.class)
+ .child(Table.class, new TableKey(flow2.getTableId())).child(Flow.class, flow2.key());
modification.merge(LogicalDatastoreType.OPERATIONAL, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(),
true);
modification.merge(LogicalDatastoreType.OPERATIONAL, path3, flow2.build(), true);
modification.merge(LogicalDatastoreType.CONFIGURATION, path3, flow2.build(), true);
InstanceIdentifier<Flow> path4 = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, nodeBuilder.getKey()).augmentation(FlowCapableNode.class)
- .child(Table.class, new TableKey(flow3.getTableId())).child(Flow.class, flow3.getKey());
+ .child(Node.class, nodeBuilder.key()).augmentation(FlowCapableNode.class)
+ .child(Table.class, new TableKey(flow3.getTableId())).child(Flow.class, flow3.key());
modification.merge(LogicalDatastoreType.OPERATIONAL, nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(),
true);
modification.merge(LogicalDatastoreType.OPERATIONAL, path4, flow3.build(), true);
// Wrap our Apply Action in an Instruction
InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setOrder(0);
// Put our Instruction in a list of Instructions
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setOrder(0);
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
List<Action> actionList = new ArrayList<>();
actionList.add(ab.build());
InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
// Put our Instruction in a list of Instructions
InstructionsBuilder isb = new InstructionsBuilder();
private void createUserNode(String nodeRef) {
NodeBuilder builder = new NodeBuilder();
builder.setId(new NodeId(nodeRef));
- builder.setKey(new NodeKey(builder.getId()));
+ builder.withKey(new NodeKey(builder.getId()));
testNode = builder.build();
}
private void createTestNode() {
NodeBuilder builder = new NodeBuilder();
builder.setId(new NodeId(OpenflowpluginTestActivator.NODE_ID));
- builder.setKey(new NodeKey(builder.getId()));
+ builder.withKey(new NodeKey(builder.getId()));
testNode = builder.build();
}
private InstanceIdentifier<Node> nodeToInstanceId(Node node) {
- return InstanceIdentifier.create(Nodes.class).child(Node.class, node.getKey());
+ return InstanceIdentifier.create(Nodes.class).child(Node.class, node.key());
}
private GroupBuilder createTestGroup(String actionType, String groupType, String groupMod) {
GroupBuilder group = new GroupBuilder();
BucketBuilder bucket = new BucketBuilder();
bucket.setBucketId(new BucketId((long) 12));
- bucket.setKey(new BucketKey(new BucketId((long) 12)));
+ bucket.withKey(new BucketKey(new BucketId((long) 12)));
if (groupType == null) {
groupType = "g1";
long id = 1;
GroupKey key = new GroupKey(new GroupId(id));
- group.setKey(key);
+ group.withKey(key);
// group.setInstall(false);
group.setGroupId(new GroupId(id));
group.setGroupName(ORIGINAL_GROUP_NAME);
PopVlanActionBuilder vlanAction = new PopVlanActionBuilder();
ActionBuilder action = new ActionBuilder();
action.setAction(new PopVlanActionCaseBuilder().setPopVlanAction(vlanAction.build()).build());
- action.setKey(new ActionKey(0));
+ action.withKey(new ActionKey(0));
List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
setQueueActionBuilder.setQueueId(1L);
ActionBuilder action = new ActionBuilder();
action.setAction(new SetQueueActionCaseBuilder().setSetQueueAction(setQueueActionBuilder.build()).build());
- action.setKey(new ActionKey(0));
+ action.withKey(new ActionKey(0));
List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
Uri value = new Uri("2");
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
ab.setOrder(0);
List<Action> actions = new ArrayList<>();
Uri value = new Uri(OutputPortValues.FLOOD.toString());
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
List<Action> actions = new ArrayList<>();
actions.add(ab.build());
Uri value = new Uri(OutputPortValues.ALL.toString());
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
List<Action> actions = new ArrayList<>();
actions.add(ab.build());
Uri value = new Uri(OutputPortValues.ANY.toString());
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
List<Action> actions = new ArrayList<>();
actions.add(ab.build());
Uri value = new Uri(OutputPortValues.NORMAL.toString());
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
List<Action> actions = new ArrayList<>();
actions.add(ab.build());
Uri value = new Uri(OutputPortValues.INPORT.toString());
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
List<Action> actions = new ArrayList<>();
actions.add(ab.build());
Uri value = new Uri(OutputPortValues.TABLE.toString());
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
List<Action> actions = new ArrayList<>();
actions.add(ab.build());
Uri value = new Uri(OutputPortValues.CONTROLLER.toString());
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
List<Action> actions = new ArrayList<>();
actions.add(ab.build());
Uri value = new Uri(OutputPortValues.LOCAL.toString());
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
List<Action> actions = new ArrayList<>();
actions.add(ab.build());
groupActionB.setGroup("0");
ActionBuilder action = new ActionBuilder();
action.setAction(new GroupActionCaseBuilder().setGroupAction(groupActionB.build()).build());
- action.setKey(new ActionKey(0));
+ action.withKey(new ActionKey(0));
List<Action> actions = new ArrayList<>();
actions.add(action.build());
return actions;
}
GroupBuilder gbuilder = createTestGroup(ci.nextArgument(), ci.nextArgument(), "add");
ReadWriteTransaction modification = Preconditions.checkNotNull(dataBroker).newReadWriteTransaction();
- InstanceIdentifier<Group> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, testNode.getKey())
+ InstanceIdentifier<Group> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, testNode.key())
.augmentation(FlowCapableNode.class).child(Group.class, new GroupKey(gbuilder.getGroupId()));
modification.delete(LogicalDatastoreType.CONFIGURATION, path1);
ListenableFuture<Void> commitFuture = modification.submit();
private void writeGroup(final CommandInterpreter ci, Group group) {
ReadWriteTransaction modification = Preconditions.checkNotNull(dataBroker).newReadWriteTransaction();
InstanceIdentifier<Group> path1 = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
+ .child(Node.class, testNode.key()).augmentation(FlowCapableNode.class)
.child(Group.class, new GroupKey(group.getGroupId()));
modification.merge(LogicalDatastoreType.CONFIGURATION, nodeToInstanceId(testNode), testNode, true);
modification.merge(LogicalDatastoreType.CONFIGURATION, path1, group, true);
private void createUserNode(String nodeRef) {
NodeBuilder builder = new NodeBuilder();
builder.setId(new NodeId(nodeRef));
- builder.setKey(new NodeKey(builder.getId()));
+ builder.withKey(new NodeKey(builder.getId()));
testNode = builder.build();
}
private void createTestNode() {
NodeBuilder builder = new NodeBuilder();
builder.setId(new NodeId(OpenflowpluginTestActivator.NODE_ID));
- builder.setKey(new NodeKey(builder.getId()));
+ builder.withKey(new NodeKey(builder.getId()));
testNode = builder.build();
}
private InstanceIdentifier<Node> nodeToInstanceId(Node node) {
- return InstanceIdentifier.create(Nodes.class).child(Node.class, node.getKey());
+ return InstanceIdentifier.create(Nodes.class).child(Node.class, node.key());
}
private static final class MeterEventListener implements SalMeterListener {
MeterKey key = new MeterKey(new MeterId(id));
MeterBuilder meter = new MeterBuilder();
meter.setContainerName("abcd");
- meter.setKey(key);
+ meter.withKey(key);
meter.setMeterId(new MeterId(9L));
meter.setMeterName(originalMeterName);
meter.setFlags(new MeterFlags(true, false, false, false));
MeterKey key = new MeterKey(new MeterId(id));
MeterBuilder meter = new MeterBuilder();
meter.setContainerName("abcd");
- meter.setKey(key);
+ meter.withKey(key);
meter.setMeterId(new MeterId(9L));
MeterBandHeaderBuilder bandHeader = new MeterBandHeaderBuilder();
if (s2.equalsIgnoreCase("modify")) {
}
createTestMeter();
ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
- InstanceIdentifier<Meter> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, testNode.getKey())
+ InstanceIdentifier<Meter> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, testNode.key())
.augmentation(FlowCapableNode.class).child(Meter.class, new MeterKey(testMeter.getMeterId()));
modification.delete(LogicalDatastoreType.CONFIGURATION, path1);
ListenableFuture<Void> commitFuture = modification.submit();
case 1:
createTestMeters("1", "remove");
InstanceIdentifier<Meter> path1 = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
+ .child(Node.class, testNode.key()).augmentation(FlowCapableNode.class)
.child(Meter.class, new MeterKey(testMeter1.getMeterId()));
modification.delete(LogicalDatastoreType.CONFIGURATION, path1);
createTestMeters("2", "remove");
InstanceIdentifier<Meter> path2 = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
+ .child(Node.class, testNode.key()).augmentation(FlowCapableNode.class)
.child(Meter.class, new MeterKey(testMeter2.getMeterId()));
modification.delete(LogicalDatastoreType.CONFIGURATION, path2);
case 2:
createTestMeters("3", "remove");
InstanceIdentifier<Meter> path3 = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
+ .child(Node.class, testNode.key()).augmentation(FlowCapableNode.class)
.child(Meter.class, new MeterKey(testMeter1.getMeterId()));
modification.delete(LogicalDatastoreType.CONFIGURATION, path3);
createTestMeters("4", "remove");
InstanceIdentifier<Meter> path4 = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
+ .child(Node.class, testNode.key()).augmentation(FlowCapableNode.class)
.child(Meter.class, new MeterKey(testMeter2.getMeterId()));
modification.delete(LogicalDatastoreType.CONFIGURATION, path4);
break;
case 3:
createTestMeters("5", "remove");
InstanceIdentifier<Meter> path5 = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
+ .child(Node.class, testNode.key()).augmentation(FlowCapableNode.class)
.child(Meter.class, new MeterKey(testMeter1.getMeterId()));
modification.delete(LogicalDatastoreType.CONFIGURATION, path5);
createTestMeters("6", "remove");
InstanceIdentifier<Meter> path6 = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
+ .child(Node.class, testNode.key()).augmentation(FlowCapableNode.class)
.child(Meter.class, new MeterKey(testMeter2.getMeterId()));
modification.delete(LogicalDatastoreType.CONFIGURATION, path6);
break;
case 4:
createTestMeters("7", "remove");
InstanceIdentifier<Meter> path7 = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
+ .child(Node.class, testNode.key()).augmentation(FlowCapableNode.class)
.child(Meter.class, new MeterKey(testMeter1.getMeterId()));
modification.delete(LogicalDatastoreType.CONFIGURATION, path7);
createTestMeters("8", "remove");
InstanceIdentifier<Meter> path8 = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
+ .child(Node.class, testNode.key()).augmentation(FlowCapableNode.class)
.child(Meter.class, new MeterKey(testMeter2.getMeterId()));
modification.delete(LogicalDatastoreType.CONFIGURATION, path8);
break;
private void writeMeter(final CommandInterpreter ci, Meter meter) {
ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
- InstanceIdentifier<Meter> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, testNode.getKey())
+ InstanceIdentifier<Meter> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, testNode.key())
.augmentation(FlowCapableNode.class).child(Meter.class, new MeterKey(meter.getMeterId()));
modification.merge(LogicalDatastoreType.CONFIGURATION, nodeToInstanceId(testNode), testNode, true);
modification.merge(LogicalDatastoreType.CONFIGURATION, path1, meter, true);
private void writeMeter(final CommandInterpreter ci, Meter meter, Meter meter1) {
ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
- InstanceIdentifier<Meter> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, testNode.getKey())
+ InstanceIdentifier<Meter> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, testNode.key())
.augmentation(FlowCapableNode.class).child(Meter.class, new MeterKey(meter.getMeterId()));
modification.merge(LogicalDatastoreType.CONFIGURATION, nodeToInstanceId(testNode), testNode, true);
modification.merge(LogicalDatastoreType.CONFIGURATION, path1, meter, true);
- InstanceIdentifier<Meter> path2 = InstanceIdentifier.create(Nodes.class).child(Node.class, testNode.getKey())
+ InstanceIdentifier<Meter> path2 = InstanceIdentifier.create(Nodes.class).child(Node.class, testNode.key())
.augmentation(FlowCapableNode.class).child(Meter.class, new MeterKey(meter1.getMeterId()));
modification.merge(LogicalDatastoreType.CONFIGURATION, nodeToInstanceId(testNode), testNode, true);
modification.merge(LogicalDatastoreType.CONFIGURATION, path2, meter1, true);
int nodeConnectorStatsCount = 0;
List<Node> nodes = getNodes();
for (Node node2 : nodes) {
- NodeKey nodeKey = node2.getKey();
+ NodeKey nodeKey = node2.key();
InstanceIdentifier<Node> nodeRef = InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey);
ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
Node node = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, nodeRef);
for (NodeConnector nodeConnector2 : ports) {
nodeConnectorCount++;
- NodeConnectorKey nodeConnectorKey = nodeConnector2.getKey();
+ NodeConnectorKey nodeConnectorKey = nodeConnector2.key();
InstanceIdentifier<NodeConnector> connectorRef = InstanceIdentifier.create(Nodes.class)
.child(Node.class, nodeKey).child(NodeConnector.class, nodeConnectorKey);
NodeConnector nodeConnector = TestProviderTransactionUtil.getDataObject(readOnlyTransaction,
connectorRef);
if (nodeConnector != null) {
FlowCapableNodeConnectorStatisticsData data = nodeConnector
- .getAugmentation(FlowCapableNodeConnectorStatisticsData.class);
+ .augmentation(FlowCapableNodeConnectorStatisticsData.class);
if (null != data) {
nodeConnectorStatsCount++;
}
int nodeConnectorDescStatsCount = 0;
List<Node> nodes = getNodes();
for (Node node2 : nodes) {
- NodeKey nodeKey = node2.getKey();
+ NodeKey nodeKey = node2.key();
InstanceIdentifier<Node> nodeRef = InstanceIdentifier.create(Nodes.class).child(Node.class, nodeKey);
ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
List<NodeConnector> ports = node.getNodeConnector();
for (NodeConnector nodeConnector2 : ports) {
nodeConnectorCount++;
- NodeConnectorKey nodeConnectorKey = nodeConnector2.getKey();
+ NodeConnectorKey nodeConnectorKey = nodeConnector2.key();
InstanceIdentifier<FlowCapableNodeConnector> connectorRef = InstanceIdentifier
.create(Nodes.class).child(Node.class, nodeKey)
.child(NodeConnector.class, nodeConnectorKey)
int flowStatsCount = 0;
List<Node> nodes = getNodes();
for (Node node2 : nodes) {
- NodeKey nodeKey = node2.getKey();
+ NodeKey nodeKey = node2.key();
InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
.child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
if (node != null) {
List<Table> tables = node.getTable();
for (Table table2 : tables) {
- TableKey tableKey = table2.getKey();
+ TableKey tableKey = table2.key();
InstanceIdentifier<Table> tableRef = InstanceIdentifier.create(Nodes.class)
.child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
.child(Table.class, tableKey);
List<Flow> flows = table.getFlow();
for (Flow flow2 : flows) {
flowCount++;
- FlowKey flowKey = flow2.getKey();
+ FlowKey flowKey = flow2.key();
InstanceIdentifier<Flow> flowRef = InstanceIdentifier.create(Nodes.class)
.child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
.child(Table.class, tableKey).child(Flow.class, flowKey);
Flow flow = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, flowRef);
if (flow != null) {
- FlowStatisticsData data = flow.getAugmentation(FlowStatisticsData.class);
+ FlowStatisticsData data = flow.augmentation(FlowStatisticsData.class);
if (null != data) {
flowStatsCount++;
LOG.debug("--------------------------------------------");
int tableStatsCount = 0;
List<Node> nodes = getNodes();
for (Node node2 : nodes) {
- NodeKey nodeKey = node2.getKey();
+ NodeKey nodeKey = node2.key();
InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
.child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
List<Table> tables = node.getTable();
for (Table table2 : tables) {
tableCount++;
- TableKey tableKey = table2.getKey();
+ TableKey tableKey = table2.key();
InstanceIdentifier<Table> tableRef = InstanceIdentifier.create(Nodes.class)
.child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
.child(Table.class, tableKey);
Table table = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, tableRef);
if (table != null) {
- FlowTableStatisticsData data = table.getAugmentation(FlowTableStatisticsData.class);
+ FlowTableStatisticsData data = table.augmentation(FlowTableStatisticsData.class);
if (null != data) {
tableStatsCount++;
}
NodeGroupStatistics data = null;
List<Node> nodes = getNodes();
for (Node node2 : nodes) {
- NodeKey nodeKey = node2.getKey();
+ NodeKey nodeKey = node2.key();
InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
.child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
List<Group> groups = node.getGroup();
for (Group group2 : groups) {
groupCount++;
- GroupKey groupKey = group2.getKey();
+ GroupKey groupKey = group2.key();
InstanceIdentifier<Group> groupRef = InstanceIdentifier.create(Nodes.class)
.child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
.child(Group.class, groupKey);
Group group = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, groupRef);
if (group != null) {
- data = group.getAugmentation(NodeGroupStatistics.class);
+ data = group.augmentation(NodeGroupStatistics.class);
if (null != data) {
groupStatsCount++;
}
NodeGroupDescStats data = null;
List<Node> nodes = getNodes();
for (Node node2 : nodes) {
- NodeKey nodeKey = node2.getKey();
+ NodeKey nodeKey = node2.key();
InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
.child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
List<Group> groups = node.getGroup();
for (Group group2 : groups) {
groupCount++;
- GroupKey groupKey = group2.getKey();
+ GroupKey groupKey = group2.key();
InstanceIdentifier<Group> groupRef = InstanceIdentifier.create(Nodes.class)
.child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
.child(Group.class, groupKey);
Group group = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, groupRef);
if (group != null) {
- data = group.getAugmentation(NodeGroupDescStats.class);
+ data = group.augmentation(NodeGroupDescStats.class);
if (null != data) {
groupDescStatsCount++;
}
NodeMeterStatistics data = null;
List<Node> nodes = getNodes();
for (Node node2 : nodes) {
- NodeKey nodeKey = node2.getKey();
+ NodeKey nodeKey = node2.key();
InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
.child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
List<Meter> meters = node.getMeter();
for (Meter meter2 : meters) {
meterCount++;
- MeterKey meterKey = meter2.getKey();
+ MeterKey meterKey = meter2.key();
InstanceIdentifier<Meter> meterRef = InstanceIdentifier.create(Nodes.class)
.child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
.child(Meter.class, meterKey);
Meter meter = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, meterRef);
if (meter != null) {
- data = meter.getAugmentation(NodeMeterStatistics.class);
+ data = meter.augmentation(NodeMeterStatistics.class);
if (null != data) {
meterStatsCount++;
}
NodeMeterConfigStats data = null;
List<Node> nodes = getNodes();
for (Node node2 : nodes) {
- NodeKey nodeKey = node2.getKey();
+ NodeKey nodeKey = node2.key();
InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
.child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
List<Meter> meters = node.getMeter();
for (Meter meter2 : meters) {
meterCount++;
- MeterKey meterKey = meter2.getKey();
+ MeterKey meterKey = meter2.key();
InstanceIdentifier<Meter> meterRef = InstanceIdentifier.create(Nodes.class)
.child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
.child(Meter.class, meterKey);
Meter meter = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, meterRef);
if (meter != null) {
- data = meter.getAugmentation(NodeMeterConfigStats.class);
+ data = meter.augmentation(NodeMeterConfigStats.class);
if (null != data) {
meterConfigStatsCount++;
}
int aggerateFlowStatsCount = 0;
List<Node> nodes = getNodes();
for (Node node2 : nodes) {
- NodeKey nodeKey = node2.getKey();
+ NodeKey nodeKey = node2.key();
InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
.child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
List<Table> tables = node.getTable();
for (Table table2 : tables) {
aggregateFlowCount++;
- TableKey tableKey = table2.getKey();
+ TableKey tableKey = table2.key();
InstanceIdentifier<Table> tableRef = InstanceIdentifier.create(Nodes.class)
.child(Node.class, nodeKey).augmentation(FlowCapableNode.class)
.child(Table.class, tableKey);
Table table = TestProviderTransactionUtil.getDataObject(readOnlyTransaction, tableRef);
if (table != null) {
- AggregateFlowStatisticsData data = table.getAugmentation(AggregateFlowStatisticsData.class);
+ AggregateFlowStatisticsData data = table.augmentation(AggregateFlowStatisticsData.class);
if (null != data) {
aggerateFlowStatsCount++;
}
List<Node> nodes = getNodes();
for (Node node2 : nodes) {
descCount++;
- NodeKey nodeKey = node2.getKey();
+ NodeKey nodeKey = node2.key();
InstanceIdentifier<FlowCapableNode> nodeRef = InstanceIdentifier.create(Nodes.class)
.child(Node.class, nodeKey).augmentation(FlowCapableNode.class);
ReadOnlyTransaction readOnlyTransaction = dataProviderService.newReadOnlyTransaction();
private void createUserNode(String nodeRef) {
NodeBuilder builder = new NodeBuilder();
builder.setId(new NodeId(nodeRef));
- builder.setKey(new NodeKey(builder.getId()));
+ builder.withKey(new NodeKey(builder.getId()));
testNode = builder.build();
}
private void createTestNode() {
NodeBuilder builder = new NodeBuilder();
builder.setId(new NodeId(OpenflowpluginTestActivator.NODE_ID));
- builder.setKey(new NodeKey(builder.getId()));
+ builder.withKey(new NodeKey(builder.getId()));
testNode = builder.build();
}
private InstanceIdentifier<Node> nodeToInstanceId(Node node) {
- return InstanceIdentifier.create(Nodes.class).child(Node.class, node.getKey());
+ return InstanceIdentifier.create(Nodes.class).child(Node.class, node.key());
}
private TableFeaturesBuilder createTestTableFeatures(String tableFeatureTypeArg) {
.setApplyActionsMiss(new ApplyActionsMissBuilder().setAction(actionList).build()).build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
.setApplyActions(new ApplyActionsBuilder().setAction(actionListt5).build()).build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
tableFeatureProperty.setTableFeaturePropType(nextTblBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
tableFeatureProperty.setTableFeaturePropType(nextTblMissBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
ib.setOrder(1);
ib.setInstruction(new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction
.instruction.ApplyActionsCaseBuilder().build());
- ib.setKey(new InstructionKey(1));
+ ib.withKey(new InstructionKey(1));
List<Instruction> instLst = new ArrayList<>();
TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
ib1.setOrder(1);
ib1.setInstruction(new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction
.instruction.WriteMetadataCaseBuilder().build());
- ib1.setKey(new InstructionKey(1));
+ ib1.withKey(new InstructionKey(1));
InstructionBuilder ib2 = new InstructionBuilder();
ib2.setOrder(2);
ib2.setInstruction(new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction
.instruction.MeterCaseBuilder().build());
- ib2.setKey(new InstructionKey(2));
+ ib2.withKey(new InstructionKey(2));
List<Instruction> instLst = new ArrayList<>();
TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
.WriteActionsBuilder().setAction(actionList).build()).build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
.miss.WriteActionsMissBuilder().setAction(actionList).build()).build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(matchBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(writeSetfieldBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(writeSetfieldBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(applySetfieldBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(applySetfieldMissBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(wildCardsBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
ReadWriteTransaction modification = Preconditions.checkNotNull(dataBroker).newReadWriteTransaction();
KeyedInstanceIdentifier<TableFeatures, TableFeaturesKey> path1 = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class)
+ .child(Node.class, testNode.key()).augmentation(FlowCapableNode.class)
.child(TableFeatures.class, new TableFeaturesKey(tableFeatures.getTableId()));
modification.merge(LogicalDatastoreType.OPERATIONAL, nodeToInstanceId(testNode), testNode, true);
final NodeBuilder builder = new NodeBuilder();
builder.setId(new NodeId(localNodeId));
- builder.setKey(new NodeKey(builder.getId()));
+ builder.withKey(new NodeKey(builder.getId()));
return builder;
}
private InstanceIdentifier<Node> nodeBuilderToInstanceId(final NodeBuilder node) {
- return InstanceIdentifier.create(Nodes.class).child(Node.class, node.getKey());
+ return InstanceIdentifier.create(Nodes.class).child(Node.class, node.key());
}
private FlowBuilder createTestFlow(final NodeBuilder nodeBuilder, final String flowTypeArg, final String tableId) {
flow.setId(new FlowId("12"));
flow.setTableId(getTableId(tableId));
- flow.setKey(key);
+ flow.withKey(key);
flow.setFlowName(ORIGINAL_FLOW_NAME + "X" + flowType);
return flow;
}
flow.setId(new FlowId("12"));
flow.setTableId(getTableId(tableId));
- flow.setKey(key);
+ flow.withKey(key);
flow.setFlowName(ORIGINAL_FLOW_NAME + "X" + flowType);
return flow;
}
flow.setPriority(0);
flow.setTableId((short) 0);
final FlowKey key = new FlowKey(new FlowId(Long.toString(id)));
- flow.setKey(key);
+ flow.withKey(key);
return flow;
}
final DecNwTtl decNwTtl = ta.build();
final ActionBuilder ab = new ActionBuilder();
ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(decNwTtl).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
// Add our drop action to a list
final List<Action> actionList = new ArrayList<>();
actionList.add(ab.build());
// Wrap our Apply Action in an Instruction
final InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setOrder(0);
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
instructions.add(ib.build());
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
isb.setInstruction(instructions);
return isb;
}
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final DropAction dropAction = dab.build();
final ActionBuilder ab = new ActionBuilder();
ab.setAction(new DropActionCaseBuilder().setDropAction(dropAction).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
// Add our drop action to a list
final List<Action> actionList = new ArrayList<>();
actionList.add(ab.build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final ControllerActionBuilder controller = new ControllerActionBuilder();
controller.setMaxLength(5);
ab.setAction(new ControllerActionCaseBuilder().setControllerAction(controller.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final Uri value = new Uri("PCEP");
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setOrder(0);
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
final InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setOrder(0);
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
final InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
output.setOutputNodeConnector(value);
ab.setAction(new OutputActionCaseBuilder().setOutputAction(output.build()).build());
ab.setOrder(0);
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
final InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final StripVlanActionBuilder stripActionBuilder = new StripVlanActionBuilder();
ab.setAction(new StripVlanActionCaseBuilder().setStripVlanAction(stripActionBuilder.build()).build());
ab.setOrder(0);
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
final InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final PushMplsActionBuilder push = new PushMplsActionBuilder();
push.setEthernetType(Integer.valueOf(0x8847));
ab.setAction(new PushMplsActionCaseBuilder().setPushMplsAction(push.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final PushPbbActionBuilder pbb = new PushPbbActionBuilder();
pbb.setEthernetType(Integer.valueOf(0x88E7));
ab.setAction(new PushPbbActionCaseBuilder().setPushPbbAction(pbb.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final PushVlanActionBuilder vlan = new PushVlanActionBuilder();
vlan.setEthernetType(Integer.valueOf(0x8100));
ab.setAction(new PushVlanActionCaseBuilder().setPushVlanAction(vlan.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final SetDlDstActionBuilder setdl = new SetDlDstActionBuilder();
setdl.setAddress(new MacAddress("00:05:b9:7c:81:5f"));
ab.setAction(new SetDlDstActionCaseBuilder().setSetDlDstAction(setdl.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final SetDlSrcActionBuilder src = new SetDlSrcActionBuilder();
src.setAddress(new MacAddress("00:05:b9:7c:81:5f"));
ab.setAction(new SetDlSrcActionCaseBuilder().setSetDlSrcAction(src.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final VlanId a = new VlanId(4000);
vl.setVlanId(a);
ab.setAction(new SetVlanIdActionCaseBuilder().setSetVlanIdAction(vl.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final VlanPcp pcp1 = new VlanPcp((short) 2);
pcp.setVlanPcp(pcp1);
ab.setAction(new SetVlanPcpActionCaseBuilder().setSetVlanPcpAction(pcp.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final VlanPcp pcp1 = new VlanPcp((short) 4);
pcp.setVlanPcp(pcp1);
ab.setAction(new SetVlanPcpActionCaseBuilder().setSetVlanPcpAction(pcp.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final CopyTtlInBuilder ttlin = new CopyTtlInBuilder();
ab.setAction(new CopyTtlInCaseBuilder().setCopyTtlIn(ttlin.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final CopyTtlOutBuilder ttlout = new CopyTtlOutBuilder();
ab.setAction(new CopyTtlOutCaseBuilder().setCopyTtlOut(ttlout.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final DecMplsTtlBuilder mpls = new DecMplsTtlBuilder();
ab.setAction(new DecMplsTtlCaseBuilder().setDecMplsTtl(mpls.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Wrap our Apply Action in an Instruction
final InstructionBuilder ib = new InstructionBuilder();
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setOrder(0);
// Put our Instruction in a list of Instruction
final DecNwTtlBuilder nwttl = new DecNwTtlBuilder();
ab.setAction(new DecNwTtlCaseBuilder().setDecNwTtl(nwttl.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final DropActionBuilder drop = new DropActionBuilder();
ab.setAction(new DropActionCaseBuilder().setDropAction(drop.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final FloodActionBuilder fld = new FloodActionBuilder();
ab.setAction(new FloodActionCaseBuilder().setFloodAction(fld.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final FloodAllActionBuilder fldall = new FloodAllActionBuilder();
ab.setAction(new FloodAllActionCaseBuilder().setFloodAllAction(fldall.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
groupActionB.setGroupId(1L);
groupActionB.setGroup("0");
ab.setAction(new GroupActionCaseBuilder().setGroupAction(groupActionB.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final HwPathActionBuilder hwPathB = new HwPathActionBuilder();
ab.setAction(new HwPathActionCaseBuilder().setHwPathAction(hwPathB.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final LoopbackActionBuilder loopbackActionBuilder = new LoopbackActionBuilder();
ab.setAction(new LoopbackActionCaseBuilder().setLoopbackAction(loopbackActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final PopMplsActionBuilder popMplsActionBuilder = new PopMplsActionBuilder();
popMplsActionBuilder.setEthernetType(0XB);
ab.setAction(new PopMplsActionCaseBuilder().setPopMplsAction(popMplsActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final PopPbbActionBuilder popPbbActionBuilder = new PopPbbActionBuilder();
ab.setAction(new PopPbbActionCaseBuilder().setPopPbbAction(popPbbActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final PopVlanActionBuilder popVlanActionBuilder = new PopVlanActionBuilder();
ab.setAction(new PopVlanActionCaseBuilder().setPopVlanAction(popVlanActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final SetDlTypeActionBuilder setDlTypeActionBuilder = new SetDlTypeActionBuilder();
setDlTypeActionBuilder.setDlType(new EtherType(8L));
ab.setAction(new SetDlTypeActionCaseBuilder().setSetDlTypeAction(setDlTypeActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final SetFieldBuilder setFieldBuilder = new SetFieldBuilder();
setFieldBuilder.setInPort(new NodeConnectorId(nodeId + ":2"));
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final SetMplsTtlActionBuilder setMplsTtlActionBuilder = new SetMplsTtlActionBuilder();
setMplsTtlActionBuilder.setMplsTtl((short) 0X1);
ab.setAction(new SetMplsTtlActionCaseBuilder().setSetMplsTtlAction(setMplsTtlActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
ipnext.setIpv4Address(prefix);
setNextHopActionBuilder.setAddress(ipnext.build());
ab.setAction(new SetNextHopActionCaseBuilder().setSetNextHopAction(setNextHopActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
ipdst.setIpv4Address(prefixdst);
setNwDstActionBuilder.setAddress(ipdst.build());
ab.setAction(new SetNwDstActionCaseBuilder().setSetNwDstAction(setNwDstActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
ipsrc.setIpv4Address(prefixsrc);
setNwsrcActionBuilder.setAddress(ipsrc.build());
ab.setAction(new SetNwSrcActionCaseBuilder().setSetNwSrcAction(setNwsrcActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final SetNwTosActionBuilder setNwTosActionBuilder = new SetNwTosActionBuilder();
setNwTosActionBuilder.setTos(8);
ab.setAction(new SetNwTosActionCaseBuilder().setSetNwTosAction(setNwTosActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final SetNwTtlActionBuilder setNwTtlActionBuilder = new SetNwTtlActionBuilder();
setNwTtlActionBuilder.setNwTtl((short) 1);
ab.setAction(new SetNwTtlActionCaseBuilder().setSetNwTtlAction(setNwTtlActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final SetQueueActionBuilder setQueueActionBuilder = new SetQueueActionBuilder();
setQueueActionBuilder.setQueueId(1L);
ab.setAction(new SetQueueActionCaseBuilder().setSetQueueAction(setQueueActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
setTpDstActionBuilder.setPort(new PortNumber(109));
ab.setAction(new SetTpDstActionCaseBuilder().setSetTpDstAction(setTpDstActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final SetTpSrcActionBuilder setTpSrcActionBuilder = new SetTpSrcActionBuilder();
setTpSrcActionBuilder.setPort(new PortNumber(109));
ab.setAction(new SetTpSrcActionCaseBuilder().setSetTpSrcAction(setTpSrcActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final SetVlanCfiActionBuilder setVlanCfiActionBuilder = new SetVlanCfiActionBuilder();
setVlanCfiActionBuilder.setVlanCfi(new VlanCfi(2));
ab.setAction(new SetVlanCfiActionCaseBuilder().setSetVlanCfiAction(setVlanCfiActionBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
final SwPathActionBuilder swPathAction = new SwPathActionBuilder();
ab.setAction(new SwPathActionCaseBuilder().setSwPathAction(swPathAction.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Create an Apply Action
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
setFieldBuilder1.setEthernetMatch(ethernetMatch1.build());
setFieldBuilder2.setEthernetMatch(ethernetMatch2.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionList.add(ab1.build());
ab2.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder2.build()).build());
- ab2.setKey(new ActionKey(2));
+ ab2.withKey(new ActionKey(2));
actionList.add(ab2.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
final List<Instruction> instructions = new ArrayList<>();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
instructions.add(ib.build());
isb.setInstruction(instructions);
return isb;
setFieldBuilder.setVlanMatch(vlanBuilder.build());
setFieldBuilder1.setVlanMatch(vlanBuilder1.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionList.add(ab1.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
ipmatch2.setIpProtocol((short) 120);
setFieldBuilder.setIpMatch(ipmatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
setFieldBuilder1.setIpMatch(ipmatch1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionList.add(ab1.build());
setFieldBuilder2.setIpMatch(ipmatch2.build());
ab2.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder2.build()).build());
- ab2.setKey(new ActionKey(2));
+ ab2.withKey(new ActionKey(2));
actionList.add(ab2.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
ipv4Match.setIpv4Source(srcip);
setFieldBuilder.setLayer3Match(ipv4Match.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
setFieldBuilder1.setLayer3Match(ipv4Match1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionList.add(ab1.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
tcpmatch1.setTcpDestinationPort(tcpdstport);
setFieldBuilder.setLayer4Match(tcpmatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
setFieldBuilder1.setLayer4Match(tcpmatch1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionList.add(ab.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
udpmatch1.setUdpSourcePort(udpsrcport);
setFieldBuilder.setLayer4Match(udpmatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
setFieldBuilder1.setLayer4Match(udpmatch1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionList.add(ab1.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
sctpmatch1.setSctpDestinationPort(dstport);
setFieldBuilder.setLayer4Match(sctpmatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
setFieldBuilder1.setLayer4Match(sctpmatch1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionList.add(ab1.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
icmpv4match1.setIcmpv4Code((short) 0);
setFieldBuilder.setIcmpv4Match(icmpv4match.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
setFieldBuilder1.setIcmpv4Match(icmpv4match1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionList.add(ab1.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
arpmatch4.setArpTargetTransportAddress(dstiparp);
setFieldBuilder.setLayer3Match(arpmatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
setFieldBuilder1.setLayer3Match(arpmatch1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionList.add(ab1.build());
setFieldBuilder2.setLayer3Match(arpmatch2.build());
ab2.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder2.build()).build());
- ab2.setKey(new ActionKey(2));
+ ab2.withKey(new ActionKey(2));
actionList.add(ab2.build());
setFieldBuilder3.setLayer3Match(arpmatch3.build());
ab3.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder3.build()).build());
- ab3.setKey(new ActionKey(3));
+ ab3.withKey(new ActionKey(3));
actionList.add(ab3.build());
setFieldBuilder4.setLayer3Match(arpmatch4.build());
ab4.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder4.build()).build());
- ab4.setKey(new ActionKey(4));
+ ab4.withKey(new ActionKey(4));
actionList.add(ab4.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
setFieldBuilder.setLayer3Match(ipv6Builder.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionLists.add(ab.build());
setFieldBuilder1.setLayer3Match(ipv6Builder1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionLists.add(ab1.build());
setFieldBuilder5.setLayer3Match(ipv6Builder5.build());
ab5.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder5.build()).build());
- ab5.setKey(new ActionKey(5));
+ ab5.withKey(new ActionKey(5));
actionLists.add(ab5.build());
setFieldBuilder6.setLayer3Match(ipv6Builder6.build());
ab6.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder6.build()).build());
- ab6.setKey(new ActionKey(6));
+ ab6.withKey(new ActionKey(6));
actionLists.add(ab6.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionLists);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
icmpv6match1.setIcmpv6Code((short) 0);
setFieldBuilder.setIcmpv6Match(icmpv6match.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
setFieldBuilder1.setIcmpv6Match(icmpv6match1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionList.add(ab1.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
protomatch2.setMplsBos((short) 1);
setFieldBuilder.setProtocolMatchFields(protomatch.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
setFieldBuilder1.setProtocolMatchFields(protomatch1.build());
ab1.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder1.build()).build());
- ab1.setKey(new ActionKey(1));
+ ab1.withKey(new ActionKey(1));
actionList.add(ab1.build());
setFieldBuilder2.setProtocolMatchFields(protomatch2.build());
ab2.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder2.build()).build());
- ab2.setKey(new ActionKey(2));
+ ab2.withKey(new ActionKey(2));
actionList.add(ab2.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
tunnel.setTunnelId(BigInteger.valueOf(10668));
setFieldBuilder.setTunnel(tunnel.build());
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
aab.setAction(actionList);
final InstructionBuilder ib = new InstructionBuilder();
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
// Add the IPv4 tunnel dst to the set_field value
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
ab.setOrder(0);
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Resulting action is a per/flow src TEP (set_field:172.16.100.100->tun_dst)
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Add the action to the ordered list of Instructions
final InstructionBuilder ib = new InstructionBuilder();
ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Add the Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
// Add the IPv4 tunnel src to the set_field value
ab.setAction(new SetFieldCaseBuilder().setSetField(setFieldBuilder.build()).build());
ab.setOrder(0);
- ab.setKey(new ActionKey(0));
+ ab.withKey(new ActionKey(0));
actionList.add(ab.build());
// Resulting action is a per/flow src TEP (set_field:172.16.100.100->tun_src)
final ApplyActionsBuilder aab = new ApplyActionsBuilder();
// Add the action to the ordered list of Instructions
final InstructionBuilder ib = new InstructionBuilder();
ib.setOrder(0);
- ib.setKey(new InstructionKey(0));
+ ib.withKey(new InstructionKey(0));
ib.setInstruction(new ApplyActionsCaseBuilder().setApplyActions(aab.build()).build());
// Put our Instruction in a list of Instructions
final InstructionsBuilder isb = new InstructionsBuilder();
} else {
tf = createTestFlow(tn, flowtype, ci.nextArgument());
}
- final InstanceIdentifier<Flow> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, tn.getKey())
+ final InstanceIdentifier<Flow> path1 = InstanceIdentifier.create(Nodes.class).child(Node.class, tn.key())
.augmentation(FlowCapableNode.class).child(Table.class, new TableKey(tf.getTableId()))
- .child(Flow.class, tf.getKey());
+ .child(Flow.class, tf.key());
modification.delete(LogicalDatastoreType.CONFIGURATION, path1);
final ListenableFuture<Void> commitFuture = modification.submit();
Futures.addCallback(commitFuture, new FutureCallback<Void>() {
private void writeFlow(final CommandInterpreter ci, final FlowBuilder flow, final NodeBuilder nodeBuilder) {
final ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
final InstanceIdentifier<Flow> path1 = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, nodeBuilder.getKey()).augmentation(FlowCapableNode.class)
- .child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flow.getKey());
+ .child(Node.class, nodeBuilder.key()).augmentation(FlowCapableNode.class)
+ .child(Table.class, new TableKey(flow.getTableId())).child(Flow.class, flow.key());
modification.merge(LogicalDatastoreType.CONFIGURATION,
nodeBuilderToInstanceId(nodeBuilder), nodeBuilder.build(), true);
modification.merge(LogicalDatastoreType.CONFIGURATION, path1, flow.build(), true);