Move PCE label handling from APP to protocol.

Change-Id: I26ae21b27ac2dc9ae3302030f6860e0e371c342c
diff --git a/providers/pcep/BUCK b/providers/pcep/BUCK
index bcf6c31..c5b609d 100644
--- a/providers/pcep/BUCK
+++ b/providers/pcep/BUCK
@@ -5,7 +5,6 @@
     '//protocols/pcep/pcepio:onos-protocols-pcep-pcepio',
     '//protocols/pcep/ctl:onos-protocols-pcep-ctl',
     '//apps/pcep-api:onos-apps-pcep-api',
-    '//providers/pcep/packet:onos-providers-pcep-packet',
 ]
 
 onos_app (
diff --git a/providers/pcep/packet/BUCK b/providers/pcep/packet/BUCK
deleted file mode 100644
index 94b0e5b..0000000
--- a/providers/pcep/packet/BUCK
+++ /dev/null
@@ -1,8 +0,0 @@
-COMPILE_DEPS = [
-    '//lib:CORE_DEPS',
-    '//protocols/pcep/api:onos-protocols-pcep-api',
-]
-
-osgi_jar_with_tests (
-    deps = COMPILE_DEPS,
-)
diff --git a/providers/pcep/packet/pom.xml b/providers/pcep/packet/pom.xml
deleted file mode 100644
index 2d32c19..0000000
--- a/providers/pcep/packet/pom.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<!--
-  ~ Copyright 2016-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.
-  -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <parent>
-        <groupId>org.onosproject</groupId>
-        <artifactId>onos-pcep-providers</artifactId>
-        <version>1.7.0-SNAPSHOT</version>
-    </parent>
-    <artifactId>onos-pcep-provider-packet</artifactId>
-    <packaging>bundle</packaging>
-    <description>PCEP packet provider</description>
-    <dependencies>
-        <dependency>
-            <groupId>org.onosproject</groupId>
-            <artifactId>onos-pcep-controller-api</artifactId>
-        </dependency>
-    </dependencies>
-</project>
diff --git a/providers/pcep/packet/src/main/java/org/onosproject/provider/pcep/packet/impl/PcepPacketProvider.java b/providers/pcep/packet/src/main/java/org/onosproject/provider/pcep/packet/impl/PcepPacketProvider.java
deleted file mode 100644
index a522a8f..0000000
--- a/providers/pcep/packet/src/main/java/org/onosproject/provider/pcep/packet/impl/PcepPacketProvider.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package org.onosproject.provider.pcep.packet.impl;
-
-import static org.slf4j.LoggerFactory.getLogger;
-
-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.apache.felix.scr.annotations.Service;
-import org.onlab.packet.Ethernet;
-import org.onlab.packet.IPv4;
-import org.onlab.packet.MacAddress;
-import org.onlab.packet.TCP;
-import org.onosproject.net.ConnectPoint;
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.PortNumber;
-import org.onosproject.net.device.DeviceService;
-import org.onosproject.net.packet.DefaultInboundPacket;
-import org.onosproject.net.packet.DefaultPacketContext;
-import org.onosproject.net.packet.InboundPacket;
-import org.onosproject.net.packet.OutboundPacket;
-import org.onosproject.net.packet.PacketProvider;
-import org.onosproject.net.packet.PacketProviderRegistry;
-import org.onosproject.net.packet.PacketProviderService;
-import org.onosproject.net.provider.AbstractProvider;
-import org.onosproject.net.provider.ProviderId;
-import org.onosproject.pcep.controller.PccId;
-import org.onosproject.pcep.controller.PcepClientController;
-import org.onosproject.pcep.controller.PcepPacketListener;
-import org.slf4j.Logger;
-
-/**
- * Provider which uses an PCEP controller to process packets.
- */
-@Component(immediate = true)
-@Service
-public class PcepPacketProvider extends AbstractProvider implements PacketProvider {
-
-    private static final Logger log = getLogger(PcepPacketProvider.class);
-    static final String PROVIDER_ID = "org.onosproject.provider.packet.pcep";
-
-    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
-    protected PacketProviderRegistry packetProviderRegistry;
-
-    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
-    protected PcepClientController pcepClientController;
-
-    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
-    protected DeviceService deviceService;
-
-    PacketProviderService packetProviderService;
-
-    private InnerPacketProvider listener = new InnerPacketProvider();
-    public static final String LSRID = "lsrId";
-    public static final int PCEP_PORT = 4189;
-
-    /**
-     * Creates a Packet provider.
-     */
-    public PcepPacketProvider() {
-        super(new ProviderId("pcep", PROVIDER_ID));
-    }
-
-    @Activate
-    public void activate() {
-        packetProviderService = packetProviderRegistry.register(this);
-        pcepClientController.addPacketListener(listener);
-        log.info("Started");
-    }
-
-    @Deactivate
-    public void deactivate() {
-        packetProviderRegistry.unregister(this);
-        pcepClientController.removePacketListener(listener);
-        log.info("Stopped");
-    }
-
-    private class InnerPacketProvider implements PcepPacketListener {
-        @Override
-        public void sendPacketIn(PccId pccId) {
-            TCP tcp = new TCP();
-            // Set the well known PCEP port. To be used to decide to process/discard the packet while processing.
-            tcp.setDestinationPort(PCEP_PORT);
-
-            IPv4 ipv4 = new IPv4();
-            ipv4.setProtocol(IPv4.PROTOCOL_TCP);
-            ipv4.setPayload(tcp);
-
-            Ethernet eth = new Ethernet();
-            eth.setEtherType(Ethernet.TYPE_IPV4);
-            eth.setDestinationMACAddress(MacAddress.NONE);
-            eth.setPayload(ipv4);
-
-            // Get lsrId of the PCEP client from the PCC ID. Session info is based on lsrID.
-            String lsrId = String.valueOf(pccId.ipAddress());
-            DeviceId pccDeviceId = DeviceId.deviceId(lsrId);
-
-            InboundPacket inPkt = new DefaultInboundPacket(new ConnectPoint(pccDeviceId,
-                                                                            PortNumber.portNumber(PCEP_PORT)),
-                                                           eth, null);
-
-            packetProviderService.processPacket(new PcepPacketContext(inPkt, null));
-        }
-    }
-
-    // Minimal PacketContext to make core and applications happy.
-    private final class PcepPacketContext extends DefaultPacketContext {
-        private PcepPacketContext(InboundPacket inPkt, OutboundPacket outPkt) {
-            super(System.currentTimeMillis(), inPkt, outPkt, false);
-        }
-
-        @Override
-        public void send() {
-            // We don't send anything out.
-        }
-    }
-
-    @Override
-    public void emit(OutboundPacket packet) {
-        // Nothing to emit
-    }
-}
diff --git a/providers/pcep/packet/src/main/java/org/onosproject/provider/pcep/packet/impl/package-info.java b/providers/pcep/packet/src/main/java/org/onosproject/provider/pcep/packet/impl/package-info.java
deleted file mode 100644
index 8e1ab9a..0000000
--- a/providers/pcep/packet/src/main/java/org/onosproject/provider/pcep/packet/impl/package-info.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*
- * Copyright 2016-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.
- */
-/**
- *Provider that uses PCEP controller as a means to send packets.
- */
-package org.onosproject.provider.pcep.packet.impl;
\ No newline at end of file
diff --git a/providers/pcep/pom.xml b/providers/pcep/pom.xml
index 03638de..7fdfc76 100644
--- a/providers/pcep/pom.xml
+++ b/providers/pcep/pom.xml
@@ -27,6 +27,5 @@
         <module>topology</module>
         <module>tunnel</module>
         <module>app</module>
-        <module>packet</module>
   </modules>
 </project>
\ No newline at end of file
diff --git a/providers/pcep/topology/BUCK b/providers/pcep/topology/BUCK
index 7a64a61..5b5078d 100644
--- a/providers/pcep/topology/BUCK
+++ b/providers/pcep/topology/BUCK
@@ -1,5 +1,6 @@
 COMPILE_DEPS = [
     '//lib:CORE_DEPS',
+    '//incubator/api:onos-incubator-api',
     '//protocols/ovsdb/api:onos-protocols-ovsdb-api',
     '//protocols/ovsdb/rfc:onos-protocols-ovsdb-rfc',
     '//apps/pcep-api:onos-apps-pcep-api',
diff --git a/providers/pcep/topology/src/test/java/org/onosproject/provider/pcep/topology/impl/PcepClientControllerAdapter.java b/providers/pcep/topology/src/test/java/org/onosproject/provider/pcep/topology/impl/PcepClientControllerAdapter.java
index 1cf2a32..459ebc9 100644
--- a/providers/pcep/topology/src/test/java/org/onosproject/provider/pcep/topology/impl/PcepClientControllerAdapter.java
+++ b/providers/pcep/topology/src/test/java/org/onosproject/provider/pcep/topology/impl/PcepClientControllerAdapter.java
@@ -25,6 +25,10 @@
 import org.apache.felix.scr.annotations.Activate;
 import org.apache.felix.scr.annotations.Deactivate;
 import org.onlab.packet.IpAddress;
+import org.onosproject.incubator.net.tunnel.DefaultLabelStack;
+import org.onosproject.incubator.net.tunnel.LabelStack;
+import org.onosproject.incubator.net.tunnel.Tunnel;
+import org.onosproject.net.Path;
 import org.onosproject.pcep.controller.ClientCapability;
 import org.onosproject.pcep.controller.PccId;
 import org.onosproject.pcep.controller.PcepClient;
@@ -32,7 +36,6 @@
 import org.onosproject.pcep.controller.PcepClientListener;
 import org.onosproject.pcep.controller.PcepEventListener;
 import org.onosproject.pcep.controller.PcepNodeListener;
-import org.onosproject.pcep.controller.PcepPacketListener;
 import org.onosproject.pcep.controller.driver.PcepAgent;
 import org.onosproject.pcepio.protocol.PcepError;
 import org.onosproject.pcepio.protocol.PcepErrorInfo;
@@ -41,6 +44,7 @@
 import org.onosproject.pcepio.protocol.PcepFactory;
 import org.onosproject.pcepio.protocol.PcepMessage;
 import org.onosproject.pcepio.protocol.PcepVersion;
+import org.onosproject.pcepio.types.PcepValueType;
 
 import com.google.common.collect.Sets;
 
@@ -290,14 +294,20 @@
     }
 
     @Override
-    public void addPacketListener(PcepPacketListener listener) {
+    public LabelStack computeLabelStack(Path path) {
         // TODO Auto-generated method stub
-
+        return null;
     }
 
     @Override
-    public void removePacketListener(PcepPacketListener listener) {
+    public LinkedList<PcepValueType> createPcepLabelStack(DefaultLabelStack labelStack, Path path) {
         // TODO Auto-generated method stub
+        return null;
+    }
 
+    @Override
+    public boolean allocateLocalLabel(Tunnel tunnel) {
+        // TODO Auto-generated method stub
+        return false;
     }
 }
diff --git a/providers/pcep/tunnel/src/main/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProvider.java b/providers/pcep/tunnel/src/main/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProvider.java
index f821f21..767d026 100644
--- a/providers/pcep/tunnel/src/main/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProvider.java
+++ b/providers/pcep/tunnel/src/main/java/org/onosproject/provider/pcep/tunnel/impl/PcepTunnelProvider.java
@@ -100,7 +100,6 @@
 import org.onosproject.pcepio.protocol.PcepMessage;
 import org.onosproject.pcepio.protocol.PcepMetricObject;
 import org.onosproject.pcepio.protocol.PcepMsgPath;
-import org.onosproject.pcepio.protocol.PcepNai;
 import org.onosproject.pcepio.protocol.PcepReportMsg;
 import org.onosproject.pcepio.protocol.PcepSrpObject;
 import org.onosproject.pcepio.protocol.PcepStateReport;
@@ -109,7 +108,6 @@
 import org.onosproject.pcepio.types.IPv4SubObject;
 import org.onosproject.pcepio.types.PathSetupTypeTlv;
 import org.onosproject.pcepio.types.PcepNaiIpv4Adjacency;
-import org.onosproject.pcepio.types.PcepNaiIpv4NodeId;
 import org.onosproject.pcepio.types.PcepValueType;
 import org.onosproject.pcepio.types.SrEroSubObject;
 import org.onosproject.pcepio.types.StatefulIPv4LspIdentifiersTlv;
@@ -124,7 +122,6 @@
 import java.util.Collections;
 import java.util.Dictionary;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.ListIterator;
@@ -280,7 +277,6 @@
             collectors.values().forEach(tsc -> tsc.adjustPollInterval(tunnelStatsPollFrequency));
             log.info("New setting: tunnelStatsPollFrequency={}", tunnelStatsPollFrequency);
         }
-
     }
 
     @Override
