Platform SDK Java 9.0 API Reference

Package com.genesyslab.platform.json.jackson2

Platform SDK includes the following protocol-specific Jackson modules, that help to serialize protocol messages to or from JSON format:

Configuration protocol: ConfServerModule
Contacts protocol: ContactServerModule
OpenMedia protocols: ExternalServiceModule InteractionServerModule OpenMediaAttributesModule
Outbound protocols: OutboundDesktopModule OutboundServerModule
Management protocols: LocalControlAgentModule MessageServerModule SolutionControlServerModule
Reporting protocol: StatServerModule
Routing protocol: CustomServerModule RoutingServerModule
Voice protocols: TServerModule PreviewInteractionModule
WebMedia protocol: BasicChatModule CallbackModule EmailModule EspEmailModule FlexChatModule

An example of using the ConfServerModule is provided below. Syntax for other Jackson modules is similar, with differences detailed on the page for that specific module.

 
  // create jackson's JSON converter
  ObjectMapper mapper = new ObjectMapper();
   
  // register our new PSDK module
  mapper.registerModule( new ConfServerModule() );
   
  // create PSDK message
  RequestCreateObject request = RequestCreateObject.create();
  // TODO : fill the request attributes
    
  // serialize message
  String json = mapper.writeValueAsString(request);
  
  // ...
   
  // deserialize message
 RequestCreateObject msg = mapper.readValue(json, RequestCreateObject.class);
 
If you need to work with some specific version of Configuration Server, you can use the server metadata. This approach is useful when it needs connection to newer version of Configuration Server then Platform SDK supports.
  ConfServerProtocol c = new ConfServerProtocol(endpoint);
  c.open();
  
  // to use specific metadata version use following code
  
  // gets server specific version of metadata
  CfgMetadata metadata = c.getServerContext().getMetadata();
 
  // create jackson's JSON converter
  ObjectMapper mapper = new ObjectMapper();
  
  mapper.registerModule( new ConfServerModule(metadata) );
 
Any Configuration Server message that is deserialized using the latest metadata version contained in Platform SDK can be sent to older versions of Configuration Server, but the unknown (new) attributes for that version of Configuration Server will be ignored while sending the message.

NOTE: The Jackson module changes ObjectMapper features while it is registering (as shown in commented lines below), so if you intend to customize the configuration then only make changes after the module is registered.
     ObjectMapper mapper = new ObjectMapper(); 
     mapper.register( new ConfServerModule() );
     // mapper.setSerializationInclusion(Include.NON_NULL);
     // mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false);
     // mapper.setDateFormat(new ISO8601DateFormatWithMilliseconds()); 
  
Skip navigation links
Platform SDK Java 9.0 API Reference

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