Remove deprected Tunnel APIs
Change-Id: I46c265cfeb7ffe02d344bfc60fd1a903a69fd4a7
diff --git a/core/api/src/main/java/org/onosproject/net/behaviour/IpTunnelEndPoint.java b/core/api/src/main/java/org/onosproject/net/behaviour/IpTunnelEndPoint.java
deleted file mode 100644
index 2b622e3..0000000
--- a/core/api/src/main/java/org/onosproject/net/behaviour/IpTunnelEndPoint.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Foundation
- *
- * 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.behaviour;
-
-import com.google.common.annotations.Beta;
-import com.google.common.base.MoreObjects;
-import org.onlab.packet.IpAddress;
-
-/**
- * Represent for a tunnel point using ip address.
- *
- * @deprecated version 1.7.0 - Hummingbird; use {@code TunnelEndPoint<IpAddress>}
- */
-@Deprecated
-@Beta
-public final class IpTunnelEndPoint extends TunnelEndPoint<IpAddress> {
-
- /**
- * Public construction is prohibited.
- * @param ip ip address
- */
- private IpTunnelEndPoint(IpAddress ip) {
- super(ip);
- }
-
- /**
- * Create a IP tunnel end point.
- * @param ip IP address
- * @return IpTunnelEndPoint
- */
- public static IpTunnelEndPoint ipTunnelPoint(IpAddress ip) {
- return new IpTunnelEndPoint(ip);
- }
-
- /**
- * Returns IP address.
- * @return IP address
- */
- public IpAddress ip() {
- return value;
- }
-
- @Override
- public String toString() {
- return MoreObjects.toStringHelper(getClass()).add("ip", value).toString();
- }
-}
diff --git a/core/api/src/main/java/org/onosproject/net/behaviour/TunnelConfig.java b/core/api/src/main/java/org/onosproject/net/behaviour/TunnelConfig.java
deleted file mode 100644
index 696061c..0000000
--- a/core/api/src/main/java/org/onosproject/net/behaviour/TunnelConfig.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Foundation
- *
- * 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.behaviour;
-
-import java.util.Collection;
-
-import org.onosproject.net.driver.HandlerBehaviour;
-
-/**
- * Behaviour for handling various drivers for tunnel configuration.
- *
- * @deprecated version 1.7.0 - Hummingbird; use interface config tunnel mode
- */
-@Deprecated
-public interface TunnelConfig extends HandlerBehaviour {
-
- /**
- * Creates a tunnel interface on a given bridge of this device.
- *
- * @param bridgeName bridge name
- * @param tunnel tunnel description
- * @return true if succeeds, false otherwise
- */
- boolean createTunnelInterface(BridgeName bridgeName, TunnelDescription tunnel);
-
- /**
- * Removes a tunnel on this device.
- *
- * @param tunnel tunnel descriptor
- */
- void removeTunnel(TunnelDescription tunnel);
-
- /**
- * Updates a tunnel on this device.
- *
- * @param tunnel tunnel descriptor
- */
- void updateTunnel(TunnelDescription tunnel);
-
- /**
- * Returns tunnels created on this device.
- *
- * @return collection of tunnels
- */
- Collection<TunnelDescription> getTunnels();
-
-}
diff --git a/core/api/src/main/java/org/onosproject/net/behaviour/TunnelName.java b/core/api/src/main/java/org/onosproject/net/behaviour/TunnelName.java
deleted file mode 100644
index 2b567ac..0000000
--- a/core/api/src/main/java/org/onosproject/net/behaviour/TunnelName.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright 2015-present Open Networking Foundation
- *
- * 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.behaviour;
-
-import com.google.common.annotations.Beta;
-
-import java.util.Objects;
-
-/**
- * Represents for a unique tunnel name. TunnelId is generated by ONOS while
- * TunnelName is given by producer. The consumer can borrow tunnels with
- * TunnelId or TunnelName.
- *
- * @deprecated version 1.7.0 - Hummingbird
- */
-@Deprecated
-@Beta
-public final class TunnelName {
- private final String str;
-
- // Default constructor for serialization
- private TunnelName(String tunnelName) {
- this.str = tunnelName;
- }
-
-
- /**
- * Creates a tunnel name using the supplied URI string.
- *
- * @param tunnelName tunnel name string
- * @return tunnel name object
- */
- public static TunnelName tunnelName(String tunnelName) {
- return new TunnelName(tunnelName);
- }
-
- /**
- * The string of tunnel name.
- *
- * @return the string of tunnel name
- */
- public String value() {
- return str;
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(str);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj instanceof TunnelName) {
- final TunnelName that = (TunnelName) obj;
- return this.getClass() == that.getClass()
- && Objects.equals(this.str, that.str);
- }
- return false;
- }
-
- @Override
- public String toString() {
- return str;
- }
-}
diff --git a/drivers/ovsdb/src/main/java/org/onosproject/drivers/ovsdb/OvsdbTunnelConfig.java b/drivers/ovsdb/src/main/java/org/onosproject/drivers/ovsdb/OvsdbTunnelConfig.java
deleted file mode 100644
index 8618552..0000000
--- a/drivers/ovsdb/src/main/java/org/onosproject/drivers/ovsdb/OvsdbTunnelConfig.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright 2016-present Open Networking Foundation
- *
- * 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.drivers.ovsdb;
-
-import org.onlab.packet.IpAddress;
-import org.onosproject.net.DeviceId;
-import org.onosproject.net.behaviour.BridgeName;
-import org.onosproject.net.behaviour.TunnelConfig;
-import org.onosproject.net.behaviour.TunnelDescription;
-import org.onosproject.net.driver.AbstractHandlerBehaviour;
-import org.onosproject.net.driver.DriverHandler;
-import org.onosproject.ovsdb.controller.OvsdbClientService;
-import org.onosproject.ovsdb.controller.OvsdbController;
-import org.onosproject.ovsdb.controller.OvsdbInterface;
-import org.onosproject.ovsdb.controller.OvsdbNodeId;
-
-import java.util.Collection;
-import java.util.Collections;
-
-/**
- * OVSDB-based implementation of tunnel config behaviour.
- *
- * @deprecated version 1.7.0 - Hummingbird; use interface config instead
- */
-@Deprecated
-public class OvsdbTunnelConfig extends AbstractHandlerBehaviour
- implements TunnelConfig {
-
- @Override
- public boolean createTunnelInterface(BridgeName bridgeName, TunnelDescription tunnel) {
- DriverHandler handler = handler();
- OvsdbClientService ovsdbNode = getOvsdbNode(handler);
-
- OvsdbInterface ovsdbIface = OvsdbInterface.builder(tunnel).build();
- return ovsdbNode.createInterface(bridgeName.name(), ovsdbIface);
- }
-
- @Override
- public void removeTunnel(TunnelDescription tunnel) {
- DriverHandler handler = handler();
- OvsdbClientService ovsdbNode = getOvsdbNode(handler);
- ovsdbNode.dropInterface(tunnel.ifaceName());
- }
-
- @Override
- public void updateTunnel(TunnelDescription tunnel) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public Collection<TunnelDescription> getTunnels() {
- return Collections.emptyList();
- }
-
- // OvsdbNodeId(IP) is used in the adaptor while DeviceId(ovsdb:IP)
- // is used in the core. So DeviceId need be changed to OvsdbNodeId.
- private OvsdbNodeId changeDeviceIdToNodeId(DeviceId deviceId) {
- String[] splits = deviceId.toString().split(":");
- if (splits == null || splits.length < 1) {
- return null;
- }
- IpAddress ipAddress = IpAddress.valueOf(splits[1]);
- return new OvsdbNodeId(ipAddress, 0);
- }
-
- private OvsdbClientService getOvsdbNode(DriverHandler handler) {
- OvsdbController ovsController = handler.get(OvsdbController.class);
- DeviceId deviceId = handler.data().deviceId();
- OvsdbNodeId nodeId = changeDeviceIdToNodeId(deviceId);
- return ovsController.getOvsdbClient(nodeId);
- }
-}