Device Object initiated
diff --git a/src/main/java/net/floodlightcontroller/core/INetMapTopologyObjects.java b/src/main/java/net/floodlightcontroller/core/INetMapTopologyObjects.java
index eb363a7..d0cf90f 100644
--- a/src/main/java/net/floodlightcontroller/core/INetMapTopologyObjects.java
+++ b/src/main/java/net/floodlightcontroller/core/INetMapTopologyObjects.java
@@ -1,5 +1,9 @@
package net.floodlightcontroller.core;
+import java.util.List;
+
+import net.floodlightcontroller.devicemanager.SwitchPort;
+
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonProperty;
@@ -87,27 +91,32 @@
@Property("dl_addr")
public String getMACAddress();
@Property("dl_addr")
- public void setMACAddress();
+ public void setMACAddress(String macaddr);
@JsonProperty("ipv4")
@Property("nw_addr")
public String getIPAddress();
@Property("dl_addr")
- public void setIPAddress();
+ public void setIPAddress(String ipaddr);
@JsonIgnore
@Incidence(label="host",direction = Direction.IN)
- public IPortObject getPort();
+ public Iterable<IPortObject> getAttachedPorts();
+
+ @JsonIgnore
+ @Incidence(label="host",direction=Direction.IN)
+ public void setHostPort(final IPortObject port);
+
+ @JsonIgnore
+ @Incidence(label="host",direction=Direction.IN)
+ public void removeHostPort(final IPortObject port);
@JsonIgnore
@GremlinGroovy("_().in('host').in('on')")
- public ISwitchObject getSwitch();
-
- public interface AttachmentPoint {
- @GremlinGroovy("_().in('host').in('on').dpid")
- public String getDPID();
- @GremlinGroovy("_().in('host').number")
- public Short getPortNumber();
- }
+ public Iterable<ISwitchObject> getSwitch();
+
+ @JsonProperty("AttachmentPoint")
+ @GremlinGroovy("_().in('host').in('on').path(){it.number}{it.dpid}")
+ public List<SwitchPort> getAttachmentPoints();
}
}
diff --git a/src/main/java/net/floodlightcontroller/core/INetMapTopologyService.java b/src/main/java/net/floodlightcontroller/core/INetMapTopologyService.java
index e5df25e..937c551 100644
--- a/src/main/java/net/floodlightcontroller/core/INetMapTopologyService.java
+++ b/src/main/java/net/floodlightcontroller/core/INetMapTopologyService.java
@@ -2,6 +2,8 @@
import java.util.List;
+import net.floodlightcontroller.core.INetMapTopologyObjects.IDeviceObject;
+import net.floodlightcontroller.core.INetMapTopologyObjects.IPortObject;
import net.floodlightcontroller.core.INetMapTopologyObjects.ISwitchObject;
import net.floodlightcontroller.routing.Link;
import net.floodlightcontroller.topology.NodePortTuple;
@@ -9,29 +11,32 @@
public interface INetMapTopologyService extends INetMapService {
public interface ITopoSwitchService {
- Iterable<ISwitchObject> GetActiveSwitches();
- Iterable<ISwitchObject> GetAllSwitches();
- Iterable<ISwitchObject> GetInactiveSwitches();
- List<String> GetPortsOnSwitch(String dpid);
+ Iterable<ISwitchObject> getActiveSwitches();
+ Iterable<ISwitchObject> getAllSwitches();
+ Iterable<ISwitchObject> getInactiveSwitches();
+ Iterable<IPortObject> getPortsOnSwitch(String dpid);
+ IPortObject getPortOnSwitch(String dpid, short port_num);
+
}
public interface ITopoLinkService {
- List<Link> GetActiveLinks();
- List<Link> GetLinksOnSwitch(String dpid);
+ List<Link> getActiveLinks();
+ List<Link> getLinksOnSwitch(String dpid);
}
public interface ITopoDeviceService {
- List<Link> GetActiveDevices();
- List<Link> GetDevicesOnSwitch(String dpid);
+ Iterable<IDeviceObject> getActiveDevices();
+ Iterable<IDeviceObject> getDevicesOnSwitch(String dpid);
+ Iterable<IDeviceObject> getDevicesOnSwitch(String dpid, short port_num);
}
public interface ITopoRouteService {
- List<NodePortTuple> GetShortestPath(NodePortTuple src, NodePortTuple dest);
- Boolean RouteExists(NodePortTuple src, NodePortTuple dest);
+ List<NodePortTuple> getShortestPath(NodePortTuple src, NodePortTuple dest);
+ Boolean routeExists(NodePortTuple src, NodePortTuple dest);
}
public interface ITopoFlowService {
- Boolean FlowExists(NodePortTuple src, NodePortTuple dest);
- List<NodePortTuple> GetShortestFlowPath(NodePortTuple src, NodePortTuple dest);
+ Boolean flowExists(NodePortTuple src, NodePortTuple dest);
+ List<NodePortTuple> getShortestFlowPath(NodePortTuple src, NodePortTuple dest);
}
}
diff --git a/src/main/java/net/floodlightcontroller/core/internal/TopoSwitchServiceImpl.java b/src/main/java/net/floodlightcontroller/core/internal/TopoSwitchServiceImpl.java
index 1136a90..deae4bf 100644
--- a/src/main/java/net/floodlightcontroller/core/internal/TopoSwitchServiceImpl.java
+++ b/src/main/java/net/floodlightcontroller/core/internal/TopoSwitchServiceImpl.java
@@ -2,6 +2,7 @@
import java.util.List;
+import net.floodlightcontroller.core.INetMapTopologyObjects.IPortObject;
import net.floodlightcontroller.core.INetMapTopologyObjects.ISwitchObject;
import net.floodlightcontroller.core.INetMapTopologyService.ITopoSwitchService;
@@ -20,25 +21,31 @@
SwitchStorageImpl swStore = store.get();
@Override
- public Iterable<ISwitchObject> GetActiveSwitches() {
+ public Iterable<ISwitchObject> getActiveSwitches() {
// TODO Auto-generated method stub
return swStore.getActiveSwitches();
}
@Override
- public Iterable<ISwitchObject> GetAllSwitches() {
+ public Iterable<ISwitchObject> getAllSwitches() {
// TODO Auto-generated method stub
return swStore.getAllSwitches();
}
@Override
- public Iterable<ISwitchObject> GetInactiveSwitches() {
+ public Iterable<ISwitchObject> getInactiveSwitches() {
// TODO Auto-generated method stub
return swStore.getInactiveSwitches();
}
@Override
- public List<String> GetPortsOnSwitch(String dpid) {
+ public Iterable<IPortObject> getPortsOnSwitch(String dpid) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public IPortObject getPortOnSwitch(String dpid, short port_num) {
// TODO Auto-generated method stub
return null;
}