public class TServerModule extends PSDKCommonModule
Example:
// create jackson's JSONizator ObjectMapper mapper = new ObjectMapper(); // register our new PSDK module mapper.registerModule( new TServerModule() ); // create PSDK message RequestQueryServer request = RequestQueryServer.create(); // request.set ... // serializeAsString message String json = mapper.writeValueAsString(request); // deserialize message RequestQueryServer msg = mapper.readValue(json, RequestQueryServer.class);NOTE: the module changes ObjectMapper features when it is registering as shown in commented lines:
ObjectMapper mapper = new ObjectMapper(); mapper.register( new TServerModule() ); // mapper.setSerializationInclusion(Include.NON_NULL); // mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); // mapper.setDateFormat(new ISO8601DateFormatWithMilliseconds());so if you have own vision how it should be configured then configure it after the module will be registered.
enabledMessageNameSerialization
Constructor | Description |
---|---|
TServerModule() |
Create new instance of the jackson module.
|
TServerModule(boolean enableMessageNameSerialization) |
Create new instance of the jackson module.
|
Modifier and Type | Method | Description |
---|---|---|
ProtocolUnknownMessage |
createUnknownMessage(int messageId) |
Create protocol unknown message by id.
|
java.lang.Class<?> |
getMarkerClass() |
Gets protocol messages marker class that can be used to deserialize a message.
|
java.lang.Class<? extends Message> |
getMessageClass(java.lang.String name) |
Gets protocol message class by name.
|
static void |
init(PSDKCommonModule module) |
For internal use only
|
static boolean |
isAvailable() |
Checks if the appropriate protocol jar file is available according to the classpath.
|
static void |
setup(com.fasterxml.jackson.databind.Module.SetupContext context) |
Do not call it directly.
|
void |
setupModule(com.fasterxml.jackson.databind.Module.SetupContext context) |
Do not call it directly.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isProtocolAvailable
_checkNotNull, addAbstractTypeMapping, addDeserializer, addKeyDeserializer, addKeySerializer, addSerializer, addSerializer, addValueInstantiator, getModuleName, getTypeId, registerSubtypes, registerSubtypes, registerSubtypes, setAbstractTypes, setDeserializerModifier, setDeserializers, setKeyDeserializers, setKeySerializers, setMixInAnnotation, setNamingStrategy, setSerializerModifier, setSerializers, setValueInstantiators, version
public TServerModule()
public TServerModule(boolean enableMessageNameSerialization)
enableMessageNameSerialization
- flag enables message name serialization
(it is disabled by default).public void setupModule(com.fasterxml.jackson.databind.Module.SetupContext context)
setupModule
in class PSDKCommonModule
public static void init(PSDKCommonModule module)
public static void setup(com.fasterxml.jackson.databind.Module.SetupContext context)
public static boolean isAvailable()
public java.lang.Class<?> getMarkerClass()
getMarkerClass
in class PSDKCommonModule
public java.lang.Class<? extends Message> getMessageClass(java.lang.String name)
getMessageClass
in class PSDKCommonModule
public ProtocolUnknownMessage createUnknownMessage(int messageId)
createUnknownMessage
in class PSDKCommonModule
Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 9.0.006.00
Copyright © 2006–2019 Genesys Telecommunications Laboratories, Inc. All rights reserved.