@@ -318,8 +314,27 @@
         //TODO: tunnel which is passed doesn't have tunnelID
         if (tunnel.annotations().value(PLSP_ID) != null) {
             if (LspType.valueOf(tunnel.annotations().value(LSP_SIG_TYPE)) != WITHOUT_SIGNALLING_AND_WITHOUT_SR) {
-                // For CR LSPs, BGP flow provider will send update message after pushing labels.
                 updateTunnel(tunnel, path);
+            } else {
+                // Download labels and send update message.
+                // To get new tunnel ID (modified tunnel ID)
+                Collection<Tunnel> tunnels = tunnelService.queryTunnel(tunnel.src(), tunnel.dst());
+                for (Tunnel t : tunnels) {
+                    if (t.state().equals(INIT) && t.tunnelName().equals(tunnel.tunnelName())) {
+                        tunnel = new DefaultTunnel(tunnel.providerId(), tunnel.src(),
+                                tunnel.dst(), tunnel.type(),
+                                t.state(), tunnel.groupId(),
+                                t.tunnelId(),
+                                tunnel.tunnelName(),
+                                tunnel.path(),
+                                tunnel.resource(),
+                                tunnel.annotations());
+                                break;
+                    }
+                }
+                if (!pcepClientController.allocateLocalLabel(tunnel)) {
+                    log.error("Unable to allocate labels for the tunnel {}.", tunnel.toString());
+                }
             }
             return;
         }
