Sho SHIMIZU
Committed by Gerrit Code Review

Remove optical related APIs deprecated in Cardinal

Change-Id: I0e428039cc99247d1bfe6493a926ebac0adb1ebc
...@@ -23,7 +23,6 @@ import org.onlab.packet.MacAddress; ...@@ -23,7 +23,6 @@ import org.onlab.packet.MacAddress;
23 import org.onlab.packet.MplsLabel; 23 import org.onlab.packet.MplsLabel;
24 import org.onlab.packet.TpPort; 24 import org.onlab.packet.TpPort;
25 import org.onlab.packet.VlanId; 25 import org.onlab.packet.VlanId;
26 -import org.onosproject.net.IndexedLambda;
27 import org.onosproject.net.PortNumber; 26 import org.onosproject.net.PortNumber;
28 import org.onosproject.net.flow.criteria.Criteria; 27 import org.onosproject.net.flow.criteria.Criteria;
29 import org.onosproject.net.flow.criteria.Criterion; 28 import org.onosproject.net.flow.criteria.Criterion;
...@@ -352,18 +351,6 @@ public final class DefaultTrafficSelector implements TrafficSelector { ...@@ -352,18 +351,6 @@ public final class DefaultTrafficSelector implements TrafficSelector {
352 return add(Criteria.matchIPv6ExthdrFlags(exthdrFlags)); 351 return add(Criteria.matchIPv6ExthdrFlags(exthdrFlags));
353 } 352 }
354 353
355 - @Deprecated
356 - @Override
357 - public Builder matchLambda(short lambda) {
358 - return add(Criteria.matchLambda(new IndexedLambda(lambda)));
359 - }
360 -
361 - @Deprecated
362 - @Override
363 - public Builder matchOpticalSignalType(short signalType) {
364 - return add(Criteria.matchOpticalSignalType(signalType));
365 - }
366 -
367 @Override 354 @Override
368 public TrafficSelector build() { 355 public TrafficSelector build() {
369 return new DefaultTrafficSelector(ImmutableSet.copyOf(selector.values())); 356 return new DefaultTrafficSelector(ImmutableSet.copyOf(selector.values()));
......
...@@ -386,30 +386,6 @@ public interface TrafficSelector { ...@@ -386,30 +386,6 @@ public interface TrafficSelector {
386 Builder matchIPv6ExthdrFlags(short exthdrFlags); 386 Builder matchIPv6ExthdrFlags(short exthdrFlags);
387 387
388 /** 388 /**
389 - * Matches an optical signal ID or lambda.
390 - *
391 - * @param lambda lambda
392 - * @return a selection builder
393 - * @deprecated in Cardinal Release.
394 - * Use {@link #add(Criterion)} with an instance created
395 - * by {@link org.onosproject.net.flow.criteria.Criteria#matchLambda(org.onosproject.net.Lambda)}.
396 - */
397 - @Deprecated
398 - Builder matchLambda(short lambda);
399 -
400 - /**
401 - * Matches an optical Signal Type.
402 - *
403 - * @param signalType signalType
404 - * @return a selection builder
405 - * @deprecated in Cardinal Release.
406 - * Use {@link #add(Criterion)}} with an instance created
407 - * by {@link org.onosproject.net.flow.criteria.Criteria#matchOchSignalType(org.onosproject.net.OchSignalType)}.
408 - */
409 - @Deprecated
410 - Builder matchOpticalSignalType(short signalType);
411 -
412 - /**
413 * Builds an immutable traffic selector. 389 * Builds an immutable traffic selector.
414 * 390 *
415 * @return traffic selector 391 * @return traffic selector
......
...@@ -461,18 +461,6 @@ public final class Criteria { ...@@ -461,18 +461,6 @@ public final class Criteria {
461 } 461 }
462 462
463 /** 463 /**
464 - * Creates a match on lambda field using the specified value.
465 - *
466 - * @param lambda lambda to match on (16 bits unsigned integer)
467 - * @return match criterion
468 - * @deprecated in Cardinal Release. Use {@link #matchLambda(Lambda)} instead.
469 - */
470 - @Deprecated
471 - public static Criterion matchLambda(int lambda) {
472 - return new LambdaCriterion(lambda, Type.OCH_SIGID);
473 - }
474 -
475 - /**
476 * Creates a match on lambda using the specified value. 464 * Creates a match on lambda using the specified value.
477 * 465 *
478 * @param lambda lambda 466 * @param lambda lambda
...@@ -489,18 +477,6 @@ public final class Criteria { ...@@ -489,18 +477,6 @@ public final class Criteria {
489 } 477 }
490 478
491 /** 479 /**
492 - * Creates a match on optical signal type using the specified value.
493 - *
494 - * @param sigType optical signal type (8 bits unsigned integer)
495 - * @return match criterion
496 - * @deprecated in Cardinal Release
497 - */
498 - @Deprecated
499 - public static Criterion matchOpticalSignalType(short sigType) {
500 - return new OpticalSignalTypeCriterion(sigType, Type.OCH_SIGTYPE);
501 - }
502 -
503 - /**
504 * Create a match on OCh (Optical Channel) signal type. 480 * Create a match on OCh (Optical Channel) signal type.
505 * 481 *
506 * @param signalType OCh signal type 482 * @param signalType OCh signal type
......
1 -/*
2 - * Copyright 2015 Open Networking Laboratory
3 - *
4 - * Licensed under the Apache License, Version 2.0 (the "License");
5 - * you may not use this file except in compliance with the License.
6 - * You may obtain a copy of the License at
7 - *
8 - * http://www.apache.org/licenses/LICENSE-2.0
9 - *
10 - * Unless required by applicable law or agreed to in writing, software
11 - * distributed under the License is distributed on an "AS IS" BASIS,
12 - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 - * See the License for the specific language governing permissions and
14 - * limitations under the License.
15 - */
16 -package org.onosproject.net.flow.criteria;
17 -
18 -import java.util.Objects;
19 -
20 -import static com.google.common.base.MoreObjects.toStringHelper;
21 -
22 -/**
23 - * Implementation of optical signal type criterion (8 bits unsigned
24 - * integer).
25 - *
26 - * @deprecated in Cardinal Release
27 - */
28 -@Deprecated
29 -public final class OpticalSignalTypeCriterion implements Criterion {
30 - private static final short MASK = 0xff;
31 - private final short signalType; // Signal type value: 8 bits
32 - private final Type type;
33 -
34 - /**
35 - * Constructor.
36 - *
37 - * @param signalType the optical signal type to match (8 bits unsigned
38 - * integer)
39 - * @param type the match type. Should be Type.OCH_SIGTYPE
40 - */
41 - OpticalSignalTypeCriterion(short signalType, Type type) {
42 - this.signalType = (short) (signalType & MASK);
43 - this.type = type;
44 - }
45 -
46 - @Override
47 - public Type type() {
48 - return this.type;
49 - }
50 -
51 - /**
52 - * Gets the optical signal type to match.
53 - *
54 - * @return the optical signal type to match (8 bits unsigned integer)
55 - */
56 - public short signalType() {
57 - return signalType;
58 - }
59 -
60 - @Override
61 - public String toString() {
62 - return toStringHelper(type().toString())
63 - .add("signalType", signalType).toString();
64 - }
65 -
66 - @Override
67 - public int hashCode() {
68 - return Objects.hash(type().ordinal(), signalType);
69 - }
70 -
71 - @Override
72 - public boolean equals(Object obj) {
73 - if (this == obj) {
74 - return true;
75 - }
76 - if (obj instanceof OpticalSignalTypeCriterion) {
77 - OpticalSignalTypeCriterion that = (OpticalSignalTypeCriterion) obj;
78 - return Objects.equals(signalType, that.signalType) &&
79 - Objects.equals(type, that.type);
80 - }
81 - return false;
82 - }
83 -}
...@@ -89,19 +89,6 @@ public final class Instructions { ...@@ -89,19 +89,6 @@ public final class Instructions {
89 } 89 }
90 90
91 /** 91 /**
92 - * Creates a l0 modification.
93 - *
94 - * @param lambda the lambda to modify to
95 - * @return a l0 modification
96 - * @deprecated in Cardinal Release. Use {@link #modL0Lambda(Lambda)} instead.
97 - */
98 - @Deprecated
99 - public static L0ModificationInstruction modL0Lambda(short lambda) {
100 - checkNotNull(lambda, "L0 lambda cannot be null");
101 - return new ModLambdaInstruction(L0SubType.LAMBDA, lambda);
102 - }
103 -
104 - /**
105 * Creates an L0 modification with the specified OCh signal. 92 * Creates an L0 modification with the specified OCh signal.
106 * 93 *
107 * @param lambda OCh signal 94 * @param lambda OCh signal
......
...@@ -267,29 +267,5 @@ public class DefaultTrafficSelectorTest { ...@@ -267,29 +267,5 @@ public class DefaultTrafficSelectorTest {
267 selector = DefaultTrafficSelector.builder() 267 selector = DefaultTrafficSelector.builder()
268 .add(Criteria.matchLambda(new IndexedLambda(shortValue))).build(); 268 .add(Criteria.matchLambda(new IndexedLambda(shortValue))).build();
269 assertThat(selector, hasCriterionWithType(Type.OCH_SIGID)); 269 assertThat(selector, hasCriterionWithType(Type.OCH_SIGID));
270 -
271 - selector = DefaultTrafficSelector.builder()
272 - .add(Criteria.matchOpticalSignalType(shortValue)).build();
273 - assertThat(selector, hasCriterionWithType(Type.OCH_SIGTYPE));
274 - }
275 -
276 - /**
277 - * Tests the traffic selector builder.
278 - */
279 - @Test
280 - public void testTrafficSelectorBuilder() {
281 - TrafficSelector selector;
282 - final short shortValue = 33;
283 -
284 - final TrafficSelector baseSelector = DefaultTrafficSelector.builder()
285 - .add(Criteria.matchLambda(new IndexedLambda(shortValue))).build();
286 - selector = DefaultTrafficSelector.builder(baseSelector)
287 - .build();
288 - assertThat(selector, hasCriterionWithType(Type.OCH_SIGID));
289 -
290 - final Criterion criterion = Criteria.matchLambda(shortValue);
291 - selector = DefaultTrafficSelector.builder()
292 - .add(criterion).build();
293 - assertThat(selector, hasCriterionWithType(Type.OCH_SIGID));
294 } 270 }
295 } 271 }
......
...@@ -225,12 +225,6 @@ public class CriteriaTest { ...@@ -225,12 +225,6 @@ public class CriteriaTest {
225 Criterion matchIpv6ExthdrFlags2 = 225 Criterion matchIpv6ExthdrFlags2 =
226 Criteria.matchIPv6ExthdrFlags(ipv6ExthdrFlags2); 226 Criteria.matchIPv6ExthdrFlags(ipv6ExthdrFlags2);
227 227
228 - int lambda1 = 1;
229 - int lambda2 = 2;
230 - Criterion matchLambda1 = Criteria.matchLambda(lambda1);
231 - Criterion sameAsMatchLambda1 = Criteria.matchLambda(lambda1);
232 - Criterion matchLambda2 = Criteria.matchLambda(lambda2);
233 -
234 Criterion matchOchSignalType1 = Criteria.matchOchSignalType(OchSignalType.FIXED_GRID); 228 Criterion matchOchSignalType1 = Criteria.matchOchSignalType(OchSignalType.FIXED_GRID);
235 Criterion sameAsMatchOchSignalType1 = Criteria.matchOchSignalType(OchSignalType.FIXED_GRID); 229 Criterion sameAsMatchOchSignalType1 = Criteria.matchOchSignalType(OchSignalType.FIXED_GRID);
236 Criterion matchOchSignalType2 = Criteria.matchOchSignalType(OchSignalType.FLEX_GRID); 230 Criterion matchOchSignalType2 = Criteria.matchOchSignalType(OchSignalType.FLEX_GRID);
...@@ -239,12 +233,6 @@ public class CriteriaTest { ...@@ -239,12 +233,6 @@ public class CriteriaTest {
239 Criterion sameAsMatchIndexedLambda1 = Criteria.matchLambda(Lambda.indexedLambda(1)); 233 Criterion sameAsMatchIndexedLambda1 = Criteria.matchLambda(Lambda.indexedLambda(1));
240 Criterion matchIndexedLambda2 = Criteria.matchLambda(Lambda.indexedLambda(2)); 234 Criterion matchIndexedLambda2 = Criteria.matchLambda(Lambda.indexedLambda(2));
241 235
242 - short signalLambda1 = 1;
243 - short signalLambda2 = 2;
244 - Criterion matchSignalLambda1 = Criteria.matchOpticalSignalType(signalLambda1);
245 - Criterion sameAsMatchSignalLambda1 = Criteria.matchOpticalSignalType(signalLambda1);
246 - Criterion matchSignalLambda2 = Criteria.matchOpticalSignalType(signalLambda2);
247 -
248 Criterion matchOchSignal1 = 236 Criterion matchOchSignal1 =
249 Criteria.matchLambda(Lambda.ochSignal(GridType.DWDM, ChannelSpacing.CHL_100GHZ, 4, 8)); 237 Criteria.matchLambda(Lambda.ochSignal(GridType.DWDM, ChannelSpacing.CHL_100GHZ, 4, 8));
250 Criterion sameAsMatchOchSignal1 = 238 Criterion sameAsMatchOchSignal1 =
...@@ -306,7 +294,6 @@ public class CriteriaTest { ...@@ -306,7 +294,6 @@ public class CriteriaTest {
306 assertThatClassIsImmutable(MplsCriterion.class); 294 assertThatClassIsImmutable(MplsCriterion.class);
307 assertThatClassIsImmutable(IPv6ExthdrFlagsCriterion.class); 295 assertThatClassIsImmutable(IPv6ExthdrFlagsCriterion.class);
308 assertThatClassIsImmutable(LambdaCriterion.class); 296 assertThatClassIsImmutable(LambdaCriterion.class);
309 - assertThatClassIsImmutable(OpticalSignalTypeCriterion.class);
310 } 297 }
311 298
312 // PortCriterion class 299 // PortCriterion class
...@@ -1057,32 +1044,6 @@ public class CriteriaTest { ...@@ -1057,32 +1044,6 @@ public class CriteriaTest {
1057 .testEquals(); 1044 .testEquals();
1058 } 1045 }
1059 1046
1060 - // LambdaCriterion class
1061 -
1062 - /**
1063 - * Test the matchLambda method.
1064 - */
1065 - @Test
1066 - public void testMatchLambdaMethod() {
1067 - Criterion matchLambda = Criteria.matchLambda(lambda1);
1068 - LambdaCriterion lambdaCriterion =
1069 - checkAndConvert(matchLambda,
1070 - Criterion.Type.OCH_SIGID,
1071 - LambdaCriterion.class);
1072 - assertThat(lambdaCriterion.lambda(), is(equalTo(lambda1)));
1073 - }
1074 -
1075 - /**
1076 - * Test the equals() method of the LambdaCriterion class.
1077 - */
1078 - @Test
1079 - public void testLambdaCriterionEquals() {
1080 - new EqualsTester()
1081 - .addEqualityGroup(matchLambda1, sameAsMatchLambda1)
1082 - .addEqualityGroup(matchLambda2)
1083 - .testEquals();
1084 - }
1085 -
1086 @Test 1047 @Test
1087 public void testIndexedLambdaCriterionEquals() { 1048 public void testIndexedLambdaCriterionEquals() {
1088 new EqualsTester() 1049 new EqualsTester()
...@@ -1109,30 +1070,4 @@ public class CriteriaTest { ...@@ -1109,30 +1070,4 @@ public class CriteriaTest {
1109 .addEqualityGroup(matchOchSignalType2) 1070 .addEqualityGroup(matchOchSignalType2)
1110 .testEquals(); 1071 .testEquals();
1111 } 1072 }
1112 -
1113 - // OpticalSignalTypeCriterion class
1114 -
1115 - /**
1116 - * Test the matchOpticalSignalType method.
1117 - */
1118 - @Test
1119 - public void testMatchOpticalSignalTypeMethod() {
1120 - Criterion matchLambda = Criteria.matchOpticalSignalType(signalLambda1);
1121 - OpticalSignalTypeCriterion opticalSignalTypeCriterion =
1122 - checkAndConvert(matchLambda,
1123 - Criterion.Type.OCH_SIGTYPE,
1124 - OpticalSignalTypeCriterion.class);
1125 - assertThat(opticalSignalTypeCriterion.signalType(), is(equalTo(signalLambda1)));
1126 - }
1127 -
1128 - /**
1129 - * Test the equals() method of the OpticalSignalTypeCriterion class.
1130 - */
1131 - @Test
1132 - public void testOpticalSignalTypeCriterionEquals() {
1133 - new EqualsTester()
1134 - .addEqualityGroup(matchSignalLambda1, sameAsMatchSignalLambda1)
1135 - .addEqualityGroup(matchSignalLambda2)
1136 - .testEquals();
1137 - }
1138 } 1073 }
......
...@@ -38,10 +38,8 @@ import org.onosproject.net.flow.criteria.Criterion; ...@@ -38,10 +38,8 @@ import org.onosproject.net.flow.criteria.Criterion;
38 import com.fasterxml.jackson.databind.node.ObjectNode; 38 import com.fasterxml.jackson.databind.node.ObjectNode;
39 39
40 import static org.hamcrest.MatcherAssert.assertThat; 40 import static org.hamcrest.MatcherAssert.assertThat;
41 -import static org.hamcrest.Matchers.is;
42 import static org.hamcrest.Matchers.notNullValue; 41 import static org.hamcrest.Matchers.notNullValue;
43 import static org.onlab.junit.TestUtils.getField; 42 import static org.onlab.junit.TestUtils.getField;
44 -import static org.onlab.junit.TestUtils.setField;
45 import static org.onosproject.codec.impl.CriterionJsonMatcher.matchesCriterion; 43 import static org.onosproject.codec.impl.CriterionJsonMatcher.matchesCriterion;
46 44
47 /** 45 /**
...@@ -429,17 +427,4 @@ public class CriterionCodecTest { ...@@ -429,17 +427,4 @@ public class CriterionCodecTest {
429 ObjectNode result = criterionCodec.encode(criterion, context); 427 ObjectNode result = criterionCodec.encode(criterion, context);
430 assertThat(result, matchesCriterion(criterion)); 428 assertThat(result, matchesCriterion(criterion));
431 } 429 }
432 -
433 - /**
434 - * Tests that an unimplemented criterion type only returns the type and
435 - * no other data.
436 - */
437 - @Test
438 - public void matchUnknownTypeTest() throws Exception {
439 - Criterion criterion = Criteria.matchOpticalSignalType((byte) 250);
440 - setField(criterion, "type", Criterion.Type.UNASSIGNED_40);
441 - ObjectNode result = criterionCodec.encode(criterion, context);
442 - assertThat(result.get("type").textValue(), is(criterion.type().toString()));
443 - assertThat(result.size(), is(1));
444 - }
445 } 430 }
......
...@@ -118,7 +118,6 @@ import org.onosproject.net.flow.criteria.MetadataCriterion; ...@@ -118,7 +118,6 @@ import org.onosproject.net.flow.criteria.MetadataCriterion;
118 import org.onosproject.net.flow.criteria.MplsCriterion; 118 import org.onosproject.net.flow.criteria.MplsCriterion;
119 import org.onosproject.net.flow.criteria.OchSignalCriterion; 119 import org.onosproject.net.flow.criteria.OchSignalCriterion;
120 import org.onosproject.net.flow.criteria.OchSignalTypeCriterion; 120 import org.onosproject.net.flow.criteria.OchSignalTypeCriterion;
121 -import org.onosproject.net.flow.criteria.OpticalSignalTypeCriterion;
122 import org.onosproject.net.flow.criteria.PortCriterion; 121 import org.onosproject.net.flow.criteria.PortCriterion;
123 import org.onosproject.net.flow.criteria.SctpPortCriterion; 122 import org.onosproject.net.flow.criteria.SctpPortCriterion;
124 import org.onosproject.net.flow.criteria.TcpPortCriterion; 123 import org.onosproject.net.flow.criteria.TcpPortCriterion;
...@@ -339,7 +338,6 @@ public final class KryoNamespaces { ...@@ -339,7 +338,6 @@ public final class KryoNamespaces {
339 IndexedLambdaCriterion.class, 338 IndexedLambdaCriterion.class,
340 OchSignalCriterion.class, 339 OchSignalCriterion.class,
341 OchSignalTypeCriterion.class, 340 OchSignalTypeCriterion.class,
342 - OpticalSignalTypeCriterion.class,
343 Criterion.class, 341 Criterion.class,
344 Criterion.Type.class, 342 Criterion.Type.class,
345 DefaultTrafficTreatment.class, 343 DefaultTrafficTreatment.class,
......