*/
package org.opendaylight.openflowplugin.test;
+import com.google.common.base.Preconditions;
import com.google.common.util.concurrent.CheckedFuture;
import com.google.common.util.concurrent.FutureCallback;
import com.google.common.util.concurrent.Futures;
import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
import org.osgi.framework.BundleContext;
-
+@SuppressWarnings("checkstyle:MethodName")
public class OpenflowpluginTableFeaturesTestCommandProvider implements CommandProvider {
private DataBroker dataBroker;
- private ProviderContext pc;
private final BundleContext ctx;
- private TableFeatures testTable;
private Node testNode;
- private final String originalTableName = "Foo";
- private final String updatedTableName = "Bar";
public OpenflowpluginTableFeaturesTestCommandProvider(BundleContext ctx) {
this.ctx = ctx;
}
public void onSessionInitiated(ProviderContext session) {
- pc = session;
dataBroker = session.getSALService(DataBroker.class);
ctx.registerService(CommandProvider.class.getName(), this, null);
// createTestNode();
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) {
tableFeature.setConfig(new TableConfig(false));
- List<TableFeatureProperties> properties = new ArrayList<TableFeatureProperties>();
+ List<TableFeatureProperties> properties = new ArrayList<>();
switch (tableFeatureType) {
// To set the wildcards set field match
properties.add(createWildCardsTblFeatureProp().build());
break;
+ default:
+ break;
}
propertyBld.setTableFeatureProperties(properties);
tableFeature.setTableProperties(propertyBld.build());
}
- testTable = tableFeature.build();
return tableFeature;
}
TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
//To set the ApplyActionsMiss
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder ab = new ActionBuilder();
ab.setAction(new PopMplsActionCaseBuilder().build());
actionList.add(ab.build());
tableFeatureProperty.setTableFeaturePropType(
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsMissBuilder()
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+ .feature.prop.type.ApplyActionsMissBuilder()
.setApplyActionsMiss(new ApplyActionsMissBuilder().setAction(actionList).build()).build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
private TableFeaturePropertiesBuilder createApplyActionsTblFeatureProp() {
TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
- List<Action> actionListt5 = new ArrayList<Action>();
+ List<Action> actionListt5 = new ArrayList<>();
ActionBuilder abt5 = new ActionBuilder();
abt5.setAction(new PopMplsActionCaseBuilder().build());
actionListt5.add(abt5.build());
tableFeatureProperty.setTableFeaturePropType(
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.ApplyActionsBuilder()
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+ .feature.prop.type.ApplyActionsBuilder()
.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;
private TableFeaturePropertiesBuilder createInstructionsTblFeatureProp() {
- TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
-
- List<Instruction> instLst = new ArrayList<Instruction>();
InstructionBuilder ib = new InstructionBuilder();
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.setInstruction(new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction
+ .instruction.ApplyActionsCaseBuilder().build());
+ ib.withKey(new InstructionKey(1));
+ List<Instruction> instLst = new ArrayList<>();
+ TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsBuilder().setInstructions(
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.instructions.InstructionsBuilder().setInstruction(instLst).build()).build());
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+ .feature.prop.type.InstructionsBuilder().setInstructions(
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type
+ .table.feature.prop.type.instructions.InstructionsBuilder().setInstruction(instLst).build())
+ .build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
private TableFeaturePropertiesBuilder createInstructionsMissTblFeatureProp() {
// To set the instructions miss -- "t7"
- TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
- List<Instruction> instLst = new ArrayList<Instruction>();
InstructionBuilder ib1 = new InstructionBuilder();
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.setInstruction(new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction
+ .instruction.WriteMetadataCaseBuilder().build());
+ 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.setInstruction(new org.opendaylight.yang.gen.v1.urn.opendaylight.flow.types.rev131026.instruction
+ .instruction.MeterCaseBuilder().build());
+ ib2.withKey(new InstructionKey(2));
+ List<Instruction> instLst = new ArrayList<>();
+ TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.InstructionsMissBuilder().setInstructionsMiss(
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.instructions.miss.InstructionsMissBuilder().setInstruction(instLst).build()).build());
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+ .feature.prop.type.InstructionsMissBuilder().setInstructionsMiss(
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type
+ .table.feature.prop.type.instructions.miss.InstructionsMissBuilder().setInstruction(instLst)
+ .build()).build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
private TableFeaturePropertiesBuilder createWriteActionsTblFeatureProp() {
// t8
- TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder abt1 = new ActionBuilder();
abt1.setAction(new CopyTtlOutCaseBuilder().build());
abt2.setAction(new PopVlanActionCaseBuilder().build());
actionList.add(abt2.build());
+ TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsBuilder()
- .setWriteActions(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.actions.WriteActionsBuilder().setAction(actionList).build()).build());
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+ .feature.prop.type.WriteActionsBuilder().setWriteActions(new org.opendaylight.yang.gen.v1.urn
+ .opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.actions
+ .WriteActionsBuilder().setAction(actionList).build()).build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
private TableFeaturePropertiesBuilder createWriteActionsMissTblFeatureProp() {
// t9
- TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
-
- List<Action> actionList = new ArrayList<Action>();
+ List<Action> actionList = new ArrayList<>();
ActionBuilder abt1 = new ActionBuilder();
abt1.setAction(new CopyTtlInCaseBuilder().build());
abt2.setAction(new PushPbbActionCaseBuilder().build());
actionList.add(abt2.build());
+ TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.WriteActionsMissBuilder()
- .setWriteActionsMiss(new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.actions.miss.WriteActionsMissBuilder().setAction(actionList).build()).build());
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+ .feature.prop.type.WriteActionsMissBuilder().setWriteActionsMiss(new org.opendaylight.yang.gen.v1.urn
+ .opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.actions
+ .miss.WriteActionsMissBuilder().setAction(actionList).build()).build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
private TableFeaturePropertiesBuilder createMatchFieldTblFeatureProp() {
//t10
- TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
-
- List<SetFieldMatch> setFieldMatch = new ArrayList<SetFieldMatch>();
+ List<SetFieldMatch> setFieldMatch = new ArrayList<>();
SetFieldMatchBuilder setFieldMatchBld = new SetFieldMatchBuilder();
setFieldMatchBld.setHasMask(false);
setFieldMatchBld.setMatchType(MplsLabel.class);
matchSetfieldBld.setSetFieldMatch(setFieldMatch);
matchBld.setMatchSetfield(matchSetfieldBld.build());
+ TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(matchBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
private TableFeaturePropertiesBuilder createWriteSetFieldTblFeatureProp() {
//t11
- TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
- List<SetFieldMatch> setFieldMatch = new ArrayList<SetFieldMatch>();
SetFieldMatchBuilder setFieldMatchBld1 = new SetFieldMatchBuilder();
setFieldMatchBld1.setHasMask(false);
setFieldMatchBld1.setMatchType(MplsLabel.class);
setFieldMatchBld3.setHasMask(true);
setFieldMatchBld3.setMatchType(EthDst.class);
+ List<SetFieldMatch> setFieldMatch = new ArrayList<>();
setFieldMatch.add(setFieldMatchBld1.build());
setFieldMatch.add(setFieldMatchBld2.build());
setFieldMatch.add(setFieldMatchBld3.build());
WriteSetfieldBuilder writeSetfieldBld = new WriteSetfieldBuilder();
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.setfield.WriteSetfieldBuilder writeSetfieldBuilder =
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.setfield.WriteSetfieldBuilder();
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop
+ .type.write.setfield.WriteSetfieldBuilder writeSetfieldBuilder =
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+ .feature.prop.type.write.setfield.WriteSetfieldBuilder();
writeSetfieldBuilder.setSetFieldMatch(setFieldMatch);
writeSetfieldBld.setWriteSetfield(writeSetfieldBuilder.build());
-
+ TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(writeSetfieldBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
private TableFeaturePropertiesBuilder createWriteSetFieldMissTblFeatureProp() {
// t12
- TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
- List<SetFieldMatch> setFieldMatch = new ArrayList<SetFieldMatch>();
SetFieldMatchBuilder setFieldMatchBld1 = new SetFieldMatchBuilder();
setFieldMatchBld1.setHasMask(false);
setFieldMatchBld1.setMatchType(EthSrc.class);
setFieldMatchBld3.setHasMask(true);
setFieldMatchBld3.setMatchType(Ipv4Dst.class);
+ List<SetFieldMatch> setFieldMatch = new ArrayList<>();
setFieldMatch.add(setFieldMatchBld1.build());
setFieldMatch.add(setFieldMatchBld2.build());
setFieldMatch.add(setFieldMatchBld3.build());
WriteSetfieldMissBuilder writeSetfieldBld = new WriteSetfieldMissBuilder();
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.setfield.miss.WriteSetfieldMissBuilder writeSetfieldMissBuilder =
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.write.setfield.miss.WriteSetfieldMissBuilder();
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop
+ .type.write.setfield.miss.WriteSetfieldMissBuilder writeSetfieldMissBuilder =
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+ .feature.prop.type.write.setfield.miss.WriteSetfieldMissBuilder();
writeSetfieldMissBuilder.setSetFieldMatch(setFieldMatch);
writeSetfieldBld.setWriteSetfieldMiss(writeSetfieldMissBuilder.build());
+ TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(writeSetfieldBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
private TableFeaturePropertiesBuilder createApplySetFieldTblFeatureProp() {
//t13
- TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
- List<SetFieldMatch> setFieldMatch = new ArrayList<SetFieldMatch>();
SetFieldMatchBuilder setFieldMatchBld1 = new SetFieldMatchBuilder();
setFieldMatchBld1.setHasMask(false);
setFieldMatchBld1.setMatchType(ArpOp.class);
setFieldMatchBld3.setHasMask(true);
setFieldMatchBld3.setMatchType(Ipv4Dst.class);
+ List<SetFieldMatch> setFieldMatch = new ArrayList<>();
setFieldMatch.add(setFieldMatchBld1.build());
setFieldMatch.add(setFieldMatchBld2.build());
setFieldMatch.add(setFieldMatchBld3.build());
ApplySetfieldBuilder applySetfieldBld = new ApplySetfieldBuilder();
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.ApplySetfieldBuilder applySetfieldBuilder =
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.ApplySetfieldBuilder();
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop
+ .type.apply.setfield.ApplySetfieldBuilder applySetfieldBuilder =
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+ .feature.prop.type.apply.setfield.ApplySetfieldBuilder();
applySetfieldBuilder.setSetFieldMatch(setFieldMatch);
applySetfieldBld.setApplySetfield(applySetfieldBuilder.build());
+ TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(applySetfieldBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
private TableFeaturePropertiesBuilder createApplySetFieldMissTblFeatureProp() {
//t14
- TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
- List<SetFieldMatch> setFieldMatch = new ArrayList<SetFieldMatch>();
SetFieldMatchBuilder setFieldMatchBld1 = new SetFieldMatchBuilder();
setFieldMatchBld1.setHasMask(false);
setFieldMatchBld1.setMatchType(ArpOp.class);
setFieldMatchBld3.setHasMask(true);
setFieldMatchBld3.setMatchType(Ipv4Dst.class);
+ List<SetFieldMatch> setFieldMatch = new ArrayList<>();
setFieldMatch.add(setFieldMatchBld1.build());
setFieldMatch.add(setFieldMatchBld2.build());
setFieldMatch.add(setFieldMatchBld3.build());
ApplySetfieldMissBuilder applySetfieldMissBld = new ApplySetfieldMissBuilder();
- org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.miss.ApplySetfieldMissBuilder applySetfieldMissBuilder =
- new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop.type.apply.setfield.miss.ApplySetfieldMissBuilder();
+ org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table.feature.prop
+ .type.apply.setfield.miss.ApplySetfieldMissBuilder applySetfieldMissBuilder =
+ new org.opendaylight.yang.gen.v1.urn.opendaylight.table.types.rev131026.table.feature.prop.type.table
+ .feature.prop.type.apply.setfield.miss.ApplySetfieldMissBuilder();
applySetfieldMissBuilder.setSetFieldMatch(setFieldMatch);
applySetfieldMissBld.setApplySetfieldMiss(applySetfieldMissBuilder.build());
+ TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(applySetfieldMissBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
private TableFeaturePropertiesBuilder createWildCardsTblFeatureProp() {
//t15
- TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
- List<SetFieldMatch> setFieldMatch = new ArrayList<SetFieldMatch>();
SetFieldMatchBuilder setFieldMatchBld1 = new SetFieldMatchBuilder();
setFieldMatchBld1.setHasMask(false);
setFieldMatchBld1.setMatchType(ArpOp.class);
setFieldMatchBld2.setHasMask(true);
setFieldMatchBld2.setMatchType(InPort.class);
-
+ List<SetFieldMatch> setFieldMatch = new ArrayList<>();
setFieldMatch.add(setFieldMatchBld1.build());
setFieldMatch.add(setFieldMatchBld2.build());
wildcardsBuilder.setSetFieldMatch(setFieldMatch);
wildCardsBld.setWildcardSetfield(wildcardsBuilder.build());
+ TableFeaturePropertiesBuilder tableFeatureProperty = new TableFeaturePropertiesBuilder();
tableFeatureProperty.setTableFeaturePropType(wildCardsBld.build());
TableFeaturePropertiesKey keyValue = new TableFeaturePropertiesKey(0);
- tableFeatureProperty.setKey(keyValue);
+ tableFeatureProperty.withKey(keyValue);
tableFeatureProperty.setOrder(1);
return tableFeatureProperty;
}
-
private void writeTableFeatures(final CommandInterpreter ci, TableFeatures tableFeatures) {
- ReadWriteTransaction modification = dataBroker.newReadWriteTransaction();
+ ReadWriteTransaction modification = Preconditions.checkNotNull(dataBroker).newReadWriteTransaction();
KeyedInstanceIdentifier<TableFeatures, TableFeaturesKey> path1 = InstanceIdentifier.create(Nodes.class)
- .child(Node.class, testNode.getKey()).augmentation(FlowCapableNode.class).
- child(TableFeatures.class, new TableFeaturesKey(tableFeatures.getTableId()));
-
+ .child(Node.class, testNode.key()).augmentation(FlowCapableNode.class)
+ .child(TableFeatures.class, new TableFeaturesKey(tableFeatures.getTableId()));
modification.merge(LogicalDatastoreType.OPERATIONAL, nodeToInstanceId(testNode), testNode, true);
modification.merge(LogicalDatastoreType.OPERATIONAL, path1, tableFeatures, true);
CheckedFuture<Void, TransactionCommitFailedException> commitFuture = modification.submit();
Futures.addCallback(commitFuture, new FutureCallback<Void>() {
@Override
- public void onSuccess(Void aVoid) {
+ public void onSuccess(Void notUsed) {
ci.println("Status of Group Data Loaded Transaction: success.");
}
return help.toString();
}
-
}