Renamed routing packages to foo & foo.impl pattern.
Plus added some package-info.java files.
Change-Id: I0b68a7f4cea7a5f089b37b1a1c016d1c3b7a8702
diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpRouteEntry.java b/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpRouteEntry.java
index e7e7f3c..aee85b4 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpRouteEntry.java
+++ b/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpRouteEntry.java
@@ -19,7 +19,7 @@
import org.onlab.packet.Ip4Address;
import org.onlab.packet.IpAddress;
import org.onlab.packet.IpPrefix;
-import org.onosproject.routingapi.RouteEntry;
+import org.onosproject.routing.RouteEntry;
import java.util.ArrayList;
import java.util.Objects;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpRouteSelector.java b/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpRouteSelector.java
index e95aaff..ec02023 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpRouteSelector.java
+++ b/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpRouteSelector.java
@@ -16,7 +16,7 @@
package org.onosproject.routing.bgp;
import org.onlab.packet.IpPrefix;
-import org.onosproject.routingapi.RouteUpdate;
+import org.onosproject.routing.RouteUpdate;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSessionManager.java b/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSessionManager.java
index 5a16313..68aaefb 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSessionManager.java
+++ b/apps/routing/src/main/java/org/onosproject/routing/bgp/BgpSessionManager.java
@@ -35,8 +35,8 @@
import org.onlab.packet.Ip4Prefix;
import org.onlab.packet.Ip6Prefix;
import org.onlab.packet.IpPrefix;
-import org.onosproject.routingapi.BgpService;
-import org.onosproject.routingapi.RouteListener;
+import org.onosproject.routing.BgpService;
+import org.onosproject.routing.RouteListener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/cli/BgpRoutesListCommand.java b/apps/routing/src/main/java/org/onosproject/routing/cli/BgpRoutesListCommand.java
index c3d3c52..3734bea 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/cli/BgpRoutesListCommand.java
+++ b/apps/routing/src/main/java/org/onosproject/routing/cli/BgpRoutesListCommand.java
@@ -22,10 +22,10 @@
import org.apache.karaf.shell.commands.Command;
import org.apache.karaf.shell.commands.Option;
import org.onosproject.cli.AbstractShellCommand;
-import org.onosproject.routing.bgp.BgpConstants.Update;
import org.onosproject.routing.bgp.BgpInfoService;
import org.onosproject.routing.bgp.BgpRouteEntry;
import org.onosproject.routing.bgp.BgpSession;
+import org.onosproject.routing.bgp.BgpConstants;
import java.util.ArrayList;
import java.util.Collection;
@@ -150,7 +150,7 @@
private void printRoute(BgpRouteEntry route) {
if (route != null) {
print(FORMAT_ROUTE_LINE1, route.prefix(), route.nextHop(),
- Update.Origin.typeToString(route.getOrigin()),
+ BgpConstants.Update.Origin.typeToString(route.getOrigin()),
route.getLocalPref(), route.getMultiExitDisc(),
route.getBgpSession().remoteInfo().bgpId());
print(FORMAT_ROUTE_LINE2, asPath4Cli(route.getAsPath()));
@@ -176,23 +176,23 @@
String prefix = null;
String suffix = null;
switch (pathSegment.getType()) {
- case Update.AsPath.AS_SET:
+ case BgpConstants.Update.AsPath.AS_SET:
prefix = "[AS-Set";
suffix = "]";
break;
- case Update.AsPath.AS_SEQUENCE:
+ case BgpConstants.Update.AsPath.AS_SEQUENCE:
break;
- case Update.AsPath.AS_CONFED_SEQUENCE:
+ case BgpConstants.Update.AsPath.AS_CONFED_SEQUENCE:
prefix = "[AS-Confed-Seq";
suffix = "]";
break;
- case Update.AsPath.AS_CONFED_SET:
+ case BgpConstants.Update.AsPath.AS_CONFED_SET:
prefix = "[AS-Confed-Set";
suffix = "]";
break;
default:
builder.append(String.format("(type = %s)",
- Update.AsPath.typeToString(pathSegment.getType())));
+ BgpConstants.Update.AsPath.typeToString(pathSegment.getType())));
break;
}
@@ -247,7 +247,7 @@
result.put("nextHop", route.nextHop().toString());
result.put("bgpId",
route.getBgpSession().remoteInfo().bgpId().toString());
- result.put("origin", Update.Origin.typeToString(route.getOrigin()));
+ result.put("origin", BgpConstants.Update.Origin.typeToString(route.getOrigin()));
result.set("asPath", json(mapper, route.getAsPath()));
result.put("localPref", route.getLocalPref());
result.put("multiExitDisc", route.getMultiExitDisc());
@@ -268,7 +268,7 @@
for (BgpRouteEntry.PathSegment pathSegment : asPath.getPathSegments()) {
ObjectNode pathSegmentJson = mapper.createObjectNode();
pathSegmentJson.put("type",
- Update.AsPath.typeToString(pathSegment.getType()));
+ BgpConstants.Update.AsPath.typeToString(pathSegment.getType()));
ArrayNode segmentAsNumbersJson = mapper.createArrayNode();
for (Long asNumber : pathSegment.getSegmentAsNumbers()) {
segmentAsNumbersJson.add(asNumber);
diff --git a/apps/routing/src/main/java/org/onosproject/routing/cli/RoutesListCommand.java b/apps/routing/src/main/java/org/onosproject/routing/cli/RoutesListCommand.java
index ab2b91e..698ebb7 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/cli/RoutesListCommand.java
+++ b/apps/routing/src/main/java/org/onosproject/routing/cli/RoutesListCommand.java
@@ -22,8 +22,8 @@
import org.apache.karaf.shell.commands.Command;
import org.apache.karaf.shell.commands.Option;
import org.onosproject.cli.AbstractShellCommand;
-import org.onosproject.routingapi.RouteEntry;
-import org.onosproject.routingapi.RoutingService;
+import org.onosproject.routing.RouteEntry;
+import org.onosproject.routing.RoutingService;
import java.util.Collection;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/cli/package-info.java b/apps/routing/src/main/java/org/onosproject/routing/cli/package-info.java
new file mode 100644
index 0000000..cb6781e
--- /dev/null
+++ b/apps/routing/src/main/java/org/onosproject/routing/cli/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2015 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.
+ */
+
+/**
+ * CLI handlers for routing commands.
+ */
+package org.onosproject.routing.cli;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/config/Configuration.java b/apps/routing/src/main/java/org/onosproject/routing/config/impl/Configuration.java
similarity index 93%
rename from apps/routing/src/main/java/org/onosproject/routing/config/Configuration.java
rename to apps/routing/src/main/java/org/onosproject/routing/config/impl/Configuration.java
index 9ae69f8..bb57302 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/config/Configuration.java
+++ b/apps/routing/src/main/java/org/onosproject/routing/config/impl/Configuration.java
@@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.routing.config;
+package org.onosproject.routing.config.impl;
import com.fasterxml.jackson.annotation.JsonProperty;
-import org.onosproject.routingapi.config.BgpPeer;
-import org.onosproject.routingapi.config.BgpSpeaker;
+import org.onosproject.routing.config.BgpPeer;
+import org.onosproject.routing.config.BgpSpeaker;
import java.util.Collections;
import java.util.List;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/config/HostToInterfaceAdaptor.java b/apps/routing/src/main/java/org/onosproject/routing/config/impl/HostToInterfaceAdaptor.java
similarity index 96%
rename from apps/routing/src/main/java/org/onosproject/routing/config/HostToInterfaceAdaptor.java
rename to apps/routing/src/main/java/org/onosproject/routing/config/impl/HostToInterfaceAdaptor.java
index 98b7914..ee026dc 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/config/HostToInterfaceAdaptor.java
+++ b/apps/routing/src/main/java/org/onosproject/routing/config/impl/HostToInterfaceAdaptor.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.routing.config;
+package org.onosproject.routing.config.impl;
import com.google.common.collect.Sets;
import org.onlab.packet.IpAddress;
@@ -21,7 +21,7 @@
import org.onosproject.net.host.HostService;
import org.onosproject.net.host.InterfaceIpAddress;
import org.onosproject.net.host.PortAddresses;
-import org.onosproject.routingapi.config.Interface;
+import org.onosproject.routing.config.Interface;
import java.util.Set;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/config/RoutingConfigurationImpl.java b/apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java
similarity index 93%
rename from apps/routing/src/main/java/org/onosproject/routing/config/RoutingConfigurationImpl.java
rename to apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java
index 6ca0155..ac20475 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/config/RoutingConfigurationImpl.java
+++ b/apps/routing/src/main/java/org/onosproject/routing/config/impl/RoutingConfigurationImpl.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.routing.config;
+package org.onosproject.routing.config.impl;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.felix.scr.annotations.Activate;
@@ -24,10 +24,10 @@
import org.onlab.packet.IpAddress;
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.host.HostService;
-import org.onosproject.routingapi.config.BgpPeer;
-import org.onosproject.routingapi.config.BgpSpeaker;
-import org.onosproject.routingapi.config.Interface;
-import org.onosproject.routingapi.config.RoutingConfigurationService;
+import org.onosproject.routing.config.BgpPeer;
+import org.onosproject.routing.config.BgpSpeaker;
+import org.onosproject.routing.config.Interface;
+import org.onosproject.routing.config.RoutingConfigurationService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/config/impl/package-info.java b/apps/routing/src/main/java/org/onosproject/routing/config/impl/package-info.java
new file mode 100644
index 0000000..83c4a86
--- /dev/null
+++ b/apps/routing/src/main/java/org/onosproject/routing/config/impl/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2015 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.
+ */
+
+/**
+ * Implementation of routing configuration APIs.
+ */
+package org.onosproject.routing.config.impl;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/Router.java b/apps/routing/src/main/java/org/onosproject/routing/impl/Router.java
similarity index 97%
rename from apps/routing/src/main/java/org/onosproject/routing/Router.java
rename to apps/routing/src/main/java/org/onosproject/routing/impl/Router.java
index 1db8e0b..ddbc5ee 100644
--- a/apps/routing/src/main/java/org/onosproject/routing/Router.java
+++ b/apps/routing/src/main/java/org/onosproject/routing/impl/Router.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.onosproject.routing;
+package org.onosproject.routing.impl;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimaps;
@@ -37,14 +37,14 @@
import org.onosproject.net.host.HostEvent;
import org.onosproject.net.host.HostListener;
import org.onosproject.net.host.HostService;
-import org.onosproject.routingapi.BgpService;
-import org.onosproject.routingapi.FibEntry;
-import org.onosproject.routingapi.FibListener;
-import org.onosproject.routingapi.FibUpdate;
-import org.onosproject.routingapi.RouteEntry;
-import org.onosproject.routingapi.RouteListener;
-import org.onosproject.routingapi.RouteUpdate;
-import org.onosproject.routingapi.RoutingService;
+import org.onosproject.routing.BgpService;
+import org.onosproject.routing.FibEntry;
+import org.onosproject.routing.FibListener;
+import org.onosproject.routing.FibUpdate;
+import org.onosproject.routing.RouteEntry;
+import org.onosproject.routing.RouteListener;
+import org.onosproject.routing.RouteUpdate;
+import org.onosproject.routing.RoutingService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
diff --git a/apps/routing/src/main/java/org/onosproject/routing/impl/package-info.java b/apps/routing/src/main/java/org/onosproject/routing/impl/package-info.java
new file mode 100644
index 0000000..bb64bf6
--- /dev/null
+++ b/apps/routing/src/main/java/org/onosproject/routing/impl/package-info.java
@@ -0,0 +1,20 @@
+/*
+ * Copyright 2015 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.
+ */
+
+/**
+ * Implementation of routing functionality.
+ */
+package org.onosproject.routing.impl;