[ONOS-4171] Merge PCEP and BGP providers into common BGPCEP provider.

Change-Id: Ia87f0898e51704ce8d02d877e9f0d57219099a53
diff --git a/providers/bgp/flow/BUCK b/providers/bgp/flow/BUCK
deleted file mode 100644
index 917fc34..0000000
--- a/providers/bgp/flow/BUCK
+++ /dev/null
@@ -1,8 +0,0 @@
-COMPILE_DEPS = [
-    '//lib:CORE_DEPS',
-    '//protocols/bgp/api:onos-bgp-api',
-]
-
-osgi_jar_with_tests (
-    deps = COMPILE_DEPS,
-)
diff --git a/providers/bgp/flow/pom.xml b/providers/bgp/flow/pom.xml
deleted file mode 100755
index c901115..0000000
--- a/providers/bgp/flow/pom.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-  ~ 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/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>org.onosproject</groupId>
-        <artifactId>onos-bgp-providers</artifactId>
-        <version>1.6.0-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-
-    <artifactId>onos-bgp-provider-flow</artifactId>
-    <packaging>bundle</packaging>
-
-    <description>ONOS BGP protocol flow provider</description>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.compendium</artifactId>
-        </dependency>
-    </dependencies>
-</project>
diff --git a/providers/bgp/flow/src/main/java/org/onosproject/provider/bgp/flow/impl/BgpFlowRuleProvider.java b/providers/bgp/flow/src/main/java/org/onosproject/provider/bgp/flow/impl/BgpFlowRuleProvider.java
deleted file mode 100755
index 8482e38..0000000
--- a/providers/bgp/flow/src/main/java/org/onosproject/provider/bgp/flow/impl/BgpFlowRuleProvider.java
+++ /dev/null
@@ -1,110 +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.
- */
-package org.onosproject.provider.bgp.flow.impl;
-
-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.onosproject.bgp.controller.BgpController;
-import org.onosproject.cfg.ComponentConfigService;
-import org.onosproject.core.ApplicationId;
-import org.onosproject.net.flow.FlowRule;
-import org.onosproject.net.flow.FlowRuleBatchOperation;
-import org.onosproject.net.flow.FlowRuleProvider;
-import org.onosproject.net.flow.FlowRuleProviderRegistry;
-import org.onosproject.net.flow.FlowRuleProviderService;
-import org.onosproject.net.provider.AbstractProvider;
-import org.onosproject.net.provider.ProviderId;
-import org.osgi.service.component.ComponentContext;
-import org.slf4j.Logger;
-
-import static org.slf4j.LoggerFactory.getLogger;
-
-/**
- * Bgp Flow provider.
- */
-@Component(immediate = true)
-public class BgpFlowRuleProvider extends AbstractProvider
-        implements FlowRuleProvider {
-
-    private final Logger log = getLogger(getClass());
-
-    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
-    protected FlowRuleProviderRegistry providerRegistry;
-
-    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
-    protected ComponentConfigService cfgService;
-
-    @Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
-    protected BgpController bgpController;
-
-    private FlowRuleProviderService providerService;
-
-    /**
-     * Creates an BgpFlow host provider.
-     */
-    public BgpFlowRuleProvider() {
-        super(new ProviderId("bgp", "org.onosproject.provider.bgp"));
-    }
-
-    @Activate
-    public void activate(ComponentContext context) {
-        cfgService.registerProperties(getClass());
-        providerService = providerRegistry.register(this);
-    }
-
-    @Deactivate
-    public void deactivate(ComponentContext context) {
-        cfgService.unregisterProperties(getClass(), false);
-        providerRegistry.unregister(this);
-        providerService = null;
-    }
-
-    @Override
-    public void applyFlowRule(FlowRule... flowRules) {
-        for (FlowRule flowRule : flowRules) {
-            applyRule(flowRule);
-        }
-    }
-
-    private void applyRule(FlowRule flowRule) {
-        //TODO
-    }
-
-    @Override
-    public void removeFlowRule(FlowRule... flowRules) {
-        for (FlowRule flowRule : flowRules) {
-            removeRule(flowRule);
-        }
-    }
-
-    private void removeRule(FlowRule flowRule) {
-        //TODO
-    }
-
-    @Override
-    public void removeRulesById(ApplicationId id, FlowRule... flowRules) {
-        // TODO
-        removeFlowRule(flowRules);
-    }
-
-    @Override
-    public void executeBatch(FlowRuleBatchOperation batch) {
-    //TODO
-    }
-}
diff --git a/providers/bgp/flow/src/main/java/org/onosproject/provider/bgp/flow/impl/package-info.java b/providers/bgp/flow/src/main/java/org/onosproject/provider/bgp/flow/impl/package-info.java
deleted file mode 100755
index bacbbec..0000000
--- a/providers/bgp/flow/src/main/java/org/onosproject/provider/bgp/flow/impl/package-info.java
+++ /dev/null
@@ -1,20 +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.
- */
-
-/**
- * Bgp Flow provider.
- */
-package org.onosproject.provider.bgp.flow.impl;
diff --git a/providers/bgp/pom.xml b/providers/bgp/pom.xml
index 5764f7d..4264c52 100755
--- a/providers/bgp/pom.xml
+++ b/providers/bgp/pom.xml
@@ -25,10 +25,9 @@
   <packaging>pom</packaging>
   <description>BGP-LS protocol providers root</description>
   <modules>
