Jonathan Hart

Renamed routing packages to foo & foo.impl pattern.

Plus added some package-info.java files.

Change-Id: I0b68a7f4cea7a5f089b37b1a1c016d1c3b7a8702
Showing 39 changed files with 183 additions and 103 deletions
......@@ -42,11 +42,11 @@ import org.onosproject.net.group.GroupDescription;
import org.onosproject.net.group.GroupKey;
import org.onosproject.net.group.GroupService;
import org.onosproject.net.packet.PacketService;
import org.onosproject.routingapi.FibListener;
import org.onosproject.routingapi.FibUpdate;
import org.onosproject.routingapi.RoutingService;
import org.onosproject.routingapi.config.Interface;
import org.onosproject.routingapi.config.RoutingConfigurationService;
import org.onosproject.routing.FibListener;
import org.onosproject.routing.FibUpdate;
import org.onosproject.routing.RoutingService;
import org.onosproject.routing.config.Interface;
import org.onosproject.routing.config.RoutingConfigurationService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......
......@@ -31,10 +31,10 @@ import org.onosproject.net.packet.PacketContext;
import org.onosproject.net.packet.PacketPriority;
import org.onosproject.net.packet.PacketProcessor;
import org.onosproject.net.packet.PacketService;
import org.onosproject.routingapi.config.BgpPeer;
import org.onosproject.routingapi.config.BgpSpeaker;
import org.onosproject.routingapi.config.InterfaceAddress;
import org.onosproject.routingapi.config.RoutingConfigurationService;
import org.onosproject.routing.config.BgpPeer;
import org.onosproject.routing.config.BgpSpeaker;
import org.onosproject.routing.config.InterfaceAddress;
import org.onosproject.routing.config.RoutingConfigurationService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.routingapi;
package org.onosproject.routing;
/**
* Provides a way of interacting with the BGP protocol component.
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.routingapi;
package org.onosproject.routing;
import com.google.common.base.MoreObjects;
import org.onlab.packet.IpAddress;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.routingapi;
package org.onosproject.routing;
import java.util.Collection;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.routingapi;
package org.onosproject.routing;
import com.google.common.base.MoreObjects;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.routingapi;
package org.onosproject.routing;
import com.google.common.base.MoreObjects;
import org.onlab.packet.IpAddress;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.routingapi;
package org.onosproject.routing;
import java.util.Collection;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.routingapi;
package org.onosproject.routing;
import com.google.common.base.MoreObjects;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.routingapi;
package org.onosproject.routing;
import java.util.Collection;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.routingapi.config;
package org.onosproject.routing.config;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.MoreObjects;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.routingapi.config;
package org.onosproject.routing.config;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.routingapi.config;
package org.onosproject.routing.config;
import com.google.common.base.MoreObjects;
import com.google.common.collect.Sets;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.routingapi.config;
package org.onosproject.routing.config;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.MoreObjects;
......
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.routingapi.config;
package org.onosproject.routing.config;
import org.onlab.packet.IpAddress;
import org.onosproject.net.ConnectPoint;
......
......@@ -15,6 +15,6 @@
*/
/**
* SDN-IP configuration services.
* Routing configuration interfaces.
*/
package org.onosproject.routingapi.config;
package org.onosproject.routing.config;
......
/*
* 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.
*/
/**
* API for routing libraries.
*/
package org.onosproject.routing;
......@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.onosproject.routingapi;
package org.onosproject.routing;
import org.hamcrest.Matchers;
import org.junit.Test;
......
......@@ -19,7 +19,7 @@ import com.google.common.base.MoreObjects;
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;
......
......@@ -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;
......
......@@ -35,8 +35,8 @@ import org.onlab.packet.Ip4Address;
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;
......
......@@ -22,10 +22,10 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
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 @@ public class BgpRoutesListCommand extends AbstractShellCommand {
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 @@ public class BgpRoutesListCommand extends AbstractShellCommand {
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 @@ public class BgpRoutesListCommand extends AbstractShellCommand {
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 @@ public class BgpRoutesListCommand extends AbstractShellCommand {
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);
......
......@@ -22,8 +22,8 @@ import com.fasterxml.jackson.databind.node.ObjectNode;
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;
......
/*
* 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;
......@@ -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;
......
......@@ -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.ConnectPoint;
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;
......
......@@ -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.apache.felix.scr.annotations.Service;
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;
......
/*
* 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;
......@@ -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;
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;
......
/*
* 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;
......@@ -33,8 +33,8 @@ import org.onlab.junit.TestUtils;
import org.onlab.junit.TestUtils.TestUtilsException;
import org.onlab.packet.Ip4Address;
import org.onlab.packet.Ip4Prefix;
import org.onosproject.routingapi.RouteListener;
import org.onosproject.routingapi.RouteUpdate;
import org.onosproject.routing.RouteListener;
import org.onosproject.routing.RouteUpdate;
import org.osgi.service.component.ComponentContext;
import java.net.InetAddress;
......
......@@ -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.Maps;
import com.google.common.collect.Sets;
......@@ -29,7 +29,7 @@ import org.onosproject.net.PortNumber;
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.Collections;
import java.util.Map;
......
......@@ -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.Sets;
import org.junit.After;
......@@ -36,14 +36,14 @@ import org.onosproject.net.host.HostEvent;
import org.onosproject.net.host.HostListener;
import org.onosproject.net.host.HostService;
import org.onosproject.net.provider.ProviderId;
import org.onosproject.routing.Router.InternalHostListener;
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.routing.impl.Router.InternalHostListener;
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 java.util.Collections;
......
......@@ -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.Sets;
import org.junit.After;
......@@ -35,13 +35,13 @@ import org.onosproject.net.PortNumber;
import org.onosproject.net.host.HostListener;
import org.onosproject.net.host.HostService;
import org.onosproject.net.provider.ProviderId;
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.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 java.util.Collections;
......
......@@ -35,11 +35,11 @@ import org.onosproject.net.intent.IntentService;
import org.onosproject.net.intent.IntentState;
import org.onosproject.net.intent.MultiPointToSinglePointIntent;
import org.onosproject.net.intent.PointToPointIntent;
import org.onosproject.routingapi.FibListener;
import org.onosproject.routingapi.FibUpdate;
import org.onosproject.routingapi.config.BgpPeer;
import org.onosproject.routingapi.config.Interface;
import org.onosproject.routingapi.config.RoutingConfigurationService;
import org.onosproject.routing.FibListener;
import org.onosproject.routing.FibUpdate;
import org.onosproject.routing.config.BgpPeer;
import org.onosproject.routing.config.Interface;
import org.onosproject.routing.config.RoutingConfigurationService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......
......@@ -28,11 +28,11 @@ import org.onosproject.net.flow.DefaultTrafficTreatment;
import org.onosproject.net.flow.TrafficSelector;
import org.onosproject.net.flow.TrafficTreatment;
import org.onosproject.net.intent.PointToPointIntent;
import org.onosproject.routingapi.config.BgpPeer;
import org.onosproject.routingapi.config.BgpSpeaker;
import org.onosproject.routingapi.config.Interface;
import org.onosproject.routingapi.config.InterfaceAddress;
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.InterfaceAddress;
import org.onosproject.routing.config.RoutingConfigurationService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......
......@@ -30,8 +30,8 @@ import org.onosproject.config.NetworkConfigService;
import org.onosproject.core.ApplicationId;
import org.onosproject.core.CoreService;
import org.onosproject.net.intent.IntentService;
import org.onosproject.routingapi.RoutingService;
import org.onosproject.routingapi.config.RoutingConfigurationService;
import org.onosproject.routing.RoutingService;
import org.onosproject.routing.config.RoutingConfigurationService;
import org.slf4j.Logger;
import static org.slf4j.LoggerFactory.getLogger;
......
......@@ -41,12 +41,12 @@ import org.onosproject.net.intent.Intent;
import org.onosproject.net.intent.IntentService;
import org.onosproject.net.intent.IntentState;
import org.onosproject.net.intent.MultiPointToSinglePointIntent;
import org.onosproject.routingapi.FibEntry;
import org.onosproject.routingapi.FibUpdate;
import org.onosproject.routingapi.RouteEntry;
import org.onosproject.routingapi.config.BgpPeer;
import org.onosproject.routingapi.config.Interface;
import org.onosproject.routingapi.config.RoutingConfigurationService;
import org.onosproject.routing.FibEntry;
import org.onosproject.routing.FibUpdate;
import org.onosproject.routing.RouteEntry;
import org.onosproject.routing.config.BgpPeer;
import org.onosproject.routing.config.Interface;
import org.onosproject.routing.config.RoutingConfigurationService;
import org.onosproject.sdnip.IntentSynchronizer.IntentKey;
import java.util.Collections;
......
......@@ -40,11 +40,11 @@ import org.onosproject.net.intent.AbstractIntentTest;
import org.onosproject.net.intent.Intent;
import org.onosproject.net.intent.IntentService;
import org.onosproject.net.intent.PointToPointIntent;
import org.onosproject.routingapi.config.BgpPeer;
import org.onosproject.routingapi.config.BgpSpeaker;
import org.onosproject.routingapi.config.Interface;
import org.onosproject.routingapi.config.InterfaceAddress;
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.InterfaceAddress;
import org.onosproject.routing.config.RoutingConfigurationService;
import java.util.ArrayList;
import java.util.Collections;
......