Move reactive-routing-specific config and classes out of common routing bundle
Change-Id: I463e5225337bfaa0ec85285658dbbabc8059f209
diff --git a/apps/routing-api/src/main/java/org/onosproject/routing/IntentRequestListener.java b/apps/routing-api/src/main/java/org/onosproject/routing/IntentRequestListener.java
deleted file mode 100644
index fbb3f5b..0000000
--- a/apps/routing-api/src/main/java/org/onosproject/routing/IntentRequestListener.java
+++ /dev/null
@@ -1,86 +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.routing;
-
-import org.onlab.packet.IpAddress;
-import org.onlab.packet.IpPrefix;
-import org.onlab.packet.MacAddress;
-import org.onosproject.net.ConnectPoint;
-
-/**
- * An interface to process intent requests.
- */
-public interface IntentRequestListener {
-
- /**
- * Sets up connectivity for packet from Internet to a host in local
- * SDN network.
- *
- * @param dstIpAddress IP address of destination host in local SDN network
- */
- void setUpConnectivityInternetToHost(IpAddress dstIpAddress);
-
- /**
- * Sets up the connectivity for two hosts in local SDN network.
- *
- * @param dstIpAddress the destination IP address
- * @param srcIpAddress the source IP address
- * @param srcMacAddress the source MAC address
- * @param srcConnectPoint the connectPoint of the source host
- */
- void setUpConnectivityHostToHost(IpAddress dstIpAddress,
- IpAddress srcIpAddress,
- MacAddress srcMacAddress,
- ConnectPoint srcConnectPoint);
-
- /**
- * Sets up connectivity for packet from a local host to the Internet.
- *
- * @param hostIp IP address of the local host
- * @param prefix external IP prefix that the host is talking to
- * @param nextHopIpAddress IP address of the next hop router for the prefix
- */
- void setUpConnectivityHostToInternet(IpAddress hostIp, IpPrefix prefix,
- IpAddress nextHopIpAddress);
-
- /**
- * Adds one new ingress connect point into ingress points of an existing
- * intent and resubmits the new intent.
- * <p>
- * If there is already an intent for an IP prefix in the system, we do not
- * need to create a new one, we only need to update this existing intent by
- * adding more ingress points.
- * </p>
- *
- * @param ipPrefix the IP prefix used to search the existing
- * MultiPointToSinglePointIntent
- * @param ingressConnectPoint the ingress connect point to be added into
- * the exiting intent
- */
- void updateExistingMp2pIntent(IpPrefix ipPrefix,
- ConnectPoint ingressConnectPoint);
-
- /**
- * Checks whether there is a MultiPointToSinglePointIntent in memory for a
- * given IP prefix.
- *
- * @param ipPrefix the IP prefix used to search the existing
- * MultiPointToSinglePointIntent
- * @return true if there is a MultiPointToSinglePointIntent, otherwise false
- */
- boolean mp2pIntentExists(IpPrefix ipPrefix);
-
-}
diff --git a/apps/routing-api/src/main/java/org/onosproject/routing/config/LocalIpPrefixEntry.java b/apps/routing-api/src/main/java/org/onosproject/routing/config/LocalIpPrefixEntry.java
deleted file mode 100644
index 5b2b908..0000000
--- a/apps/routing-api/src/main/java/org/onosproject/routing/config/LocalIpPrefixEntry.java
+++ /dev/null
@@ -1,139 +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.routing.config;
-
-import com.google.common.base.MoreObjects;
-
-import java.util.Objects;
-
-import org.onlab.packet.IpAddress;
-import org.onlab.packet.IpPrefix;
-
-/**
- * Configuration details for an IP prefix entry.
- */
-public class LocalIpPrefixEntry {
- private final IpPrefix ipPrefix;
- private final IpPrefixType type;
- private final IpAddress gatewayIpAddress;
-
- /**
- * Specifies the type of local IP prefix.
- */
- public enum IpPrefixType {
- /**
- * Public IP prefixes should be exchanged by eBGP.
- */
- PUBLIC,
- /**
- * Private IP prefixes should be used only locally and not exchanged
- * by eBGP.
- */
- PRIVATE,
- /**
- * For IP prefixes in blacklist.
- */
- BLACK_LIST
- }
-
- /**
- * Creates a new IP prefix entry.
- *
- * @param ipPrefix an IP prefix
- * @param type an IP prefix type as an IpPrefixType
- * @param gatewayIpAddress IP of the gateway
- */
- public LocalIpPrefixEntry(IpPrefix ipPrefix,
- IpPrefixType type,
- IpAddress gatewayIpAddress) {
- this.ipPrefix = ipPrefix;
- this.type = type;
- this.gatewayIpAddress = gatewayIpAddress;
- }
-
- /**
- * Gets the IP prefix of the IP prefix entry.
- *
- * @return the IP prefix
- */
- public IpPrefix ipPrefix() {
- return ipPrefix;
- }
-
- /**
- * Gets the IP prefix type of the IP prefix entry.
- *
- * @return the IP prefix type
- */
- public IpPrefixType ipPrefixType() {
- return type;
- }
-
- /**
- * Gets the gateway IP address of the IP prefix entry.
- *
- * @return the gateway IP address
- */
- public IpAddress getGatewayIpAddress() {
- return gatewayIpAddress;
- }
-
- /**
- * Tests whether the IP version of this entry is IPv4.
- *
- * @return true if the IP version of this entry is IPv4, otherwise false.
- */
- public boolean isIp4() {
- return ipPrefix.isIp4();
- }
-
- /**
- * Tests whether the IP version of this entry is IPv6.
- *
- * @return true if the IP version of this entry is IPv6, otherwise false.
- */
- public boolean isIp6() {
- return ipPrefix.isIp6();
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(ipPrefix, type);
- }
-
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- }
-
- if (!(obj instanceof LocalIpPrefixEntry)) {
- return false;
- }
-
- LocalIpPrefixEntry that = (LocalIpPrefixEntry) obj;
- return Objects.equals(this.ipPrefix, that.ipPrefix)
- && Objects.equals(this.type, that.type);
- }
-
- @Override
- public String toString() {
- return MoreObjects.toStringHelper(getClass())
- .add("ipPrefix", ipPrefix)
- .add("ipPrefixType", type)
- .toString();
- }
-}
diff --git a/apps/routing-api/src/main/java/org/onosproject/routing/config/ReactiveRoutingConfig.java b/apps/routing-api/src/main/java/org/onosproject/routing/config/ReactiveRoutingConfig.java
deleted file mode 100644
index aa0b0c7..0000000
--- a/apps/routing-api/src/main/java/org/onosproject/routing/config/ReactiveRoutingConfig.java
+++ /dev/null
@@ -1,108 +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.routing.config;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import com.google.common.collect.Sets;
-
-import java.util.Set;
-
-import org.onlab.packet.IpAddress;
-import org.onlab.packet.IpPrefix;
-import org.onlab.packet.MacAddress;
-import org.onosproject.core.ApplicationId;
-import org.onosproject.net.config.Config;
-import org.onosproject.routing.config.LocalIpPrefixEntry.IpPrefixType;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-/**
- * Configuration object for prefix config.
- */
-public class ReactiveRoutingConfig extends Config<ApplicationId> {
-
- private final Logger log = LoggerFactory.getLogger(getClass());
-
- public static final String IP4LOCALPREFIXES = "ip4LocalPrefixes";
- public static final String IP6LOCALPREFIXES = "ip6LocalPrefixes";
- public static final String IPPREFIX = "ipPrefix";
- public static final String TYPE = "type";
- public static final String GATEWAYIP = "gatewayIp";
- public static final String VIRTUALGATEWAYMACADDRESS =
- "virtualGatewayMacAddress";
-
- /**
- * Gets the set of configured local IPv4 prefixes.
- *
- * @return IPv4 prefixes
- */
- public Set<LocalIpPrefixEntry> localIp4PrefixEntries() {
- Set<LocalIpPrefixEntry> prefixes = Sets.newHashSet();
-
- JsonNode prefixesNode = object.get(IP4LOCALPREFIXES);
- if (prefixesNode == null) {
- log.warn("ip4LocalPrefixes is null!");
- return prefixes;
- }
-
- prefixesNode.forEach(jsonNode -> {
-
- prefixes.add(new LocalIpPrefixEntry(
- IpPrefix.valueOf(jsonNode.get(IPPREFIX).asText()),
- IpPrefixType.valueOf(jsonNode.get(TYPE).asText()),
- IpAddress.valueOf(jsonNode.get(GATEWAYIP).asText())));
- });
-
- return prefixes;
- }
-
- /**
- * Gets the set of configured local IPv6 prefixes.
- *
- * @return IPv6 prefixes
- */
- public Set<LocalIpPrefixEntry> localIp6PrefixEntries() {
- Set<LocalIpPrefixEntry> prefixes = Sets.newHashSet();
-
- JsonNode prefixesNode = object.get(IP6LOCALPREFIXES);
-
- if (prefixesNode == null) {
- log.warn("ip6LocalPrefixes is null!");
- return prefixes;
- }
-
- prefixesNode.forEach(jsonNode -> {
-
- prefixes.add(new LocalIpPrefixEntry(
- IpPrefix.valueOf(jsonNode.get(IPPREFIX).asText()),
- IpPrefixType.valueOf(jsonNode.get(TYPE).asText()),
- IpAddress.valueOf(jsonNode.get(GATEWAYIP).asText())));
- });
-
- return prefixes;
- }
-
- /**
- * Gets of the virtual gateway MAC address.
- *
- * @return virtual gateway MAC address
- */
- public MacAddress virtualGatewayMacAddress() {
- return MacAddress.valueOf(
- object.get(VIRTUALGATEWAYMACADDRESS).asText());
- }
-}
diff --git a/apps/routing-api/src/main/java/org/onosproject/routing/config/RoutingConfigurationService.java b/apps/routing-api/src/main/java/org/onosproject/routing/config/RoutingConfigurationService.java
index e2ed83f..7c7b0e5 100644
--- a/apps/routing-api/src/main/java/org/onosproject/routing/config/RoutingConfigurationService.java
+++ b/apps/routing-api/src/main/java/org/onosproject/routing/config/RoutingConfigurationService.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015-present Open Networking Laboratory
+ * Copyright 2017-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.
@@ -13,58 +13,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+
package org.onosproject.routing.config;
-import java.util.Set;
-
-import org.onlab.packet.IpAddress;
-import org.onlab.packet.IpPrefix;
-import org.onlab.packet.MacAddress;
-import org.onosproject.net.ConnectPoint;
-
/**
- * Provides information about the routing configuration.
+ * Routing configuration service. Going away very soon.
+ *
+ * @deprecated in Junco release
*/
+@Deprecated
public interface RoutingConfigurationService {
- String REACTIVE_ROUTING_APP_ID = "org.onosproject.reactive.routing";
-
- Class<ReactiveRoutingConfig> CONFIG_CLASS = ReactiveRoutingConfig.class;
-
-
- MacAddress getVirtualGatewayMacAddress();
-
/**
- * Evaluates whether an IP address is a virtual gateway IP address.
- *
- * @param ipAddress the IP address to evaluate
- * @return true if the IP address is a virtual gateway address, otherwise false
+ * Empty method to pacify checkstyle.
*/
- boolean isVirtualGatewayIpAddress(IpAddress ipAddress);
-
- /**
- * Evaluates whether an IP address belongs to local SDN network.
- *
- * @param ipAddress the IP address to evaluate
- * @return true if the IP address belongs to local SDN network, otherwise false
- */
- boolean isIpAddressLocal(IpAddress ipAddress);
-
- /**
- * Evaluates whether an IP prefix belongs to local SDN network.
- *
- * @param ipPrefix the IP prefix to evaluate
- * @return true if the IP prefix belongs to local SDN network, otherwise false
- */
- boolean isIpPrefixLocal(IpPrefix ipPrefix);
-
- /**
- * Retrieves the entire set of connect points connected to BGP peers in the
- * network.
- *
- * @return the set of connect points connected to BGP peers
- */
- Set<ConnectPoint> getBgpPeerConnectPoints();
-
-
+ default void nothing() {
+ }
}