Remove deprecated MPLS Intent classes

Change-Id: I6f4d6fd84ce41c26b8a30f5c0881c42c67a1f209
diff --git a/cli/src/main/java/org/onosproject/cli/net/AddMplsIntent.java b/cli/src/main/java/org/onosproject/cli/net/AddMplsIntent.java
deleted file mode 100644
index eef00c6..0000000
--- a/cli/src/main/java/org/onosproject/cli/net/AddMplsIntent.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright 2014-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.cli.net;
-
-import org.apache.karaf.shell.commands.Argument;
-import org.apache.karaf.shell.commands.Command;
-import org.apache.karaf.shell.commands.Option;
-import org.onlab.packet.MplsLabel;
-import org.onosproject.net.ConnectPoint;
-import org.onosproject.net.flow.TrafficSelector;
-import org.onosproject.net.flow.TrafficTreatment;
-import org.onosproject.net.intent.Constraint;
-import org.onosproject.net.intent.IntentService;
-import org.onosproject.net.intent.MplsIntent;
-
-import java.util.List;
-import java.util.Optional;
-
-/**
- * Installs MPLS intents.
- *
- * @deprecated in Goldeneye Release, in favour of encapsulation
- * constraint {@link org.onosproject.net.intent.constraint.EncapsulationConstraint}
- */
-@Deprecated
-@Command(scope = "onos", name = "add-mpls-intent", description = "Installs mpls connectivity intent")
-public class AddMplsIntent extends ConnectivityIntentCommand {
-
-    @Argument(index = 0, name = "ingressDevice",
-            description = "Ingress Device/Port Description",
-            required = true,
-            multiValued = false)
-    private String ingressDeviceString = null;
-
-    @Option(name = "--ingressLabel",
-            description = "Ingress Mpls label",
-            required = false,
-            multiValued = false)
-    private String ingressLabelString = "";
-
-    @Argument(index = 1, name = "egressDevice",
-            description = "Egress Device/Port Description",
-            required = true,
-            multiValued = false)
-    private String egressDeviceString = null;
-
-    @Option(name = "--egressLabel",
-            description = "Egress Mpls label",
-            required = false,
-            multiValued = false)
-    private String egressLabelString = "";
-
-    @Override
-    protected void execute() {
-        IntentService service = get(IntentService.class);
-
-        ConnectPoint ingress = ConnectPoint.deviceConnectPoint(ingressDeviceString);
-        Optional<MplsLabel> ingressLabel = Optional.empty();
-        if (!ingressLabelString.isEmpty()) {
-            ingressLabel = Optional
-                    .ofNullable(MplsLabel.mplsLabel(parseInt(ingressLabelString)));
-        }
-
-        ConnectPoint egress = ConnectPoint.deviceConnectPoint(egressDeviceString);
-        Optional<MplsLabel> egressLabel = Optional.empty();
-        if (!egressLabelString.isEmpty()) {
-            egressLabel = Optional
-                    .ofNullable(MplsLabel.mplsLabel(parseInt(egressLabelString)));
-        }
-
-        TrafficSelector selector = buildTrafficSelector();
-        TrafficTreatment treatment = buildTrafficTreatment();
-
-        List<Constraint> constraints = buildConstraints();
-
-        MplsIntent intent = MplsIntent.builder()
-                .appId(appId())
-                .selector(selector)
-                .treatment(treatment)
-                .ingressPoint(ingress)
-                .ingressLabel(ingressLabel)
-                .egressPoint(egress)
-                .egressLabel(egressLabel)
-                .constraints(constraints)
-                .priority(priority())
-                .build();
-        service.submit(intent);
-    }
-
-    protected Integer parseInt(String value) {
-        try {
-            return Integer.parseInt(value);
-        } catch (NumberFormatException nfe) {
-            return null;
-        }
-    }
-}
diff --git a/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml b/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml
index 24d5ec1..2d0d048 100644
--- a/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml
+++ b/cli/src/main/resources/OSGI-INF/blueprint/shell-config.xml
@@ -563,21 +563,6 @@
         <command>
             <action class="org.onosproject.cli.net.WipeOutCommand"/>
         </command>
-        <command>
-            <action class="org.onosproject.cli.net.AddMplsIntent"/>
-            <completers>
-                <ref component-id="connectPointCompleter"/>
-                <ref component-id="connectPointCompleter"/>
-            </completers>
-            <optional-completers>
-                <entry key="-t" value-ref="ethTypeCompleter"/>
-                <entry key="--ipProto" value-ref="ipProtocolCompleter"/>
-                <entry key="--icmp6Type" value-ref="Icmp6TypeCompleter"/>
-                <entry key="--icmp6Code" value-ref="Icmp6CodeCompleter"/>
-                <entry key="--extHdr" value-ref="ExtHeaderCompleter"/>
-                <entry key="-a" value-ref="allAppNameCompleter"/>
-            </optional-completers>
-        </command>
 
         <command>
             <action class="org.onosproject.cli.net.RoutesListCommand"/>
