Added Link REST and service for active links
diff --git a/src/main/java/net/floodlightcontroller/core/internal/OFSwitchImpl.java b/src/main/java/net/floodlightcontroller/core/internal/OFSwitchImpl.java
index bf5aaf7..5ffd9bc 100644
--- a/src/main/java/net/floodlightcontroller/core/internal/OFSwitchImpl.java
+++ b/src/main/java/net/floodlightcontroller/core/internal/OFSwitchImpl.java
@@ -48,7 +48,7 @@
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.map.annotate.JsonSerialize;
-import org.codehaus.jackson.map.ser.ToStringSerializer;
+import org.codehaus.jackson.map.ser.std.ToStringSerializer;
import org.jboss.netty.channel.Channel;
import org.openflow.protocol.OFFeaturesReply;
import org.openflow.protocol.OFFeaturesRequest;
diff --git a/src/main/java/net/floodlightcontroller/core/internal/SwitchStorageImpl.java b/src/main/java/net/floodlightcontroller/core/internal/SwitchStorageImpl.java
index dbb985e..1e14b05 100644
--- a/src/main/java/net/floodlightcontroller/core/internal/SwitchStorageImpl.java
+++ b/src/main/java/net/floodlightcontroller/core/internal/SwitchStorageImpl.java
@@ -20,6 +20,8 @@
import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.blueprints.Vertex;
import com.tinkerpop.frames.FramedGraph;
+import com.tinkerpop.gremlin.java.GremlinPipeline;
+
import net.floodlightcontroller.core.ISwitchStorage;
public class SwitchStorageImpl implements ISwitchStorage {
@@ -53,11 +55,11 @@
if ((sw = graph.getVertices("dpid",dpid).iterator().next()) != null) {
sw.setProperty("state",state.toString());
graph.stopTransaction(Conclusion.SUCCESS);
- log.info("SwitchStorage:setSTatus dpid:{} state: {} done", dpid, state);
+ log.info("SwitchStorage:setStatus dpid:{} state: {} done", dpid, state);
}
} catch (TitanException e) {
// TODO: handle exceptions
- log.info("SwitchStorage:setSTatus dpid:{} state: {} failed", dpid, state);
+ log.info("SwitchStorage:setStatus dpid:{} state: {} failed", dpid, state);
}
@@ -204,14 +206,14 @@
FramedGraph<TitanGraph> fg = new FramedGraph<TitanGraph>(graph);
Iterable<ISwitchObject> switches = fg.getVertices("type","switch",ISwitchObject.class);
List<ISwitchObject> activeSwitches = new ArrayList<ISwitchObject>();
-
+
for (ISwitchObject sw: switches) {
if(sw.getState().equals(SwitchState.ACTIVE.toString())) {
activeSwitches.add(sw);
}
}
-
- return activeSwitches;
+
+ return activeSwitches;
}
@Override
@@ -250,14 +252,14 @@
FramedGraph<TitanGraph> fg = new FramedGraph<TitanGraph>(graph);
Iterable<ISwitchObject> switches = fg.getVertices("type","switch",ISwitchObject.class);
- List<ISwitchObject> inActiveSwitches = new ArrayList<ISwitchObject>();
+ List<ISwitchObject> inactiveSwitches = new ArrayList<ISwitchObject>();
for (ISwitchObject sw: switches) {
if(sw.getState().equals(SwitchState.INACTIVE.toString())) {
- inActiveSwitches.add(sw);
+ inactiveSwitches.add(sw);
}
}
- return inActiveSwitches;
+ return inactiveSwitches;
}