Remove Intent constructor APIs deprecated in 1.9.1
Change-Id: Ib88ee534174882cb135bba70a6cfc86747a0c193
diff --git a/core/api/src/main/java/org/onosproject/net/domain/DomainIntent.java b/core/api/src/main/java/org/onosproject/net/domain/DomainIntent.java
index 4e6dda6..da212a5 100644
--- a/core/api/src/main/java/org/onosproject/net/domain/DomainIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/domain/DomainIntent.java
@@ -66,7 +66,7 @@
Set<FilteredConnectPoint> filteredEgressPoints,
TrafficTreatment treatment,
List<Constraint> constraints) {
- super(appId, key, resources, priority);
+ super(appId, key, resources, priority, null);
checkNotNull(filteredIngressPoints, "Ingress points cannot be null");
checkArgument(!filteredIngressPoints.isEmpty(), "Ingress point cannot be empty");
diff --git a/core/api/src/main/java/org/onosproject/net/intent/ConnectivityIntent.java b/core/api/src/main/java/org/onosproject/net/intent/ConnectivityIntent.java
index 5dc54a0..f6d0e3e 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/ConnectivityIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/ConnectivityIntent.java
@@ -64,37 +64,6 @@
* @param treatment treatment
* @param constraints optional prioritized list of constraints
* @param priority priority to use for flows generated by this intent
- * @throws NullPointerException if the selector or treatment is null
- * @deprecated 1.9.1
- */
- @Deprecated
- protected ConnectivityIntent(ApplicationId appId,
- Key key,
- Collection<NetworkResource> resources,
- TrafficSelector selector,
- TrafficTreatment treatment,
- List<Constraint> constraints,
- int priority) {
- super(appId, key, resources, priority);
- this.selector = checkNotNull(selector);
- this.treatment = checkNotNull(treatment);
- this.constraints = checkNotNull(constraints);
- }
-
- /**
- * Creates a connectivity intent that matches on the specified selector
- * and applies the specified treatment.
- * <p>
- * Path will be optimized based on the first constraint if one is given.
- * </p>
- *
- * @param appId application identifier
- * @param key explicit key to use for intent
- * @param resources required network resources (optional)
- * @param selector traffic selector
- * @param treatment treatment
- * @param constraints optional prioritized list of constraints
- * @param priority priority to use for flows generated by this intent
* @param resourceGroup resource group for this intent
* @throws NullPointerException if the selector or treatment is null
*/
diff --git a/core/api/src/main/java/org/onosproject/net/intent/FlowObjectiveIntent.java b/core/api/src/main/java/org/onosproject/net/intent/FlowObjectiveIntent.java
index e1aa21d..2c858ca 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/FlowObjectiveIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/FlowObjectiveIntent.java
@@ -52,44 +52,6 @@
* resources.
*
* @param appId application id
- * @param devices list of target devices; in same order as the objectives
- * @param objectives backing flow objectives
- * @param resources backing network resources
- * @deprecated 1.9.1
- */
- @Deprecated
- public FlowObjectiveIntent(ApplicationId appId,
- List<DeviceId> devices,
- List<Objective> objectives,
- Collection<NetworkResource> resources) {
- this(appId, null, devices, objectives, resources, null);
- }
-
- /**
- * Creates a flow objective intent with the specified objectives and
- * resources.
- *
- * @param appId application id
- * @param key intent key
- * @param devices list of target devices; in same order as the objectives
- * @param objectives backing flow objectives
- * @param resources backing network resources
- * @deprecated 1.9.1
- */
- @Deprecated
- public FlowObjectiveIntent(ApplicationId appId,
- Key key,
- List<DeviceId> devices,
- List<Objective> objectives,
- Collection<NetworkResource> resources) {
- this(appId, key, devices, objectives, resources, null);
- }
-
- /**
- * Creates a flow objective intent with the specified objectives and
- * resources.
- *
- * @param appId application id
* @param key intent key
* @param devices list of target devices; in same order as the objectives
* @param objectives backing flow objectives
diff --git a/core/api/src/main/java/org/onosproject/net/intent/FlowRuleIntent.java b/core/api/src/main/java/org/onosproject/net/intent/FlowRuleIntent.java
index f01d819..23a38a2 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/FlowRuleIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/FlowRuleIntent.java
@@ -24,7 +24,6 @@
import org.onosproject.net.flow.FlowRule;
import java.util.Collection;
-import java.util.List;
import static com.google.common.base.Preconditions.checkNotNull;
@@ -39,71 +38,6 @@
private PathIntent.ProtectionType type;
/**
- * Creates a flow rule intent with the specified flow rules and resources.
- *
- * @param appId application id
- * @param flowRules flow rules to be set
- * @param resources network resource to be set
- * @deprecated 1.9.1
- */
- @Deprecated
- public FlowRuleIntent(ApplicationId appId, List<FlowRule> flowRules, Collection<NetworkResource> resources) {
- this(appId, null, flowRules, resources);
- }
-
- /**
- * Creates a flow rule intent with the specified flow rules, resources, and type.
- *
- * @param appId application id
- * @param flowRules flow rules to be set
- * @param resources network resource to be set
- * @param type protection type
- * @deprecated 1.9.1
- */
- @Deprecated
- public FlowRuleIntent(ApplicationId appId, List<FlowRule> flowRules, Collection<NetworkResource> resources,
- PathIntent.ProtectionType type) {
- this(appId, null, flowRules, resources, type, null);
- }
-
- /**
- * Creates a flow rule intent with the specified key, flow rules to be set, and
- * required network resources.
- *
- * @param appId application id
- * @param key key
- * @param flowRules flow rules
- * @param resources network resources
- * @deprecated 1.9.1
- */
- @Deprecated
- public FlowRuleIntent(ApplicationId appId, Key key, Collection<FlowRule> flowRules,
- Collection<NetworkResource> resources) {
- this(appId, key, flowRules, resources,
- PathIntent.ProtectionType.PRIMARY, null);
- }
-
- /**
- * Creates a flow rule intent with the specified key, flow rules to be set, and
- * required network resources.
- *
- * @param appId application id
- * @param key key
- * @param flowRules flow rules
- * @param resources network resources
- * @param primary primary protection type
- * @deprecated 1.9.1
- */
- @Deprecated
- public FlowRuleIntent(ApplicationId appId,
- Key key,
- Collection<FlowRule> flowRules,
- Collection<NetworkResource> resources,
- PathIntent.ProtectionType primary) {
- this(appId, key, flowRules, resources, primary, null);
- }
-
- /**
* Creates a flow rule intent with the specified key, flow rules to be set, and
* required network resources.
*
diff --git a/core/api/src/main/java/org/onosproject/net/intent/Intent.java b/core/api/src/main/java/org/onosproject/net/intent/Intent.java
index 692a152..7a541e7 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/Intent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/Intent.java
@@ -67,29 +67,6 @@
* @param key optional key
* @param resources required network resources (optional)
* @param priority flow rule priority
- * @deprecated 1.9.1
- */
- @Deprecated
- protected Intent(ApplicationId appId,
- Key key,
- Collection<NetworkResource> resources,
- int priority) {
- checkState(idGenerator != null, "Id generator is not bound.");
- checkArgument(priority <= MAX_PRIORITY && priority >= MIN_PRIORITY);
- this.id = IntentId.valueOf(idGenerator.getNewId());
- this.appId = checkNotNull(appId, "Application ID cannot be null");
- this.key = (key != null) ? key : Key.of(id.fingerprint(), appId);
- this.priority = priority;
- this.resources = checkNotNull(resources);
- this.resourceGroup = null;
- }
-
- /**
- * Creates a new intent.
- * @param appId application identifier
- * @param key optional key
- * @param resources required network resources (optional)
- * @param priority flow rule priority
* @param resourceGroup the resource group for intent
*/
protected Intent(ApplicationId appId,
diff --git a/core/api/src/main/java/org/onosproject/net/intent/OpticalCircuitIntent.java b/core/api/src/main/java/org/onosproject/net/intent/OpticalCircuitIntent.java
index ab9d6da..2a29a31 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/OpticalCircuitIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/OpticalCircuitIntent.java
@@ -48,29 +48,6 @@
* @param signalType ODU signal type
* @param isBidirectional indicate if intent is bidirectional
* @param priority priority to use for flows from this intent
- * @deprecated 1.9.1
- */
- @Deprecated
- protected OpticalCircuitIntent(ApplicationId appId, Key key, ConnectPoint src, ConnectPoint dst,
- CltSignalType signalType, boolean isBidirectional, int priority) {
- super(appId, key, Collections.emptyList(), priority, null);
- this.src = checkNotNull(src);
- this.dst = checkNotNull(dst);
- this.signalType = checkNotNull(signalType);
- this.isBidirectional = isBidirectional;
- }
-
- /**
- * Creates an optical circuit intent between the specified
- * connection points.
- *
- * @param appId application identification
- * @param key intent key
- * @param src the source transponder port
- * @param dst the destination transponder port
- * @param signalType ODU signal type
- * @param isBidirectional indicate if intent is bidirectional
- * @param priority priority to use for flows from this intent
* @param resourceGroup resource group for this intent
*/
protected OpticalCircuitIntent(ApplicationId appId, Key key, ConnectPoint src, ConnectPoint dst,
diff --git a/core/api/src/main/java/org/onosproject/net/intent/OpticalOduIntent.java b/core/api/src/main/java/org/onosproject/net/intent/OpticalOduIntent.java
index 9cb335a..8040fdf 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/OpticalOduIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/OpticalOduIntent.java
@@ -47,33 +47,6 @@
* @param signalType CltSignalType signal type
* @param isBidirectional indicate if intent is bidirectional
* @param priority priority to use for flows from this intent
- * @deprecated 1.9.1
- */
- @Deprecated
- protected OpticalOduIntent(ApplicationId appId,
- Key key,
- ConnectPoint src,
- ConnectPoint dst,
- CltSignalType signalType,
- boolean isBidirectional,
- int priority) {
- super(appId, key, Collections.emptyList(), priority, null);
- this.src = checkNotNull(src);
- this.dst = checkNotNull(dst);
- this.signalType = checkNotNull(signalType);
- this.isBidirectional = isBidirectional;
- }
-
- /**
- * Creates an optical ODU intent between the specified connection points.
- *
- * @param appId application identification
- * @param key intent key
- * @param src the source transponder port
- * @param dst the destination transponder port
- * @param signalType CltSignalType signal type
- * @param isBidirectional indicate if intent is bidirectional
- * @param priority priority to use for flows from this intent
* @param resourceGroup resource group for this intent
*/
protected OpticalOduIntent(ApplicationId appId,
diff --git a/core/api/src/main/java/org/onosproject/net/intent/PathIntent.java b/core/api/src/main/java/org/onosproject/net/intent/PathIntent.java
index a95fd9e..b0869b7 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/PathIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/PathIntent.java
@@ -41,32 +41,6 @@
/**
* Creates a new point-to-point intent with the supplied ingress/egress
- * ports and using the specified explicit path. Path is primary by default.
- *
- * @param appId application identifier
- * @param key intent key
- * @param selector traffic selector
- * @param treatment treatment
- * @param path traversed links
- * @param constraints optional list of constraints
- * @param priority priority to use for the generated flows
- * @throws NullPointerException {@code path} is null
- * @deprecated 1.9.1
- */
- @Deprecated
- protected PathIntent(ApplicationId appId,
- Key key,
- TrafficSelector selector,
- TrafficTreatment treatment,
- Path path,
- List<Constraint> constraints,
- int priority) {
- this(appId, key, selector, treatment, path, constraints, priority,
- ProtectionType.PRIMARY, null);
- }
-
- /**
- * Creates a new point-to-point intent with the supplied ingress/egress
* ports and using the specified explicit path, which can be classified
* as PRIMARY or BACKUP.
*
diff --git a/core/api/src/main/java/org/onosproject/net/intent/ProtectionEndpointIntent.java b/core/api/src/main/java/org/onosproject/net/intent/ProtectionEndpointIntent.java
index 06757e5..7a23096 100644
--- a/core/api/src/main/java/org/onosproject/net/intent/ProtectionEndpointIntent.java
+++ b/core/api/src/main/java/org/onosproject/net/intent/ProtectionEndpointIntent.java
@@ -49,29 +49,6 @@
* @param priority priority to use for flows from this intent
* @param deviceId target device id
* @param description protected transport endpoint description of the intent
- * @deprecated 1.9.1
- */
- @Deprecated
- protected ProtectionEndpointIntent(ApplicationId appId, Key key,
- Collection<NetworkResource> resources,
- int priority,
- DeviceId deviceId,
- ProtectedTransportEndpointDescription description) {
- super(appId, key, resources, priority, null);
-
- this.deviceId = checkNotNull(deviceId);
- this.description = checkNotNull(description);
- }
-
- /**
- * Creates a ProtectionEndpointIntent by specific resource and description.
- *
- * @param appId application identification
- * @param key intent key
- * @param resources network resource to be set
- * @param priority priority to use for flows from this intent
- * @param deviceId target device id
- * @param description protected transport endpoint description of the intent
* @param resourceGroup resource group for this intent
*/
protected ProtectionEndpointIntent(ApplicationId appId, Key key,
diff --git a/core/api/src/test/java/org/onosproject/net/intent/FlowObjectiveIntentTest.java b/core/api/src/test/java/org/onosproject/net/intent/FlowObjectiveIntentTest.java
index 29581f6..ecc2987 100644
--- a/core/api/src/test/java/org/onosproject/net/intent/FlowObjectiveIntentTest.java
+++ b/core/api/src/test/java/org/onosproject/net/intent/FlowObjectiveIntentTest.java
@@ -97,11 +97,11 @@
@Override
protected Intent createOne() {
- return new FlowObjectiveIntent(APP_ID, DEVICE, OBJECTIVES, RESOURCES);
+ return new FlowObjectiveIntent(APP_ID, null, DEVICE, OBJECTIVES, RESOURCES, null);
}
@Override
protected Intent createAnother() {
- return new FlowObjectiveIntent(APP_ID, DEVICE, OBJECTIVES, RESOURCES);
+ return new FlowObjectiveIntent(APP_ID, null, DEVICE, OBJECTIVES, RESOURCES, null);
}
}
diff --git a/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java b/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java
index 90cc697..59aad9c 100644
--- a/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java
+++ b/core/api/src/test/java/org/onosproject/net/intent/IntentTestsMocks.java
@@ -448,12 +448,12 @@
public MockIntent(Long number) {
super(NetTestTools.APP_ID, null, Collections.emptyList(),
- Intent.DEFAULT_INTENT_PRIORITY);
+ Intent.DEFAULT_INTENT_PRIORITY, null);
this.number = number;
}
public MockIntent(Long number, Collection<NetworkResource> resources) {
- super(NetTestTools.APP_ID, null, resources, Intent.DEFAULT_INTENT_PRIORITY);
+ super(NetTestTools.APP_ID, null, resources, Intent.DEFAULT_INTENT_PRIORITY, null);
this.number = number;
}
diff --git a/core/api/src/test/java/org/onosproject/net/intent/TestInstallableIntent.java b/core/api/src/test/java/org/onosproject/net/intent/TestInstallableIntent.java
index 018bf14..b35bcd6 100644
--- a/core/api/src/test/java/org/onosproject/net/intent/TestInstallableIntent.java
+++ b/core/api/src/test/java/org/onosproject/net/intent/TestInstallableIntent.java
@@ -33,7 +33,7 @@
*/
public TestInstallableIntent(int value) { // FIXME
super(new TestApplicationId("foo"), null, Collections.emptyList(),
- Intent.DEFAULT_INTENT_PRIORITY);
+ Intent.DEFAULT_INTENT_PRIORITY, null);
this.value = value;
}
diff --git a/core/api/src/test/java/org/onosproject/net/intent/TestIntent.java b/core/api/src/test/java/org/onosproject/net/intent/TestIntent.java
index c1fa840..3afc54c 100644
--- a/core/api/src/test/java/org/onosproject/net/intent/TestIntent.java
+++ b/core/api/src/test/java/org/onosproject/net/intent/TestIntent.java
@@ -33,7 +33,7 @@
*/
public TestIntent(int value) { // FIXME
super(new TestApplicationId("foo"), null, Collections.emptyList(),
- Intent.DEFAULT_INTENT_PRIORITY);
+ Intent.DEFAULT_INTENT_PRIORITY, null);
this.value = value;
}
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/LinkCollectionIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/LinkCollectionIntentCompiler.java
index 861ab7d..6413408 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/LinkCollectionIntentCompiler.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/LinkCollectionIntentCompiler.java
@@ -44,6 +44,7 @@
import org.onosproject.net.intent.IntentCompilationException;
import org.onosproject.net.intent.IntentCompiler;
import org.onosproject.net.intent.LinkCollectionIntent;
+import org.onosproject.net.intent.PathIntent;
import org.onosproject.net.intent.constraint.EncapsulationConstraint;
import org.onosproject.net.resource.ResourceService;
import org.onosproject.net.resource.impl.LabelAllocator;
@@ -135,7 +136,9 @@
// if any rules have been created
if (!rules.isEmpty()) {
intentList.add(new FlowRuleIntent(appId, intent.key(), rules,
- intent.resources()));
+ intent.resources(),
+ PathIntent.ProtectionType.PRIMARY,
+ null));
}
return intentList.build();
}
@@ -301,7 +304,7 @@
* if we have to perform it
*/
private Instruction optimizeTtlInstructions(int index, Instruction instruction, List<Instruction> instructions) {
- /**
+ /*
* Here we handle the optimization of decrement mpls ttl. The optimization
* is to come back to the start of the list looking for the same
* action. If we find the same action, we can optimize.
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/IntentManagerTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/IntentManagerTest.java
index d4a3039..14fb380 100644
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/IntentManagerTest.java
+++ b/core/net/src/test/java/org/onosproject/net/intent/impl/IntentManagerTest.java
@@ -53,6 +53,7 @@
import org.onosproject.net.intent.IntentState;
import org.onosproject.net.intent.Key;
import org.onosproject.net.intent.ObjectiveTrackerService;
+import org.onosproject.net.intent.PathIntent;
import org.onosproject.net.intent.TopologyChangeDelegate;
import org.onosproject.store.trivial.SimpleIntentStore;
@@ -170,7 +171,8 @@
private static class MockInstallableIntent extends FlowRuleIntent {
public MockInstallableIntent() {
- super(APPID, Collections.singletonList(new MockFlowRule(100)), Collections.emptyList());
+ super(APPID, null, Collections.singletonList(new MockFlowRule(100)), Collections.emptyList(),
+ PathIntent.ProtectionType.PRIMARY, null);
}
}
@@ -516,7 +518,7 @@
class IntentNoCompiler extends Intent {
IntentNoCompiler() {
super(APPID, null, Collections.emptyList(),
- Intent.DEFAULT_INTENT_PRIORITY);
+ Intent.DEFAULT_INTENT_PRIORITY, null);
}
}
diff --git a/incubator/net/src/test/java/org/onosproject/incubator/net/virtual/impl/VirtualNetworkIntentManagerTest.java b/incubator/net/src/test/java/org/onosproject/incubator/net/virtual/impl/VirtualNetworkIntentManagerTest.java
index 60521b4..9d6e547 100644
--- a/incubator/net/src/test/java/org/onosproject/incubator/net/virtual/impl/VirtualNetworkIntentManagerTest.java
+++ b/incubator/net/src/test/java/org/onosproject/incubator/net/virtual/impl/VirtualNetworkIntentManagerTest.java
@@ -62,6 +62,7 @@
import org.onosproject.net.intent.IntentTestsMocks;
import org.onosproject.net.intent.Key;
import org.onosproject.net.intent.MockIdGenerator;
+import org.onosproject.net.intent.PathIntent;
import org.onosproject.net.intent.TestableIntentService;
import org.onosproject.net.intent.WorkPartitionService;
import org.onosproject.net.intent.WorkPartitionServiceAdapter;
@@ -394,7 +395,8 @@
private static class MockInstallableIntent extends FlowRuleIntent {
public MockInstallableIntent() {
- super(APP_ID, Collections.singletonList(new IntentTestsMocks.MockFlowRule(100)), Collections.emptyList());
+ super(APP_ID, null, Collections.singletonList(new IntentTestsMocks.MockFlowRule(100)),
+ Collections.emptyList(), PathIntent.ProtectionType.PRIMARY, null);
}
}
diff --git a/web/api/src/test/java/org/onosproject/rest/resources/IntentsResourceTest.java b/web/api/src/test/java/org/onosproject/rest/resources/IntentsResourceTest.java
index 28ca0a5..b9b5dbd 100644
--- a/web/api/src/test/java/org/onosproject/rest/resources/IntentsResourceTest.java
+++ b/web/api/src/test/java/org/onosproject/rest/resources/IntentsResourceTest.java
@@ -63,6 +63,7 @@
import org.onosproject.net.intent.IntentState;
import org.onosproject.net.intent.Key;
import org.onosproject.net.intent.MockIdGenerator;
+import org.onosproject.net.intent.PathIntent;
import org.onosproject.net.provider.ProviderId;
@@ -862,8 +863,11 @@
flowRules.add(flowRule2);
FlowRuleIntent flowRuleIntent = new FlowRuleIntent(
APP_ID,
+ null,
flowRules,
- new HashSet<NetworkResource>());
+ new HashSet<NetworkResource>(),
+ PathIntent.ProtectionType.PRIMARY,
+ null);
Intent intent = new MockIntent(3L);
installableIntents.add(flowRuleIntent);
intents.add(intent);
@@ -936,8 +940,11 @@
FlowRuleIntent flowRuleIntent = new FlowRuleIntent(
APP_ID,
+ null,
new ArrayList<>(),
- resources);
+ resources,
+ PathIntent.ProtectionType.PRIMARY,
+ null);
Intent intent = new MockIntent(MockIntent.nextId());
Long intentId = intent.id().id();