-  	<module>topology</module>
+        <module>topology</module>
         <module>cfg</module>
-  	<module>app</module>
-        <module>flow</module>
+        <module>app</module>
   </modules>
     <dependencies>
 
diff --git a/providers/bgp/topology/src/main/java/org/onosproject/provider/bgp/topology/impl/BgpTopologyProvider.java b/providers/bgp/topology/src/main/java/org/onosproject/provider/bgp/topology/impl/BgpTopologyProvider.java
old mode 100755
new mode 100644
index 82af9a9..0ac494c
--- a/providers/bgp/topology/src/main/java/org/onosproject/provider/bgp/topology/impl/BgpTopologyProvider.java
+++ b/providers/bgp/topology/src/main/java/org/onosproject/provider/bgp/topology/impl/BgpTopologyProvider.java
@@ -79,8 +79,11 @@
 @Component(immediate = true)
 public class BgpTopologyProvider extends AbstractProvider implements DeviceProvider, LinkProvider {
 
+    /**
+     * Creates an instance of BGP topology provider.
+     */
     public BgpTopologyProvider() {
-        super(new ProviderId("bgp", "org.onosproject.provider.bgp"));
+        super(new ProviderId("l3", "org.onosproject.provider.bgp"));
     }
 
     private static final Logger log = LoggerFactory.getLogger(BgpTopologyProvider.class);
diff --git a/providers/bgp/topology/src/test/java/org/onosproject/provider/bgp/topology/impl/BgpTopologyProviderTest.java b/providers/bgp/topology/src/test/java/org/onosproject/provider/bgp/topology/impl/BgpTopologyProviderTest.java
old mode 100755
new mode 100644
index d212fb4..7401fa5
--- a/providers/bgp/topology/src/test/java/org/onosproject/provider/bgp/topology/impl/BgpTopologyProviderTest.java
+++ b/providers/bgp/topology/src/test/java/org/onosproject/provider/bgp/topology/impl/BgpTopologyProviderTest.java
@@ -70,9 +70,9 @@
  * Test for BGP topology provider.
  */
 public class BgpTopologyProviderTest {
-    private static final DeviceId DID2 = DeviceId.deviceId("bgp:rd=0::routinguniverse=0:asn=10");
+    private static final DeviceId DID2 = DeviceId.deviceId("l3:rd=0::routinguniverse=0:asn=10");
     private static final String UNKNOWN = new String("unknown");
-    public static ProviderId providerId = new ProviderId("bgp", "foo");
+    public static ProviderId providerId = new ProviderId("l3", "foo");
 
     private final BgpTopologyProvider provider = new BgpTopologyProvider();
     private final TestDeviceRegistry nodeRegistry = new TestDeviceRegistry();