Merge branch 'dev'
diff --git a/cluster-mgmt/common/onos.properties b/cluster-mgmt/common/onos.properties
deleted file mode 100644
index 13fca75..0000000
--- a/cluster-mgmt/common/onos.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-floodlight.modules = net.floodlightcontroller.storage.memory.MemoryStorageSource,\
-net.floodlightcontroller.core.FloodlightProvider,\
-net.floodlightcontroller.threadpool.ThreadPool,\
-net.floodlightcontroller.devicemanager.internal.DeviceManagerImpl,\
-net.floodlightcontroller.staticflowentry.StaticFlowEntryPusher,\
-net.floodlightcontroller.firewall.Firewall,\
-net.floodlightcontroller.jython.JythonDebugInterface,\
-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.jython.JythonDebugInterface.port = 6655
-net.floodlightcontroller.forwarding.Forwarding.idletimeout = 5
-net.floodlightcontroller.forwarding.Forwarding.hardtimeout = 0
-net.onrc.onos.ofcontroller.floodlightlistener.NetworkGraphPublisher.dbconf = /tmp/cassandra.titan
diff --git a/cluster-mgmt/cp-config.sh b/cluster-mgmt/cp-config.sh
index e3b2108..e6db9d3 100755
--- a/cluster-mgmt/cp-config.sh
+++ b/cluster-mgmt/cp-config.sh
@@ -22,7 +22,7 @@
#dsh -g $basename 'cd ONOS; ./stop-cassandra stop'
#dsh -g $basename '$ZK_DIR/bin/zkServer.sh stop'
-# authorized_keys cassandra.yaml hosts id_rsa id_rsa.pub known_hosts onlab-gui.pem onlabkey.pem onos.properties zoo.cfg
+# authorized_keys cassandra.yaml hosts id_rsa id_rsa.pub known_hosts onlab-gui.pem onlabkey.pem zoo.cfg
## SSH Setting
dsh -g $basename 'mkdir -m 700 .ssh'
for n in $SSH_COPY; do
diff --git a/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntryMatch.java b/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntryMatch.java
index fd41d09..a2ac748 100644
--- a/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntryMatch.java
+++ b/src/main/java/net/onrc/onos/ofcontroller/util/FlowEntryMatch.java
@@ -16,7 +16,7 @@
/**
* A class for storing a value to match.
*/
- static class Field<T> {
+ public static class Field<T> {
/**
* Default constructor.
*/
diff --git a/src/main/java/net/onrc/onos/ofcontroller/util/Switch.java b/src/main/java/net/onrc/onos/ofcontroller/util/Switch.java
new file mode 100644
index 0000000..c989732
--- /dev/null
+++ b/src/main/java/net/onrc/onos/ofcontroller/util/Switch.java
@@ -0,0 +1,113 @@
+package net.onrc.onos.ofcontroller.util;
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+/**
+ * The class representing a Switch.
+ * NOTE: Currently this class is (almost) not used.
+ */
+public class Switch {
+ public enum SwitchState {
+ INACTIVE,
+ ACTIVE,
+ }
+
+ private Dpid dpid; // The DPID of the switch
+ private SwitchState state; // The state of the switch
+
+ /**
+ * Default constructor.
+ *
+ * NOTE: The default state for the switch is INACTIVE.
+ */
+ public Switch() {
+ this.dpid = new Dpid();
+ this.state = SwitchState.INACTIVE;
+ }
+
+ /**
+ * Constructor for a given DPID.
+ *
+ * NOTE: The state for the switch with a given DPID is ACTIVE.
+ *
+ * @param dpid the DPID to use.
+ */
+ public Switch(Dpid dpid) {
+ this.dpid = dpid;
+ this.state = SwitchState.ACTIVE;
+ }
+
+ /**
+ * Constructor for a given DPID and Switch State.
+ *
+ * @param dpid the DPID to use.
+ * @param state the Switch State to use.
+ */
+ public Switch(Dpid dpid, SwitchState state) {
+ this.dpid = dpid;
+ this.state = state;
+ }
+
+ /**
+ * Get the DPID.
+ *
+ * @return the DPID.
+ */
+ @JsonProperty("dpid")
+ public Dpid dpid() { return dpid; }
+
+ /**
+ * Set the DPID.
+ *
+ * @param dpid the DPID to use.
+ */
+ @JsonProperty("dpid")
+ public void setDpid(Dpid dpid) {
+ this.dpid = dpid;
+ }
+
+ /**
+ * Get the state.
+ *
+ * @return the state.
+ */
+ @JsonProperty("state")
+ public SwitchState state() { return state; }
+
+ /**
+ * Set the state.
+ *
+ * @param state the state to use.
+ */
+ @JsonProperty("state")
+ public void setState(SwitchState state) {
+ this.state = state;
+ }
+
+ /**
+ * Set the Switch State to ACTIVE.
+ */
+ public void setStateActive() {
+ this.state = SwitchState.ACTIVE;
+ }
+
+ /**
+ * Set the Switch State to INACTIVE.
+ */
+ public void setStateInactive() {
+ this.state = SwitchState.INACTIVE;
+ }
+
+ /**
+ * Convert the Switch value to a string.
+ *
+ * The string has the following form:
+ * dpid/state
+ *
+ * @return the Switch value as a string.
+ */
+ @Override
+ public String toString() {
+ return this.dpid.toString() + "/" + this.state.toString();
+ }
+}
diff --git a/src/test/java/net/onrc/onos/ofcontroller/flowmanager/FlowManagerTest.java b/src/test/java/net/onrc/onos/ofcontroller/flowmanager/FlowManagerTest.java
index 68e31ba..5a1549b 100644
--- a/src/test/java/net/onrc/onos/ofcontroller/flowmanager/FlowManagerTest.java
+++ b/src/test/java/net/onrc/onos/ofcontroller/flowmanager/FlowManagerTest.java
@@ -885,7 +885,6 @@
// setup expectations
expectInitWithContext();
- expect(floodlightProvider.getSwitches()).andReturn(null); // TODO: why is this needed?
expect(iFlowPath1.getFlowEntries()).andReturn(oldFlowEntries);
iFlowEntry1.setUserState("FE_USER_DELETE");
iFlowEntry1.setSwitchState("FE_SWITCH_NOT_UPDATED");