Platform SDK Java 8.5 API Reference

com.genesyslab.platform.json.jackson2.contactserver
Class ContactServerModule

java.lang.Object
  extended by com.fasterxml.jackson.databind.Module
      extended by com.fasterxml.jackson.databind.module.SimpleModule
          extended by com.genesyslab.platform.json.jackson2.PSDKCommonModule
              extended by com.genesyslab.platform.json.jackson2.contactserver.ContactServerModule
All Implemented Interfaces:
com.fasterxml.jackson.core.Versioned, java.io.Serializable

public class ContactServerModule
extends PSDKCommonModule

PSDK module for Jackson ObjectMapper that describes how to convert PSDK messages to/from JSON.

Example:

  // create jackson's JSONizator
  ObjectMapper mapper = new ObjectMapper();
   
  // register our new PSDK module
  mapper.registerModule( new ContactServerModule() ); 
   
  // create PSDK message
  RequestContactListGet request = RequestContactListGet.create();
  // request.set ...
    
  // serialize message
  String json = mapper.writeValueAsString(request);
   
  // deserialize message
  RequestContactListGet msg = mapper.readValue(json, RequestContactListGet.class);
 
NOTE: the module changes ObjectMapper features when it is registering as shown in commented lines:
     ObjectMapper mapper = new ObjectMapper(); 
     mapper.register( new ContactServerModule() );
     // 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.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.fasterxml.jackson.databind.Module
com.fasterxml.jackson.databind.Module.SetupContext
 
Field Summary
 
Fields inherited from class com.genesyslab.platform.json.jackson2.PSDKCommonModule
enabledMessageNameSerialization
 
Fields inherited from class com.fasterxml.jackson.databind.module.SimpleModule
_abstractTypes, _deserializerModifier, _deserializers, _keyDeserializers, _keySerializers, _mixins, _name, _namingStrategy, _serializerModifier, _serializers, _subtypes, _valueInstantiators, _version
 
Constructor Summary
ContactServerModule()
          Create new instance of the jackson module.
ContactServerModule(boolean enableMessageNameSerialization)
          Create new instance of the jackson module.
 
Method Summary
 com.genesyslab.platform.commons.protocol.runtime.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.
 
Methods inherited from class com.genesyslab.platform.json.jackson2.PSDKCommonModule
isProtocolAvailable
 
Methods inherited from class com.fasterxml.jackson.databind.module.SimpleModule
addAbstractTypeMapping, addDeserializer, addKeyDeserializer, addKeySerializer, addSerializer, addSerializer, addValueInstantiator, getModuleName, registerSubtypes, registerSubtypes, setAbstractTypes, setDeserializerModifier, setDeserializers, setKeyDeserializers, setKeySerializers, setMixInAnnotation, setNamingStrategy, setSerializerModifier, setSerializers, setValueInstantiators, version
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContactServerModule

public ContactServerModule()
Create new instance of the jackson module.


ContactServerModule

public ContactServerModule(boolean enableMessageNameSerialization)
Create new instance of the jackson module.

Parameters:
enableMessageNameSerialization - flag enables message name serialization (it is disabled by default).
Method Detail

setupModule

public void setupModule(com.fasterxml.jackson.databind.Module.SetupContext context)
Do not call it directly.

Overrides:
setupModule in class PSDKCommonModule

init

public static void init(PSDKCommonModule module)
For internal use only


setup

public static void setup(com.fasterxml.jackson.databind.Module.SetupContext context)
Do not call it directly.


isAvailable

public static boolean isAvailable()
Checks if the appropriate protocol jar file is available according to the classpath.

Returns:
true if the appropriate protocol is available.

getMarkerClass

public java.lang.Class<?> getMarkerClass()
Gets protocol messages marker class that can be used to deserialize a message.

Overrides:
getMarkerClass in class PSDKCommonModule
Returns:
protocol messages marker class or null if the module's protocol doesn't have it.

getMessageClass

public java.lang.Class<? extends Message> getMessageClass(java.lang.String name)
Gets protocol message class by name.

Overrides:
getMessageClass in class PSDKCommonModule
Returns:
protocol message class or null if the module's protocol doesn't know it.

createUnknownMessage

public com.genesyslab.platform.commons.protocol.runtime.ProtocolUnknownMessage createUnknownMessage(int messageId)
Create protocol unknown message by id.

Overrides:
createUnknownMessage in class PSDKCommonModule
Returns:
protocol unknown message for a specified message id.

Platform SDK Java 8.5 API Reference

Send comments on this topicTechpubs.webadmin@genesys.com.
Document version: 8.5.302.00
Copyright © 2006–2017 Genesys Telecommunications Laboratories, Inc. All rights reserved.