Serializers Cleanup
- Fixed some warnings about unneeded 'throws' statements
- Moved ShortestPathIntentSerializer to a more reasonable place
Change-Id: I40ada8a260ebc69cbb89452ba57716a347c67283
diff --git a/src/main/java/net/onrc/onos/core/intent/ShortestPathIntent.java b/src/main/java/net/onrc/onos/core/intent/ShortestPathIntent.java
index b77652f..2e2ca8c 100644
--- a/src/main/java/net/onrc/onos/core/intent/ShortestPathIntent.java
+++ b/src/main/java/net/onrc/onos/core/intent/ShortestPathIntent.java
@@ -1,7 +1,7 @@
package net.onrc.onos.core.intent;
import net.floodlightcontroller.util.MACAddress;
-import net.onrc.onos.core.topology.web.serializers.ShortestPathIntentSerializer;
+import net.onrc.onos.core.intent.runtime.web.serializers.ShortestPathIntentSerializer;
import net.onrc.onos.core.util.Dpid;
import org.codehaus.jackson.map.annotate.JsonSerialize;
diff --git a/src/main/java/net/onrc/onos/core/topology/web/serializers/ShortestPathIntentSerializer.java b/src/main/java/net/onrc/onos/core/intent/runtime/web/serializers/ShortestPathIntentSerializer.java
similarity index 98%
rename from src/main/java/net/onrc/onos/core/topology/web/serializers/ShortestPathIntentSerializer.java
rename to src/main/java/net/onrc/onos/core/intent/runtime/web/serializers/ShortestPathIntentSerializer.java
index 42f102f..ce0709e 100644
--- a/src/main/java/net/onrc/onos/core/topology/web/serializers/ShortestPathIntentSerializer.java
+++ b/src/main/java/net/onrc/onos/core/intent/runtime/web/serializers/ShortestPathIntentSerializer.java
@@ -1,4 +1,4 @@
-package net.onrc.onos.core.topology.web.serializers;
+package net.onrc.onos.core.intent.runtime.web.serializers;
import com.google.common.net.InetAddresses;
diff --git a/src/main/java/net/onrc/onos/core/topology/web/serializers/DeviceSerializer.java b/src/main/java/net/onrc/onos/core/topology/web/serializers/DeviceSerializer.java
index 933fde3..61a8fd9 100644
--- a/src/main/java/net/onrc/onos/core/topology/web/serializers/DeviceSerializer.java
+++ b/src/main/java/net/onrc/onos/core/topology/web/serializers/DeviceSerializer.java
@@ -5,7 +5,6 @@
import net.onrc.onos.core.topology.Device;
import net.onrc.onos.core.topology.Port;
-import org.codehaus.jackson.JsonGenerationException;
import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.map.SerializerProvider;
import org.codehaus.jackson.map.ser.std.SerializerBase;
@@ -19,8 +18,7 @@
@Override
public void serialize(Device dev, JsonGenerator jsonGenerator,
- SerializerProvider serializerProvider) throws IOException,
- JsonGenerationException {
+ SerializerProvider serializerProvider) throws IOException {
jsonGenerator.writeStartObject();
jsonGenerator.writeStringField("mac", dev.getMacAddress().toString());
jsonGenerator.writeFieldName("attachmentPoints");
diff --git a/src/main/java/net/onrc/onos/core/topology/web/serializers/LinkSerializer.java b/src/main/java/net/onrc/onos/core/topology/web/serializers/LinkSerializer.java
index a287814..b34a011 100644
--- a/src/main/java/net/onrc/onos/core/topology/web/serializers/LinkSerializer.java
+++ b/src/main/java/net/onrc/onos/core/topology/web/serializers/LinkSerializer.java
@@ -4,7 +4,6 @@
import net.onrc.onos.core.topology.Link;
-import org.codehaus.jackson.JsonGenerationException;
import org.codehaus.jackson.JsonGenerator;
import org.codehaus.jackson.map.SerializerProvider;
import org.codehaus.jackson.map.ser.std.SerializerBase;
@@ -19,7 +18,7 @@
@Override
public void serialize(Link link, JsonGenerator jsonGenerator,
SerializerProvider serializerProvider)
- throws IOException, JsonGenerationException {
+ throws IOException {
jsonGenerator.writeStartObject();
jsonGenerator.writeStringField("src-switch",
HexString.toHexString(link.getSrcSwitch().getDpid()));
diff --git a/src/main/java/net/onrc/onos/core/topology/web/serializers/PortSerializer.java b/src/main/java/net/onrc/onos/core/topology/web/serializers/PortSerializer.java
index 41626b6..156d2c0 100644
--- a/src/main/java/net/onrc/onos/core/topology/web/serializers/PortSerializer.java
+++ b/src/main/java/net/onrc/onos/core/topology/web/serializers/PortSerializer.java
@@ -5,7 +5,6 @@
import net.onrc.onos.core.topology.Port;
import org.codehaus.jackson.JsonGenerator;
-import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.SerializerProvider;
import org.codehaus.jackson.map.ser.std.SerializerBase;
import org.openflow.util.HexString;
@@ -19,7 +18,7 @@
@Override
public void serialize(Port port, JsonGenerator jsonGenerator,
SerializerProvider serializerProvider)
- throws IOException, JsonProcessingException {
+ throws IOException {
jsonGenerator.writeStartObject();
jsonGenerator.writeStringField("state", "ACTIVE");
jsonGenerator.writeStringField("dpid", HexString.toHexString(port.getDpid()));
diff --git a/src/main/java/net/onrc/onos/core/topology/web/serializers/SwitchSerializer.java b/src/main/java/net/onrc/onos/core/topology/web/serializers/SwitchSerializer.java
index e8f85dc..89ee7ae 100644
--- a/src/main/java/net/onrc/onos/core/topology/web/serializers/SwitchSerializer.java
+++ b/src/main/java/net/onrc/onos/core/topology/web/serializers/SwitchSerializer.java
@@ -6,7 +6,6 @@
import net.onrc.onos.core.topology.Switch;
import org.codehaus.jackson.JsonGenerator;
-import org.codehaus.jackson.JsonProcessingException;
import org.codehaus.jackson.map.SerializerProvider;
import org.codehaus.jackson.map.ser.std.SerializerBase;
import org.openflow.util.HexString;
@@ -19,8 +18,7 @@
@Override
public void serialize(Switch sw, JsonGenerator jsonGenerator,
- SerializerProvider serializerProvider) throws IOException,
- JsonProcessingException {
+ SerializerProvider serializerProvider) throws IOException {
jsonGenerator.writeStartObject();
jsonGenerator.writeStringField("dpid", HexString.toHexString(sw.getDpid()));