diff --git a/core/api/src/main/java/org/onosproject/net/intent/MplsIntent.java b/core/api/src/main/java/org/onosproject/net/intent/MplsIntent.java
deleted file mode 100644
index 85fac06..0000000
--- a/core/api/src/main/java/org/onosproject/net/intent/MplsIntent.java
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * Copyright 2014-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.net.intent;
-
-import java.util.Collections;
-import java.util.List;
-import java.util.Optional;
-
-import com.google.common.annotations.Beta;
-import org.onlab.packet.MplsLabel;
-import org.onosproject.core.ApplicationId;
-import org.onosproject.net.ConnectPoint;
-import org.onosproject.net.flow.TrafficSelector;
-import org.onosproject.net.flow.TrafficTreatment;
-
-import com.google.common.base.MoreObjects;
-
-import static com.google.common.base.Preconditions.checkArgument;
-import static com.google.common.base.Preconditions.checkNotNull;
-
-
-/**
- * Abstraction of MPLS label-switched connectivity.
- *
- * @deprecated in Goldeneye Release, in favour of encapsulation
- * constraint {@link org.onosproject.net.intent.constraint.EncapsulationConstraint}
- * with Encasulation type {@link org.onosproject.net.EncapsulationType} MPLS.
- *
- */
-@Beta
-@Deprecated
-public final class MplsIntent extends ConnectivityIntent {
-
-    private final ConnectPoint ingressPoint;
-    private final Optional<MplsLabel> ingressLabel;
-    private final ConnectPoint egressPoint;
-    private final Optional<MplsLabel> egressLabel;
-
-    /**
-     * Creates a new point-to-point intent with the supplied ingress/egress
-     * ports, labels and constraints.
-     *
-     * @param appId        application identifier
-     * @param selector     traffic selector
-     * @param treatment    treatment
-     * @param ingressPoint ingress port
-     * @param ingressLabel ingress MPLS label
-     * @param egressPoint  egress port
-     * @param egressLabel  egress MPLS label
-     * @param constraints  optional list of constraints
-     * @param priority    priority to use for flows generated by this intent
-     * @throws NullPointerException if {@code ingressPoint} or {@code egressPoints} is null.
-     */
-    private MplsIntent(ApplicationId appId,
-                      Key key,
-                      TrafficSelector selector,
-                      TrafficTreatment treatment,
-                      ConnectPoint ingressPoint,
-                      Optional<MplsLabel> ingressLabel,
-                      ConnectPoint egressPoint,
-                      Optional<MplsLabel> egressLabel,
-                      List<Constraint> constraints,
-                      int priority) {
-
-        super(appId, key, Collections.emptyList(), selector, treatment, constraints,
-              priority);
-
-        this.ingressPoint = checkNotNull(ingressPoint);
-        this.ingressLabel = checkNotNull(ingressLabel);
-        this.egressPoint = checkNotNull(egressPoint);
-        this.egressLabel = checkNotNull(egressLabel);
-
-        checkArgument(!ingressPoint.equals(egressPoint),
-                "ingress and egress should be different (ingress: %s, egress: %s)",
-                ingressPoint, egressPoint);
-    }
-
-    /**
-     * Returns a new MPLS intent builder. The application id,
-     * ingress point, egress point, ingress label and egress label are
-     * required fields.  If they are not set by calls to the appropriate
-     * methods, an exception will be thrown.
-     *
-     * @return point to point builder
-     */
-    public static Builder builder() {
-        return new Builder();
-    }
-
-    /**
-     * Builder of an MPLS intent.
-     */
-    public static final class Builder extends ConnectivityIntent.Builder {
-        ConnectPoint ingressPoint;
-        ConnectPoint egressPoint;
-        Optional<MplsLabel> ingressLabel;
-        Optional<MplsLabel> egressLabel;
-
-        private Builder() {
-            // Hide constructor
-        }
-
-        @Override
-        public Builder appId(ApplicationId appId) {
-            return (Builder) super.appId(appId);
-        }
-
-        @Override
-        public Builder key(Key key) {
-            return (Builder) super.key(key);
-        }
-
-        @Override
-        public Builder selector(TrafficSelector selector) {
-            return (Builder) super.selector(selector);
-        }
-
-        @Override
-        public Builder treatment(TrafficTreatment treatment) {
-            return (Builder) super.treatment(treatment);
-        }
-
-        @Override
-        public Builder constraints(List<Constraint> constraints) {
-            return (Builder) super.constraints(constraints);
-        }
-
-        @Override
-        public Builder priority(int priority) {
-            return (Builder) super.priority(priority);
-        }
-
-        /**
-         * Sets the ingress point of the point to point intent that will be built.
-         *
-         * @param ingressPoint ingress connect point
-         * @return this builder
-         */
-        public Builder ingressPoint(ConnectPoint ingressPoint) {
-            this.ingressPoint = ingressPoint;
-            return this;
-        }
-
-        /**
-         * Sets the egress point of the point to point intent that will be built.
-         *
-         * @param egressPoint egress connect point
-         * @return this builder
-         */
-        public Builder egressPoint(ConnectPoint egressPoint) {
-            this.egressPoint = egressPoint;
-            return this;
-        }
-
-        /**
-         * Sets the ingress label of the intent that will be built.
-         *
-         * @param ingressLabel ingress label
-         * @return this builder
-         */
-        public Builder ingressLabel(Optional<MplsLabel> ingressLabel) {
-            this.ingressLabel = ingressLabel;
-            return this;
-        }
-
-        /**
-         * Sets the ingress label of the intent that will be built.
-         *
-         * @param egressLabel ingress label
-         * @return this builder
-         */
-        public Builder egressLabel(Optional<MplsLabel> egressLabel) {
-            this.egressLabel = egressLabel;
-            return this;
-        }
-
-        /**
-         * Builds a point to point intent from the accumulated parameters.
-         *
-         * @return point to point intent
-         */
-        public MplsIntent build() {
-
-            return new MplsIntent(
-                    appId,
-                    key,
-                    selector,
-                    treatment,
-                    ingressPoint,
-                    ingressLabel,
-                    egressPoint,
-                    egressLabel,
-                    constraints,
-                    priority
-            );
-        }
-    }
-
-
-
-    /**
-     * Constructor for serializer.
-     */
-    protected MplsIntent() {
-        super();
-        this.ingressPoint = null;
-        this.ingressLabel = null;
-        this.egressPoint = null;
-        this.egressLabel = null;
-    }
-
-    /**
-     * Returns the port on which the ingress traffic should be connected to
-     * the egress.
-     *
-     * @return ingress switch port
-     */
-    public ConnectPoint ingressPoint() {
-        return ingressPoint;
-    }
-
-    /**
-     * Returns the port on which the traffic should egress.
-     *
-     * @return egress switch port
-     */
-    public ConnectPoint egressPoint() {
-        return egressPoint;
-    }
-
-
-    /**
-     * Returns the MPLS label which the ingress traffic should tagged.
-     *
-     * @return ingress MPLS label
-     */
-    public Optional<MplsLabel> ingressLabel() {
-        return ingressLabel;
-    }
-
-    /**
-     * Returns the MPLS label which the egress traffic should tagged.
-     *
-     * @return egress MPLS label
-     */
-    public Optional<MplsLabel> egressLabel() {
-        return egressLabel;
-    }
-
-    @Override
-    public String toString() {
-        return MoreObjects.toStringHelper(getClass())
-                .add("id", id())
-                .add("appId", appId())
-                .add("key", key())
-                .add("priority", priority())
-                .add("selector", selector())
-                .add("treatment", treatment())
-                .add("ingressPoint", ingressPoint)
-                .add("ingressLabel", ingressLabel)
-                .add("egressPoint", egressPoint)
-                .add("egressLabel", egressLabel)
-                .add("constraints", constraints())
-                .toString();
-    }
-
-
-
-}
diff --git a/core/api/src/main/java/org/onosproject/net/intent/MplsPathIntent.java b/core/api/src/main/java/org/onosproject/net/intent/MplsPathIntent.java
deleted file mode 100644
index 1fe1617..0000000
--- a/core/api/src/main/java/org/onosproject/net/intent/MplsPathIntent.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Copyright 2014-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.net.intent;
-
-import java.util.List;
-import java.util.Optional;
-
-import com.google.common.annotations.Beta;
-import org.onlab.packet.MplsLabel;
-import org.onosproject.core.ApplicationId;
-import org.onosproject.net.Path;
-import org.onosproject.net.flow.TrafficSelector;
-import org.onosproject.net.flow.TrafficTreatment;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-
-
-/**
- * Abstraction of explicit MPLS label-switched path.
- *
- * @deprecated in Goldeneye Release, in favour of encapsulation
- * constraint {@link org.onosproject.net.intent.constraint.EncapsulationConstraint}
- */
-@Beta
-@Deprecated
-public final class MplsPathIntent extends PathIntent {
-
-    private final Optional<MplsLabel> ingressLabel;
-    private final Optional<MplsLabel> egressLabel;
-
-    /**
-     * Creates a new point-to-point intent with the supplied ingress/egress
-     * ports and using the specified explicit path.
-     *
-     * @param appId application identifier
-     * @param key intent key
-     * @param selector traffic selector
-     * @param treatment treatment
-     * @param path traversed links
-     * @param ingressLabel MPLS egress label
-     * @param egressLabel MPLS ingress label
-     * @param constraints optional list of constraints
-     * @param priority    priority to use for flows generated by this intent
-     * @throws NullPointerException {@code path} is null
-     */
-    private MplsPathIntent(ApplicationId appId, Key key, TrafficSelector selector,
-            TrafficTreatment treatment, Path path, Optional<MplsLabel> ingressLabel,
-            Optional<MplsLabel> egressLabel, List<Constraint> constraints,
-            int priority) {
-        super(appId, key, selector, treatment, path, constraints,
-              priority);
-
-        this.ingressLabel = checkNotNull(ingressLabel);
-        this.egressLabel = checkNotNull(egressLabel);
-    }
-
-    /**
-     * Returns a new host to host intent builder.
-     *
-     * @return host to host intent builder
-     */
-    public static Builder builder() {
-        return new Builder();
-    }
-
-    /**
-     * Builder of a host to host intent.
-     */
-    public static final class Builder extends PathIntent.Builder {
-        private Optional<MplsLabel> ingressLabel = Optional.empty();
-        private Optional<MplsLabel> egressLabel = Optional.empty();
-
-        private Builder() {
-            // Hide constructor
-        }
-
-        @Override
-        public Builder appId(ApplicationId appId) {
-            return (Builder) super.appId(appId);
-        }
-
-        @Override
-        public Builder key(Key key) {
-            return (Builder) super.key(key);
-        }
-
-        @Override
-        public Builder selector(TrafficSelector selector) {
-            return (Builder) super.selector(selector);
-        }
-
-        @Override
-        public Builder treatment(TrafficTreatment treatment) {
-            return (Builder) super.treatment(treatment);
-        }
-
-        @Override
-        public Builder constraints(List<Constraint> constraints) {
-            return (Builder) super.constraints(constraints);
-        }
-
-        @Override
-        public Builder priority(int priority) {
-            return (Builder) super.priority(priority);
-        }
-
-        @Override
-        public Builder path(Path path) {
-            return (Builder) super.path(path);
-        }
-
-        /**
-         * Sets the ingress label of the intent that will be built.
-         *
-         * @param ingressLabel ingress label
-         * @return this builder
-         */
-        public Builder ingressLabel(Optional<MplsLabel> ingressLabel) {
-            this.ingressLabel = ingressLabel;
-            return this;
-        }
-
-        /**
-         * Sets the ingress label of the intent that will be built.
-         *
-         * @param egressLabel ingress label
-         * @return this builder
-         */
-        public Builder egressLabel(Optional<MplsLabel> egressLabel) {
-            this.egressLabel = egressLabel;
-            return this;
-        }
-
-
-        /**
-         * Builds a host to host intent from the accumulated parameters.
-         *
-         * @return point to point intent
-         */
-        public MplsPathIntent build() {
-
-            return new MplsPathIntent(
-                    appId,
-                    key,
-                    selector,
-                    treatment,
-                    path,
-                    ingressLabel,
-                    egressLabel,
-                    constraints,
-                    priority
-            );
-        }
-    }
-
-
-    /**
-     * Returns the MPLS label which the ingress traffic should tagged.
-     *
-     * @return ingress MPLS label
-     */
-    public Optional<MplsLabel> ingressLabel() {
-        return ingressLabel;
-    }
-
-    /**
-     * Returns the MPLS label which the egress traffic should tagged.
-     *
-     * @return egress MPLS label
-     */
-    public Optional<MplsLabel> egressLabel() {
-        return egressLabel;
-    }
-
-}
diff --git a/core/api/src/test/java/org/onosproject/net/intent/MplsIntentTest.java b/core/api/src/test/java/org/onosproject/net/intent/MplsIntentTest.java
deleted file mode 100644
index 17e14b0..0000000
--- a/core/api/src/test/java/org/onosproject/net/intent/MplsIntentTest.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.net.intent;
-
-import java.util.Optional;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.onlab.packet.MplsLabel;
-import org.onosproject.net.flow.TrafficSelector;
-import org.onosproject.net.flow.TrafficTreatment;
-
-import com.google.common.testing.EqualsTester;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;
-import static org.onosproject.net.NetTestTools.APP_ID;
-import static org.onosproject.net.NetTestTools.connectPoint;
-
-/**
- * Unit tests for the MplsIntent class.
- */
-
-public class MplsIntentTest extends AbstractIntentTest {
-    static final int PRIORITY = 22;
-
-    MplsIntent intent1;
-    MplsIntent intent2;
-
-    Optional<MplsLabel> label1;
-    Optional<MplsLabel> label2;
-
-    TrafficSelector selector;
-    TrafficTreatment treatment;
-
-    @Before
-    public void mplsIntentTestSetUp() throws Exception {
-
-        label1 = Optional.of(MplsLabel.mplsLabel(1));
-        label2 = Optional.of(MplsLabel.mplsLabel(2));
-
-        selector = new IntentTestsMocks.MockSelector();
-        treatment = new IntentTestsMocks.MockTreatment();
-
-        intent1 = MplsIntent.builder()
-                .appId(APP_ID)
-                .ingressLabel(label1)
-                .egressLabel(label2)
-                .ingressPoint(connectPoint("in", 1))
-                .egressPoint(connectPoint("out", 1))
-                .selector(selector)
-                .treatment(treatment)
-                .priority(PRIORITY)
-                .build();
-
-        intent2 = MplsIntent.builder()
-                .appId(APP_ID)
-                .ingressLabel(label1)
-                .egressLabel(label2)
-                .ingressPoint(connectPoint("in", 2))
-                .egressPoint(connectPoint("out", 2))
-                .selector(selector)
-                .treatment(treatment)
-                .priority(PRIORITY)
-                .build();
-    }
-
-    /**
-     * Checks that the MplsIntent class is immutable.
-     */
-    @Test
-    public void testImmutability() {
-        assertThatClassIsImmutable(MplsIntent.class);
-    }
-
-    /**
-     * Checks the operation of equals(), hashCode() and toString() methods.
-     */
-    @Test
-    public void testEquals() {
-        new EqualsTester()
-                .addEqualityGroup(intent1)
-                .addEqualityGroup(intent2)
-                .testEquals();
-    }
-
-    /**
-     * Checks that the MplsIntent objects are created correctly.
-     */
-    @Test
-    public void testContents() {
-        assertThat(intent1.appId(), equalTo(APP_ID));
-        assertThat(intent1.ingressLabel(), equalTo(label1));
-        assertThat(intent1.egressLabel(), equalTo(label2));
-        assertThat(intent1.ingressPoint(), equalTo(connectPoint("in", 1)));
-        assertThat(intent1.egressPoint(), equalTo(connectPoint("out", 1)));
-        assertThat(intent1.selector(), equalTo(intent2.selector()));
-        assertThat(intent1.treatment(), equalTo(intent2.treatment()));
-        assertThat(intent1.priority(), is(PRIORITY));
-    }
-}
diff --git a/core/api/src/test/java/org/onosproject/net/intent/MplsPathIntentTest.java b/core/api/src/test/java/org/onosproject/net/intent/MplsPathIntentTest.java
deleted file mode 100644
index 79d3a81..0000000
--- a/core/api/src/test/java/org/onosproject/net/intent/MplsPathIntentTest.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.net.intent;
-
-import java.util.Optional;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.onlab.packet.MplsLabel;
-import org.onosproject.net.Path;
-import org.onosproject.net.flow.TrafficSelector;
-import org.onosproject.net.flow.TrafficTreatment;
-
-import com.google.common.testing.EqualsTester;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.core.IsEqual.equalTo;
-import static org.onlab.junit.ImmutableClassChecker.assertThatClassIsImmutable;
-import static org.onosproject.net.NetTestTools.APP_ID;
-import static org.onosproject.net.NetTestTools.createPath;
-
-/**
- * Unit tests for the MplsPathIntent class.
- */
-public class MplsPathIntentTest extends AbstractIntentTest {
-
-    static final int PRIORITY = 777;
-
-    MplsPathIntent intent1;
-    MplsPathIntent intent2;
-    Path defaultPath;
-    Optional<MplsLabel> label1;
-    Optional<MplsLabel> label2;
-    TrafficSelector selector;
-    TrafficTreatment treatment;
-    static final Key KEY1 = Key.of(5L, APP_ID);
-
-    @Before
-    public void mplsPathIntentTestSetUp() {
-        defaultPath = createPath("a", "b", "c");
-        selector = new IntentTestsMocks.MockSelector();
-        treatment = new IntentTestsMocks.MockTreatment();
-
-        label1 = Optional.of(MplsLabel.mplsLabel(1));
-        label2 = Optional.of(MplsLabel.mplsLabel(2));
-        intent1 = MplsPathIntent.builder()
-                .appId(APP_ID)
-                .key(KEY1)
-                .ingressLabel(label1)
-                .egressLabel(label2)
-                .path(defaultPath)
-                .priority(PRIORITY)
-                .build();
-
-        intent2 = MplsPathIntent.builder()
-                .appId(APP_ID)
-                .ingressLabel(label1)
-                .egressLabel(label2)
-                .path(defaultPath)
-                .priority(PRIORITY)
-                .build();
-    }
-
-
-    /**
-     * Checks that the MplsPathIntent class is immutable.
-     */
-    @Test
-    public void testImmutability() {
-        assertThatClassIsImmutable(MplsPathIntent.class);
-    }
-
-    /**
-     * Checks the operation of equals(), hashCode() and toString() methods.
-     */
-    @Test
-    public void testEquals() {
-        new EqualsTester()
-                .addEqualityGroup(intent1)
-                .addEqualityGroup(intent2)
-                .testEquals();
-    }
-
-    /**
-     * Checks that the MPLS path intent objects are created correctly.
-     */
-    @Test
-    public void testContents() {
-        assertThat(intent1.appId(), equalTo(APP_ID));
-        assertThat(intent1.ingressLabel(), equalTo(label1));
-        assertThat(intent1.egressLabel(), equalTo(label2));
-        assertThat(intent1.selector(), equalTo(intent2.selector()));
-        assertThat(intent1.treatment(), equalTo(intent2.treatment()));
-        assertThat(intent1.priority(), is(PRIORITY));
-        assertThat(intent1.path(), is(defaultPath));
-        assertThat(intent1.key(), equalTo(KEY1));
-    }
-
-}
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/MplsIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/MplsIntentCompiler.java
deleted file mode 100644
index 4f466de..0000000
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/MplsIntentCompiler.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.net.intent.impl.compiler;
-
-import static java.util.Arrays.asList;
-import static org.onosproject.net.DefaultEdgeLink.createEdgeLink;
-
-import java.util.ArrayList;
-import java.util.List;
-
-
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Deactivate;
-import org.onosproject.net.ConnectPoint;
-import org.onosproject.net.DefaultPath;
-import org.onosproject.net.Link;
-import org.onosproject.net.Path;
-import org.onosproject.net.intent.Intent;
-import org.onosproject.net.intent.MplsIntent;
-import org.onosproject.net.intent.MplsPathIntent;
-import org.onosproject.net.provider.ProviderId;
-
-/**
- * @deprecated in Goldeneye Release, in favour of encapsulation
- * constraint {@link org.onosproject.net.intent.constraint.EncapsulationConstraint}
- */
-@Deprecated
-@Component(immediate = true)
-public class MplsIntentCompiler  extends ConnectivityIntentCompiler<MplsIntent> {
-
-    // TODO: use off-the-shell core provider ID
-    private static final ProviderId PID =
-            new ProviderId("core", "org.onosproject.core", true);
-    // TODO: consider whether the default cost is appropriate or not
-    public static final int DEFAULT_COST = 1;
-
-
-    @Activate
-    public void activate() {
-        intentManager.registerCompiler(MplsIntent.class, this);
-    }
-
-    @Deactivate
-    public void deactivate() {
-        intentManager.unregisterCompiler(MplsIntent.class);
-    }
-
-    @Override
-    public List<Intent> compile(MplsIntent intent, List<Intent> installable) {
-        ConnectPoint ingressPoint = intent.ingressPoint();
-        ConnectPoint egressPoint = intent.egressPoint();
-
-        if (ingressPoint.deviceId().equals(egressPoint.deviceId())) {
-            List<Link> links = asList(createEdgeLink(ingressPoint, true), createEdgeLink(egressPoint, false));
-            return asList(createPathIntent(new DefaultPath(PID, links, DEFAULT_COST), intent));
-        }
-
-        List<Link> links = new ArrayList<>();
-        Path path = getPathOrException(intent, ingressPoint.deviceId(),
-                                       egressPoint.deviceId());
-
-        links.add(createEdgeLink(ingressPoint, true));
-        links.addAll(path.links());
-
-        links.add(createEdgeLink(egressPoint, false));
-
-        return asList(createPathIntent(new DefaultPath(PID, links, path.cost(),
-                                                       path.annotations()), intent));
-    }
-
-    /**
-     * Creates a path intent from the specified path and original
-     * connectivity intent.
-     *
-     * @param path   path to create an intent for
-     * @param intent original intent
-     */
-    private Intent createPathIntent(Path path,
-                                    MplsIntent intent) {
-        return MplsPathIntent.builder()
-                .appId(intent.appId())
-                .selector(intent.selector())
-                .treatment(intent.treatment())
-                .path(path)
-                .ingressLabel(intent.ingressLabel())
-                .egressLabel(intent.egressLabel())
-                .constraints(intent.constraints())
-                .priority(intent.priority())
-                .build();
-    }
-
-
-}
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/MplsPathIntentCompiler.java b/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/MplsPathIntentCompiler.java
deleted file mode 100644
index 9c84853..0000000
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/compiler/MplsPathIntentCompiler.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.net.intent.impl.compiler;
-
-import com.google.common.collect.ImmutableList;
-import com.google.common.collect.Sets;
-import org.apache.felix.scr.annotations.Activate;
-import org.apache.felix.scr.annotations.Component;
-import org.apache.felix.scr.annotations.Deactivate;
-import org.apache.felix.scr.annotations.Reference;
-import org.apache.felix.scr.annotations.ReferenceCardinality;
-import org.onlab.packet.EthType;
-import org.onlab.packet.Ethernet;
-import org.onlab.packet.MplsLabel;
-import org.onlab.packet.VlanId;
-import org.onosproject.core.ApplicationId;
-import org.onosproject.core.CoreService;
-import org.onosproject.net.ConnectPoint;
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.Link;
-import org.onosproject.net.LinkKey;
-import org.onosproject.net.PortNumber;
-import org.onosproject.net.flow.DefaultFlowRule;
-import org.onosproject.net.flow.DefaultTrafficSelector;
-import org.onosproject.net.flow.DefaultTrafficTreatment;
-import org.onosproject.net.flow.FlowRule;
-import org.onosproject.net.flow.TrafficSelector;
-import org.onosproject.net.flow.TrafficTreatment;
-import org.onosproject.net.flow.criteria.Criterion;
-import org.onosproject.net.flow.criteria.EthTypeCriterion;
-import org.onosproject.net.flow.instructions.Instruction;
-import org.onosproject.net.flow.instructions.L2ModificationInstruction;
-import org.onosproject.net.intent.FlowRuleIntent;
-import org.onosproject.net.intent.Intent;
-import org.onosproject.net.intent.IntentCompiler;
-import org.onosproject.net.intent.IntentExtensionService;
-import org.onosproject.net.intent.MplsPathIntent;
-import org.onosproject.net.resource.Resource;
-import org.onosproject.net.resource.ResourceAllocation;
-import org.onosproject.net.resource.ResourceService;
-import org.onosproject.net.resource.Resources;
-import org.slf4j.Logger;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import static com.google.common.base.Preconditions.checkNotNull;
-import static org.onosproject.net.LinkKey.linkKey;
-import static org.slf4j.LoggerFactory.getLogger;
-
-/**
- * @deprecated in Goldeneye Release, in favour of encapsulation
- * constraint {@link org.onosproject.net.intent.constraint.EncapsulationConstraint}
- */
-@Deprecated
-@Component(immediate = true)
-public class MplsPathIntentCompiler implements IntentCompiler<MplsPathIntent> {
-
-    private final Logger log = getLogger(getClass());
-
-    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
-    protected IntentExtensionService intentExtensionService;
-
-    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
-    protected CoreService coreService;
-
-    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
-    protected ResourceService resourceService;
-
-    protected ApplicationId appId;
-
-    @Override
-    public List<Intent> compile(MplsPathIntent intent, List<Intent> installable) {
-        Map<LinkKey, MplsLabel> labels = assignMplsLabel(intent);
-        List<FlowRule> rules = generateRules(intent, labels);
-
-        return Collections.singletonList(new FlowRuleIntent(appId,
-                                                            intent.key(),
-                                                            rules,
-                                                            intent.resources()));
-    }
-
-    @Activate
-    public void activate() {
-        appId = coreService.registerApplication("org.onosproject.net.intent");
-        intentExtensionService.registerCompiler(MplsPathIntent.class, this);
-    }
-
-    @Deactivate
-    public void deactivate() {
-        intentExtensionService.unregisterCompiler(MplsPathIntent.class);
-    }
-
-    private Map<LinkKey, MplsLabel> assignMplsLabel(MplsPathIntent intent) {
-        // TODO: do it better... Suggestions?
-        Set<LinkKey> linkRequest = Sets.newHashSetWithExpectedSize(intent.path()
-                .links().size() - 2);
-        for (int i = 1; i <= intent.path().links().size() - 2; i++) {
-            LinkKey link = linkKey(intent.path().links().get(i));
-            linkRequest.add(link);
-            // add the inverse link. I want that the label is reserved both for
-            // the direct and inverse link
-            linkRequest.add(linkKey(link.dst(), link.src()));
-        }
-
-        Map<LinkKey, MplsLabel> labels = findMplsLabels(linkRequest);
-        if (labels.isEmpty()) {
-            return Collections.emptyMap();
-        }
-
-        // for short term solution: same label is used for both directions
-        // TODO: introduce the concept of Tx and Rx resources of a port
-        Set<Resource> resources = labels.entrySet().stream()
-                .flatMap(x -> Stream.of(
-                        Resources.discrete(x.getKey().src().deviceId(), x.getKey().src().port(), x.getValue())
-                                .resource(),
-                        Resources.discrete(x.getKey().dst().deviceId(), x.getKey().dst().port(), x.getValue())
-                                .resource()
-                ))
-                .collect(Collectors.toSet());
-        List<ResourceAllocation> allocations =
-                resourceService.allocate(intent.id(), ImmutableList.copyOf(resources));
-        if (allocations.isEmpty()) {
-            Collections.emptyMap();
-        }
-
-        return labels;
-    }
-
-    private Map<LinkKey, MplsLabel> findMplsLabels(Set<LinkKey> links) {
-        Map<LinkKey, MplsLabel> labels = new HashMap<>();
-        for (LinkKey link : links) {
-            Set<MplsLabel> forward = findMplsLabel(link.src());
-            Set<MplsLabel> backward = findMplsLabel(link.dst());
-            Set<MplsLabel> common = Sets.intersection(forward, backward);
-            if (common.isEmpty()) {
-                continue;
-            }
-            labels.put(link, common.iterator().next());
-        }
-
-        return labels;
-    }
-
-    private Set<MplsLabel> findMplsLabel(ConnectPoint cp) {
-        return resourceService.getAvailableResourceValues(
-                Resources.discrete(cp.deviceId(), cp.port()).id(),
-                MplsLabel.class);
-    }
-
-    private MplsLabel getMplsLabel(Map<LinkKey, MplsLabel> labels, LinkKey link) {
-        return labels.get(link);
-    }
-
-    private List<FlowRule> generateRules(MplsPathIntent intent,
-                                         Map<LinkKey, MplsLabel> labels) {
-
-        Iterator<Link> links = intent.path().links().iterator();
-        Link srcLink = links.next();
-        ConnectPoint prev = srcLink.dst();
-
-        Link link = links.next();
-        // List of flow rules to be installed
-        List<FlowRule> rules = new LinkedList<>();
-
-        // Ingress traffic
-        // Get the new MPLS label
-        MplsLabel mpls = getMplsLabel(labels, linkKey(link));
-        checkNotNull(mpls);
-        MplsLabel prevLabel = mpls;
-        rules.add(ingressFlow(prev.port(), link, intent, mpls));
-
-        prev = link.dst();
-
-        while (links.hasNext()) {
-
-            link = links.next();
-
-            if (links.hasNext()) {
-                // Transit traffic
-                // Get the new MPLS label
-                mpls = getMplsLabel(labels, linkKey(link));
-                checkNotNull(mpls);
-                rules.add(transitFlow(prev.port(), link, intent,
-                        prevLabel, mpls));
-                prevLabel = mpls;
-
-            } else {
-                // Egress traffic
-                rules.add(egressFlow(prev.port(), link, intent,
-                        prevLabel));
-            }
-
-            prev = link.dst();
-        }
-        return rules;
-    }
-
-    private FlowRule ingressFlow(PortNumber inPort, Link link,
-                                 MplsPathIntent intent,
-                                 MplsLabel label) {
-
-        TrafficSelector.Builder ingressSelector = DefaultTrafficSelector
-                .builder(intent.selector());
-        TrafficTreatment.Builder treat = DefaultTrafficTreatment.builder();
-        ingressSelector.matchInPort(inPort);
-
-        if (intent.ingressLabel().isPresent()) {
-            ingressSelector.matchEthType(Ethernet.MPLS_UNICAST)
-                    .matchMplsLabel(intent.ingressLabel().get());
-
-            // Swap the MPLS label
-            treat.setMpls(label);
-        } else {
-            // Push and set the MPLS label
-            treat.pushMpls().setMpls(label);
-        }
-        // Add the output action
-        treat.setOutput(link.src().port());
-
-        return createFlowRule(intent, link.src().deviceId(), ingressSelector.build(), treat.build());
-    }
-
-    private FlowRule transitFlow(PortNumber inPort, Link link,
-                                 MplsPathIntent intent,
-                                 MplsLabel prevLabel,
-                                 MplsLabel outLabel) {
-
-        // Ignore the ingress Traffic Selector and use only the MPLS label
-        // assigned in the previous link
-        TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
-        selector.matchInPort(inPort).matchEthType(Ethernet.MPLS_UNICAST)
-                .matchMplsLabel(prevLabel);
-        TrafficTreatment.Builder treat = DefaultTrafficTreatment.builder();
-
-        // Set the new label only if the label on the packet is
-        // different
-        if (!prevLabel.equals(outLabel)) {
-            treat.setMpls(outLabel);
-        }
-
-        treat.setOutput(link.src().port());
-        return createFlowRule(intent, link.src().deviceId(), selector.build(), treat.build());
-    }
-
-    private FlowRule egressFlow(PortNumber inPort, Link link,
-                                MplsPathIntent intent,
-                                MplsLabel prevLabel) {
-        // egress point: either set the egress MPLS label or pop the
-        // MPLS label based on the intent annotations
-
-        TrafficSelector.Builder selector = DefaultTrafficSelector.builder();
-        selector.matchInPort(inPort).matchEthType(Ethernet.MPLS_UNICAST)
-                .matchMplsLabel(prevLabel);
-
-        // apply the intent's treatments
-        TrafficTreatment.Builder treat = DefaultTrafficTreatment.builder(intent
-                .treatment());
-
-        // check if the treatement is popVlan or setVlan (rewrite),
-        // than selector needs to match any VlanId
-        for (Instruction instruct : intent.treatment().allInstructions()) {
-            if (instruct instanceof L2ModificationInstruction) {
-                L2ModificationInstruction l2Mod = (L2ModificationInstruction) instruct;
-                if (l2Mod.subtype() == L2ModificationInstruction.L2SubType.VLAN_PUSH) {
-                    break;
-                }
-                if (l2Mod.subtype() == L2ModificationInstruction.L2SubType.VLAN_POP ||
-                        l2Mod.subtype() == L2ModificationInstruction.L2SubType.VLAN_ID) {
-                    selector.matchVlanId(VlanId.ANY);
-                }
-            }
-        }
-
-        if (intent.egressLabel().isPresent()) {
-            treat.setMpls(intent.egressLabel().get());
-        } else {
-                treat.popMpls(outputEthType(intent.selector()));
-        }
-        treat.setOutput(link.src().port());
-        return createFlowRule(intent, link.src().deviceId(),
-                selector.build(), treat.build());
-    }
-
-    protected FlowRule createFlowRule(MplsPathIntent intent, DeviceId deviceId,
-                                      TrafficSelector selector, TrafficTreatment treat) {
-        return DefaultFlowRule.builder()
-                .forDevice(deviceId)
-                .withSelector(selector)
-                .withTreatment(treat)
-                .withPriority(intent.priority())
-                .fromApp(appId)
-                .makePermanent()
-                .build();
-    }
-
-    // if the ingress ethertype is defined, the egress traffic
-    // will be use that value, otherwise the IPv4 ethertype is used.
-    private EthType outputEthType(TrafficSelector selector) {
-        Criterion c = selector.getCriterion(Criterion.Type.ETH_TYPE);
-        if (c != null && c instanceof EthTypeCriterion) {
-            EthTypeCriterion ethertype = (EthTypeCriterion) c;
-            return ethertype.ethType();
-        } else {
-            return EthType.EtherType.IPV4.ethType();
-        }
-    }
-}
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MplsIntentCompilerTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MplsIntentCompilerTest.java
deleted file mode 100644
index e576e76..0000000
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MplsIntentCompilerTest.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.net.intent.impl.compiler;
-
-import java.util.List;
-import java.util.Optional;
-
-import org.hamcrest.Matchers;
-import org.junit.Test;
-
-import static org.junit.Assert.assertEquals;
-
-
-import org.onlab.packet.MplsLabel;
-import org.onosproject.TestApplicationId;
-import org.onosproject.core.ApplicationId;
-import org.onosproject.net.ConnectPoint;
-import org.onosproject.net.Link;
-import org.onosproject.net.Path;
-import org.onosproject.net.flow.TrafficSelector;
-import org.onosproject.net.flow.TrafficTreatment;
-import org.onosproject.net.intent.AbstractIntentTest;
-import org.onosproject.net.intent.Intent;
-import org.onosproject.net.intent.IntentTestsMocks;
-import org.onosproject.net.intent.MplsIntent;
-import org.onosproject.net.intent.MplsPathIntent;
-
-import static org.hamcrest.CoreMatchers.instanceOf;
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.hasSize;
-import static org.hamcrest.Matchers.is;
-import static org.onosproject.net.DefaultEdgeLink.createEdgeLink;
-import static org.onosproject.net.DeviceId.deviceId;
-import static org.onosproject.net.NetTestTools.APP_ID;
-import static org.onosproject.net.NetTestTools.connectPoint;
-import static org.onosproject.net.PortNumber.portNumber;
-import static org.onosproject.net.intent.LinksHaveEntryWithSourceDestinationPairMatcher.linksHasPath;
-
-/**
- * Unit tests for the HostToHost intent compiler.
- */
-public class MplsIntentCompilerTest extends AbstractIntentTest {
-
-    private static final ApplicationId APPID = new TestApplicationId("foo");
-
-    private TrafficSelector selector = new IntentTestsMocks.MockSelector();
-    private TrafficTreatment treatment = new IntentTestsMocks.MockTreatment();
-
-    /**
-     * Creates a PointToPoint intent based on ingress and egress device Ids.
-     *
-     * @param ingressIdString string for id of ingress device
-     * @param egressIdString  string for id of egress device
-     * @return PointToPointIntent for the two devices
-     */
-    private MplsIntent makeIntent(String ingressIdString,  Optional<MplsLabel> ingressLabel,
-                                          String egressIdString, Optional<MplsLabel> egressLabel) {
-
-        return MplsIntent.builder()
-                .appId(APPID)
-                .selector(selector)
-                .treatment(treatment)
-                .ingressPoint(connectPoint(ingressIdString, 1))
-                .ingressLabel(ingressLabel)
-                .egressPoint(connectPoint(egressIdString, 1))
-                .egressLabel(egressLabel).build();
-    }
-    /**
-     * Creates a compiler for HostToHost intents.
-     *
-     * @param hops string array describing the path hops to use when compiling
-     * @return HostToHost intent compiler
-     */
-    private MplsIntentCompiler makeCompiler(String[] hops) {
-        MplsIntentCompiler compiler =
-                new MplsIntentCompiler();
-        compiler.pathService = new IntentTestsMocks.MockPathService(hops);
-        return compiler;
-    }
-
-
-    /**
-     * Tests a pair of devices in an 8 hop path, forward direction.
-     */
-    @Test
-    public void testForwardPathCompilation() {
-        Optional<MplsLabel> ingressLabel = Optional.of(MplsLabel.mplsLabel(10));
-        Optional<MplsLabel> egressLabel = Optional.of(MplsLabel.mplsLabel(20));
-
-        MplsIntent intent = makeIntent("d1", ingressLabel, "d8", egressLabel);
-        assertThat(intent, is(notNullValue()));
-
-        String[] hops = {"d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8"};
-        MplsIntentCompiler compiler = makeCompiler(hops);
-        assertThat(compiler, is(notNullValue()));
-
-        List<Intent> result = compiler.compile(intent, null);
-        assertThat(result, is(Matchers.notNullValue()));
-        assertThat(result, hasSize(1));
-        Intent forwardResultIntent = result.get(0);
-        assertThat(forwardResultIntent instanceof MplsPathIntent, is(true));
-
-        // if statement suppresses static analysis warnings about unchecked cast
-        if (forwardResultIntent instanceof MplsPathIntent) {
-            MplsPathIntent forwardPathIntent = (MplsPathIntent) forwardResultIntent;
-            // 7 links for the hops, plus one default lnk on ingress and egress
-            assertThat(forwardPathIntent.path().links(), hasSize(hops.length + 1));
-            assertThat(forwardPathIntent.path().links(), linksHasPath("d1", "d2"));
-            assertThat(forwardPathIntent.path().links(), linksHasPath("d2", "d3"));
-            assertThat(forwardPathIntent.path().links(), linksHasPath("d3", "d4"));
-            assertThat(forwardPathIntent.path().links(), linksHasPath("d4", "d5"));
-            assertThat(forwardPathIntent.path().links(), linksHasPath("d5", "d6"));
-            assertThat(forwardPathIntent.path().links(), linksHasPath("d6", "d7"));
-            assertThat(forwardPathIntent.path().links(), linksHasPath("d7", "d8"));
-            assertEquals(forwardPathIntent.egressLabel(), egressLabel);
-            assertEquals(forwardPathIntent.ingressLabel(), ingressLabel);
-        }
-    }
-
-    /**
-     * Tests a pair of devices in an 8 hop path, forward direction.
-     */
-    @Test
-    public void testReversePathCompilation() {
-        Optional<MplsLabel> ingressLabel = Optional.of(MplsLabel.mplsLabel(10));
-        Optional<MplsLabel> egressLabel = Optional.of(MplsLabel.mplsLabel(20));
-
-        MplsIntent intent = makeIntent("d8", ingressLabel, "d1", egressLabel);
-        assertThat(intent, is(notNullValue()));
-
-        String[] hops = {"d1", "d2", "d3", "d4", "d5", "d6", "d7", "d8"};
-        MplsIntentCompiler compiler = makeCompiler(hops);
-        assertThat(compiler, is(notNullValue()));
-
-        List<Intent> result = compiler.compile(intent, null);
-        assertThat(result, is(Matchers.notNullValue()));
-        assertThat(result, hasSize(1));
-        Intent reverseResultIntent = result.get(0);
-        assertThat(reverseResultIntent instanceof MplsPathIntent, is(true));
-
-        // if statement suppresses static analysis warnings about unchecked cast
-        if (reverseResultIntent instanceof MplsPathIntent) {
-            MplsPathIntent reversePathIntent = (MplsPathIntent) reverseResultIntent;
-            assertThat(reversePathIntent.path().links(), hasSize(hops.length + 1));
-            assertThat(reversePathIntent.path().links(), linksHasPath("d2", "d1"));
-            assertThat(reversePathIntent.path().links(), linksHasPath("d3", "d2"));
-            assertThat(reversePathIntent.path().links(), linksHasPath("d4", "d3"));
-            assertThat(reversePathIntent.path().links(), linksHasPath("d5", "d4"));
-            assertThat(reversePathIntent.path().links(), linksHasPath("d6", "d5"));
-            assertThat(reversePathIntent.path().links(), linksHasPath("d7", "d6"));
-            assertThat(reversePathIntent.path().links(), linksHasPath("d8", "d7"));
-            assertEquals(reversePathIntent.egressLabel(), egressLabel);
-            assertEquals(reversePathIntent.ingressLabel(), ingressLabel);
-        }
-    }
-
-    /**
-     * Tests compilation of the intent which designates two different ports on the same switch.
-     */
-    @Test
-    public void testSameSwitchDifferentPortsIntentCompilation() {
-        ConnectPoint src = new ConnectPoint(deviceId("1"), portNumber(1));
-        ConnectPoint dst = new ConnectPoint(deviceId("1"), portNumber(2));
-        MplsIntent intent = MplsIntent.builder()
-                .appId(APP_ID)
-                .selector(selector)
-                .treatment(treatment)
-                .ingressPoint(src)
-                .ingressLabel(Optional.empty())
-                .egressPoint(dst)
-                .egressLabel(Optional.empty())
-                .build();
-
-        String[] hops = {"1"};
-        MplsIntentCompiler sut = makeCompiler(hops);
-
-        List<Intent> compiled = sut.compile(intent, null);
-
-        assertThat(compiled, hasSize(1));
-        assertThat(compiled.get(0), is(instanceOf(MplsPathIntent.class)));
-        Path path = ((MplsPathIntent) compiled.get(0)).path();
-
-        assertThat(path.links(), hasSize(2));
-        Link firstLink = path.links().get(0);
-        assertThat(firstLink, is(createEdgeLink(src, true)));
-        Link secondLink = path.links().get(1);
-        assertThat(secondLink, is(createEdgeLink(dst, false)));
-    }
-}
diff --git a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MplsPathIntentCompilerTest.java b/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MplsPathIntentCompilerTest.java
deleted file mode 100644
index 5bdb0ee..0000000
--- a/core/net/src/test/java/org/onosproject/net/intent/impl/compiler/MplsPathIntentCompilerTest.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Laboratory
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.onosproject.net.intent.impl.compiler;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.onlab.packet.MplsLabel;
-import org.onosproject.TestApplicationId;
-import org.onosproject.core.ApplicationId;
-import org.onosproject.core.CoreService;
-import org.onosproject.net.ConnectPoint;
-import org.onosproject.net.DefaultLink;
-import org.onosproject.net.DefaultPath;
-import org.onosproject.net.Link;
-import org.onosproject.net.flow.DefaultTrafficSelector;
-import org.onosproject.net.flow.DefaultTrafficTreatment;
-import org.onosproject.net.flow.FlowRule;
-import org.onosproject.net.flow.TrafficSelector;
-import org.onosproject.net.flow.TrafficTreatment;
-import org.onosproject.net.intent.AbstractIntentTest;
-import org.onosproject.net.intent.FlowRuleIntent;
-import org.onosproject.net.intent.Intent;
-import org.onosproject.net.intent.IntentExtensionService;
-import org.onosproject.net.intent.MplsPathIntent;
-import org.onosproject.net.resource.MockResourceService;
-
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Optional;
-
-import static org.easymock.EasyMock.*;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.hasSize;
-import static org.hamcrest.Matchers.is;
-import static org.onosproject.net.DefaultEdgeLink.createEdgeLink;
-import static org.onosproject.net.Link.Type.DIRECT;
-import static org.onosproject.net.NetTestTools.*;
-
-public class MplsPathIntentCompilerTest extends AbstractIntentTest {
-
-    private final ApplicationId appId = new TestApplicationId("test");
-
-    private final ConnectPoint d1pi = connectPoint("s1", 100);
-    private final ConnectPoint d1p1 = connectPoint("s1", 0);
-    private final ConnectPoint d2p0 = connectPoint("s2", 0);
-    private final ConnectPoint d2p1 = connectPoint("s2", 1);
-    private final ConnectPoint d3p1 = connectPoint("s3", 1);
-    private final ConnectPoint d3pe = connectPoint("s3", 100);
-
-    private final TrafficSelector selector = DefaultTrafficSelector.builder().build();
-    private final TrafficTreatment treatment = DefaultTrafficTreatment.builder().build();
-
-    private final Optional<MplsLabel> ingressLabel =
-            Optional.of(MplsLabel.mplsLabel(10));
-    private final Optional<MplsLabel> egressLabel =
-            Optional.of(MplsLabel.mplsLabel(20));
-
-    private final List<Link> links = Arrays.asList(
-            createEdgeLink(d1pi, true),
-            DefaultLink.builder().providerId(PID).src(d1p1).dst(d2p0).type(DIRECT).build(),
-            DefaultLink.builder().providerId(PID).src(d2p1).dst(d3p1).type(DIRECT).build(),
-            createEdgeLink(d3pe, false)
-    );
-
-    private final int hops = links.size() - 1;
-    private MplsPathIntent intent;
-    private MplsPathIntentCompiler sut;
-
-    @Before
-    public void setUp() {
-        sut = new MplsPathIntentCompiler();
-        CoreService coreService = createMock(CoreService.class);
-        expect(coreService.registerApplication("org.onosproject.net.intent"))
-                .andReturn(appId);
-        sut.coreService = coreService;
-        sut.resourceService = new MockResourceService();
-
-        super.setUp();
-
-        intent = MplsPathIntent.builder()
-                .appId(APP_ID)
-                .selector(selector)
-                .treatment(treatment)
-                .path(new DefaultPath(PID, links, hops))
-                .ingressLabel(ingressLabel)
-                .egressLabel(egressLabel)
-                .priority(55)
-                .build();
-
-        IntentExtensionService intentExtensionService = createMock(IntentExtensionService.class);
-        intentExtensionService.registerCompiler(MplsPathIntent.class, sut);
-        intentExtensionService.unregisterCompiler(MplsPathIntent.class);
-        sut.intentExtensionService = intentExtensionService;
-
-        replay(coreService, intentExtensionService);
-    }
-
-    @Test
-    public void testCompile() {
-        sut.activate();
-
-        List<Intent> compiled = sut.compile(intent, Collections.emptyList());
-        assertThat(compiled, hasSize(1));
-
-        Collection<FlowRule> rules = ((FlowRuleIntent) compiled.get(0)).flowRules();
-        assertThat(rules, hasSize(3));
-
-        FlowRule rule = rules.stream()
-                .filter(x -> x.deviceId().equals(d2p0.deviceId()))
-                .findFirst()
-                .get();
-        assertThat(rule.deviceId(), is(d2p0.deviceId()));
-
-        sut.deactivate();
-
-    }
-
-}
diff --git a/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java b/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java
index 2cfd0c4..64fdba3 100644
--- a/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java
+++ b/core/store/serializers/src/main/java/org/onosproject/store/serializers/KryoNamespaces.java
@@ -168,8 +168,6 @@
 import org.onosproject.net.intent.IntentState;
 import org.onosproject.net.intent.Key;
 import org.onosproject.net.intent.LinkCollectionIntent;
-import org.onosproject.net.intent.MplsIntent;
-import org.onosproject.net.intent.MplsPathIntent;
 import org.onosproject.net.intent.MultiPointToSinglePointIntent;
 import org.onosproject.net.intent.OpticalCircuitIntent;
 import org.onosproject.net.intent.OpticalConnectivityIntent;
@@ -544,8 +542,6 @@
             .register(TributarySlot.class)
             .register(OtuSignalType.class)
             .register(
-                    MplsIntent.class,
-                    MplsPathIntent.class,
                     org.onlab.packet.MplsLabel.class,
                     org.onlab.packet.MPLS.class
             )