Removed obsolete methods SwitchPort.dpid() and SwitchPort.port()

Instead, always use the equivalent SwitchPort.getDpid() and
SwitchPort.getPortNumber()

No functional changes.

Change-Id: Ia654bb4b1e2c2f7582307f5b0d2c83dd60405525
diff --git a/src/main/java/net/onrc/onos/api/flowmanager/FlowLink.java b/src/main/java/net/onrc/onos/api/flowmanager/FlowLink.java
index 59bcb98..42b7788 100644
--- a/src/main/java/net/onrc/onos/api/flowmanager/FlowLink.java
+++ b/src/main/java/net/onrc/onos/api/flowmanager/FlowLink.java
@@ -56,7 +56,7 @@
      * @return The source switch DPID.
      */
     public Dpid getSrcDpid() {
-        return srcSwitchPort.dpid();
+        return srcSwitchPort.getDpid();
     }
 
     /**
@@ -65,7 +65,7 @@
      * @return The source port number at the source switch.
      */
     public PortNumber getSrcPortNumber() {
-        return srcSwitchPort.port();
+        return srcSwitchPort.getPortNumber();
     }
 
     /**
@@ -83,7 +83,7 @@
      * @return The destination switch DPID.
      */
     public Dpid getDstDpid() {
-        return dstSwitchPort.dpid();
+        return dstSwitchPort.getDpid();
     }
 
     /**
@@ -92,7 +92,7 @@
      * @return The destination port number at the destination switch.
      */
     public PortNumber getDstPortNumber() {
-        return dstSwitchPort.port();
+        return dstSwitchPort.getPortNumber();
     }
 
     @Override
