Hook up the Intent and Flow REST APIs to the modules/services.
This involved some slight changes to the way the intent service is registered
with the Floodlight module framework. Also FlowManagerModule is now registered
in the services file.
Change-Id: I6a97599e625c385a07996e03236fe94af4705650
diff --git a/src/main/java/net/floodlightcontroller/restserver/CustomSerializerHelper.java b/src/main/java/net/floodlightcontroller/restserver/CustomSerializerHelper.java
index 9810563..8f99be0 100644
--- a/src/main/java/net/floodlightcontroller/restserver/CustomSerializerHelper.java
+++ b/src/main/java/net/floodlightcontroller/restserver/CustomSerializerHelper.java
@@ -24,7 +24,6 @@
* used on the class in different contexts.
*/
public class CustomSerializerHelper {
- private final ObjectMapper mapper;
private final SimpleModule customSerializerModule;
private CustomSerializerFactory sf;
@@ -32,9 +31,7 @@
* Constructor.
*/
public CustomSerializerHelper() {
- mapper = new ObjectMapper();
customSerializerModule = new SimpleModule("custom-serializers", new Version(1, 0, 0, null));
- mapper.registerModule(customSerializerModule);
sf = new CustomSerializerFactory();
}
@@ -58,9 +55,12 @@
* @return a representation with the custom serializers applied
*/
public Representation applySerializers(JacksonRepresentation<?> jacksonRepresentation) {
+ ObjectMapper mapper = jacksonRepresentation.getObjectMapper();
+
mapper.registerModule(customSerializerModule);
- jacksonRepresentation.setObjectMapper(mapper);
mapper.setSerializerFactory(sf);
+ jacksonRepresentation.setObjectMapper(mapper);
+
return jacksonRepresentation;
}
}