@@ -806,13 +821,11 @@
                                                    extendAnnotations);
 
         }
-        TunnelDescription tunnel = new DefaultTunnelDescription(
-                                                                tunnelId,
+        TunnelDescription tunnel = new DefaultTunnelDescription(tunnelId,
                                                                 srcPoint,
                                                                 dstPoint,
                                                                 tunnelType,
-                                                                new DefaultGroupId(
-                                                                                   0),
+                                                                new DefaultGroupId(0),
                                                                 id(), name,
                                                                 path,
                                                                 annotations);
@@ -904,55 +917,6 @@
     }
 
     /**
-     * Creates label stack for ERO object from network resource.
-     *
-     * @param labelStack
-     * @param path (hop list)
-     * @return list of ERO subobjects
-     */
-    private LinkedList<PcepValueType> createPcepLabelStack(DefaultLabelStack labelStack, Path path) {
-        checkNotNull(labelStack);
-
-        LinkedList<PcepValueType> llSubObjects = new LinkedList<PcepValueType>();
-        Iterator<Link> links = path.links().iterator();
-        LabelResourceId label = null;
-        Link link = null;
-        PcepValueType subObj = null;
-        PcepNai nai = null;
-        Device dstNode = null;
-        long srcPortNo, dstPortNo;
-
-        ListIterator<LabelResourceId> labelListIterator = labelStack.labelResources().listIterator();
-        while (labelListIterator.hasNext()) {
-            label = labelListIterator.next();
-            link = links.next();
-
-            srcPortNo = link.src().port().toLong();
-            srcPortNo = ((srcPortNo & IDENTIFIER_SET) == IDENTIFIER_SET) ? srcPortNo & SET : srcPortNo;
-
-            dstPortNo = link.dst().port().toLong();
-            dstPortNo = ((dstPortNo & IDENTIFIER_SET) == IDENTIFIER_SET) ? dstPortNo & SET : dstPortNo;
-
-            nai = new PcepNaiIpv4Adjacency((int) srcPortNo, (int) dstPortNo);
-            subObj = new SrEroSubObject(PcepNaiIpv4Adjacency.ST_TYPE, false, false, false, true, (int) label.labelId(),
-                                        nai);
-            llSubObjects.add(subObj);
-
-            dstNode = deviceService.getDevice(link.dst().deviceId());
-            nai = new PcepNaiIpv4NodeId(Ip4Address.valueOf(dstNode.annotations().value(LSRID)).toInt());
-
-            if (!labelListIterator.hasNext()) {
-                log.error("Malformed label stack.");
-            }
-            label = labelListIterator.next();
-            subObj = new SrEroSubObject(PcepNaiIpv4NodeId.ST_TYPE, false, false, false, true, (int) label.labelId(),
-                                        nai);
-            llSubObjects.add(subObj);
-        }
-        return llSubObjects;
-    }
-
-    /**
      * Creates PcInitiated lsp request list for setup tunnel.
      *
      * @param tunnel mpls tunnel
@@ -967,10 +931,18 @@
                                                                           throws PcepParseException {
         PcepValueType tlv;
         LinkedList<PcepValueType> llSubObjects = null;
+        LspType lspType = LspType.valueOf(tunnel.annotations().value(LSP_SIG_TYPE));
 
-        NetworkResource labelStack = tunnel.resource();
-        if (labelStack != null && labelStack instanceof DefaultLabelStack) {
-            llSubObjects = createPcepLabelStack((DefaultLabelStack) labelStack, path);
+        if (lspType == SR_WITHOUT_SIGNALLING) {
+            NetworkResource labelStack = tunnel.resource();
+            if (labelStack == null || !(labelStack instanceof DefaultLabelStack)) {
+                labelStack = pcepClientController.computeLabelStack(tunnel.path());
+                if (labelStack == null) {
+                    log.error("Unable to create label stack.");
+                    return null;
+                }
+            }
+            llSubObjects = pcepClientController.createPcepLabelStack((DefaultLabelStack) labelStack, path);
         } else {
             llSubObjects = createPcepPath(path);
         }
@@ -983,7 +955,7 @@
         LinkedList<PcepValueType> llOptionalTlv = new LinkedList<PcepValueType>();
 
         // set PathSetupTypeTlv of SRP object
-        tlv = new PathSetupTypeTlv(LspType.valueOf(tunnel.annotations().value(LSP_SIG_TYPE)).type());
+        tlv = new PathSetupTypeTlv(lspType.type());
         llOptionalTlv.add(tlv);
 
         // build SRP object
@@ -1115,7 +1087,6 @@
             PcepTunnelData pcepTunnelData = new PcepTunnelData(tunnel, DELETE);
             pcepTunnelApiMapper.addToCoreTunnelRequestQueue(pcepTunnelData);
             int srpId = SrpIdGenerators.create();
-            TunnelId tunnelId = tunnel.tunnelId();
 
             PcepValueType tlv;
             LinkedList<PcepValueType> llOptionalTlv = new LinkedList<PcepValueType>();
@@ -1193,14 +1164,21 @@
             PcepTunnelData pcepTunnelData = new PcepTunnelData(tunnel, path, UPDATE);
             pcepTunnelApiMapper.addToCoreTunnelRequestQueue(pcepTunnelData);
             int srpId = SrpIdGenerators.create();
-            TunnelId tunnelId = tunnel.tunnelId();
             PcepValueType tlv;
-            int plspId = 0;
 
             LinkedList<PcepValueType> llSubObjects = null;
-            NetworkResource labelStack = tunnel.resource();
-            if (labelStack != null && labelStack instanceof DefaultLabelStack) {
-                llSubObjects = createPcepLabelStack((DefaultLabelStack) labelStack, path);
+            LspType lspSigType = LspType.valueOf(tunnel.annotations().value(LSP_SIG_TYPE));
+
+            if (lspSigType == SR_WITHOUT_SIGNALLING) {
+                NetworkResource labelStack = tunnel.resource();
+                if (labelStack == null || !(labelStack instanceof DefaultLabelStack)) {
+                    labelStack = pcepClientController.computeLabelStack(tunnel.path());
+                    if (labelStack == null) {
+                        log.error("Unable to create label stack.");
+                        return;
+                    }
+                }
+                llSubObjects = pcepClientController.createPcepLabelStack((DefaultLabelStack) labelStack, path);
             } else {
                 llSubObjects = createPcepPath(path);
             }
@@ -1209,7 +1187,6 @@
             LinkedList<PcepUpdateRequest> llUpdateRequestList = new LinkedList<PcepUpdateRequest>();
 
             // set PathSetupTypeTlv of SRP object
-            LspType lspSigType = LspType.valueOf(tunnel.annotations().value(LSP_SIG_TYPE));
             tlv = new PathSetupTypeTlv(lspSigType.type());
             llOptionalTlv.add(tlv);
 
@@ -1285,8 +1262,6 @@
         }
     }
 
-
-
     private class InnerTunnelProvider implements PcepTunnelListener, PcepEventListener, PcepClientListener {
 
         @Override
@@ -1302,7 +1277,6 @@
             }
 
             TunnelId tunnelId = getTunnelId(tunnelKey);
-
             tunnel = buildOpticalTunnel(pcepTunnel, tunnelId);
 
             OperationType operType = pcepTunnel.getOperationType();
@@ -1737,7 +1711,7 @@
         private void tunnelUpdateInDelegatedCase(PccId pccId, SparseAnnotations annotations,
                 DefaultTunnelDescription td, ProviderId providerId, State tunnelState,
                                                  StatefulIPv4LspIdentifiersTlv ipv4LspIdentifiersTlv) {
-            //Wait for 2sec then query tunnel based on ingress PLSP-ID and local LSP-ID
+            // Wait for 2sec then query tunnel based on ingress PLSP-ID and local LSP-ID
 
             /*
              * If ONOS is not the master for that PCC then check if D flag is set, if yes wait [while
@@ -1891,14 +1865,11 @@
 
 
             if (endOfSyncAction == PcepLspSyncAction.UNSTABLE) {
-
                 // Send PCInit msg again after global reoptimization.
                 tunnelUpdated(td, UNSTABLE);
 
-                // To remove the old tunnel from store whose PLSPID is not
-                // recognized by ingress PCC.
+                // To remove the old tunnel from store whose PLSPID is not recognized by ingress PCC.
                 tunnelRemoved(td);
-
             } else if (endOfSyncAction == REMOVE) {
                 tunnelRemoved(td);
             }
diff --git a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepClientControllerAdapter.java b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepClientControllerAdapter.java
index b9c751e..a541734 100644
--- a/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepClientControllerAdapter.java
+++ b/providers/pcep/tunnel/src/test/java/org/onosproject/provider/pcep/tunnel/impl/PcepClientControllerAdapter.java
@@ -24,13 +24,16 @@
 
 import org.apache.felix.scr.annotations.Activate;
 import org.apache.felix.scr.annotations.Deactivate;
+import org.onosproject.incubator.net.tunnel.DefaultLabelStack;
+import org.onosproject.incubator.net.tunnel.LabelStack;
+import org.onosproject.incubator.net.tunnel.Tunnel;
+import org.onosproject.net.Path;
 import org.onosproject.pcep.controller.PccId;
 import org.onosproject.pcep.controller.PcepClient;
 import org.onosproject.pcep.controller.PcepClientController;
 import org.onosproject.pcep.controller.PcepClientListener;
 import org.onosproject.pcep.controller.PcepEventListener;
 import org.onosproject.pcep.controller.PcepNodeListener;
-import org.onosproject.pcep.controller.PcepPacketListener;
 import org.onosproject.pcep.controller.driver.PcepAgent;
 import org.onosproject.pcepio.protocol.PcepError;
 import org.onosproject.pcepio.protocol.PcepErrorInfo;
@@ -39,6 +42,7 @@
 import org.onosproject.pcepio.protocol.PcepFactory;
 import org.onosproject.pcepio.protocol.PcepMessage;
 import org.onosproject.pcepio.protocol.PcepVersion;
+import org.onosproject.pcepio.types.PcepValueType;
 
 import com.google.common.collect.Sets;
 
@@ -58,7 +62,6 @@
 
     protected Set<PcepEventListener> pcepEventListener = Sets.newHashSet();
     public Set<PcepNodeListener> pcepNodeListener = Sets.newHashSet();
-    protected Set<PcepPacketListener> pcepPacketListener = Sets.newHashSet();
 
     @Activate
     public void activate() {
@@ -118,16 +121,6 @@
     }
 
     @Override
-    public void addPacketListener(PcepPacketListener listener) {
-        pcepPacketListener.add(listener);
-    }
-
-    @Override
-    public void removePacketListener(PcepPacketListener listener) {
-        pcepPacketListener.remove(listener);
-    }
-
-    @Override
     public void writeMessage(PccId pccId, PcepMessage msg) {
         this.getClient(pccId).sendMessage(msg);
     }
@@ -292,4 +285,22 @@
             return false;
         }
     }
+
+    @Override
+    public LabelStack computeLabelStack(Path path) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public LinkedList<PcepValueType> createPcepLabelStack(DefaultLabelStack labelStack, Path path) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    @Override
+    public boolean allocateLocalLabel(Tunnel tunnel) {
+        // TODO Auto-generated method stub
+        return false;
+    }
 }