Added new method IDBUtils.searchActiveSwitch()
diff --git a/src/main/java/net/onrc/onos/util/GraphDBUtils.java b/src/main/java/net/onrc/onos/util/GraphDBUtils.java
index ba48103..7283d09 100644
--- a/src/main/java/net/onrc/onos/util/GraphDBUtils.java
+++ b/src/main/java/net/onrc/onos/util/GraphDBUtils.java
@@ -44,6 +44,16 @@
}
@Override
+ public ISwitchObject searchActiveSwitch(GraphDBConnection conn, String dpid) {
+ ISwitchObject sw = searchSwitch(conn, dpid);
+ if ((sw != null) &&
+ sw.getState().equals(SwitchState.ACTIVE.toString())) {
+ return sw;
+ }
+ return null;
+ }
+
+ @Override
public IDeviceObject searchDevice(GraphDBConnection conn, String macAddr) {
// TODO Auto-generated method stub
FramedGraph<TitanGraph> fg = conn.getFramedGraph();