diff --git a/src/main/java/net/onrc/onos/api/flowmanager/Tree.java b/src/main/java/net/onrc/onos/api/flowmanager/Tree.java
index 1e161a2..a6d0e89 100644
--- a/src/main/java/net/onrc/onos/api/flowmanager/Tree.java
+++ b/src/main/java/net/onrc/onos/api/flowmanager/Tree.java
@@ -64,10 +64,10 @@
 
     private void addPort(SwitchPort port) {
         checkNotNull(port);
-        if (!ports.containsKey(port.dpid())) {
-            ports.put(port.dpid(), new HashSet<PortNumber>());
+        if (!ports.containsKey(port.getDpid())) {
+            ports.put(port.getDpid(), new HashSet<PortNumber>());
         }
-        ports.get(port.dpid()).add(port.port());
+        ports.get(port.getDpid()).add(port.getPortNumber());
     }
 
     /**
diff --git a/src/main/java/net/onrc/onos/apps/sdnip/SdnIp.java b/src/main/java/net/onrc/onos/apps/sdnip/SdnIp.java
index 7118f71..e39f404 100644
--- a/src/main/java/net/onrc/onos/apps/sdnip/SdnIp.java
+++ b/src/main/java/net/onrc/onos/apps/sdnip/SdnIp.java
@@ -859,20 +859,20 @@
             String bwdIntentId = caller + ":"
                     + controllerRegistryService.getNextUniqueId();
             SwitchPort srcPort =
-                    new SwitchPort(bgpdAttachmentPoint.dpid(),
-                            bgpdAttachmentPoint.port());
+                    new SwitchPort(bgpdAttachmentPoint.getDpid(),
+                            bgpdAttachmentPoint.getPortNumber());
             SwitchPort dstPort =
                     new SwitchPort(new Dpid(peerInterface.getDpid()),
-                            new PortNumber(peerInterface.getSwitchPort().port()));
+                            new PortNumber(peerInterface.getSwitchPort().getPortNumber()));
             ShortestPathIntent fwdIntent = new ShortestPathIntent(fwdIntentId,
-                    srcPort.dpid().value(), srcPort.port().value(),
+                    srcPort.getDpid().value(), srcPort.getPortNumber().value(),
                     ShortestPathIntent.EMPTYMACADDRESS, srcIP,
-                    dstPort.dpid().value(), dstPort.port().value(),
+                    dstPort.getDpid().value(), dstPort.getPortNumber().value(),
                     ShortestPathIntent.EMPTYMACADDRESS, dstIP);
             ShortestPathIntent bwdIntent = new ShortestPathIntent(bwdIntentId,
-                    dstPort.dpid().value(), dstPort.port().value(),
+                    dstPort.getDpid().value(), dstPort.getPortNumber().value(),
                     ShortestPathIntent.EMPTYMACADDRESS, dstIP,
-                    srcPort.dpid().value(), srcPort.port().value(),
+                    srcPort.getDpid().value(), srcPort.getPortNumber().value(),
                     ShortestPathIntent.EMPTYMACADDRESS, srcIP);
             IntentOperation.Operator operator = IntentOperation.Operator.ADD;
             operations.add(operator, fwdIntent);
diff --git a/src/main/java/net/onrc/onos/core/linkdiscovery/LinkDiscoveryManager.java b/src/main/java/net/onrc/onos/core/linkdiscovery/LinkDiscoveryManager.java
index fbd06b7..8ffe4ee 100644
--- a/src/main/java/net/onrc/onos/core/linkdiscovery/LinkDiscoveryManager.java
+++ b/src/main/java/net/onrc/onos/core/linkdiscovery/LinkDiscoveryManager.java
@@ -445,10 +445,10 @@
         }
 
         SwitchPort switchPort = OnosLldp.extractSwitchPort(packetData);
-        long remoteDpid = switchPort.dpid().value();
-        short remotePort = switchPort.port().shortValue();
+        long remoteDpid = switchPort.getDpid().value();
+        short remotePort = switchPort.getPortNumber().shortValue();
         IOFSwitch remoteSwitch = floodlightProvider.getSwitches().get(
-                switchPort.dpid().value());
+                switchPort.getDpid().value());
 
         OFPortDesc physicalPort = null;
         if (remoteSwitch != null) {
diff --git a/src/main/java/net/onrc/onos/core/packetservice/PacketModule.java b/src/main/java/net/onrc/onos/core/packetservice/PacketModule.java
index ca4c4b1..35aca3a 100644
--- a/src/main/java/net/onrc/onos/core/packetservice/PacketModule.java
+++ b/src/main/java/net/onrc/onos/core/packetservice/PacketModule.java
@@ -104,7 +104,7 @@
     public void sendPacket(Ethernet eth, SwitchPort switchPort) {
         SinglePacketOutNotification notification =
                 new SinglePacketOutNotification(eth.serialize(), 0,
-                        switchPort.dpid().value(), switchPort.port().shortValue());
+                        switchPort.getDpid().value(), switchPort.getPortNumber().shortValue());
 
         // TODO We shouldn't care what the destination MAC is
         long dstMac = eth.getDestinationMAC().toLong();
@@ -127,7 +127,7 @@
     public void broadcastPacketOutEdge(Ethernet eth, SwitchPort inSwitchPort) {
         BroadcastPacketOutNotification notification =
                 new BroadcastPacketOutNotification(eth.serialize(), 0,
-                        inSwitchPort.dpid().value(), inSwitchPort.port().shortValue());
+                        inSwitchPort.getDpid().value(), inSwitchPort.getPortNumber().shortValue());
 
         long dstMac = eth.getDestinationMAC().toLong();
         packetOutEventChannel.addTransientEntry(dstMac, notification);
diff --git a/src/main/java/net/onrc/onos/core/topology/TopologyImpl.java b/src/main/java/net/onrc/onos/core/topology/TopologyImpl.java
index a0248b7..31b143d 100644
--- a/src/main/java/net/onrc/onos/core/topology/TopologyImpl.java
+++ b/src/main/java/net/onrc/onos/core/topology/TopologyImpl.java
@@ -142,7 +142,7 @@
 
     @Override
     public Port getPort(SwitchPort port) {
-        return getPort(port.dpid(), port.port());
+        return getPort(port.getDpid(), port.getPortNumber());
     }
 
     @Override
diff --git a/src/main/java/net/onrc/onos/core/util/SwitchPort.java b/src/main/java/net/onrc/onos/core/util/SwitchPort.java
index cbe4bcb..e296b7b 100644
--- a/src/main/java/net/onrc/onos/core/util/SwitchPort.java
+++ b/src/main/java/net/onrc/onos/core/util/SwitchPort.java
@@ -11,8 +11,8 @@
  */
 @JsonSerialize(using = SwitchPortSerializer.class)
 public final class SwitchPort {
-    private final Dpid dpid;        // The DPID of the switch
-    private final PortNumber port;        // The port of the switch
+    private final Dpid dpid;            // The DPID of the switch
+    private final PortNumber port;      // The port number on the switch
 
     /**
      * Default constructor for Serializer to use.
@@ -62,29 +62,11 @@
      *
      * @return the DPID value of the Switch-Port.
      */
-    public Dpid dpid() {
-        return dpid;
-    }
-
-    /**
-     * Get the DPID value of the Switch-Port.
-     *
-     * @return the DPID value of the Switch-Port.
-     */
     public Dpid getDpid() {
         return dpid;
     }
 
     /**
-     * Get the port value of the Switch-Port.
-     *
-     * @return the port value of the Switch-Port.
-     */
-    public PortNumber port() {
-        return port;
-    }
-
-    /**
      * Get the port number of the Switch-Port.
      *
      * @return the port number of the Switch-Port.