Removed INetMapStorage.java and INetMapTopologyObjects.java and the
corresponding references.
Removed references to class NetworkGraphPublisher as well.
Change-Id: I3d2bf480a34c1f4769110720054562a90a6a46eb
diff --git a/conf/onos.properties b/conf/onos.properties
index d1912c5..8e2c4cb 100644
--- a/conf/onos.properties
+++ b/conf/onos.properties
@@ -12,5 +12,3 @@
net.floodlightcontroller.forwarding.Forwarding.idletimeout = 5
net.floodlightcontroller.forwarding.Forwarding.hardtimeout = 0
net.onrc.onos.datagrid.HazelcastDatagrid.datagridConfig = conf/hazelcast.xml
-#net.onrc.onos.ofcontroller.floodlightlistener.NetworkGraphPublisher.dbconf = /tmp/ramcloud.conf
-#net.onrc.onos.ofcontroller.floodlightlistener.NetworkGraphPublisher.graph_db_store = ramcloud
diff --git a/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java b/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java
index a6aacf1..49be7d9 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/bgproute/BgpRoute.java
@@ -33,8 +33,6 @@
import net.floodlightcontroller.topology.ITopologyService;
import net.floodlightcontroller.util.MACAddress;
import net.onrc.onos.ofcontroller.bgproute.RibUpdate.Operation;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IDeviceObject;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
import net.onrc.onos.ofcontroller.core.config.IConfigInfoService;
import net.onrc.onos.ofcontroller.linkdiscovery.ILinkDiscovery;
import net.onrc.onos.ofcontroller.linkdiscovery.ILinkDiscovery.LDUpdate;
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/INetMapStorage.java b/src/main/java/net/onrc/onos/ofcontroller/core/INetMapStorage.java
deleted file mode 100644
index 2cf0e18..0000000
--- a/src/main/java/net/onrc/onos/ofcontroller/core/INetMapStorage.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- *
- */
-package net.onrc.onos.ofcontroller.core;
-
-/**
- * @author pankaj
- *
- */
-public interface INetMapStorage {
- enum DM_OPERATION {
- CREATE, // Create the object type if does not exist and insert the object
- INSERT, // Insert the object if it does not exist
- DELETE, // Delete the object
- UPDATE // Update the object if exists or CREATE/INSERT if does not exist
- }
- public void init(final String dbStore, final String conf);
- public void close();
-}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjects.java b/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjects.java
deleted file mode 100644
index 26c9a98..0000000
--- a/src/main/java/net/onrc/onos/ofcontroller/core/INetMapTopologyObjects.java
+++ /dev/null
@@ -1,591 +0,0 @@
-package net.onrc.onos.ofcontroller.core;
-
-import org.codehaus.jackson.annotate.JsonIgnore;
-import org.codehaus.jackson.annotate.JsonProperty;
-import org.codehaus.jackson.map.annotate.JsonSerialize;
-
-import com.tinkerpop.blueprints.Direction;
-import com.tinkerpop.frames.Adjacency;
-import com.tinkerpop.frames.Property;
-import com.tinkerpop.frames.annotations.gremlin.GremlinGroovy;
-import com.tinkerpop.frames.annotations.gremlin.GremlinParam;
-import com.tinkerpop.frames.VertexFrame;
-
-import net.floodlightcontroller.core.web.serializers.IPv4Serializer;
-
-/*
- * This is the interfaces to make the objects for Cassandra DB.
- * They are interfaces, but it is also implementation,
- * so this handles various control to the objects.
- * Please take a look at tinkerpop/frames annotation doc to understand more.
- */
-public interface INetMapTopologyObjects {
-
- public interface IBaseObject extends VertexFrame {
-
- @JsonProperty("state")
- @Property("state")
- public String getState();
-
- @Property("state")
- public void setState(final String state);
-
- @JsonIgnore
- @Property("type")
- public String getType();
- @Property("type")
- public void setType(final String type);
-
- }
-
- public interface ISwitchObject extends IBaseObject{
-
- @JsonProperty("dpid")
- @Property("dpid")
- public String getDPID();
-
- @Property("dpid")
- public void setDPID(String dpid);
-
- @JsonProperty("ports")
- @Adjacency(label="on")
- public Iterable<IPortObject> getPorts();
-
- // Requires Frames 2.3.0
- @JsonIgnore
- @GremlinGroovy("it.out('on').has('number',port_num)")
- public IPortObject getPort(@GremlinParam("port_num") final short port_num);
-
- @Adjacency(label="on")
- public void addPort(final IPortObject port);
-
- @Adjacency(label="on")
- public void removePort(final IPortObject port);
-
- @JsonIgnore
- @GremlinGroovy("it.out('on').out('host')")
- public Iterable<IDeviceObject> getDevices();
-
- @JsonIgnore
- @Adjacency(label="switch",direction = Direction.IN)
- public Iterable<IFlowEntry> getFlowEntries();
-
- }
-
- public interface IPortObject extends IBaseObject{
-
- @JsonProperty("number")
- @Property("number")
- public Short getNumber();
-
- @JsonIgnore
- @Property("port_id")
- public void setPortId(String id);
-
- @JsonIgnore
- @Property("port_id")
- public String getPortId();
-
- @Property("number")
- public void setNumber(Short n);
-
- @JsonProperty("desc")
- @Property("desc")
- public String getDesc();
-
- @Property("desc")
- public void setDesc(String s);
-
- @JsonIgnore
- @Property("port_state")
- public Integer getPortState();
-
- @Property("port_state")
- public void setPortState(Integer s);
-
- @JsonIgnore
- @Adjacency(label="on",direction = Direction.IN)
- public ISwitchObject getSwitch();
-
- @JsonProperty("devices")
- @Adjacency(label="host")
- public Iterable<IDeviceObject> getDevices();
-
- @Adjacency(label="host")
- public void setDevice(final IDeviceObject device);
-
- @Adjacency(label="host")
- public void removeDevice(final IDeviceObject device);
-
-
- @JsonIgnore
- @Adjacency(label="inport",direction = Direction.IN)
- public Iterable<IFlowEntry> getInFlowEntries();
-
- @JsonIgnore
- @Adjacency(label="outport",direction = Direction.IN)
- public Iterable<IFlowEntry> getOutFlowEntries();
-
-
- @JsonIgnore
- @Adjacency(label="link")
- public Iterable<IPortObject> getLinkedPorts();
-
- @JsonIgnore
- @Adjacency(label="link",direction = Direction.IN)
- public Iterable<IPortObject> getReverseLinkedPorts();
-
- @Adjacency(label="link")
- public void removeLink(final IPortObject dest_port);
-
- @Adjacency(label="link")
- public void setLinkPort(final IPortObject dest_port);
-
- // @JsonIgnore
- // @Adjacency(label="link")
- // public Iterable<ILinkObject> getLinks();
- }
-
- public interface IDeviceObject extends IBaseObject {
-
- @JsonProperty("mac")
- @Property("dl_addr")
- public String getMACAddress();
-
- @Property("dl_addr")
- public void setMACAddress(String macaddr);
-
- @JsonIgnore
- @Adjacency(label="host",direction = Direction.IN)
- public Iterable<IPortObject> getAttachedPorts();
-
- @JsonIgnore
- @Adjacency(label="host",direction=Direction.IN)
- public void setHostPort(final IPortObject port);
-
- @JsonIgnore
- @Adjacency(label="host",direction=Direction.IN)
- public void removeHostPort(final IPortObject port);
-
- @JsonIgnore
- @GremlinGroovy("it.in('host').in('on')")
- public Iterable<ISwitchObject> getSwitch();
-
- //
- // IPv4 Addresses
- //
- @JsonProperty("ipv4addresses")
- @Adjacency(label="hasAddress")
- public Iterable<IIpv4Address> getIpv4Addresses();
-
- @JsonIgnore
- @GremlinGroovy("it.out('hasAddress').has('ipv4_address', ipv4Address)")
- public IIpv4Address getIpv4Address(@GremlinParam("ipv4Address") final int ipv4Address);
-
- @Adjacency(label="hasAddress")
- public void addIpv4Address(final IIpv4Address ipv4Address);
-
- @Adjacency(label="hasAddress")
- public void removeIpv4Address(final IIpv4Address ipv4Address);
-
-/* @JsonProperty("dpid")
- @GremlinGroovy("_().in('host').in('on').next().getProperty('dpid')")
- public Iterable<String> getSwitchDPID();
-
- @JsonProperty("number")
- @GremlinGroovy("_().in('host').transform{it.number}")
- public Iterable<Short> getPortNumber();
-
- @JsonProperty("AttachmentPoint")
- @GremlinGroovy("_().in('host').in('on').path(){it.number}{it.dpid}")
- public Iterable<SwitchPort> getAttachmentPoints();*/
- }
-
- public interface IIpv4Address extends IBaseObject {
-
- @JsonProperty("ipv4")
- @Property("ipv4_address")
- @JsonSerialize(using=IPv4Serializer.class)
- public int getIpv4Address();
-
- @Property("ipv4_address")
- public void setIpv4Address(int ipv4Address);
-
- @JsonIgnore
- //@GremlinGroovy("it.in('hasAddress')")
- @Adjacency(label = "hasAddress", direction = Direction.IN)
- public IDeviceObject getDevice();
- }
-
- public interface IFlowPath extends IBaseObject {
- @JsonProperty("flowId")
- @Property("flow_id")
- public String getFlowId();
-
- @Property("flow_id")
- public void setFlowId(String flowId);
-
- @JsonProperty("installerId")
- @Property("installer_id")
- public String getInstallerId();
-
- @Property("installer_id")
- public void setInstallerId(String installerId);
-
- @JsonProperty("flowPathType")
- @Property("flow_path_type")
- public String getFlowPathType();
-
- @Property("flow_path_type")
- public void setFlowPathType(String flowPathType);
-
- @JsonProperty("flowPathUserState")
- @Property("user_state")
- public String getFlowPathUserState();
-
- @Property("user_state")
- public void setFlowPathUserState(String userState);
-
- @JsonProperty("flowPathFlags")
- @Property("flow_path_flags")
- public Long getFlowPathFlags();
-
- @Property("flow_path_flags")
- public void setFlowPathFlags(Long flowPathFlags);
-
- @JsonProperty("idleTimeout")
- @Property("idle_timeout")
- public Integer getIdleTimeout();
-
- @Property("idle_timeout")
- public void setIdleTimeout(Integer idleTimeout);
-
- @JsonProperty("hardTimeout")
- @Property("hard_timeout")
- public Integer getHardTimeout();
-
- @Property("hard_timeout")
- public void setHardTimeout(Integer hardTimeout);
-
- @JsonProperty("priority")
- @Property("priority")
- public Integer getPriority();
-
- @Property("priority")
- public void setPriority(Integer priority);
-
- @JsonProperty("srcDpid")
- @Property("src_switch")
- public String getSrcSwitch();
-
- @Property("src_switch")
- public void setSrcSwitch(String srcSwitch);
-
- @JsonProperty("srcPort")
- @Property("src_port")
- public Short getSrcPort();
-
- @Property("src_port")
- public void setSrcPort(Short srcPort);
-
- @JsonProperty("dstDpid")
- @Property("dst_switch")
- public String getDstSwitch();
-
- @Property("dst_switch")
- public void setDstSwitch(String dstSwitch);
-
- @JsonProperty("dstPort")
- @Property("dst_port")
- public Short getDstPort();
-
- @Property("dst_port")
- public void setDstPort(Short dstPort);
-
- @JsonIgnore
- @Adjacency(label="flow", direction=Direction.IN)
- public Iterable<IFlowEntry> getFlowEntries();
-
- @Adjacency(label="flow", direction=Direction.IN)
- public void addFlowEntry(final IFlowEntry flowEntry);
-
- @Adjacency(label="flow", direction=Direction.IN)
- public void removeFlowEntry(final IFlowEntry flowEntry);
-
- //
- // Matching fields
- //
- @JsonIgnore
- @Property("matchSrcMac")
- public String getMatchSrcMac();
-
- @Property("matchSrcMac")
- public void setMatchSrcMac(String matchSrcMac);
-
- @JsonIgnore
- @Property("matchDstMac")
- public String getMatchDstMac();
-
- @Property("matchDstMac")
- public void setMatchDstMac(String matchDstMac);
-
- @JsonIgnore
- @Property("matchEthernetFrameType")
- public Short getMatchEthernetFrameType();
-
- @Property("matchEthernetFrameType")
- public void setMatchEthernetFrameType(Short matchEthernetFrameType);
-
- @JsonIgnore
- @Property("matchVlanId")
- public Short getMatchVlanId();
-
- @Property("matchVlanId")
- public void setMatchVlanId(Short matchVlanId);
-
- @JsonIgnore
- @Property("matchVlanPriority")
- public Byte getMatchVlanPriority();
-
- @Property("matchVlanPriority")
- public void setMatchVlanPriority(Byte matchVlanPriority);
-
- @JsonIgnore
- @Property("matchSrcIPv4Net")
- public String getMatchSrcIPv4Net();
-
- @Property("matchSrcIPv4Net")
- public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
-
- @JsonIgnore
- @Property("matchDstIPv4Net")
- public String getMatchDstIPv4Net();
-
- @Property("matchDstIPv4Net")
- public void setMatchDstIPv4Net(String matchDstIPv4Net);
-
- @JsonIgnore
- @Property("matchIpProto")
- public Byte getMatchIpProto();
-
- @Property("matchIpProto")
- public void setMatchIpProto(Byte matchIpProto);
-
- @JsonIgnore
- @Property("matchIpToS")
- public Byte getMatchIpToS();
-
- @Property("matchIpToS")
- public void setMatchIpToS(Byte matchIpToS);
-
- @JsonIgnore
- @Property("matchSrcTcpUdpPort")
- public Short getMatchSrcTcpUdpPort();
-
- @Property("matchSrcTcpUdpPort")
- public void setMatchSrcTcpUdpPort(Short matchSrcTcpUdpPort);
-
- @JsonIgnore
- @Property("matchDstTcpUdpPort")
- public Short getMatchDstTcpUdpPort();
-
- @Property("matchDstTcpUdpPort")
- public void setMatchDstTcpUdpPort(Short matchDstTcpUdpPort);
-
- //
- // Action-related fields
- //
- @Property("actions")
- public String getActions();
-
- @Property("actions")
- public void setActions(String actionsStr);
-
- //
- // Other fields
- //
- @JsonIgnore
- @GremlinGroovy("it.in('flow').out('switch')")
- public Iterable<ISwitchObject> getSwitches();
-
- @JsonIgnore
- @Property("state")
- public String getState();
- }
-
- public interface IFlowEntry extends IBaseObject {
- @Property("flow_entry_id")
- public String getFlowEntryId();
-
- @Property("flow_entry_id")
- public void setFlowEntryId(String flowEntryId);
-
- @JsonProperty("idleTimeout")
- @Property("idle_timeout")
- public Integer getIdleTimeout();
-
- @Property("idle_timeout")
- public void setIdleTimeout(Integer idleTimeout);
-
- @JsonProperty("hardTimeout")
- @Property("hard_timeout")
- public Integer getHardTimeout();
-
- @Property("hard_timeout")
- public void setHardTimeout(Integer hardTimeout);
-
- @JsonProperty("priority")
- @Property("priority")
- public Integer getPriority();
-
- @Property("priority")
- public void setPriority(Integer priority);
-
- @Property("switch_dpid")
- public String getSwitchDpid();
-
- @Property("switch_dpid")
- public void setSwitchDpid(String switchDpid);
-
- @Property("user_state")
- public String getUserState();
-
- @Property("user_state")
- public void setUserState(String userState);
-
- @Property("switch_state")
- public String getSwitchState();
-
- @Property("switch_state")
- public void setSwitchState(String switchState);
-
- @Property("error_state_type")
- public String getErrorStateType();
-
- @Property("error_state_type")
- public void setErrorStateType(String errorStateType);
-
- @Property("error_state_code")
- public String getErrorStateCode();
-
- @Property("error_state_code")
- public void setErrorStateCode(String errorStateCode);
-
- //
- // Matching fields
- //
- @Property("matchInPort")
- public Short getMatchInPort();
-
- @Property("matchInPort")
- public void setMatchInPort(Short matchInPort);
-
- @Property("matchSrcMac")
- public String getMatchSrcMac();
-
- @Property("matchSrcMac")
- public void setMatchSrcMac(String matchSrcMac);
-
- @Property("matchDstMac")
- public String getMatchDstMac();
-
- @Property("matchDstMac")
- public void setMatchDstMac(String matchDstMac);
-
- @Property("matchEthernetFrameType")
- public Short getMatchEthernetFrameType();
-
- @Property("matchEthernetFrameType")
- public void setMatchEthernetFrameType(Short matchEthernetFrameType);
-
- @Property("matchVlanId")
- public Short getMatchVlanId();
-
- @Property("matchVlanId")
- public void setMatchVlanId(Short matchVlanId);
-
- @Property("matchVlanPriority")
- public Byte getMatchVlanPriority();
-
- @Property("matchVlanPriority")
- public void setMatchVlanPriority(Byte matchVlanPriority);
-
- @Property("matchSrcIPv4Net")
- public String getMatchSrcIPv4Net();
-
- @Property("matchSrcIPv4Net")
- public void setMatchSrcIPv4Net(String matchSrcIPv4Net);
-
- @Property("matchDstIPv4Net")
- public String getMatchDstIPv4Net();
-
- @Property("matchDstIPv4Net")
- public void setMatchDstIPv4Net(String matchDstIPv4Net);
-
- @Property("matchIpProto")
- public Byte getMatchIpProto();
-
- @Property("matchIpProto")
- public void setMatchIpProto(Byte matchIpProto);
-
- @Property("matchIpToS")
- public Byte getMatchIpToS();
-
- @Property("matchIpToS")
- public void setMatchIpToS(Byte matchIpToS);
-
- @Property("matchSrcTcpUdpPort")
- public Short getMatchSrcTcpUdpPort();
-
- @Property("matchSrcTcpUdpPort")
- public void setMatchSrcTcpUdpPort(Short matchSrcTcpUdpPort);
-
- @Property("matchDstTcpUdpPort")
- public Short getMatchDstTcpUdpPort();
-
- @Property("matchDstTcpUdpPort")
- public void setMatchDstTcpUdpPort(Short matchDstTcpUdpPort);
-
- //
- // Action-related fields
- //
- @Property("actionOutputPort")
- public Short getActionOutputPort();
-
- @Property("actionOutputPort")
- public void setActionOutputPort(Short actionOutputPort);
-
- @Property("actions")
- public String getActions();
-
- @Property("actions")
- public void setActions(String actionsStr);
-
- //
- // Other fields
- //
- @Adjacency(label="flow")
- public IFlowPath getFlow();
-
- @Adjacency(label="flow")
- public void setFlow(IFlowPath flow);
-
- @Adjacency(label="switch")
- public ISwitchObject getSwitch();
-
- @Adjacency(label="switch")
- public void setSwitch(ISwitchObject sw);
-
- @Adjacency(label="inport")
- public IPortObject getInPort();
-
- @Adjacency(label="inport")
- public void setInPort(IPortObject port);
-
- @Adjacency(label="outport")
- public IPortObject getOutPort();
-
- @Adjacency(label="outport")
- public void setOutPort(IPortObject port);
- }
-}
diff --git a/src/main/java/net/onrc/onos/ofcontroller/floodlightlistener/NetworkGraphPublisher.java b/src/main/java/net/onrc/onos/ofcontroller/floodlightlistener/NetworkGraphPublisher.java
index 4c78d23..533e05a 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/floodlightlistener/NetworkGraphPublisher.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/floodlightlistener/NetworkGraphPublisher.java
@@ -22,8 +22,6 @@
import net.floodlightcontroller.threadpool.IThreadPoolService;
import net.floodlightcontroller.util.MACAddress;
import net.onrc.onos.datagrid.IDatagridService;
-import net.onrc.onos.ofcontroller.core.INetMapStorage.DM_OPERATION;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
import net.onrc.onos.ofcontroller.core.IOFSwitchPortListener;
import net.onrc.onos.ofcontroller.linkdiscovery.ILinkDiscoveryListener;
import net.onrc.onos.ofcontroller.linkdiscovery.ILinkDiscoveryService;
@@ -140,9 +138,9 @@
}
protected void switchCleanup() {
+ /*
//op.close();
- // Iterable<ISwitchObject> switches = op.getActiveSwitches();
- Iterable<ISwitchObject> switches = null;
+ Iterable<ISwitchObject> switches = op.getActiveSwitches();
log.debug("Checking for inactive switches");
// For each switch check if a controller exists in controller registry
@@ -166,6 +164,7 @@
}
}
// op.close();
+ */
}
@Override
diff --git a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowSynchronizer.java b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowSynchronizer.java
index 83edc49..1f426b3 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowSynchronizer.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowSynchronizer.java
@@ -24,8 +24,6 @@
import org.slf4j.LoggerFactory;
import net.floodlightcontroller.core.IOFSwitch;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowEntry;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
import net.onrc.onos.ofcontroller.flowprogrammer.IFlowPusherService.MsgPriority;
import net.onrc.onos.ofcontroller.util.Dpid;
import net.onrc.onos.ofcontroller.util.FlowEntry;
@@ -43,13 +41,13 @@
private static Logger log = LoggerFactory.getLogger(FlowSynchronizer.class);
- // TODO: fix after FlowSynchronizer is refactored
+ // TODO: fix when FlowSynchronizer is refactored
// private DBOperation dbHandler;
protected IFlowPusherService pusher;
private Map<IOFSwitch, FutureTask<SyncResult>> switchThreads;
public FlowSynchronizer() {
- // TODO: fix after FlowSynchronizer is refactored
+ // TODO: fix when FlowSynchronizer is refactored
// dbHandler = GraphDBManager.getDBOperation();
switchThreads = new HashMap<IOFSwitch, FutureTask<SyncResult>>();
}
@@ -86,12 +84,13 @@
*/
protected class Synchronizer implements Callable<SyncResult> {
IOFSwitch sw;
- ISwitchObject swObj;
+ // TODO: fix when FlowSynchronizer is refactored
+ // ISwitchObject swObj;
public Synchronizer(IOFSwitch sw) {
this.sw = sw;
Dpid dpid = new Dpid(sw.getId());
- // TODO: fix after FlowSynchronizer is refactored
+ // TODO: fix when FlowSynchronizer is refactored
// this.swObj = dbHandler.searchSwitch(dpid.toString());
}
@@ -186,10 +185,14 @@
*/
private Set<FlowEntryWrapper> getFlowEntriesFromGraph() {
Set<FlowEntryWrapper> entries = new HashSet<FlowEntryWrapper>();
+
+ // TODO: fix when FlowSynchronizer is refactored
+ /*
for(IFlowEntry entry : swObj.getFlowEntries()) {
FlowEntryWrapper fe = new FlowEntryWrapper(entry);
entries.add(fe);
}
+ */
return entries;
}
@@ -254,14 +257,18 @@
*/
class FlowEntryWrapper {
FlowEntryId flowEntryId;
- IFlowEntry iFlowEntry;
+ // TODO: fix when FlowSynchronizer is refactored
+ // IFlowEntry iFlowEntry;
OFFlowStatisticsReply statisticsReply;
+ // TODO: fix when FlowSynchronizer is refactored
+ /*
public FlowEntryWrapper(IFlowEntry entry) {
flowEntryId = new FlowEntryId(entry.getFlowEntryId());
iFlowEntry = entry;
- }
+ }
+ */
public FlowEntryWrapper(OFFlowStatisticsReply entry) {
flowEntryId = new FlowEntryId(entry.getCookie());
@@ -282,16 +289,19 @@
double startDB = System.nanoTime();
// Get the Flow Entry state from the Network Graph
+ // TODO: fix when FlowSynchronizer is refactored
+ /*
if (iFlowEntry == null) {
try {
- // TODO: fix after FlowSynchronizer is refactored
- // iFlowEntry = dbHandler.searchFlowEntry(flowEntryId);
+ // TODO: fix when FlowSynchronizer is refactored
+ iFlowEntry = dbHandler.searchFlowEntry(flowEntryId);
} catch (Exception e) {
log.error("Error finding flow entry {} in Network Graph",
flowEntryId);
return;
}
}
+ */
dbTime = System.nanoTime() - startDB;
//
diff --git a/src/main/java/net/onrc/onos/ofcontroller/forwarding/Forwarding.java b/src/main/java/net/onrc/onos/ofcontroller/forwarding/Forwarding.java
index 97b3e28..8dfd3e3 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/forwarding/Forwarding.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/forwarding/Forwarding.java
@@ -20,9 +20,6 @@
import net.floodlightcontroller.packet.Ethernet;
import net.floodlightcontroller.util.MACAddress;
import net.onrc.onos.datagrid.IDatagridService;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IDeviceObject;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IPortObject;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
import net.onrc.onos.ofcontroller.devicemanager.IOnosDeviceService;
import net.onrc.onos.ofcontroller.flowprogrammer.IFlowPusherService;
import net.onrc.onos.ofcontroller.proxyarp.BroadcastPacketOutNotification;
@@ -298,6 +295,8 @@
}
}
+ // TODO: Fix the code below because IDeviceObject was removed
+ /*
private void continueHandlePacketIn(IOFSwitch sw, OFPacketIn pi, Ethernet eth, IDeviceObject deviceObject) {
log.debug("Start continuehandlePacketIn");
@@ -431,6 +430,7 @@
// TODO: Add the flow by using the new Path Intent framework
// flowService.addFlow(flowPath);
}
+ */
private OFPacketOut constructPacketOut(OFPacketIn pi, IOFSwitch sw) {
OFPacketOut po = new OFPacketOut();
diff --git a/src/main/java/net/onrc/onos/ofcontroller/proxyarp/ProxyArpManager.java b/src/main/java/net/onrc/onos/ofcontroller/proxyarp/ProxyArpManager.java
index f405e0f..1593369 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/proxyarp/ProxyArpManager.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/proxyarp/ProxyArpManager.java
@@ -29,9 +29,6 @@
import net.floodlightcontroller.util.MACAddress;
import net.onrc.onos.datagrid.IDatagridService;
import net.onrc.onos.ofcontroller.bgproute.Interface;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IDeviceObject;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IPortObject;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
import net.onrc.onos.ofcontroller.core.config.IConfigInfoService;
import net.onrc.onos.ofcontroller.flowprogrammer.IFlowPusherService;
import net.onrc.onos.ofcontroller.util.Dpid;
@@ -345,8 +342,9 @@
IDeviceObject targetDevice =
deviceStorage.getDeviceByIP(InetAddresses.coerceToInteger(target));
*/
- IDeviceObject targetDevice = null;
-
+
+ // TODO: Fix the code below after deviceStorage was removed
+ /*
if (targetDevice == null) {
if (log.isTraceEnabled()) {
log.trace("No device info found for {} - broadcasting",
@@ -390,10 +388,9 @@
//long outSwitch = 0;
//short outPort = 0;
- /*
- if (!portObject.getLinkedPorts().iterator().hasNext()) {
- outPort = portObject.getNumber();
- }*/
+ // if (!portObject.getLinkedPorts().iterator().hasNext()) {
+ // outPort = portObject.getNumber();
+ // }
if (portObject.getLinkedPorts().iterator().hasNext()) {
continue;
}
@@ -414,6 +411,7 @@
}
}
}
+ */
}
private void handleArpReply(IOFSwitch sw, OFPacketIn pi, ARP arp){
diff --git a/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java b/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java
index 0371046..c7806a2 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/util/FlowPath.java
@@ -2,10 +2,6 @@
import java.util.ArrayList;
-import net.floodlightcontroller.util.MACAddress;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowEntry;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowPath;
-
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonProperty;
@@ -42,166 +38,6 @@
}
/**
- * Constructor to instantiate from object in Network Map
- */
- public FlowPath(IFlowPath flowObj) {
- dataPath = new DataPath();
- this.setFlowId(new FlowId(flowObj.getFlowId()));
- this.setInstallerId(new CallerId(flowObj.getInstallerId()));
- this.setFlowPathType(FlowPathType.valueOf(flowObj.getFlowPathType()));
- this.setFlowPathUserState(FlowPathUserState.valueOf(flowObj.getFlowPathUserState()));
- this.setFlowPathFlags(new FlowPathFlags(flowObj.getFlowPathFlags()));
- this.setIdleTimeout(flowObj.getIdleTimeout());
- this.setHardTimeout(flowObj.getHardTimeout());
- this.setPriority(flowObj.getPriority());
- this.dataPath().srcPort().setDpid(new Dpid(flowObj.getSrcSwitch()));
- this.dataPath().srcPort().setPort(new Port(flowObj.getSrcPort()));
- this.dataPath().dstPort().setDpid(new Dpid(flowObj.getDstSwitch()));
- this.dataPath().dstPort().setPort(new Port(flowObj.getDstPort()));
- //
- // Extract the match conditions that are common for all Flow Entries
- //
- {
- FlowEntryMatch match = new FlowEntryMatch();
- String matchSrcMac = flowObj.getMatchSrcMac();
- if (matchSrcMac != null)
- match.enableSrcMac(MACAddress.valueOf(matchSrcMac));
- String matchDstMac = flowObj.getMatchDstMac();
- if (matchDstMac != null)
- match.enableDstMac(MACAddress.valueOf(matchDstMac));
- Short matchEthernetFrameType = flowObj.getMatchEthernetFrameType();
- if (matchEthernetFrameType != null)
- match.enableEthernetFrameType(matchEthernetFrameType);
- Short matchVlanId = flowObj.getMatchVlanId();
- if (matchVlanId != null)
- match.enableVlanId(matchVlanId);
- Byte matchVlanPriority = flowObj.getMatchVlanPriority();
- if (matchVlanPriority != null)
- match.enableVlanPriority(matchVlanPriority);
- String matchSrcIPv4Net = flowObj.getMatchSrcIPv4Net();
- if (matchSrcIPv4Net != null)
- match.enableSrcIPv4Net(new IPv4Net(matchSrcIPv4Net));
- String matchDstIPv4Net = flowObj.getMatchDstIPv4Net();
- if (matchDstIPv4Net != null)
- match.enableDstIPv4Net(new IPv4Net(matchDstIPv4Net));
- Byte matchIpProto = flowObj.getMatchIpProto();
- if (matchIpProto != null)
- match.enableIpProto(matchIpProto);
- Byte matchIpToS = flowObj.getMatchIpToS();
- if (matchIpToS != null)
- match.enableIpToS(matchIpToS);
- Short matchSrcTcpUdpPort = flowObj.getMatchSrcTcpUdpPort();
- if (matchSrcTcpUdpPort != null)
- match.enableSrcTcpUdpPort(matchSrcTcpUdpPort);
- Short matchDstTcpUdpPort = flowObj.getMatchDstTcpUdpPort();
- if (matchDstTcpUdpPort != null)
- match.enableDstTcpUdpPort(matchDstTcpUdpPort);
-
- this.setFlowEntryMatch(match);
- }
-
- //
- // Extract the actions for the first Flow Entry
- //
- {
- FlowEntryActions actions = new FlowEntryActions();
-
- String actionsStr = flowObj.getActions();
- if (actions != null)
- actions = new FlowEntryActions(actionsStr);
-
- this.setFlowEntryActions(actions);
- }
-
- //
- // Extract all Flow Entries
- //
- Iterable<IFlowEntry> flowEntries = flowObj.getFlowEntries();
- for (IFlowEntry flowEntryObj : flowEntries) {
- FlowEntry flowEntry = new FlowEntry();
- flowEntry.setFlowEntryId(new FlowEntryId(flowEntryObj.getFlowEntryId()));
- flowEntry.setDpid(new Dpid(flowEntryObj.getSwitchDpid()));
-
- //
- // Extract the match conditions
- //
- FlowEntryMatch match = new FlowEntryMatch();
- //
- Short matchInPort = flowEntryObj.getMatchInPort();
- if (matchInPort != null)
- match.enableInPort(new Port(matchInPort));
- //
- String matchSrcMac = flowEntryObj.getMatchSrcMac();
- if (matchSrcMac != null)
- match.enableSrcMac(MACAddress.valueOf(matchSrcMac));
- //
- String matchDstMac = flowEntryObj.getMatchDstMac();
- if (matchDstMac != null)
- match.enableDstMac(MACAddress.valueOf(matchDstMac));
- //
- Short matchEthernetFrameType = flowEntryObj.getMatchEthernetFrameType();
- if (matchEthernetFrameType != null)
- match.enableEthernetFrameType(matchEthernetFrameType);
- //
- Short matchVlanId = flowEntryObj.getMatchVlanId();
- if (matchVlanId != null)
- match.enableVlanId(matchVlanId);
- //
- Byte matchVlanPriority = flowEntryObj.getMatchVlanPriority();
- if (matchVlanPriority != null)
- match.enableVlanPriority(matchVlanPriority);
- //
- String matchSrcIPv4Net = flowEntryObj.getMatchSrcIPv4Net();
- if (matchSrcIPv4Net != null)
- match.enableSrcIPv4Net(new IPv4Net(matchSrcIPv4Net));
- //
- String matchDstIPv4Net = flowEntryObj.getMatchDstIPv4Net();
- if (matchDstIPv4Net != null)
- match.enableDstIPv4Net(new IPv4Net(matchDstIPv4Net));
- //
- Byte matchIpProto = flowEntryObj.getMatchIpProto();
- if (matchIpProto != null)
- match.enableIpProto(matchIpProto);
- //
- Byte matchIpToS = flowEntryObj.getMatchIpToS();
- if (matchIpToS != null)
- match.enableIpToS(matchIpToS);
- //
- Short matchSrcTcpUdpPort = flowEntryObj.getMatchSrcTcpUdpPort();
- if (matchSrcTcpUdpPort != null)
- match.enableSrcTcpUdpPort(matchSrcTcpUdpPort);
- //
- Short matchDstTcpUdpPort = flowEntryObj.getMatchDstTcpUdpPort();
- if (matchDstTcpUdpPort != null)
- match.enableDstTcpUdpPort(matchDstTcpUdpPort);
- //
- flowEntry.setFlowEntryMatch(match);
-
- //
- // Extract the actions
- //
- {
- FlowEntryActions actions = new FlowEntryActions();
-
- String actionsStr = flowEntryObj.getActions();
- if (actions != null)
- actions = new FlowEntryActions(actionsStr);
-
- flowEntry.setFlowEntryActions(actions);
- }
-
- String userState = flowEntryObj.getUserState();
- flowEntry.setFlowEntryUserState(FlowEntryUserState.valueOf(userState));
- String switchState = flowEntryObj.getSwitchState();
- flowEntry.setFlowEntrySwitchState(FlowEntrySwitchState.valueOf(switchState));
- //
- // TODO: Take care of the FlowEntryErrorState.
- //
- this.dataPath().flowEntries().add(flowEntry);
- }
- }
-
- /**
* Get the flow path Flow ID.
*
* @return the flow path Flow ID.
diff --git a/src/main/resources/floodlightdefault.properties b/src/main/resources/floodlightdefault.properties
index 9f83ec8..a8fbd05 100644
--- a/src/main/resources/floodlightdefault.properties
+++ b/src/main/resources/floodlightdefault.properties
@@ -5,11 +5,8 @@
net.floodlightcontroller.counter.CounterStore,\
net.floodlightcontroller.perfmon.PktInProcessingTime,\
net.floodlightcontroller.ui.web.StaticWebRoutable,\
-net.onrc.onos.ofcontroller.floodlightlistener.NetworkGraphPublisher, \
net.onrc.onos.registry.controller.ZookeeperRegistry
net.floodlightcontroller.restserver.RestApiServer.port = 8080
net.floodlightcontroller.core.FloodlightProvider.openflowport = 6633
net.floodlightcontroller.forwarding.Forwarding.idletimeout = 5
net.floodlightcontroller.forwarding.Forwarding.hardtimeout = 0
-net.onrc.onos.ofcontroller.floodlightlistener.NetworkGraphPublisher.dbconf = /tmp/cassandra.titan
-net.onrc.onos.ofcontroller.floodlightlistener.NetworkGraphPublisher.EnableCleanup = True
diff --git a/src/test/java/net/floodlightcontroller/core/internal/TestDatabaseManager.java b/src/test/java/net/floodlightcontroller/core/internal/TestDatabaseManager.java
deleted file mode 100644
index 4e6477b..0000000
--- a/src/test/java/net/floodlightcontroller/core/internal/TestDatabaseManager.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package net.floodlightcontroller.core.internal;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.apache.commons.io.FileUtils;
-import org.junit.Assert;
-
-import com.thinkaurelius.titan.core.TitanFactory;
-import com.thinkaurelius.titan.core.TitanGraph;
-import com.tinkerpop.blueprints.TransactionalGraph.Conclusion;
-import com.tinkerpop.blueprints.Vertex;
-import com.tinkerpop.blueprints.util.io.graphml.GraphMLReader;
-
-@SuppressWarnings("deprecation")
-public class TestDatabaseManager {
- private static final String testDbLocation = "/tmp/onos-testdb";
-
- //private static final String testDbGraphML = "<?xml version=\"1.0\" ?><graphml xmlns=\"http://graphml.graphdrawing.org/xmlns\"> <key id=\"id\" for=\"node\" attr.name=\"id\" attr.type=\"string\"></key> <key id=\"type\" for=\"node\" attr.name=\"type\" attr.type=\"string\"></key> <key id=\"dpid\" for=\"node\" attr.name=\"dpid\" attr.type=\"string\"></key> <key id=\"desc\" for=\"node\" attr.name=\"desc\" attr.type=\"string\"></key> <key id=\"number\" for=\"node\" attr.name=\"number\" attr.type=\"int\"></key> <key id=\"dl_addr\" for=\"node\" attr.name=\"dl_addr\" attr.type=\"string\"></key> <key id=\"nw_addr\" for=\"node\" attr.name=\"nw_addr\" attr.type=\"string\"></key> <key id=\"id\" for=\"edge\" attr.name=\"id\" attr.type=\"string\"></key> <key id=\"source\" for=\"edge\" attr.name=\"source\" attr.type=\"string\"></key> <key id=\"target\" for=\"edge\" attr.name=\"target\" attr.type=\"string\"></key> <key id=\"label\" for=\"edge\" attr.name=\"label\" attr.type=\"string\"></key> <graph id=\"G\" edgedefault=\"directed\"> <node id=\"1\"> <data key=\"type\">switch</data> <data key=\"dpid\">00:00:00:00:00:00:0a:01</data> <data key=\"desc\">OpenFlow Switch at SEA</data> </node> <node id=\"2\"> <data key=\"type\">switch</data> <data key=\"dpid\">00:00:00:00:00:00:0a:02</data> <data key=\"desc\">OpenFlow Switch at LAX</data> </node> <node id=\"3\"> <data key=\"type\">switch</data> <data key=\"dpid\">00:00:00:00:00:00:0a:03</data> <data key=\"desc\">OpenFlow Switch at CHI</data> </node> <node id=\"4\"> <data key=\"type\">switch</data> <data key=\"dpid\">00:00:00:00:00:00:0a:04</data> <data key=\"desc\">OpenFlow Switch at IAH</data> </node> <node id=\"5\"> <data key=\"type\">switch</data> <data key=\"dpid\">00:00:00:00:00:00:0a:05</data> <data key=\"desc\">OpenFlow Switch at NYC</data> </node> <node id=\"6\"> <data key=\"type\">switch</data> <data key=\"dpid\">00:00:00:00:00:00:0a:06</data> <data key=\"desc\">OpenFlow Switch at ATL</data> </node> <node id=\"100\"> <data key=\"type\">port</data> <data key=\"number\">1</data> <data key=\"desc\">port 1 at SEA Switch</data> </node> <node id=\"101\"> <data key=\"type\">port</data> <data key=\"number\">2</data> <data key=\"desc\">port 2 at SEA Switch</data> </node> <node id=\"102\"> <data key=\"type\">port</data> <data key=\"number\">3</data> <data key=\"desc\">port 3 at SEA Switch</data> </node> <node id=\"103\"> <data key=\"type\">port</data> <data key=\"number\">4</data> <data key=\"desc\">port 4 at SEA Switch</data> </node> <node id=\"104\"> <data key=\"type\">port</data> <data key=\"number\">1</data> <data key=\"desc\">port 1 at LAX Switch</data> </node> <node id=\"105\"> <data key=\"type\">port</data> <data key=\"number\">2</data> <data key=\"desc\">port 2 at LAX Switch</data> </node> <node id=\"106\"> <data key=\"type\">port</data> <data key=\"number\">3</data> <data key=\"desc\">port 3 at LAX Switch</data> </node> <node id=\"107\"> <data key=\"type\">port</data> <data key=\"number\">1</data> <data key=\"desc\">port 1 at CHI Switch</data> </node> <node id=\"108\"> <data key=\"type\">port</data> <data key=\"number\">2</data> <data key=\"desc\">port 2 at CHI Switch</data> </node> <node id=\"109\"> <data key=\"type\">port</data> <data key=\"number\">3</data> <data key=\"desc\">port 3 at CHI Switch</data> </node> <node id=\"110\"> <data key=\"type\">port</data> <data key=\"number\">4</data> <data key=\"desc\">port 4 at CHI Switch</data> </node> <node id=\"111\"> <data key=\"type\">port</data> <data key=\"number\">1</data> <data key=\"desc\">port 1 at IAH Switch</data> </node> <node id=\"112\"> <data key=\"type\">port</data> <data key=\"number\">2</data> <data key=\"desc\">port 2 at IAH Switch</data> </node> <node id=\"113\"> <data key=\"type\">port</data> <data key=\"number\">3</data> <data key=\"desc\">port 3 at IAH Switch</data> </node> <node id=\"114\"> <data key=\"type\">port</data> <data key=\"number\">1</data> <data key=\"desc\">port 1 at NYC Switch</data> </node> <node id=\"115\"> <data key=\"type\">port</data> <data key=\"number\">2</data> <data key=\"desc\">port 2 at NYC Switch</data> </node> <node id=\"116\"> <data key=\"type\">port</data> <data key=\"number\">3</data> <data key=\"desc\">port 3 at NYC Switch</data> </node> <node id=\"117\"> <data key=\"type\">port</data> <data key=\"number\">1</data> <data key=\"desc\">port 1 at ATL Switch</data> </node> <node id=\"118\"> <data key=\"type\">port</data> <data key=\"number\">2</data> <data key=\"desc\">port 2 at ATL Switch</data> </node> <node id=\"119\"> <data key=\"type\">port</data> <data key=\"number\">3</data> <data key=\"desc\">port 3 at ATL Switch</data> </node> <node id=\"1000\"> <data key=\"type\">device</data> <data key=\"dl_addr\">20:c9:d0:4a:e1:73</data> <data key=\"nw_addr\">192.168.10.101</data> </node> <node id=\"1001\"> <data key=\"type\">device</data> <data key=\"dl_addr\">20:c9:d0:4a:e1:62</data> <data key=\"nw_addr\">192.168.20.101</data> </node> <node id=\"1002\"> <data key=\"type\">device</data> <data key=\"dl_addr\">10:40:f3:e6:8d:55</data> <data key=\"nw_addr\">192.168.10.1</data> </node> <node id=\"1003\"> <data key=\"type\">device</data> <data key=\"dl_addr\">a0:b3:cc:9c:c6:88</data> <data key=\"nw_addr\">192.168.20.1</data> </node> <node id=\"1004\"> <data key=\"type\">device</data> <data key=\"dl_addr\">00:04:20:e2:50:a2</data> <data key=\"nw_addr\">192.168.30.1</data> </node> <node id=\"1005\"> <data key=\"type\">device</data> <data key=\"dl_addr\">58:55:ca:c4:1b:a0</data> <data key=\"nw_addr\">192.168.40.1</data> </node> <edge id=\"10000\" source=\"1\" target=\"101\" label=\"on\"></edge> <edge id=\"10001\" source=\"1\" target=\"102\" label=\"on\"></edge> <edge id=\"10002\" source=\"1\" target=\"103\" label=\"on\"></edge> <edge id=\"10003\" source=\"2\" target=\"104\" label=\"on\"></edge> <edge id=\"10004\" source=\"2\" target=\"105\" label=\"on\"></edge> <edge id=\"10005\" source=\"2\" target=\"106\" label=\"on\"></edge> <edge id=\"10006\" source=\"3\" target=\"107\" label=\"on\"></edge> <edge id=\"10007\" source=\"3\" target=\"108\" label=\"on\"></edge> <edge id=\"10008\" source=\"3\" target=\"109\" label=\"on\"></edge> <edge id=\"10009\" source=\"3\" target=\"110\" label=\"on\"></edge> <edge id=\"10010\" source=\"4\" target=\"111\" label=\"on\"></edge> <edge id=\"10011\" source=\"4\" target=\"112\" label=\"on\"></edge> <edge id=\"10012\" source=\"4\" target=\"113\" label=\"on\"></edge> <edge id=\"10013\" source=\"5\" target=\"114\" label=\"on\"></edge> <edge id=\"10014\" source=\"5\" target=\"115\" label=\"on\"></edge> <edge id=\"10015\" source=\"5\" target=\"116\" label=\"on\"></edge> <edge id=\"10016\" source=\"6\" target=\"117\" label=\"on\"></edge> <edge id=\"10017\" source=\"6\" target=\"118\" label=\"on\"></edge> <edge id=\"10018\" source=\"6\" target=\"119\" label=\"on\"></edge> <edge id=\"11000\" source=\"101\" target=\"107\" label=\"link\"></edge> <edge id=\"11003\" source=\"105\" target=\"111\" label=\"link\"></edge> <edge id=\"11004\" source=\"107\" target=\"101\" label=\"link\"></edge> <edge id=\"11005\" source=\"108\" target=\"112\" label=\"link\"></edge> <edge id=\"11006\" source=\"109\" target=\"114\" label=\"link\"></edge> <edge id=\"11007\" source=\"111\" target=\"105\" label=\"link\"></edge> <edge id=\"11008\" source=\"112\" target=\"108\" label=\"link\"></edge> <edge id=\"11009\" source=\"113\" target=\"117\" label=\"link\"></edge> <edge id=\"11010\" source=\"114\" target=\"109\" label=\"link\"></edge> <edge id=\"11011\" source=\"115\" target=\"118\" label=\"link\"></edge> <edge id=\"11012\" source=\"117\" target=\"113\" label=\"link\"></edge> <edge id=\"11013\" source=\"118\" target=\"115\" label=\"link\"></edge> <edge id=\"12000\" source=\"103\" target=\"1000\" label=\"host\"></edge> <edge id=\"12001\" source=\"103\" target=\"1001\" label=\"host\"></edge> <edge id=\"12002\" source=\"110\" target=\"1002\" label=\"host\"></edge> <edge id=\"12003\" source=\"116\" target=\"1003\" label=\"host\"></edge> <edge id=\"12004\" source=\"106\" target=\"1004\" label=\"host\"></edge> <edge id=\"12005\" source=\"119\" target=\"1005\" label=\"host\"></edge> </graph> </graphml>";
-
- private static final String testDataLocation = "titan/schema/test-network.xml";
-
- public static TitanGraph getTestDatabase(){
- //return TitanFactory.open(testDbLocation);
-// return TitanFactory.openInMemoryGraph();
- return TitanFactory.open(testDbLocation);
- }
-
- public static void populateTestData(TitanGraph titanGraph){
- Set<String> s = titanGraph.getIndexedKeys(Vertex.class);
- if (!s.contains("dpid")) {
- titanGraph.createKeyIndex("dpid", Vertex.class);
- titanGraph.stopTransaction(Conclusion.SUCCESS);
- }
- if (!s.contains("type")) {
- titanGraph.createKeyIndex("type", Vertex.class);
- titanGraph.stopTransaction(Conclusion.SUCCESS);
- }
-
- //InputStream graphMLStream = new ByteArrayInputStream(testDbGraphML.getBytes());
-
- try {
- InputStream graphMLStream = new FileInputStream(testDataLocation);
- GraphMLReader.inputGraph(titanGraph, graphMLStream);
- } catch (FileNotFoundException e) {
- Assert.fail("Test data file not found: " + testDataLocation);
- } catch (IOException e) {
- e.printStackTrace();
- Assert.fail("IOException thrown");
- }
-
- //Change the type of all port numbers to short in the database
- Iterator<Vertex> it = titanGraph.getVertices("type", "port").iterator();
- while (it.hasNext()){
- Vertex port = it.next();
-
- if(port.getProperty("number") instanceof Short)
- {
- Short portNum = (Short) port.getProperty("number");
- port.setProperty("number", portNum.shortValue());
- }
- else{
- Integer portNum = (Integer) port.getProperty("number");
- port.setProperty("number", portNum.shortValue());
- }
-
- }
- titanGraph.stopTransaction(Conclusion.SUCCESS);
- }
-
- public static void deleteTestDatabase(){
- try {
- FileUtils.deleteDirectory(new File(testDbLocation));
- } catch (IOException e) {
- System.out.println("delete failed");
- e.printStackTrace();
- }
- }
-
-}
diff --git a/src/test/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowSynchronizerTest.java b/src/test/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowSynchronizerTest.java
index 03c9f4f..3e9e46d 100644
--- a/src/test/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowSynchronizerTest.java
+++ b/src/test/java/net/onrc/onos/ofcontroller/flowprogrammer/FlowSynchronizerTest.java
@@ -9,8 +9,6 @@
import java.util.concurrent.Future;
import net.floodlightcontroller.core.IOFSwitch;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.IFlowEntry;
-import net.onrc.onos.ofcontroller.core.INetMapTopologyObjects.ISwitchObject;
import net.onrc.onos.ofcontroller.flowprogrammer.IFlowPusherService.MsgPriority;
import net.onrc.onos.ofcontroller.flowprogrammer.IFlowSyncService.SyncResult;
import net.onrc.onos.ofcontroller.util.FlowEntry;