Remove Intent constructor APIs deprecated in 1.9.1

Change-Id: Ib88ee534174882cb135bba70a6cfc86747a0c193
This commit is contained in:
Ray Milkey 2018-01-05 15:17:37 -08:00 committed by Thomas Vachuska
parent c1518bbf34
commit 39f78b6f5a
17 changed files with 28 additions and 271 deletions

View File

@ -66,7 +66,7 @@ public abstract class DomainIntent extends Intent {
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");

View File

@ -50,37 +50,6 @@ public abstract class ConnectivityIntent extends Intent {
private final TrafficTreatment treatment;
private final List<Constraint> 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
* @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.

View File

@ -47,44 +47,6 @@ public final class FlowObjectiveIntent extends Intent {
this.devices = null;
}
/**
* Creates a flow objective intent with the specified objectives and
* 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.

View File

@ -24,7 +24,6 @@ import org.onosproject.net.ResourceGroup;
import org.onosproject.net.flow.FlowRule;
import java.util.Collection;
import java.util.List;
import static com.google.common.base.Preconditions.checkNotNull;
@ -38,71 +37,6 @@ public class FlowRuleIntent extends Intent {
private final Collection<FlowRule> flowRules;
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.

View File

@ -61,29 +61,6 @@ public abstract class Intent {
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
* @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

View File

@ -37,29 +37,6 @@ public class OpticalCircuitIntent extends Intent {
private final CltSignalType signalType;
private final boolean 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
* @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.

View File

@ -37,33 +37,6 @@ public final class OpticalOduIntent extends Intent {
private final CltSignalType signalType;
private final boolean 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
* @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.
*

View File

@ -39,32 +39,6 @@ public class PathIntent extends ConnectivityIntent {
private final Path path;
private ProtectionType type;
/**
* 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

View File

@ -40,29 +40,6 @@ public class ProtectionEndpointIntent extends Intent {
private final DeviceId deviceId;
private final ProtectedTransportEndpointDescription 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
* @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.
*

View File

@ -97,11 +97,11 @@ public class FlowObjectiveIntentTest extends IntentTest {
@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);
}
}

View File

@ -448,12 +448,12 @@ public class IntentTestsMocks {
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;
}

View File

@ -33,7 +33,7 @@ public class TestInstallableIntent extends Intent {
*/
public TestInstallableIntent(int value) { // FIXME
super(new TestApplicationId("foo"), null, Collections.emptyList(),
Intent.DEFAULT_INTENT_PRIORITY);
Intent.DEFAULT_INTENT_PRIORITY, null);
this.value = value;
}

View File

@ -33,7 +33,7 @@ public class TestIntent extends Intent {
*/
public TestIntent(int value) { // FIXME
super(new TestApplicationId("foo"), null, Collections.emptyList(),
Intent.DEFAULT_INTENT_PRIORITY);
Intent.DEFAULT_INTENT_PRIORITY, null);
this.value = value;
}

View File

@ -44,6 +44,7 @@ import org.onosproject.net.intent.Intent;
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 @@ public class LinkCollectionIntentCompiler
// 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 @@ public class LinkCollectionIntentCompiler
* 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.

View File

@ -53,6 +53,7 @@ import org.onosproject.net.intent.IntentService;
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 @@ public class IntentManagerTest {
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 @@ public class IntentManagerTest {
class IntentNoCompiler extends Intent {
IntentNoCompiler() {
super(APPID, null, Collections.emptyList(),
Intent.DEFAULT_INTENT_PRIORITY);
Intent.DEFAULT_INTENT_PRIORITY, null);
}
}

View File

@ -62,6 +62,7 @@ import org.onosproject.net.intent.IntentState;
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 @@ public class VirtualNetworkIntentManagerTest extends TestDeviceParams {
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);
}
}

View File

@ -63,6 +63,7 @@ import org.onosproject.net.intent.IntentService;
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 @@ public class IntentsResourceTest extends ResourceTest {
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 @@ public class IntentsResourceTest extends ResourceTest {
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();