Ray Milkey
Committed by Gerrit Code Review

Remove methods deprecated in Drake from Instructions API

Change-Id: I87a20cb9e8abbf4b27bbb4760a62947169866ea6
......@@ -72,17 +72,6 @@ public final class Instructions {
}
/**
* Creates a drop instruction.
*
* @return drop instruction
* @deprecated 1.4.0 Emu Release
*/
@Deprecated
public static DropInstruction createDrop() {
return new DropInstruction();
}
/**
* Creates a no action instruction.
*
* @return no action instruction
......@@ -484,42 +473,6 @@ public final class Instructions {
}
/**
* Drop instruction.
* @deprecated 1.4.0 Emu Release
*/
@Deprecated
public static final class DropInstruction implements Instruction {
private DropInstruction() {}
@Override
public Type type() {
return Type.DROP;
}
@Override
public String toString() {
return type().toString();
}
@Override
public int hashCode() {
return type().ordinal();
}
@Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj instanceof DropInstruction) {
return true;
}
return false;
}
}
/**
* No Action instruction.
*/
public static final class NoActionInstruction implements Instruction {
......
......@@ -101,7 +101,6 @@ public class InstructionsTest {
*/
@Test
public void testImmutabilityOfInstructions() {
assertThatClassIsImmutable(Instructions.DropInstruction.class);
assertThatClassIsImmutable(Instructions.OutputInstruction.class);
assertThatClassIsImmutable(L0ModificationInstruction.ModLambdaInstruction.class);
assertThatClassIsImmutable(L0ModificationInstruction.ModOchSignalInstruction.class);
......@@ -155,40 +154,6 @@ public class InstructionsTest {
assertThat(noAction1.hashCode(), is(equalTo(noAction2.hashCode())));
}
// DropInstruction
private final Instructions.DropInstruction drop1 = Instructions.createDrop();
private final Instructions.DropInstruction drop2 = Instructions.createDrop();
/**
* Test the createDrop method.
*/
@Test
public void testCreateDropMethod() {
Instructions.DropInstruction instruction = Instructions.createDrop();
checkAndConvert(instruction,
Instruction.Type.DROP,
Instructions.DropInstruction.class);
}
/**
* Test the equals() method of the DropInstruction class.
*/
@Test
public void testDropInstructionEquals() throws Exception {
assertThat(drop1, is(equalTo(drop2)));
}
/**
* Test the hashCode() method of the DropInstruction class.
*/
@Test
public void testDropInstructionHashCode() {
assertThat(drop1.hashCode(), is(equalTo(drop2.hashCode())));
}
// OutputInstruction
private final PortNumber port1 = portNumber(1);
......
......@@ -257,8 +257,8 @@ public final class DecodeInstructionCodecHelper {
+ " is not supported");
}
return Instructions.createOutput(portNumber);
} else if (type.equals(Instruction.Type.DROP.name())) {
return Instructions.createDrop();
} else if (type.equals(Instruction.Type.NOACTION.name())) {
return Instructions.createNoAction();
} else if (type.equals(Instruction.Type.L0MODIFICATION.name())) {
return decodeL0();
} else if (type.equals(Instruction.Type.L1MODIFICATION.name())) {
......
......@@ -73,18 +73,6 @@ public class InstructionCodecTest {
}
/**
* Tests the encoding of drop instructions.
*/
@Test
public void dropInstructionTest() {
final Instructions.DropInstruction instruction =
Instructions.createDrop();
final ObjectNode instructionJson =
instructionCodec.encode(instruction, context);
assertThat(instructionJson, matchesInstruction(instruction));
}
/**
* Tests the encoding of output instructions.
*/
@Test
......
......@@ -20,7 +20,6 @@ import org.hamcrest.TypeSafeDiagnosingMatcher;
import org.onlab.util.HexString;
import org.onosproject.net.OduSignalId;
import org.onosproject.net.flow.instructions.Instruction;
import org.onosproject.net.flow.instructions.Instructions.DropInstruction;
import org.onosproject.net.flow.instructions.Instructions.NoActionInstruction;
import org.onosproject.net.flow.instructions.Instructions.OutputInstruction;
import org.onosproject.net.flow.instructions.L0ModificationInstruction.ModLambdaInstruction;
......@@ -452,8 +451,6 @@ public final class InstructionJsonMatcher extends TypeSafeDiagnosingMatcher<Json
if (instruction instanceof PushHeaderInstructions) {
return matchPushHeaderInstruction(jsonInstruction, description);
} else if (instruction instanceof DropInstruction) {
return true;
} else if (instruction instanceof OutputInstruction) {
return matchOutputInstruction(jsonInstruction, description);
} else if (instruction instanceof ModLambdaInstruction) {
......
......@@ -17,7 +17,7 @@
"port": -3
},
{
"type": "DROP"
"type": "NOACTION"
}
],
"deferred": []
......
......@@ -17,7 +17,7 @@
"instructions":
[
{"type":"OUTPUT","port":-3},
{"type":"DROP"}
{"type":"NOACTION"}
],
"deferred":[]
}
......
......@@ -10,7 +10,7 @@
"port": -3
},
{
"type": "DROP"
"type": "NOACTION"
}
],
"deferred": []
......
......@@ -8,7 +8,7 @@
"instructions":
[
{"type":"OUTPUT","port":-3},
{"type":"DROP"},
{"type":"NOACTION"},
{"type":"L2MODIFICATION","subtype":"ETH_SRC","mac":"12:34:56:78:90:12"},
{"type":"L2MODIFICATION","subtype":"ETH_DST","mac":"98:76:54:32:01:00"},
{"type":"L2MODIFICATION","subtype":"VLAN_ID","vlanId":22},
......
......@@ -382,7 +382,6 @@ public final class KryoNamespaces {
Criterion.class,
Criterion.Type.class,
DefaultTrafficTreatment.class,
Instructions.DropInstruction.class,
Instructions.NoActionInstruction.class,
Instructions.OutputInstruction.class,
Instructions.GroupInstruction.class,
......
......@@ -118,7 +118,7 @@ public class DefaultSingleTablePipeline extends AbstractHandlerBehaviour impleme
(fwd.treatment().tableTransition() == null) &&
(!fwd.treatment().clearedDeferred())) {
TrafficTreatment.Builder flowTreatment = DefaultTrafficTreatment.builder();
flowTreatment.add(Instructions.createDrop());
flowTreatment.add(Instructions.createNoAction());
treatment = flowTreatment.build();
}
......
......@@ -293,7 +293,7 @@ public class OpenVSwitchPipeline extends DefaultSingleTablePipeline
// MAC table flow rules
if ((selector.getCriterion(Type.TUNNEL_ID) != null && selector
.getCriterion(Type.ETH_DST) != null)
|| tb.allInstructions().contains(Instructions.createDrop())) {
|| tb.allInstructions().contains(Instructions.createNoAction())) {
forTable = MAC_TABLE;
return reassemblyFlowRule(ruleBuilder, tb, transition, forTable);
}
......
......@@ -18,7 +18,7 @@
"port": -3
},
{
"type": "DROP"
"type": "NOACTION"
}
]
}
......
......@@ -17,7 +17,7 @@
"instructions":
[
{"type":"OUTPUT","port":-3},
{"type":"DROP"}
{"type":"NOACTION"}
]
}
}
......
......@@ -10,7 +10,7 @@
"port": -3
},
{
"type": "DROP"
"type": "NOACTION"
}
]
}
......