public static interface SinkHandler.SinkServiceProperties.Builder
A new instance of such a builder can be created using
DiffusionGatewayFramework.newSinkServicePropertiesBuilder().
| Modifier and Type | Method and Description |
|---|---|
SinkHandler.SinkServiceProperties |
build()
Create a
SinkHandler.SinkServiceProperties instance with the current
settings of this builder. |
SinkHandler.SinkServiceProperties.Builder |
consumeJSONSubTypes(boolean consumesJSONSubTypes)
Specifies whether to consume data from all subtypes of JSON topic
type, if the subscription is for JSON topic selector.
|
SinkHandler.SinkServiceProperties.Builder |
payloadConvertor(OutboundPayloadConvertor<?,?> convertor)
Specifies an outbound payload convertor to use for converting
Diffusion specific values to application format.
|
SinkHandler.SinkServiceProperties.Builder |
payloadConvertorName(String name)
Specifies the name of an outbound payload convertor to use for
converting Diffusion specific values to application format.
|
SinkHandler.SinkServiceProperties.Builder |
topicType(TopicType type)
Sets the topic type.
|
SinkHandler.SinkServiceProperties.Builder topicType(TopicType type) throws InvalidConfigurationException
If this is not set the value will be decided by the
build() method according to whether a payload convertor
has been specified or not.
If payloadConvertorName(java.lang.String) or payloadConvertor has
already been specified, the topic type must be compatible with
the payload convertor.
type - the topic type. Setting to null removes any
previously specified topic typeInvalidConfigurationException - if the specified topic type
is incompatible with the previously specified payload
convertorSinkHandler.SinkServiceProperties.Builder payloadConvertorName(String name) throws InvalidConfigurationException
The named payload convertor must be one of those configured in
the outbound payload convertors configuration file (see
"Payload
Convertors").
If a topic type has already been specified, the payload convertor must be compatible with the topic type.
If a payload convertor is not specified for the builder then a
default one will be chosen by the build() method according
to whether a topic type has been specified or not.
One of the default convertors defined in PayloadConvertor
can be explicitly specified if required.
name - the outbound convertor name. Specifying null removes
any existing payload convertorInvalidConfigurationException - if an
outbound payload
convertor with the given name could not be found or the
payload convertor is incompatible with the specified
topic typeSinkHandler.SinkServiceProperties.Builder payloadConvertor(OutboundPayloadConvertor<?,?> convertor) throws InvalidConfigurationException
This method can be used instead of payloadConvertorName(java.lang.String)
in cases where there is no suitable convertor in the convertors
configuration or a service specific convertor needs to be
instantiated.
If a topic type has already been specified, the payload convertor must be compatible with the topic type.
If a payload convertor is not specified for the builder then a
default one will be chosen by the build() method according
to whether a topic type has been specified or not.
convertor - the outbound convertor. Specifying null removes
any existing payload convertorInvalidConfigurationException - if the payload convertor is
incompatible with the specified topic typeSinkHandler.SinkServiceProperties.Builder consumeJSONSubTypes(boolean consumesJSONSubTypes) throws InvalidConfigurationException
The subscription for JSON Diffusion topic selector will match
updates for TopicType.JSON,TopicType.STRING,
TopicType.INT64 and TopicType.DOUBLE topicTypes
by default. Since, SinkHandler can process specific types
of data, by default, for JSON topic subscriptions, only data from
JSON topics are updated to sink.
However, if the requirement is to process all types of data for specific JSON subscription and the sink handler is implemented to handle different formats of data, this flag can be set to true.
This can be set only if SinkHandler.SinkServiceProperties.getTopicType() returns TopicType.JSON.
consumesJSONSubTypes - boolean flag to specify whether to
consume data from all subtypes of JSON topicInvalidConfigurationException - if the specified topic type
is not set to be JSON.SinkHandler.SinkServiceProperties build()
SinkHandler.SinkServiceProperties instance with the current
settings of this builder.
If no topic type has been specified, it will be derived from the
specified payload convertor and if no payload convertor has been
specified it will be assumed to be TopicType.JSON.
If no payload convertor is set standard conversions as described
in "Payload Convertors" will be used according to the chosen topic
type.
Copyright © 2023 DiffusionData Limited. All rights reserved.