|
Platform SDK Java 8.5 API Reference | |||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |
ConfServerModule
ContactServerModule
ExternalServiceModule
InteractionServerModule
OpenMediaAttributesModule
OutboundDesktopModule
OutboundServerModule
LocalControlAgentModule
MessageServerModule
SolutionControlServerModule
StatServerModule
CustomServerModule
RoutingServerModule
TServerModule
PreviewInteractionModule
BasicChatModule
CallbackModule
EmailModule
EspEmailModule
FlexChatModule
See:
Description
Interface Summary | |
---|---|
MetaDataSupport | Specifies which Configuration Server metadata will be used to deserialize Configuration Server messages to/from JSON. |
Class Summary | |
---|---|
PSDKCommonModule | The base class for all provided Platform SDK Jackson modules. |
PSDKJSONConstants | Contains string constants that are used as keys in JSON. |
PSDKModule | Jackson module that describes how to serialize Platform SDK messages for all protocols to/from JSON. |
Exception Summary | |
---|---|
MetadataInstantiationException | Used to prevent a ProtocolException from being thrown during the instantiation of CfgMetadata. |
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 = ((ConfServerContext)c.connectionContext().serverContext()).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.
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());
|
Platform SDK Java 8.5 API Reference | |||||||||
PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES |