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/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() {
+ }
}