public interface RecursiveChain extends Chain
Chain
implementation you can use to open
recursive chains. On the contrary of FlatChain
s RecursiveChain
s
are meant to recursively open chains that contain other chains. This is very
handy for some use cases but this also comes with a limitation: you cannot
open a RecursiveChain
with updates. RecursiveChain
s
must be built using a RecursiveChain.Builder
. As an example, the
code snippet below creates and opens the Equity Markets chain that has a max
depth of 4 levels:
OmmConsumer ommConsumer = ...; . . . RecursiveChain theChain = new RecursiveChain.Builder() .withOmmConsumer(ommConsumer) .withChainName("0#EQUITYMARKETS") .withServiceName("ELEKTRON_DD") .build(); theChain.open();There are more parameters you can use with
RecursiveChain
objects.
They must be set at built time via a RecursiveChain.Builder
. Please
refer to this class for the exhaustive list.
RecursiveChain
is
synchronized. It can be used indifferently with the API_DISPATCH
and USER_DISPATCH
OmmConsumer
operation models.
0#EQUITYMARKETS[0, 0] = [0#CA-EQ, 0#CA-SECTORS] 0#EQUITYMARKETS[0, 1, 0] = [0#CA-EQ, 0#CA-MKTSTAT, .PG.TO] 0#EQUITYMARKETS[0, 1, 1] = [0#CA-EQ, 0#CA-MKTSTAT, .PL.TO] 0#EQUITYMARKETS[0, 1, 2] = [0#CA-EQ, 0#CA-MKTSTAT, .NG.TO] ... 0#EQUITYMARKETS[1, 5, 437] = [0#DE-EQ, 0#DE-INDICES, .CXPYX] 0#EQUITYMARKETS[1, 5, 438] = [0#DE-EQ, 0#DE-INDICES, .CXKYX] 0#EQUITYMARKETS[2, 0] = [0#FR-EQ, .FCHI] 0#EQUITYMARKETS[2, 1] = [0#FR-EQ, .SBF250] 0#EQUITYMARKETS[2, 2, 0] = [0#FR-EQ, 0#FR-SECTORS, .FRBM] 0#EQUITYMARKETS[2, 2, 1] = [0#FR-EQ, 0#FR-SECTORS, .FRIN] ... 0#EQUITYMARKETS[4, 2, 20] = [0#IT-EQ, 0#IT-SECTORS, .MHME] 0#EQUITYMARKETS[4, 2, 21] = [0#IT-EQ, 0#IT-SECTORS, .MHTT] 0#EQUITYMARKETS[4, 3, 0, 0] = [0#IT-EQ, 0#IT-MKTSTAT, .PG.MI, DA.MI] 0#EQUITYMARKETS[4, 3, 0, 1] = [0#IT-EQ, 0#IT-MKTSTAT, .PG.MI, LVEN.MI] ... 0#EQUITYMARKETS[25, 5, 25] = [0#RU-EQ, 0#RU-INDICES, .MCXLC] 0#EQUITYMARKETS[25, 5, 26] = [0#RU-EQ, 0#RU-INDICES, .MCXMC] 0#EQUITYMARKETS[25, 5, 27] = [0#RU-EQ, 0#RU-INDICES, .MCXSC]As you can see, the position of each element is represented by a list of numbers (Each number representing a position at a given depth in the chain). The element name is made of a list of strings that represents the path to reach this element in the recursive chain .
Modifier and Type | Interface and Description |
---|---|
static class |
RecursiveChain.Builder
Used to build
RecursiveChain objects. |
static interface |
RecursiveChain.OnCompleteFunction
Represents an optional operation that is called when a chain is complete.
|
static interface |
RecursiveChain.OnElementAddedFunction
Represents an optional operation that is called when an element is added
to a
RecursiveChain . |
static interface |
RecursiveChain.OnErrorFunction
Represents an optional operation that is called when a chain is in error.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.util.List<java.lang.Long>,java.util.List<java.lang.String>> |
getElements()
Returns the elements of this
RecursiveChain . |
close, getName, getServiceName, isAChain, open
isComplete
java.util.Map<java.util.List<java.lang.Long>,java.util.List<java.lang.String>> getElements()
RecursiveChain
.
RecursiveChain
elements are returned in a Map
with the elements positions as keys and the elements names as values. The
first position starts at 0. The map is sorted according to the natural
ordering of the positions. If the chain is not complete this method may
return a partial list of elements.
Map
that contains the elements names (values) and
their respective positions (keys).