Addressed some checkstyle, PMD and findbugs violations in the ARP module
Change-Id: I194533ba5f96a7631ea662a93cbcbd8a2c84dea9
diff --git a/src/main/java/net/onrc/onos/ofcontroller/proxyarp/SinglePacketOutNotification.java b/src/main/java/net/onrc/onos/ofcontroller/proxyarp/SinglePacketOutNotification.java
index d654f67..ab9a9b5 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/proxyarp/SinglePacketOutNotification.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/proxyarp/SinglePacketOutNotification.java
@@ -5,34 +5,53 @@
// TODO This class is too generic to be handled by ProxyArpService.
/**
* Notification to another ONOS instance to send a packet out a single port.
- *
*/
public class SinglePacketOutNotification extends PacketOutNotification {
- private static final long serialVersionUID = 1L;
-
- private final InetAddress address;
- private final long outSwitch;
- private final short outPort;
-
- public SinglePacketOutNotification(byte[] packet, InetAddress address,
- long outSwitch, short outPort) {
- super(packet);
-
- this.address = address;
- this.outSwitch = outSwitch;
- this.outPort = outPort;
- }
+ private static final long serialVersionUID = 1L;
- public long getOutSwitch() {
- return outSwitch;
- }
+ private final InetAddress address;
+ private final long outSwitch;
+ private final short outPort;
- public short getOutPort() {
- return outPort;
- }
+ /**
+ * Class constructor.
+ * @param packet the packet data to send in the packet-out
+ * @param address target IP address if the packet is an ARP packet
+ * @param outSwitch the dpid of the switch to send the packet on
+ * @param outPort the port number of the port to send the packet out
+ */
+ public SinglePacketOutNotification(byte[] packet, InetAddress address,
+ long outSwitch, short outPort) {
+ super(packet);
- public InetAddress getTargetAddress() {
- return address;
- }
+ this.address = address;
+ this.outSwitch = outSwitch;
+ this.outPort = outPort;
+ }
+
+ /**
+ * Get the dpid of the switch the packet will be sent out.
+ * @return the switch's dpid
+ */
+ public long getOutSwitch() {
+ return outSwitch;
+ }
+
+ /**
+ * Get the port number of the port the packet will be sent out.
+ * @return the port number
+ */
+ public short getOutPort() {
+ return outPort;
+ }
+
+ /**
+ * Get the target IP address if the packet is an ARP packet.
+ * @return the target IP address for ARP packets, or null if the packet is
+ * not an ARP packet
+ */
+ public InetAddress getTargetAddress() {
+ return address;
+ }
}