public static interface DiffusionGatewayFramework.Implementation
DiffusionGatewayFramework
.Modifier and Type | Method and Description |
---|---|
String |
mapDiffusionTopic(String sourcePath,
String mappingFunction)
Extracts parts of the Diffusion topic branch in the supplied source path
and constructs another topic path specified by the supplied mapping
function.
|
GatewayApplication.ApplicationDetails.Builder |
newApplicationDetailsBuilder()
Do not use - Use
DiffusionGatewayFramework.newApplicationDetailsBuilder() . |
SinkHandler.SinkServiceProperties.Builder |
newSinkServicePropertiesBuilder()
Do not use - Use
DiffusionGatewayFramework.newSinkServicePropertiesBuilder() . |
SourceHandler.SourceServiceProperties.Builder |
newSourceServicePropertiesBuilder()
Do not use - Use
DiffusionGatewayFramework.newSourceServicePropertiesBuilder() . |
CompletableFuture<?> |
shutdown()
Shuts down the framework.
|
GatewayFramework |
start(GatewayApplication application)
|
GatewayFramework start(GatewayApplication application) throws ApplicationInitializationException
DiffusionGatewayFramework.start(com.diffusiondata.gateway.framework.GatewayApplication)
.application
- the applicationApplicationInitializationException
GatewayApplication.ApplicationDetails.Builder newApplicationDetailsBuilder()
DiffusionGatewayFramework.newApplicationDetailsBuilder()
.SourceHandler.SourceServiceProperties.Builder newSourceServicePropertiesBuilder()
DiffusionGatewayFramework.newSourceServicePropertiesBuilder()
.SinkHandler.SinkServiceProperties.Builder newSinkServicePropertiesBuilder()
DiffusionGatewayFramework.newSinkServicePropertiesBuilder()
.CompletableFuture<?> shutdown()
This is mostly useful in tests to shut down the framework.
String mapDiffusionTopic(String sourcePath, String mappingFunction)
The supplied path will only be mapped if it is a simple Diffusion topic
path. If a Diffusion topic selector is supplied, an
IllegalArgumentException
will be thrown.
The mapping function comprises path fragments and path directives.
A path fragment is a section that is literally extracted as it is. It may contain the path separator character '/'.
A path directive is an expression of format <path
(start,length)>. It is used to select parts of the source path to
be re-used in the mapped topic path. start
is
mandatory and specifies the index of the source path to start from
and length
specifies the number of parts to include
from start
index. The length
of the
expression is optional – if it is missing, or '0', or a number
that specifies a length longer than the end of the source path,
the selection extends to the end of the source path. The
start
starts from 0, i.e., the index of the first
part of the source path is 0.
With the above definition, given a source path `a/b/c/d` and the mapping function 'prefix/<path(1, 2)>', this method constructs the final topic path `prefix/b/c`. Here, `prefix/` is a path fragment that is used as it is. `1` is the index of the part in the source path to start from, which is `b`, and `2` is the number of parts to include after the start index, which includes `c`. Thus, the final mapped path is `prefix/b/c`.
Similarly, for the above source path, the mapping function '<path(1)>'
constructs the final path `b/c/d`. Here, the length
argument
is missing in the path directive. Hence, all following parts will be
included in the final mapped path.
Similarly, for the above source path, the mapping function '<path(1,10)>'
constructs the final path `b/c/d`. Here, the length
argument
in the path directive contains a larger value that covers all
parts after start
. Hence, all following parts will be
included in the final mapped path.
The start
and length
in the path directive
should be positive numbers. If start
fails to find
the corresponding part in the source path, a
NoSuchElementException
will be thrown. For example, in the
given source path `a/b/c/d`, if the mapping function is '<path(5)>',
there is no part at index 5 in the source path, which causes a
NoSuchElementException
.
sourcePath
- the Diffusion source topic path to mapmappingFunction
- the mapping function to applyNoSuchElementException
- if either start
or
length
in the path directive
in the mapping function fails to find the
corresponding part in the source pathCopyright © 2024 DiffusionData Limited. All rights reserved.