Follow ONOS naming convention in PIM application
Change-Id: Id553a89630b44eafc791e54e54b043fb4182e324
diff --git a/apps/pim/src/main/java/org/onosproject/pim/cli/PimInterfacesListCommand.java b/apps/pim/src/main/java/org/onosproject/pim/cli/PimInterfacesListCommand.java
index 64dd207..130e81e 100644
--- a/apps/pim/src/main/java/org/onosproject/pim/cli/PimInterfacesListCommand.java
+++ b/apps/pim/src/main/java/org/onosproject/pim/cli/PimInterfacesListCommand.java
@@ -18,8 +18,8 @@
import org.apache.karaf.shell.commands.Command;
import org.onosproject.cli.AbstractShellCommand;
-import org.onosproject.pim.impl.PIMInterface;
-import org.onosproject.pim.impl.PIMInterfaceService;
+import org.onosproject.pim.impl.PimInterface;
+import org.onosproject.pim.impl.PimInterfaceService;
import java.util.Set;
@@ -35,9 +35,9 @@
@Override
protected void execute() {
- PIMInterfaceService interfaceService = get(PIMInterfaceService.class);
+ PimInterfaceService interfaceService = get(PimInterfaceService.class);
- Set<PIMInterface> interfaces = interfaceService.getPimInterfaces();
+ Set<PimInterface> interfaces = interfaceService.getPimInterfaces();
interfaces.forEach(pimIntf -> {
print(FORMAT, pimIntf.getInterface().name(),
diff --git a/apps/pim/src/main/java/org/onosproject/pim/cli/PimNeighborsListCommand.java b/apps/pim/src/main/java/org/onosproject/pim/cli/PimNeighborsListCommand.java
index 605ec81..502647b 100644
--- a/apps/pim/src/main/java/org/onosproject/pim/cli/PimNeighborsListCommand.java
+++ b/apps/pim/src/main/java/org/onosproject/pim/cli/PimNeighborsListCommand.java
@@ -19,9 +19,9 @@
import org.apache.karaf.shell.commands.Command;
import org.onlab.util.Tools;
import org.onosproject.cli.AbstractShellCommand;
-import org.onosproject.pim.impl.PIMInterface;
-import org.onosproject.pim.impl.PIMInterfaceService;
-import org.onosproject.pim.impl.PIMNeighbor;
+import org.onosproject.pim.impl.PimInterface;
+import org.onosproject.pim.impl.PimInterfaceService;
+import org.onosproject.pim.impl.PimNeighbor;
import java.util.Set;
@@ -37,13 +37,13 @@
@Override
protected void execute() {
- PIMInterfaceService interfaceService = get(PIMInterfaceService.class);
+ PimInterfaceService interfaceService = get(PimInterfaceService.class);
- Set<PIMInterface> interfaces = interfaceService.getPimInterfaces();
+ Set<PimInterface> interfaces = interfaceService.getPimInterfaces();
- for (PIMInterface intf : interfaces) {
+ for (PimInterface intf : interfaces) {
print(INTF_FORMAT, intf.getInterface().name(), intf.getIpAddress());
- for (PIMNeighbor neighbor : intf.getNeighbors()) {
+ for (PimNeighbor neighbor : intf.getNeighbors()) {
// Filter out the PIM neighbor representing 'us'
if (!neighbor.ipAddress().equals(intf.getIpAddress())) {
print(NEIGHBOR_FORMAT, neighbor.ipAddress(),
diff --git a/apps/pim/src/main/java/org/onosproject/pim/impl/PIMApplication.java b/apps/pim/src/main/java/org/onosproject/pim/impl/PimApplication.java
similarity index 93%
rename from apps/pim/src/main/java/org/onosproject/pim/impl/PIMApplication.java
rename to apps/pim/src/main/java/org/onosproject/pim/impl/PimApplication.java
index ee65f5a..5d46f51 100644
--- a/apps/pim/src/main/java/org/onosproject/pim/impl/PIMApplication.java
+++ b/apps/pim/src/main/java/org/onosproject/pim/impl/PimApplication.java
@@ -42,7 +42,7 @@
* The main PIM controller class.
*/
@Component(immediate = true)
-public class PIMApplication {
+public class PimApplication {
private final Logger log = getLogger(getClass());
// Used to get the appId
@@ -61,13 +61,13 @@
protected MulticastRouteService ms;
// Create an instance of the PIM packet handler
- protected PIMPacketHandler pimPacketHandler;
+ protected PimPacketHandler pimPacketHandler;
// Provide interfaces to the pimInterface manager as a result of Netconfig updates.
@Reference(cardinality = ReferenceCardinality.MANDATORY_UNARY)
- protected PIMInterfaceService pimInterfaceManager;
+ protected PimInterfaceService pimInterfaceManager;
- private final PIMPacketProcessor processor = new PIMPacketProcessor();
+ private final PimPacketProcessor processor = new PimPacketProcessor();
/**
* Activate the PIM component.
@@ -89,7 +89,7 @@
appId, Optional.empty());
// Get a copy of the PIM Packet Handler
- pimPacketHandler = new PIMPacketHandler();
+ pimPacketHandler = new PimPacketHandler();
log.info("Started");
}
@@ -108,7 +108,7 @@
* The class that will receive PIM packets, sanitize them, determine the PIMInterface
* they arrived on, then forward them on to be processed by the appropriate entity.
*/
- public class PIMPacketProcessor implements PacketProcessor {
+ public class PimPacketProcessor implements PacketProcessor {
@Override
public void process(PacketContext context) {
@@ -135,7 +135,7 @@
}
// Get the PIM Interface the packet was received on.
- PIMInterface pimi = pimInterfaceManager.getPIMInterface(pkt.receivedFrom());
+ PimInterface pimi = pimInterfaceManager.getPimInterface(pkt.receivedFrom());
if (pimi == null) {
return;
}
diff --git a/apps/pim/src/main/java/org/onosproject/pim/impl/PIMInterface.java b/apps/pim/src/main/java/org/onosproject/pim/impl/PimInterface.java
similarity index 95%
rename from apps/pim/src/main/java/org/onosproject/pim/impl/PIMInterface.java
rename to apps/pim/src/main/java/org/onosproject/pim/impl/PimInterface.java
index 0eed893..1185e68 100644
--- a/apps/pim/src/main/java/org/onosproject/pim/impl/PIMInterface.java
+++ b/apps/pim/src/main/java/org/onosproject/pim/impl/PimInterface.java
@@ -55,7 +55,7 @@
* PIM Interface represents an ONOS Interface with IP and MAC addresses for
* a given ConnectPoint.
*/
-public final class PIMInterface {
+public final class PimInterface {
private final Logger log = getLogger(getClass());
@@ -87,7 +87,7 @@
private IpAddress drIpaddress;
// A map of all our PIM neighbors keyed on our neighbors IP address
- private Map<IpAddress, PIMNeighbor> pimNeighbors = new ConcurrentHashMap<>();
+ private Map<IpAddress, PimNeighbor> pimNeighbors = new ConcurrentHashMap<>();
private Map<McastRoute, RouteData> routes = new ConcurrentHashMap<>();
@@ -101,7 +101,7 @@
* @param overrideInterval override interval
* @param packetService reference to the packet service
*/
- private PIMInterface(Interface intf,
+ private PimInterface(Interface intf,
int helloInterval,
short holdTime,
int priority,
@@ -122,7 +122,7 @@
generationId = new Random().nextInt();
// Create a PIM Neighbor to represent ourselves for DR election.
- PIMNeighbor us = new PIMNeighbor(ourIp, mac, holdTime, 0, priority, generationId);
+ PimNeighbor us = new PimNeighbor(ourIp, mac, holdTime, 0, priority, generationId);
pimNeighbors.put(ourIp, us);
drIpaddress = ourIp;
@@ -150,7 +150,7 @@
* @param intf ONOS Interface
* @return PIM interface instance
*/
- public PIMInterface setInterface(Interface intf) {
+ public PimInterface setInterface(Interface intf) {
onosInterface = intf;
return this;
}
@@ -223,7 +223,7 @@
*
* @return PIM neighbors
*/
- public Collection<PIMNeighbor> getNeighbors() {
+ public Collection<PimNeighbor> getNeighbors() {
return ImmutableList.copyOf(pimNeighbors.values());
}
@@ -236,13 +236,13 @@
* state if they have.
*/
public void checkNeighborTimeouts() {
- Set<PIMNeighbor> expired = pimNeighbors.values().stream()
+ Set<PimNeighbor> expired = pimNeighbors.values().stream()
// Don't time ourselves out!
.filter(neighbor -> !neighbor.ipAddress().equals(getIpAddress()))
.filter(neighbor -> neighbor.isExpired())
.collect(Collectors.toSet());
- for (PIMNeighbor neighbor : expired) {
+ for (PimNeighbor neighbor : expired) {
log.info("Timing out neighbor {}", neighbor);
pimNeighbors.remove(neighbor.ipAddress(), neighbor);
}
@@ -262,7 +262,7 @@
lastHello = System.currentTimeMillis();
// Create the base PIM Packet and mark it a hello packet
- PIMPacket pimPacket = new PIMPacket(PIM.TYPE_HELLO);
+ PimPacket pimPacket = new PimPacket(PIM.TYPE_HELLO);
// We need to set the source MAC and IPv4 addresses
pimPacket.setSrcMacAddr(onosInterface.mac());
@@ -276,7 +276,7 @@
hello.addOption(PIMHelloOption.createGenID(generationId));
// Now set the hello option payload
- pimPacket.setPIMPayload(hello);
+ pimPacket.setPimPayload(hello);
packetService.emit(new DefaultOutboundPacket(
onosInterface.connectPoint().deviceId(),
@@ -315,7 +315,7 @@
}
// get the DR values for later calculation
- PIMNeighbor dr = pimNeighbors.get(drIpaddress);
+ PimNeighbor dr = pimNeighbors.get(drIpaddress);
checkNotNull(dr);
IpAddress drip = drIpaddress;
@@ -328,8 +328,8 @@
PIMHello hello = (PIMHello) pimhdr.getPayload();
// Determine if we already have a PIMNeighbor
- PIMNeighbor nbr = pimNeighbors.getOrDefault(srcip, null);
- PIMNeighbor newNbr = PIMNeighbor.createPimNeighbor(srcip, nbrmac, hello.getOptions().values());
+ PimNeighbor nbr = pimNeighbors.getOrDefault(srcip, null);
+ PimNeighbor newNbr = PimNeighbor.createPimNeighbor(srcip, nbrmac, hello.getOptions().values());
if (nbr == null) {
pimNeighbors.putIfAbsent(srcip, newNbr);
@@ -364,7 +364,7 @@
}
// Run an election if we need to. Return the elected IP address.
- private IpAddress election(PIMNeighbor nbr, IpAddress drIp, int drPriority) {
+ private IpAddress election(PimNeighbor nbr, IpAddress drIp, int drPriority) {
IpAddress nbrIp = nbr.ipAddress();
if (nbr.priority() > drPriority) {
@@ -494,7 +494,7 @@
public static class Builder {
private Interface intf;
private PacketService packetService;
- private int helloInterval = PIMInterfaceManager.DEFAULT_HELLO_INTERVAL;
+ private int helloInterval = PimInterfaceManager.DEFAULT_HELLO_INTERVAL;
private short holdtime = PIMHelloOption.DEFAULT_HOLDTIME;
private int priority = PIMHelloOption.DEFAULT_PRIORITY;
private short propagationDelay = PIMHelloOption.DEFAULT_PRUNEDELAY;
@@ -582,11 +582,11 @@
*
* @return PIM interface
*/
- public PIMInterface build() {
+ public PimInterface build() {
checkArgument(intf != null, "Must provide an interface");
checkArgument(packetService != null, "Must provide a packet service");
- return new PIMInterface(intf, helloInterval, holdtime, priority,
+ return new PimInterface(intf, helloInterval, holdtime, priority,
propagationDelay, overrideInterval, packetService);
}
diff --git a/apps/pim/src/main/java/org/onosproject/pim/impl/PIMInterfaceManager.java b/apps/pim/src/main/java/org/onosproject/pim/impl/PimInterfaceManager.java
similarity index 92%
rename from apps/pim/src/main/java/org/onosproject/pim/impl/PIMInterfaceManager.java
rename to apps/pim/src/main/java/org/onosproject/pim/impl/PimInterfaceManager.java
index 547a82e..632ef14 100644
--- a/apps/pim/src/main/java/org/onosproject/pim/impl/PIMInterfaceManager.java
+++ b/apps/pim/src/main/java/org/onosproject/pim/impl/PimInterfaceManager.java
@@ -62,7 +62,7 @@
*/
@Component(immediate = true)
@Service
-public class PIMInterfaceManager implements PIMInterfaceService {
+public class PimInterfaceManager implements PimInterfaceService {
private final Logger log = getLogger(getClass());
@@ -104,9 +104,9 @@
protected RoutingService unicastRoutingService;
// Store PIM Interfaces in a map key'd by ConnectPoint
- private final Map<ConnectPoint, PIMInterface> pimInterfaces = Maps.newConcurrentMap();
+ private final Map<ConnectPoint, PimInterface> pimInterfaces = Maps.newConcurrentMap();
- private final Map<McastRoute, PIMInterface> routes = Maps.newConcurrentMap();
+ private final Map<McastRoute, PimInterface> routes = Maps.newConcurrentMap();
private final InternalNetworkConfigListener configListener =
new InternalNetworkConfigListener();
@@ -147,18 +147,18 @@
// Schedule the periodic hello sender.
scheduledExecutorService.scheduleAtFixedRate(
SafeRecurringTask.wrap(
- () -> pimInterfaces.values().forEach(PIMInterface::sendHello)),
+ () -> pimInterfaces.values().forEach(PimInterface::sendHello)),
initialHelloDelay, pimHelloPeriod, TimeUnit.MILLISECONDS);
// Schedule task to periodically time out expired neighbors
scheduledExecutorService.scheduleAtFixedRate(
SafeRecurringTask.wrap(
- () -> pimInterfaces.values().forEach(PIMInterface::checkNeighborTimeouts)),
+ () -> pimInterfaces.values().forEach(PimInterface::checkNeighborTimeouts)),
0, timeoutTaskPeriod, TimeUnit.MILLISECONDS);
scheduledExecutorService.scheduleAtFixedRate(
SafeRecurringTask.wrap(
- () -> pimInterfaces.values().forEach(PIMInterface::sendJoins)),
+ () -> pimInterfaces.values().forEach(PimInterface::sendJoins)),
0, joinTaskPeriod, TimeUnit.MILLISECONDS);
log.info("Started");
@@ -178,8 +178,8 @@
}
@Override
- public PIMInterface getPIMInterface(ConnectPoint cp) {
- PIMInterface pi = pimInterfaces.get(cp);
+ public PimInterface getPimInterface(ConnectPoint cp) {
+ PimInterface pi = pimInterfaces.get(cp);
if (pi == null && log.isTraceEnabled()) {
log.trace("We have been asked for an Interface we don't have: {}", cp);
}
@@ -187,7 +187,7 @@
}
@Override
- public Set<PIMInterface> getPimInterfaces() {
+ public Set<PimInterface> getPimInterfaces() {
return ImmutableSet.copyOf(pimInterfaces.values());
}
@@ -216,8 +216,8 @@
pimInterfaces.remove(cp);
}
- private PIMInterface buildPimInterface(PimInterfaceConfig config, Interface intf) {
- PIMInterface.Builder builder = PIMInterface.builder()
+ private PimInterface buildPimInterface(PimInterfaceConfig config, Interface intf) {
+ PimInterface.Builder builder = PimInterface.builder()
.withPacketService(packetService)
.withInterface(intf);
@@ -231,7 +231,7 @@
}
private void addRoute(McastRoute route) {
- PIMInterface pimInterface = getSourceInterface(route);
+ PimInterface pimInterface = getSourceInterface(route);
if (pimInterface == null) {
return;
@@ -241,7 +241,7 @@
}
private void removeRoute(McastRoute route) {
- PIMInterface pimInterface = routes.remove(route);
+ PimInterface pimInterface = routes.remove(route);
if (pimInterface == null) {
return;
@@ -250,7 +250,7 @@
pimInterface.removeRoute(route);
}
- private PIMInterface getSourceInterface(McastRoute route) {
+ private PimInterface getSourceInterface(McastRoute route) {
RouteEntry routeEntry = unicastRoutingService.getLongestMatchableRouteEntry(route.source());
if (routeEntry == null) {
@@ -265,7 +265,7 @@
return null;
}
- PIMInterface pimInterface = pimInterfaces.get(intf.connectPoint());
+ PimInterface pimInterface = pimInterfaces.get(intf.connectPoint());
if (pimInterface == null) {
log.warn("PIM is not enabled on interface {}", intf);
diff --git a/apps/pim/src/main/java/org/onosproject/pim/impl/PIMInterfaceService.java b/apps/pim/src/main/java/org/onosproject/pim/impl/PimInterfaceService.java
similarity index 90%
rename from apps/pim/src/main/java/org/onosproject/pim/impl/PIMInterfaceService.java
rename to apps/pim/src/main/java/org/onosproject/pim/impl/PimInterfaceService.java
index b0ceba5..16082df 100644
--- a/apps/pim/src/main/java/org/onosproject/pim/impl/PIMInterfaceService.java
+++ b/apps/pim/src/main/java/org/onosproject/pim/impl/PimInterfaceService.java
@@ -26,7 +26,7 @@
*
* TODO: Do we need a PIMInterfaceListenerService? Who sould listen to Interfaces changes?
*/
-public interface PIMInterfaceService {
+public interface PimInterfaceService {
/**
* Returns the PIM interface associated with the given connect point.
@@ -34,12 +34,12 @@
* @param cp the connect point we want to get the PIM interface for
* @return the PIM interface if it exists, otherwise null
*/
- PIMInterface getPIMInterface(ConnectPoint cp);
+ PimInterface getPimInterface(ConnectPoint cp);
/**
* Retrieves the set of all interfaces running PIM.
*
* @return set of PIM interfaces
*/
- Set<PIMInterface> getPimInterfaces();
+ Set<PimInterface> getPimInterfaces();
}
diff --git a/apps/pim/src/main/java/org/onosproject/pim/impl/PIMNeighbor.java b/apps/pim/src/main/java/org/onosproject/pim/impl/PimNeighbor.java
similarity index 95%
rename from apps/pim/src/main/java/org/onosproject/pim/impl/PIMNeighbor.java
rename to apps/pim/src/main/java/org/onosproject/pim/impl/PimNeighbor.java
index 9e6fa38..3db6c69 100644
--- a/apps/pim/src/main/java/org/onosproject/pim/impl/PIMNeighbor.java
+++ b/apps/pim/src/main/java/org/onosproject/pim/impl/PimNeighbor.java
@@ -30,7 +30,7 @@
/**
* Represents a PIM neighbor.
*/
-public class PIMNeighbor {
+public class PimNeighbor {
// IP Address of this neighbor
private final IpAddress ipAddr;
@@ -66,7 +66,7 @@
* @param priority priority
* @param genId generation ID
*/
- public PIMNeighbor(IpAddress ipAddress, MacAddress macAddress,
+ public PimNeighbor(IpAddress ipAddress, MacAddress macAddress,
short holdTime, int pruneDelay, int priority, int genId) {
this.ipAddr = checkNotNull(ipAddress);
this.macAddr = checkNotNull(macAddress);
@@ -176,7 +176,7 @@
* @param opts options from the PIM HELLO packet
* @return new PIM neighbor
*/
- public static PIMNeighbor createPimNeighbor(IpAddress ipAddress,
+ public static PimNeighbor createPimNeighbor(IpAddress ipAddress,
MacAddress macAddress,
Collection<PIMHelloOption> opts) {
@@ -202,16 +202,16 @@
}
}
- return new PIMNeighbor(ipAddress, macAddress, holdTime, pruneDelay, priority, generationID);
+ return new PimNeighbor(ipAddress, macAddress, holdTime, pruneDelay, priority, generationID);
}
@Override
public boolean equals(Object other) {
- if (!(other instanceof PIMNeighbor)) {
+ if (!(other instanceof PimNeighbor)) {
return false;
}
- PIMNeighbor that = (PIMNeighbor) other;
+ PimNeighbor that = (PimNeighbor) other;
return this.ipAddr.equals(that.ipAddress()) &&
this.macAddr.equals(that.macAddress()) &&
diff --git a/apps/pim/src/main/java/org/onosproject/pim/impl/PIMPacket.java b/apps/pim/src/main/java/org/onosproject/pim/impl/PimPacket.java
similarity index 97%
rename from apps/pim/src/main/java/org/onosproject/pim/impl/PIMPacket.java
rename to apps/pim/src/main/java/org/onosproject/pim/impl/PimPacket.java
index 7949a15..185b2d8 100644
--- a/apps/pim/src/main/java/org/onosproject/pim/impl/PIMPacket.java
+++ b/apps/pim/src/main/java/org/onosproject/pim/impl/PimPacket.java
@@ -22,7 +22,7 @@
import org.onlab.packet.MacAddress;
import org.onlab.packet.PIM;
-public class PIMPacket {
+public class PimPacket {
// Ethernet header
private Ethernet ethHeader = new Ethernet();
@@ -51,7 +51,7 @@
*
* @param type PIM.TYPE_XXXX where XXX is the PIM message type
*/
- public PIMPacket(byte type) {
+ public PimPacket(byte type) {
pimType = type;
initDefaults();
}
@@ -105,7 +105,7 @@
*
* @param payload the PIM payload
*/
- public void setPIMPayload(IPacket payload) {
+ public void setPimPayload(IPacket payload) {
pimHeader.setPayload(payload);
payload.setParent(pimHeader);
}
diff --git a/apps/pim/src/main/java/org/onosproject/pim/impl/PIMPacketHandler.java b/apps/pim/src/main/java/org/onosproject/pim/impl/PimPacketHandler.java
similarity index 95%
rename from apps/pim/src/main/java/org/onosproject/pim/impl/PIMPacketHandler.java
rename to apps/pim/src/main/java/org/onosproject/pim/impl/PimPacketHandler.java
index fa7e0ea..f4f1bd5 100644
--- a/apps/pim/src/main/java/org/onosproject/pim/impl/PIMPacketHandler.java
+++ b/apps/pim/src/main/java/org/onosproject/pim/impl/PimPacketHandler.java
@@ -27,14 +27,14 @@
/**
* This class will process PIM packets.
*/
-public class PIMPacketHandler {
+public class PimPacketHandler {
private final Logger log = getLogger(getClass());
/**
* Constructor for this class.
*/
- public PIMPacketHandler() {
+ public PimPacketHandler() {
}
/**
@@ -44,7 +44,7 @@
* @param ethPkt the packet starting with the Ethernet header.
* @param pimi the PIM Interface the packet arrived on.
*/
- public void processPacket(Ethernet ethPkt, PIMInterface pimi) {
+ public void processPacket(Ethernet ethPkt, PimInterface pimi) {
checkNotNull(ethPkt);
checkNotNull(pimi);
diff --git a/pom.xml b/pom.xml
index d0ca544..4d82115 100644
--- a/pom.xml
+++ b/pom.xml
@@ -54,6 +54,7 @@
<module>tools/package/archetypes</module>
<module>tools/package/branding</module>
+ <module>tools/build/conf</module>
</modules>
<url>http://onosproject.org/</url>
@@ -74,7 +75,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <onos-build-conf.version>1.2</onos-build-conf.version>
+ <onos-build-conf.version>1.3-SNAPSHOT</onos-build-conf.version>
<netty4.version>4.0.33.Final</netty4.version>
<!-- TODO: replace with final release version when it is out -->
<atomix.version>1.0.0-rc3</atomix.version>
diff --git a/tools/build/conf/src/main/resources/onos/suppressions.xml b/tools/build/conf/src/main/resources/onos/suppressions.xml
index 0c3e720..ec5d82d 100644
--- a/tools/build/conf/src/main/resources/onos/suppressions.xml
+++ b/tools/build/conf/src/main/resources/onos/suppressions.xml
@@ -31,8 +31,6 @@
<suppress files="org.onlab.packet.*" checks="AbbreviationAsWordInName" />
<suppress files="org.onlab.jdvue.*" checks="AbbreviationAsWordInName" />
<suppress files="org.onosproject.driver.pipeline.*" checks="AbbreviationAsWordInName" />
- <suppress files="org.onosproject.igmp.*" checks="AbbreviationAsWordInName" />
- <suppress files="org.onosproject.pim.*" checks="AbbreviationAsWordInName" />
<suppress files="org.onosproject.segmentrouting.*" checks="AbbreviationAsWordInName" />
<!-- Suppressions for unit testing code -->