diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..c4f11b7 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,3 @@ +language: java +jdk: + - oraclejdk8 \ No newline at end of file diff --git a/README.md b/README.md index fd604f0..6d3c0fa 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,38 @@ ## Synopsis -Java Market Data Handler for CME Market Data (MDP 3.0) was designed to take advantage of the new low-latency data feed. It fully supports features of the CME Globex MDP3.0 market data platform, helps feeding CME market data directly into the client application. The handler delivers market data updates from socket to your application in a few microseconds. +Java Market Data Handler for CME Market Data (MDP 3.0) was designed to take advantage of the new low-latency data feed. It fully supports features of the CME Globex MDP3.0 market data platform(https://www.cmegroup.com/confluence/display/EPICSANDBOX/CME+MDP+3.0+Market+Data), helps feeding CME market data directly into the client application. The handler delivers market data updates from socket to your application in a few microseconds. + +## Motivation + +With the third generation of its market data platform CME made several key improvements in the +application protocol and message encoding to allow more efficient market data processing on the +client side. + +Matching engine event boundaries are now clearly indicated with the MatchEventIndicator (5799) tag to +allow a client application apply market data updates transactionally. The client application has explicit +knowledge of the moment when market data is consistent for analysis in the case of complex order +book updates or multiple instruments affected by a matching event. Matching events are now +independent of the UDP packet boundaries ??? a matching event may spread over several sequential UDP +packets and a UDP packet may contain several matching events. Market data updates of a matching +event are segregated by update type to allow the client application skip handling of messages not +relevant to specific algorithm to reduce processing time. New trade summary messages aggregate +trades by price level resulting in fewer trade updates disseminated in the case of large fill events. +(http://www.cmegroup.com/confluence/display/EPICSANDBOX/MDP+3.0+Packet+Structure+Examples) + +The new Simple Binary Encoding (SBE) format which replaced the FAST encoding allows more efficient and +faster message decoding on the client side thanks to the fixed-length fields, native little-endian byte +order and proper field alignment. The client application can efficiently access message fields directly +in the buffer filled with data received from the network socket. The client application does not have to +perform complex sequential state-based decoding process to access required fields. Overall the +increased message encoding and decoding speed overcomes slight increase of disseminated data size +and bandwidth requirements compared to the FAST compression. + +With the introduction of CME MDP 3.0 platform B2BITS EPAM Systems designed new open source market data handler +to take advantage of the new low-latency data feed and to provide developers with the required functionality. +The new handler is optimized for both single- and multi-channel usage scenarios, +the new SBE parser provides fast access to messages and message fields by tag number. +With this project developers have flexibility to include this library into own applications (with/without +required changes) instead of own implementation of all aspects of CME connectivity and market data handling. ## Features * Connects and maintains connections to the CME Globex MDP 3.0 Platform; @@ -18,19 +50,48 @@ Java Market Data Handler for CME Market Data (MDP 3.0) was designed to take adva * Loading of CME SBE templates; * Loading of CME XML channel configuration files; +## Distribution + +In order to build a package from Gradle: + +``` +> gradlew +``` + +## Installation + +This is java library which include just one jar file: b2bits-jmdp3-N.N.jar. + +**Dependencies (July 10, 2017)** +- annotations-12.0.jar +- chronicle-bytes-1.2.4.jar +- chronicle-core-1.3.6.jar +- commons-collections-3.2.2.jar +- commons-configuration-1.10.jar +- commons-lang-2.6.jar +- commons-logging-1.1.1.jar +- koloboke-api-jdk8-0.6.8.jar +- koloboke-impl-jdk8-0.6.8.jar +- log4j-api-2.5.jar +- log4j-core-2.5.jar +- log4j-slf4j-impl-2.5.jar +- slf4j-api-1.7.14.jar +- snappy-java-1.1.2.1.jar +- agrona-0.9.5.jar +- commons-lang3-3.0.jar + ## Code Examples **Full low level listener subscription example (Channel 311. All instruments)** ``` import com.epam.cme.mdp3.*; -import com.epam.cme.mdp3.core.channel.MdpChannelBuilder; -import com.epam.cme.mdp3.core.control.InstrumentState; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; +import com.epam.cme.mdp3.channel.MdpChannelBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class Main { - private static final Logger logger = LogManager.getLogger(Main.class); + private static final Logger logger = LoggerFactory.getLogger(Main.class); private static class ChannelListenerImpl implements ChannelListener { @Override @@ -64,29 +125,34 @@ public class Main { } @Override - public void onInstrumentStateChanged(final String channelId, int securityId, final String secDesc, - InstrumentState prevState, InstrumentState newState) { - logger.info("Channel '{}'s instrument {} state is changed from '{}' to '{}'", - channelId, securityId, prevState, newState); + public int onSecurityDefinition(final String channelId, final MdpMessage mdpMessage) { + logger.info("Received SecurityDefinition(d). Schema Id: {}", mdpMessage.getSchemaId()); + return MdEventFlags.MESSAGE; } @Override - public int onSecurityDefinition(final String channelId, final MdpMessage mdpMessage) { - logger.info("Received SecurityDefinition(d). Schema Id: {}", mdpMessage.getSchemaId()); - return MdEventFlags.NOTHING; + public void onIncrementalMBORefresh(final String channelId, final short matchEventIndicator, final int securityId, + final String secDesc, final long msgSeqNum, final FieldSet orderEntry, final FieldSet mdEntry){ + logger.info("[{}] onIncrementalMBORefresh: ChannelId: {}, SecurityId: {}-{}, OrderId: {}", msgSeqNum, channelId, + securityId, secDesc, orderEntry.getUInt64(37)); + } + + @Override + public void onIncrementalMBPRefresh(String channelId, short matchEventIndicator, int securityId, String secDesc, + long msgSeqNum, FieldSet mdEntry) { + logger.info("[{}] onIncrementalMBPRefresh: SecurityId: {}-{}. RptSeqNum(83): {}", msgSeqNum, securityId, + secDesc, mdEntry.getUInt32(83)); } @Override - public void onIncrementalRefresh(final String channelId, final short matchEventIndicator, - int securityId, String secDesc, - long msgSeqNum, final FieldSet incrRefreshEntry) { - logger.info("[{}] onIncrementalRefresh: SecurityId: {}-{}. RptSeqNum(83): {}", msgSeqNum, securityId, secDesc, incrRefreshEntry.getUInt32(83)); + public void onSnapshotMBOFullRefresh(final String channelId, final String secDesc, final MdpMessage snptMessage){ + logger.info("onMBOFullRefresh: ChannelId: {}, SecurityId: {}-{}.", channelId, snptMessage.getInt32(48), secDesc); } @Override - public void onSnapshotFullRefresh(final String channelId, String secDesc, final MdpMessage snptMessage) { - logger.info("onFullRefresh: SecurityId: {}-{}. RptSeqNum(83): {}", - snptMessage.getInt32(48), secDesc, snptMessage.getUInt32(83)); + public void onSnapshotMBPFullRefresh(String channelId, String secDesc, MdpMessage snptMessage) { + logger.info("onMBPFullRefresh: SecurityId: {}-{}. RptSeqNum(83): {}", + snptMessage.getInt32(48), secDesc, snptMessage.getUInt32(83)); } @Override @@ -98,35 +164,35 @@ public class Main { public void onSecurityStatus(String channelId, int securityId, MdpMessage secStatusMessage) { logger.info("onSecurityStatus. SecurityId: {}, RptSeqNum(83): {}", securityId, secStatusMessage.getUInt32(83)); } - } - public static void main(String args[]) { - try { - final MdpChannel mdpChannel311 = new MdpChannelBuilder("311", - Main.class.getResource("/config.xml").toURI(), - Main.class.getResource("/templates_FixBinary.xml").toURI()) - .usingListener(new ChannelListenerImpl()) - .usingGapThreshold(20) - .build(); - - mdpChannel311.enableAllSecuritiesMode(); - mdpChannel311.startIncrementalFeedA(); - mdpChannel311.startIncrementalFeedB(); - mdpChannel311.startSnapshotFeedA(); - System.out.println("Press enter to shutdown."); - System.in.read(); - mdpChannel311.close(); - } catch (Exception e) { - e.printStackTrace(); + public static void main(String args[]) { + try { + final MdpChannel mdpChannel311 = new MdpChannelBuilder("311", + Main.class.getResource("/config.xml").toURI(), + Main.class.getResource("/templates_FixBinary.xml").toURI()) + .usingListener(new ChannelListenerImpl()) + .usingGapThreshold(3) + .setMBOEnable(true) + .build(); + + mdpChannel311.startFeed(FeedType.N, Feed.A); + mdpChannel311.startFeed(FeedType.I, Feed.A); + mdpChannel311.startFeed(FeedType.I, Feed.B); + mdpChannel311.startFeed(FeedType.SMBO, Feed.A); + System.out.println("Press enter to shutdown."); + System.in.read(); + mdpChannel311.close(); + } catch (Exception e) { + e.printStackTrace(); + } } } -} ``` **Getting all Security Definitions of Channel 311** ``` import com.epam.cme.mdp3.*; -import com.epam.cme.mdp3.core.channel.MdpChannelBuilder; +import com.epam.cme.mdp3.channel.MdpChannelBuilder; import com.epam.cme.mdp3.sbe.message.SbeGroup; import com.epam.cme.mdp3.sbe.message.SbeString; import org.apache.logging.log4j.LogManager; @@ -187,142 +253,202 @@ public class PrintAllSecuritiesTest { } } - public static void main(String args[ ]) { + public static void main(String args[]) { try { final MdpChannel mdpChannel311 = new MdpChannelBuilder("311", - Main.class.getResource("/config.xml").toURI(), - Main.class.getResource("/templates_FixBinary.xml").toURI()) + PrintAllSecuritiesTest.class.getResource("/config.xml").toURI(), + PrintAllSecuritiesTest.class.getResource("/templates_FixBinary.xml").toURI()) .usingListener(new ChannelListenerImpl()) .build(); - mdpChannel311.startInstrumentFeedA(); + mdpChannel311.startFeed(FeedType.N, Feed.A); synchronized (resultIsReady) { resultIsReady.wait(); } logger.info("Received packets in cycles: {}", counter.get()); mdpChannel311.close(); } catch (Exception e) { - e.printStackTrace(); + logger.error(e.getMessage(), e); } } } ``` -## Motivation +## API References + +Builder parameters list (`com.epam.cme.mdp3.channel.MdpChannelBuilder`) + +| Method name | Description | Default value | +| ----------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- | +| `MdpChannelBuilder#setConfiguration(URI cfgURI)` | Path to the CME Market Data Feed Channel configuration file | null | +| `MdpChannelBuilder#setSchema(URI schemaURI)` | Path to the CME SBE templates file | null | +| `MdpChannelBuilder#setNetworkInterface(FeedType feedType, Feed feed, String networkInterface)` | Local network interface that is used for receiving UDP packets. If it is set to null then default local network interface is used. | null | +| `MdpChannelBuilder#usingListener(ChannelListener channelListener)` | User's implementation of ChannelListener, whose methods will be called for received messages | null | +| `MdpChannelBuilder#usingScheduler(ScheduledExecutorService scheduler)` | Instance of scheduled executor service, which will be used for running TCP recovery tasks and updating state from snapshot in case of there are no messages from incremental channels for 100 seconds | null(disabled) | +| `MdpChannelBuilder#usingIncrQueueSize(int incrQueueSize)` | Size of the queue that is used for buffering the messages from increment channel during recovery procedure | 15000 | +| `MdpChannelBuilder#usingGapThreshold(int gapThreshold)` | Amount of lost messages after which recovery procedure starts | 5 | +| `MdpChannelBuilder#usingRcvBufSize(int rcvBufSize)` | UDP socket buffer size | 4 * 1024 * 1024 | +| `MdpChannelBuilder#setTcpUsername(String tcpUsername)` | Username to be used in the Logon (35=A) message to CME TCP replay feed | CME | +| `MdpChannelBuilder#setTcpPassword(String tcpPassword)` | Password to be used in the Logon (35=A) message to CME TCP replay feed | CME | +| `MdpChannelBuilder#setMBOEnable(boolean enabled)` | Enabling MBO mode in which order entries in the messages are processed and MBO snapshot feed is used | false(disabled) | +| `MdpChannelBuilder#build()` | Build the channel with the specified parameters | - | + +Channel parameter list (`com.epam.cme.mdp3.MdpChannel`) + +| Method name | Description | +| --------------------------------------------------------------- | ------------------------------------------------- | +| `MdpChannel#getId()` | Gets ID of MDP Channel | +| `MdpChannel#close()` | Closes MDP Channel and releases all resources | +| `MdpChannel#getState()` | Gets current State of the channel | +| `MdpChannel#registerListener(ChannelListener channelListene)` | Registers Channel Listener | +| `MdpChannel#removeListener(ChannelListener channelListene)` | Removes Channel Listener | +| `MdpChannel#getListeners()` | Gets all registered Channel Listeners | +| `MdpChannel#startFeed(FeedType feedType, Feed feed)` | Starts defined feed | +| `MdpChannel#stopFeed(FeedType feedType, Feed feed)` | Stops defined feed | +| `MdpChannel#stopAllFeeds()` | Stops all Feeds | +| `MdpChannel#subscribe(int securityId, final String secDesc)` | Subscribes to the given security | +| `MdpChannel#discontinueSecurity(int securityId)` | Removes subscription to the given security | + +## Performance tests + +The project contains performance tests of incremental refresh handling. These tests are based on JMH and use test data similar to the data received on CME Certification Environment. +Performance tests have the following scenario: + +In the test the following steps are performed in the loop: + +1. MDP packet, which contains incremental refresh message (msgType = "X"), is generated. +2. Sequence number of the generated packet is adjusted to make it similar to the real feed. +3. It is called MDP Handler to process the next packet. +4. After processing the next packet, the entries are processed in user listener (getting the data from entries to make it similar to regular user applications). + +In order to run tests from Gradle: -With the third generation of its market data platform CME made several key improvements in the -application protocol and message encoding to allow more efficient market data processing on the -client side. +``` +> gradlew jmh +``` -Matching engine event boundaries are now clearly indicated with the MatchEventIndicator (5799) tag to -allow a client application apply market data updates transactionally. The client application has explicit -knowledge of the moment when market data is consistent for analysis in the case of complex order -book updates or multiple instruments affected by a matching event. Matching events are now -independent of the UDP packet boundaries – a matching event may spread over several sequential UDP -packets and a UDP packet may contain several matching events. Market data updates of a matching -event are segregated by update type to allow the client application skip handling of messages not -relevant to specific algorithm to reduce processing time. New trade summary messages aggregate -trades by price level resulting in fewer trade updates disseminated in the case of large fill events. -(http://www.cmegroup.com/confluence/display/EPICSANDBOX/MDP+3.0+Packet+Structure+Examples) +### Example of results: -The new Simple Binary Encoding (SBE) format which replaced the FAST encoding allows more efficient and -faster message decoding on the client side thanks to the fixed-length fields, native little-endian byte -order and proper field alignment. The client application can efficiently access message fields directly -in the buffer filled with data received from the network socket. The client application does not have to -perform complex sequential state-based decoding process to access required fields. Overall the -increased message encoding and decoding speed overcomes slight increase of disseminated data size -and bandwidth requirements compared to the FAST compression. +### Test machine hardware: -With the introduction of CME MDP 3.0 platform B2BITS EPAM Systems designed new open source market data handler -to take advantage of the new low-latency data feed and to provide developers with the required functionality. -The new handler is optimized for both single- and multi-channel usage scenarios, -the new SBE parser provides fast access to messages and message fields by tag number. -With this project developers have flexibility to include this library into own applications (with/without -required changes) instead of own implementation of all aspects of CME connectivity and market data handling. +CPU - Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz -## Installation +Memory - 16 GB -This is java library which include just one jar file: b2bits-jmdp3-N.N.jar. +Operating System - Windows 10.0, 64 bit Build 14393 (10.0.14393.1198) -**Dependencies (May 4, 2016)** -- annotations-12.0.jar -- chronicle-bytes-1.2.4.jar -- chronicle-core-1.3.6.jar -- commons-collections-3.2.2.jar -- commons-configuration-1.10.jar -- commons-lang-2.6.jar -- commons-logging-1.1.1.jar -- koloboke-api-jdk8-0.6.8.jar -- koloboke-impl-jdk8-0.6.8.jar -- log4j-api-2.5.jar -- log4j-core-2.5.jar -- log4j-slf4j-impl-2.5.jar -- slf4j-api-1.7.14.jar -- snappy-java-1.1.2.1.jar - -## API Reference - -TBD - -## Tests - -There are acceptance tests in the project. Test scenarios are based on [Cucumber](https://cucumber.io/) and test data files with MDP Messages (received via CME Certification Environment). -To run tests from Gradle (warning: unpack data files in /src/cucumber/sim/data): +### Market By Price mode(when MBO is disabled): ``` -> gradlew cucumber +... +MDP Packet sample: + msgSeqNum=1; secId=998350; rptSeqNum=1254; mdEntryType=Bid; mdAction=New; level=1; entrySize=4; orderNum=0; priceMantissa=98745000000 + msgSeqNum=1; secId=998350; rptSeqNum=1255; mdEntryType=Offer; mdAction=New; level=1; entrySize=1; orderNum=0; priceMantissa=987075000000 + msgSeqNum=1; secId=998350; rptSeqNum=1256; mdEntryType=Bid; mdAction=New; level=2; entrySize=45; orderNum=0; priceMantissa=987125000000 + msgSeqNum=1; secId=998350; rptSeqNum=1257; mdEntryType=Offer; mdAction=New; level=2; entrySize=22; orderNum=0; priceMantissa=98745000000 + msgSeqNum=1; secId=998350; rptSeqNum=1258; mdEntryType=Bid; mdAction=New; level=3; entrySize=98; orderNum=0; priceMantissa=98720000000 + msgSeqNum=1; secId=998350; rptSeqNum=1259; mdEntryType=Offer; mdAction=New; level=3; entrySize=43; orderNum=0; priceMantissa=98725000000 + msgSeqNum=1; secId=998350; rptSeqNum=1260; mdEntryType=Bid; mdAction=New; level=4; entrySize=12; orderNum=0; priceMantissa=98715000000 + msgSeqNum=1; secId=998350; rptSeqNum=1261; mdEntryType=Offer; mdAction=New; level=4; entrySize=83; orderNum=0; priceMantissa=98670000000 + msgSeqNum=1; secId=998350; rptSeqNum=1262; mdEntryType=Bid; mdAction=New; level=5; entrySize=38; orderNum=0; priceMantissa=98695000000 + msgSeqNum=1; secId=998350; rptSeqNum=1263; mdEntryType=Offer; mdAction=New; level=5; entrySize=99; orderNum=0; priceMantissa=98690000000 + msgSeqNum=1; secId=998350; rptSeqNum=1264; mdEntryType=Bid; mdAction=Delete; level=3; entrySize=1; orderNum=0; priceMantissa=987025000000 + msgSeqNum=1; secId=998350; rptSeqNum=1265; mdEntryType=Offer; mdAction=Delete; level=3; entrySize=99; orderNum=0; priceMantissa=98677500000 +... +Percentiles, us/op: + p(0.0000) = 0.641 us/op + p(50.0000) = 0.642 us/op + p(90.0000) = 0.962 us/op + p(95.0000) = 0.963 us/op + p(99.0000) = 0.963 us/op + p(99.9000) = 10.896 us/op + p(99.9900) = 17.952 us/op + ... +Benchmark Mode Cnt Score Error Units +IncrementalRefreshPerfTest.MBPOnly sample 496246 0.809 ??? 0.004 us/op ``` -There is also performance test of incremental refresh handling in the project. Test is based on JMH and use test data file with MDP Messages (received via CME Certification Environment). -Performance test has the following scenario: - -1. Find sample incremental refresh MDP packet from data file (for instance, incremental entries from 10 to 14, refreshed securities from 4 to 6) - -2. Generate a sequence of test packets from the sample packet (e.g. change sequence numbers of packet and securities) - -3. Perform test. Each iteration fills buffers with next test packet and calls MDP Handler to process it - -To run tests from Gradle (warning: unpack data files in /src/cucumber/sim/data): +### Market By Price and Market By Order mode (MBO only template): ``` -> gradlew jmh +... +MDP Packet sample: + securityId: 998350-testSymbol, orderId - '9926951995', mdOrderPriority - '414', priceMantissa - '98682500000', mdDisplayQty - '23', mdEntryType - 'Bid', mdUpdateAction - 'Delete' + securityId: 998350-testSymbol, orderId - '9926951993', mdOrderPriority - '412', priceMantissa - '98685000000', mdDisplayQty - '59', mdEntryType - 'Offer', mdUpdateAction - 'Delete' + securityId: 998350-testSymbol, orderId - '9926951992', mdOrderPriority - '411', priceMantissa - '98692500000', mdDisplayQty - '12', mdEntryType - 'Bid', mdUpdateAction - 'Delete' + securityId: 998350-testSymbol, orderId - '9926951997', mdOrderPriority - '416', priceMantissa - '98677500000', mdDisplayQty - '49', mdEntryType - 'Offer', mdUpdateAction - 'Change' + securityId: 998350-testSymbol, orderId - '9926951996', mdOrderPriority - '415', priceMantissa - '98687500000', mdDisplayQty - '92', mdEntryType - 'Offer', mdUpdateAction - 'New' + securityId: 998350-testSymbol, orderId - '9926952003', mdOrderPriority - '422', priceMantissa - '98672500000', mdDisplayQty - '88', mdEntryType - 'Offer', mdUpdateAction - 'New' + securityId: 998350-testSymbol, orderId - '9926952002', mdOrderPriority - '421', priceMantissa - '98677500000', mdDisplayQty - '32', mdEntryType - 'Bid', mdUpdateAction - 'New' + securityId: 998350-testSymbol, orderId - '9926952001', mdOrderPriority - '420', priceMantissa - '98702500000', mdDisplayQty - '99', mdEntryType - 'Bid', mdUpdateAction - 'New' + securityId: 998350-testSymbol, orderId - '9926952000', mdOrderPriority - '419', priceMantissa - '98680000000', mdDisplayQty - '94', mdEntryType - 'Bid', mdUpdateAction - 'Delete' + securityId: 998350-testSymbol, orderId - '9926952005', mdOrderPriority - '424', priceMantissa - '98675000000', mdDisplayQty - '49', mdEntryType - 'Bid', mdUpdateAction - 'Change' + securityId: 998350-testSymbol, orderId - '9926952004', mdOrderPriority - '423', priceMantissa - '98702500000', mdDisplayQty - '54', mdEntryType - 'Offer', mdUpdateAction - 'Change' + securityId: 998350-testSymbol, orderId - '9926951983', mdOrderPriority - '402', priceMantissa - '98670000000', mdDisplayQty - '16', mdEntryType - 'Offer', mdUpdateAction - 'Delete' +... +Percentiles, us/op: + p(0.0000) = 0.320 us/op + p(50.0000) = 0.641 us/op + p(90.0000) = 0.642 us/op + p(95.0000) = 0.642 us/op + p(99.0000) = 0.642 us/op + p(99.9000) = 10.576 us/op + p(99.9900) = 16.032 us/op + ... +Benchmark Mode Cnt Score Error Units +IncrementalRefreshPerfTest.MBOOnly sample 333551 0.615 ??? 0.003 us/op ``` -Example of results: +### Market By Price and Market By Order mode (MBO included in MBP template): ``` ... -Loading test data dump... -Loading test data dump...Done -Generating test MDP packets... -The found MDP Packet sample: - msgSeqNum=59343896; secId=556449; rptSeqNum=910008; mdEntryType=Bid; mdAction=Change; level=1; entrySize=137; orderNum=5; priceMa12000000000 - msgSeqNum=59343896; secId=556449; rptSeqNum=910009; mdEntryType=Bid; mdAction=Change; level=2; entrySize=147; orderNum=7; priceMantissa=11750000000 - msgSeqNum=59343896; secId=556449; rptSeqNum=910010; mdEntryType=Offer; mdAction=Change; level=1; entrySize=147; orderNum=6; priceMantissa=12500000000 - msgSeqNum=59343896; secId=556449; rptSeqNum=910011; mdEntryType=Offer; mdAction=Change; level=2; entrySize=79; orderNum=4; priceMantissa=12750000000 - msgSeqNum=59343896; secId=221807; rptSeqNum=824039; mdEntryType=Offer; mdAction=Change; level=1; entrySize=73; orderNum=3; priceMantissa=17250000000 - msgSeqNum=59343896; secId=221807; rptSeqNum=824040; mdEntryType=Offer; mdAction=Change; level=2; entrySize=57; orderNum=4; priceMantissa=17500000000 - msgSeqNum=59343896; secId=575632; rptSeqNum=831830; mdEntryType=Bid; mdAction=Change; level=1; entrySize=128; orderNum=2; priceMantissa=8500000000 - msgSeqNum=59343896; secId=575632; rptSeqNum=831831; mdEntryType=Bid; mdAction=Change; level=2; entrySize=159; orderNum=6; priceMantissa=8250000000 - msgSeqNum=59343896; secId=127203; rptSeqNum=815942; mdEntryType=Offer; mdAction=Change; level=1; entrySize=73; orderNum=3; priceMantissa=15750000000 - msgSeqNum=59343896; secId=127203; rptSeqNum=815943; mdEntryType=Offer; mdAction=Change; level=2; entrySize=61; orderNum=4; priceMantissa=16000000000 - msgSeqNum=59343896; secId=248452; rptSeqNum=953666; mdEntryType=Bid; mdAction=Change; level=1; entrySize=132; orderNum=7; priceMantissa=16250000000 - msgSeqNum=59343896; secId=248452; rptSeqNum=953667; mdEntryType=Bid; mdAction=Change; level=2; entrySize=12; orderNum=4; priceMantissa=16000000000 -Generating test MDP packets...Done -Creating Data Handler instance... -Creating Data Handler instance...Done +MDP Packet sample: + msgSeqNum=1; secId=998350; rptSeqNum=1254; mdEntryType=Bid; mdAction=New; level=1; entrySize=4; orderNum=0; priceMantissa=98745000000 + msgSeqNum=1; secId=998350; rptSeqNum=1255; mdEntryType=Offer; mdAction=New; level=1; entrySize=1; orderNum=0; priceMantissa=987075000000 + msgSeqNum=1; secId=998350; rptSeqNum=1256; mdEntryType=Bid; mdAction=New; level=2; entrySize=45; orderNum=0; priceMantissa=987125000000 + msgSeqNum=1; secId=998350; rptSeqNum=1257; mdEntryType=Offer; mdAction=New; level=2; entrySize=22; orderNum=0; priceMantissa=98745000000 + msgSeqNum=1; secId=998350; rptSeqNum=1258; mdEntryType=Bid; mdAction=New; level=3; entrySize=98; orderNum=0; priceMantissa=98720000000 + msgSeqNum=1; secId=998350; rptSeqNum=1259; mdEntryType=Offer; mdAction=New; level=3; entrySize=43; orderNum=0; priceMantissa=98725000000 + msgSeqNum=1; secId=998350; rptSeqNum=1260; mdEntryType=Bid; mdAction=New; level=4; entrySize=12; orderNum=0; priceMantissa=98715000000 + msgSeqNum=1; secId=998350; rptSeqNum=1261; mdEntryType=Offer; mdAction=New; level=4; entrySize=83; orderNum=0; priceMantissa=98670000000 + msgSeqNum=1; secId=998350; rptSeqNum=1262; mdEntryType=Bid; mdAction=New; level=5; entrySize=38; orderNum=0; priceMantissa=98695000000 + msgSeqNum=1; secId=998350; rptSeqNum=1263; mdEntryType=Offer; mdAction=New; level=5; entrySize=99; orderNum=0; priceMantissa=98690000000 + msgSeqNum=1; secId=998350; rptSeqNum=1264; mdEntryType=Bid; mdAction=Delete; level=3; entrySize=1; orderNum=0; priceMantissa=987025000000 + msgSeqNum=1; secId=998350; rptSeqNum=1265; mdEntryType=Offer; mdAction=Delete; level=3; entrySize=99; orderNum=0; priceMantissa=98677500000 + securityId: 998350-testSymbol, orderId - '9927057956', mdOrderPriority - '5394', priceMantissa - '98745000000', mdDisplayQty - '61', mdEntryType - 'Bid', mdUpdateAction - 'New' + securityId: 998350-testSymbol, orderId - '9927057957', mdOrderPriority - '5395', priceMantissa - '987075000000', mdDisplayQty - '3', mdEntryType - 'Offer', mdUpdateAction - 'New' + securityId: 998350-testSymbol, orderId - '9927057958', mdOrderPriority - '5396', priceMantissa - '987125000000', mdDisplayQty - '7', mdEntryType - 'Bid', mdUpdateAction - 'New' + securityId: 998350-testSymbol, orderId - '9927057959', mdOrderPriority - '5397', priceMantissa - '98745000000', mdDisplayQty - '44', mdEntryType - 'Offer', mdUpdateAction - 'New' + securityId: 998350-testSymbol, orderId - '9927057960', mdOrderPriority - '5398', priceMantissa - '98720000000', mdDisplayQty - '55', mdEntryType - 'Bid', mdUpdateAction - 'New' + securityId: 998350-testSymbol, orderId - '9927057961', mdOrderPriority - '5399', priceMantissa - '98725000000', mdDisplayQty - '68', mdEntryType - 'Offer', mdUpdateAction - 'New' + securityId: 998350-testSymbol, orderId - '9927057962', mdOrderPriority - '5400', priceMantissa - '98715000000', mdDisplayQty - '70', mdEntryType - 'Bid', mdUpdateAction - 'New' + securityId: 998350-testSymbol, orderId - '9927057963', mdOrderPriority - '5401', priceMantissa - '98670000000', mdDisplayQty - '56', mdEntryType - 'Offer', mdUpdateAction - 'New' + securityId: 998350-testSymbol, orderId - '9927057964', mdOrderPriority - '5402', priceMantissa - '98695000000', mdDisplayQty - '6', mdEntryType - 'Bid', mdUpdateAction - 'New' + securityId: 998350-testSymbol, orderId - '9927057965', mdOrderPriority - '5403', priceMantissa - '98690000000', mdDisplayQty - '20', mdEntryType - 'Offer', mdUpdateAction - 'New' + securityId: 998350-testSymbol, orderId - '9927057966', mdOrderPriority - '5404', priceMantissa - '987025000000', mdDisplayQty - '9', mdEntryType - 'Bid', mdUpdateAction - 'Delete' + securityId: 998350-testSymbol, orderId - '9927057967', mdOrderPriority - '5405', priceMantissa - '98677500000', mdDisplayQty - '29', mdEntryType - 'Offer', mdUpdateAction - 'Delete' ... - Percentiles, us/op: - p(0.0000) = 0.729 us/op - p(50.0000) = 1.094 us/op - p(90.0000) = 1.094 us/op - p(95.0000) = 1.458 us/op - p(99.0000) = 1.824 us/op - p(99.9000) = 14.944 us/op - p(99.9900) = 33.152 us/op +Percentiles, us/op: + p(0.0000) = 1.282 us/op + p(50.0000) = 1.604 us/op + p(90.0000) = 1.604 us/op + p(95.0000) = 1.604 us/op + p(99.0000) = 1.924 us/op + p(99.9000) = 14.752 us/op + p(99.9900) = 25.632 us/op ... +Benchmark Mode Cnt Score Error Units +IncrementalRefreshPerfTest.mboWithMBP sample 480387 1.645 ??? 0.004 us/op ``` +## High level MBP book API + +There is the API that provides high level information about changes in the book for particular instrument. The interface `com.epam.cme.mdp3.MarketDataListener` has to be implemented and the instance set in `com.epam.cme.mdp3.MdpChannel.registerMarketDataListener` method from mbp-only module. + +## License + +[GNU Lesser General Public License, version 3.0](https://www.gnu.org/licenses/lgpl-3.0.en.html). ## Contributors @@ -330,8 +456,15 @@ OLEG VERAMEI Software Engineering Team Leader in EPAM's Capital Markets Competency Center -Email: oleg_veramei@epam.com +Email: oleg_veramei@epam.com -## License +VIACHESLAV KOLYBELKIN + +Senior Software Engineer in EPAM's Capital Markets Competency Center + +Email: viacheslav_kolybelkin@epam.com + +## Support + +Should you have any questions or inquiries, please direct them to SupportFIXAntenna@epam.com -[GNU Lesser General Public License, version 3.0](https://www.gnu.org/licenses/lgpl-3.0.en.html). diff --git a/build.gradle b/build.gradle index 6c27ff9..c9ee01e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,42 +1 @@ -plugins { - id "java" - id "maven" - id "java-library-distribution" - id "com.github.samueltbrown.cucumber" version "0.9" - id "org.sonarqube" version "2.0.1" - id "me.champeau.gradle.jmh" version "0.3.0" -} -group = 'com.epam.cme' -version = '1.0' -sourceCompatibility = 1.8 -targetCompatibility = 1.8 - -repositories { - mavenCentral() -} - - -dependencies { - compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.5' - compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.5' - runtime group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.5' - compile group: 'commons-configuration', name: 'commons-configuration', version: '1.10' - runtime group: 'commons-collections', name: 'commons-collections', version: '3.2.2' - compile group: 'net.openhft', name: 'chronicle-bytes', version: '1.7.17' - compile group: 'net.openhft', name: 'koloboke-api-jdk8', version: '0.6.8' - runtime group: 'net.openhft', name: 'koloboke-impl-jdk8', version: '0.6.8' - compile group: 'net.openhft', name: 'chronicle-core', version: '1.7.6' - - cucumberCompile 'info.cukes:cucumber-java:1.2.4' - cucumberCompile 'info.cukes:cucumber-picocontainer:1.2.4' - testCompile group: 'junit', name: 'junit', version: '4.11' -} - -distributions { - main { - baseName = 'b2bits-jmdp3' - contents { - from { 'dist' } - } - } -} \ No newline at end of file +defaultTasks 'clean', 'build', 'distZip', 'distTar' \ No newline at end of file diff --git a/build/b2bits-jmdp3-1.0.zip b/build/b2bits-jmdp3-1.0.zip deleted file mode 100644 index ac5a656..0000000 Binary files a/build/b2bits-jmdp3-1.0.zip and /dev/null differ diff --git a/core/build.gradle b/core/build.gradle new file mode 100644 index 0000000..c916e16 --- /dev/null +++ b/core/build.gradle @@ -0,0 +1,21 @@ +group 'com.epam.cme' +version '2.0' + +apply plugin: 'java' + +sourceCompatibility = 1.8 + +repositories { + mavenCentral() +} + +jar { + baseName 'b2bits-jmdp3-core' +} + +dependencies { + compile group: 'net.openhft', name: 'chronicle-bytes', version: '1.7.17' + compile group: 'commons-configuration', name: 'commons-configuration', version: '1.10' + runtime group: 'commons-collections', name: 'commons-collections', version: '3.2.2' + testCompile group: 'junit', name: 'junit', version: '4.12' +} diff --git a/src/main/java/com/epam/cme/mdp3/ChannelState.java b/core/src/main/java/com/epam/cme/mdp3/ChannelState.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/ChannelState.java rename to core/src/main/java/com/epam/cme/mdp3/ChannelState.java diff --git a/src/main/java/com/epam/cme/mdp3/Feed.java b/core/src/main/java/com/epam/cme/mdp3/Feed.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/Feed.java rename to core/src/main/java/com/epam/cme/mdp3/Feed.java diff --git a/src/main/java/com/epam/cme/mdp3/FeedType.java b/core/src/main/java/com/epam/cme/mdp3/FeedType.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/FeedType.java rename to core/src/main/java/com/epam/cme/mdp3/FeedType.java diff --git a/src/main/java/com/epam/cme/mdp3/FieldSet.java b/core/src/main/java/com/epam/cme/mdp3/FieldSet.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/FieldSet.java rename to core/src/main/java/com/epam/cme/mdp3/FieldSet.java diff --git a/src/main/java/com/epam/cme/mdp3/MatchEventIndicator.java b/core/src/main/java/com/epam/cme/mdp3/MatchEventIndicator.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/MatchEventIndicator.java rename to core/src/main/java/com/epam/cme/mdp3/MatchEventIndicator.java diff --git a/core/src/main/java/com/epam/cme/mdp3/MdConstants.java b/core/src/main/java/com/epam/cme/mdp3/MdConstants.java new file mode 100644 index 0000000..b07070d --- /dev/null +++ b/core/src/main/java/com/epam/cme/mdp3/MdConstants.java @@ -0,0 +1,34 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3; + +public interface MdConstants { + byte TOP_OF_THE_BOOK_LEVEL = 1; + + int LAST_MSG_SEQ_NUM_PROCESSED = 369; + int SECURITY_ID = 48; + int SEC_DESC_TAG = 55; + int RPT_SEQ_NUM = 83; + int NO_MD_ENTRIES = 268; + int INCR_RFRSH_MD_ENTRY_TYPE = 269; + int INCR_RFRSH_MD_ACTION = 279; + int INCR_RFRSH_MD_PRICE_LEVEL = 1023; + int INCR_RFRSH_MD_ENTRY_PX = 270; + int INCR_RFRSH_MD_ENTRY_SIZE = 271; + int INCR_RFRSH_MD_ORDER_NUM = 346; + int NO_ORDER_ID_ENTRIES = 37705; + int NO_CHUNKS = 37709; + int CURRENT_CHUNK = 37710; + int TOT_NUM_REPORTS = 911; + int REFERENCE_ID = 9633; +} diff --git a/src/main/java/com/epam/cme/mdp3/MdEventFlags.java b/core/src/main/java/com/epam/cme/mdp3/MdEventFlags.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/MdEventFlags.java rename to core/src/main/java/com/epam/cme/mdp3/MdEventFlags.java diff --git a/src/main/java/com/epam/cme/mdp3/MdpGroup.java b/core/src/main/java/com/epam/cme/mdp3/MdpGroup.java similarity index 88% rename from src/main/java/com/epam/cme/mdp3/MdpGroup.java rename to core/src/main/java/com/epam/cme/mdp3/MdpGroup.java index a0f6a3b..5e0d19c 100644 --- a/src/main/java/com/epam/cme/mdp3/MdpGroup.java +++ b/core/src/main/java/com/epam/cme/mdp3/MdpGroup.java @@ -49,6 +49,14 @@ public interface MdpGroup extends FieldSet { */ void getEntry(MdpGroupEntry groupEntry); + /** + * Copies data of defined MDP Group entry to the given instance. + * + * @param entryNum number of entry + * @param groupEntry MDP Group Entry + */ + void getEntry(int entryNum, MdpGroupEntry groupEntry); + /** * Creates copy of the current Mdp Group * diff --git a/src/main/java/com/epam/cme/mdp3/MdpGroupEntry.java b/core/src/main/java/com/epam/cme/mdp3/MdpGroupEntry.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/MdpGroupEntry.java rename to core/src/main/java/com/epam/cme/mdp3/MdpGroupEntry.java diff --git a/src/main/java/com/epam/cme/mdp3/MdpMessage.java b/core/src/main/java/com/epam/cme/mdp3/MdpMessage.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/MdpMessage.java rename to core/src/main/java/com/epam/cme/mdp3/MdpMessage.java diff --git a/src/main/java/com/epam/cme/mdp3/MdpPacket.java b/core/src/main/java/com/epam/cme/mdp3/MdpPacket.java similarity index 96% rename from src/main/java/com/epam/cme/mdp3/MdpPacket.java rename to core/src/main/java/com/epam/cme/mdp3/MdpPacket.java index 14b7091..fa9735b 100644 --- a/src/main/java/com/epam/cme/mdp3/MdpPacket.java +++ b/core/src/main/java/com/epam/cme/mdp3/MdpPacket.java @@ -57,8 +57,12 @@ public static MdpPacket instance() { * @return new instance of MDP Packet */ public static MdpPacket allocate() { + return allocate(MDP_PACKET_MAX_SIZE); + } + + public static MdpPacket allocate(int size) { final MdpPacket packet = instance(); - final ByteBuffer byteBuffer = ByteBuffer.allocateDirect(SbeConstants.MDP_PACKET_MAX_SIZE).order(ByteOrder.LITTLE_ENDIAN); + final ByteBuffer byteBuffer = ByteBuffer.allocateDirect(size).order(ByteOrder.LITTLE_ENDIAN); packet.wrapFromBuffer(byteBuffer); return packet; } @@ -69,7 +73,7 @@ public static MdpPacket allocate() { * @return copy instance of MDP Packet */ public MdpPacket copy() { - final MdpPacket copyInstance = allocate(); + final MdpPacket copyInstance = allocate(buffer().length()); copyInstance.buffer().copyFrom(this.buffer()); return copyInstance; } diff --git a/src/main/java/com/epam/cme/mdp3/MutableMdpGroup.java b/core/src/main/java/com/epam/cme/mdp3/MutableMdpGroup.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/MutableMdpGroup.java rename to core/src/main/java/com/epam/cme/mdp3/MutableMdpGroup.java diff --git a/src/main/java/com/epam/cme/mdp3/MutableMdpGroupEntry.java b/core/src/main/java/com/epam/cme/mdp3/MutableMdpGroupEntry.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/MutableMdpGroupEntry.java rename to core/src/main/java/com/epam/cme/mdp3/MutableMdpGroupEntry.java diff --git a/src/main/java/com/epam/cme/mdp3/SemanticMsgType.java b/core/src/main/java/com/epam/cme/mdp3/SemanticMsgType.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/SemanticMsgType.java rename to core/src/main/java/com/epam/cme/mdp3/SemanticMsgType.java diff --git a/src/main/java/com/epam/cme/mdp3/core/cfg/ChannelCfg.java b/core/src/main/java/com/epam/cme/mdp3/core/cfg/ChannelCfg.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/core/cfg/ChannelCfg.java rename to core/src/main/java/com/epam/cme/mdp3/core/cfg/ChannelCfg.java diff --git a/src/main/java/com/epam/cme/mdp3/core/cfg/Configuration.java b/core/src/main/java/com/epam/cme/mdp3/core/cfg/Configuration.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/core/cfg/Configuration.java rename to core/src/main/java/com/epam/cme/mdp3/core/cfg/Configuration.java diff --git a/src/main/java/com/epam/cme/mdp3/core/cfg/ConnectionCfg.java b/core/src/main/java/com/epam/cme/mdp3/core/cfg/ConnectionCfg.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/core/cfg/ConnectionCfg.java rename to core/src/main/java/com/epam/cme/mdp3/core/cfg/ConnectionCfg.java diff --git a/src/main/java/com/epam/cme/mdp3/core/cfg/TransportProtocol.java b/core/src/main/java/com/epam/cme/mdp3/core/cfg/TransportProtocol.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/core/cfg/TransportProtocol.java rename to core/src/main/java/com/epam/cme/mdp3/core/cfg/TransportProtocol.java diff --git a/core/src/main/java/com/epam/cme/mdp3/core/channel/CoreChannelListener.java b/core/src/main/java/com/epam/cme/mdp3/core/channel/CoreChannelListener.java new file mode 100644 index 0000000..d0479b6 --- /dev/null +++ b/core/src/main/java/com/epam/cme/mdp3/core/channel/CoreChannelListener.java @@ -0,0 +1,98 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.core.channel; + + +import com.epam.cme.mdp3.*; + +public interface CoreChannelListener { + /** + * Called when a Channel Feed is started. + * + * @param channelId ID of MDP Channel + * @param feedType Type of MDP Feed (e.g. snapshot or incremental) + * @param feed Feed (e.g. A or B) + */ + void onFeedStarted(final String channelId, final FeedType feedType, final Feed feed); + + /** + * Called when a Channel Feed is stopped. + * + * @param channelId ID of MDP Channel + * @param feedType type of MDP Feed (e.g. snapshot or incremental) + * @param feed feed (e.g. A or B) + */ + void onFeedStopped(final String channelId, final FeedType feedType, final Feed feed); + + /** + * Called when a Channel Feed received new MDP Packet. + * + * @param channelId ID of MDP Channel + * @param feedType Type of MDP Feed (e.g. snapshot or incremental) + * @param feed Feed (e.g. A or B) + * @param mdpPacket MDP Packet which is just received and will be handled after this callback + */ + void onPacket(final String channelId, final FeedType feedType, final Feed feed, final MdpPacket mdpPacket); + + /** + * Called when a Channel has to start its reset. + * + * @param channelId ID of MDP Channel + * @param resetMessage MDP Reset Message + */ + void onBeforeChannelReset(final String channelId, final MdpMessage resetMessage); + + /** + * Called when a Channel just finished its reset. + * + * @param channelId ID of MDP Channel + * @param resetMessage MDP Reset Message + */ + void onFinishedChannelReset(final String channelId, final MdpMessage resetMessage); + + /** + * Called when a Channel state is changed. + * + * @param channelId ID of MDP Channel + * @param prevState Previous state + * @param newState New state + */ + void onChannelStateChanged(final String channelId, final ChannelState prevState, final ChannelState newState); + + /** + * Called when MDP Security Definition Message is received and processed. + * + * @param channelId ID of MDP Channel + * @param secDefMessage MDP Security Definition Message + * @return Required Subscription flags + * @see MdEventFlags + */ + int onSecurityDefinition(final String channelId, final MdpMessage secDefMessage); + + /** + * Called when MDP RFQ Message is received and processed. + * + * @param channelId ID of MDP Channel + * @param rfqMessage MDP TFQ Message + */ + void onRequestForQuote(final String channelId, final MdpMessage rfqMessage); + + /** + * Called when MDP Security Status Message is received and processed. + * + * @param channelId ID of MDP Channel + * @param securityId Security ID + * @param secStatusMessage MDP Security Status Message + */ + void onSecurityStatus(final String channelId, final int securityId, final MdpMessage secStatusMessage); +} diff --git a/src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedContext.java b/core/src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedContext.java similarity index 92% rename from src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedContext.java rename to core/src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedContext.java index 89b81be..7c59116 100644 --- a/src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedContext.java +++ b/core/src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedContext.java @@ -13,6 +13,7 @@ package com.epam.cme.mdp3.core.channel; import com.epam.cme.mdp3.*; +import com.epam.cme.mdp3.core.cfg.ConnectionCfg; import com.epam.cme.mdp3.sbe.message.SbeDouble; import com.epam.cme.mdp3.sbe.message.SbeGroup; import com.epam.cme.mdp3.sbe.message.SbeGroupEntry; @@ -32,9 +33,9 @@ public MdpFeedContext(final Feed feed, final FeedType feedType) { this.feedType = feedType; } - public MdpFeedContext(final MdpFeedWorker feedConnection) { - this.feed = feedConnection.getCfg().getFeed(); - this.feedType = feedConnection.getCfg().getFeedType(); + public MdpFeedContext(final ConnectionCfg cfg) { + this.feed = cfg.getFeed(); + this.feedType = cfg.getFeedType(); } public MdpPacket getMdpPacket() { diff --git a/src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedException.java b/core/src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedException.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedException.java rename to core/src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedException.java diff --git a/src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedListener.java b/core/src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedListener.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedListener.java rename to core/src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedListener.java diff --git a/core/src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedRtmState.java b/core/src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedRtmState.java new file mode 100644 index 0000000..bf291cb --- /dev/null +++ b/core/src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedRtmState.java @@ -0,0 +1,17 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.core.channel; + +public enum MdpFeedRtmState { + ACTIVE, PENDING_SHUTDOWN, SHUTDOWN, STOPPED +} diff --git a/src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedWorker.java b/core/src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedWorker.java similarity index 99% rename from src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedWorker.java rename to core/src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedWorker.java index f62abad..117b17b 100644 --- a/src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedWorker.java +++ b/core/src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedWorker.java @@ -66,7 +66,7 @@ public MdpFeedWorker(final ConnectionCfg cfg, final String networkInterface, fin void init() throws MdpFeedException { try { - this.feedContext = new MdpFeedContext(this); + this.feedContext = new MdpFeedContext(getCfg()); this.ni = this.networkInterface != null ? NetworkInterface.getByName(this.networkInterface) : NetworkInterface.getByInetAddress(InetAddress.getLocalHost()); } catch (IOException e) { logger.error("Failed open DatagramChannel", e); diff --git a/core/src/main/java/com/epam/cme/mdp3/core/channel/tcp/MdpTCPChannel.java b/core/src/main/java/com/epam/cme/mdp3/core/channel/tcp/MdpTCPChannel.java new file mode 100644 index 0000000..e1b0826 --- /dev/null +++ b/core/src/main/java/com/epam/cme/mdp3/core/channel/tcp/MdpTCPChannel.java @@ -0,0 +1,82 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.core.channel.tcp; + +import com.epam.cme.mdp3.core.cfg.ConnectionCfg; +import com.epam.cme.mdp3.core.channel.MdpFeedContext; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.EOFException; +import java.io.IOException; +import java.net.InetSocketAddress; +import java.nio.ByteBuffer; +import java.nio.channels.SocketChannel; +import java.util.List; + +public class MdpTCPChannel implements TCPChannel { + private static final Logger logger = LoggerFactory.getLogger(MdpTCPChannel.class); + private final ConnectionCfg cfg; + private volatile SocketChannel socketChannel; + private MdpFeedContext feedContext; + + public MdpTCPChannel(final ConnectionCfg cfg) { + this.cfg = cfg; + this.feedContext = new MdpFeedContext(cfg); + } + + @Override + public boolean connect() { + List hostIPs = cfg.getHostIPs(); + for (String hostIP : hostIPs) { + try { + final InetSocketAddress inetSocketAddress = new InetSocketAddress(hostIP, cfg.getPort()); + socketChannel = SocketChannel.open(inetSocketAddress); + logger.debug("Connected to {}:{}", hostIP, cfg.getPort()); + return true; + } catch (Exception e) { + logger.error("Failed to connect to {}:{}. Exception: {}", hostIP, cfg.getPort(), e.getMessage(), e); + } + } + return false; + } + + @Override + public void disconnect() { + try { + socketChannel.close(); + } catch (IOException e) { + logger.error(e.getMessage(), e); + } + } + + @Override + public void send(ByteBuffer bb) throws IOException { + socketChannel.write(bb); + } + + @Override + public int receive(ByteBuffer bb) throws IOException { + int readBytes = socketChannel.read(bb); + if(readBytes < 0) { + throw new EOFException("Length of last received bytes is less than zero '" + readBytes + "'"); + } else { + return readBytes; + } + } + + @Override + public MdpFeedContext getFeedContext() { + return feedContext; + } +} diff --git a/core/src/main/java/com/epam/cme/mdp3/core/channel/tcp/MdpTCPMessageRequester.java b/core/src/main/java/com/epam/cme/mdp3/core/channel/tcp/MdpTCPMessageRequester.java new file mode 100644 index 0000000..f48b496 --- /dev/null +++ b/core/src/main/java/com/epam/cme/mdp3/core/channel/tcp/MdpTCPMessageRequester.java @@ -0,0 +1,189 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.core.channel.tcp; + +import com.epam.cme.mdp3.*; +import com.epam.cme.mdp3.core.channel.CoreChannelListener; +import com.epam.cme.mdp3.sbe.message.SbeConstants; +import com.epam.cme.mdp3.sbe.message.SbeString; +import com.epam.cme.mdp3.sbe.schema.MdpMessageTypes; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.List; + +public class MdpTCPMessageRequester implements TCPMessageRequester { + private static final Logger logger = LoggerFactory.getLogger(MdpTCPChannel.class); + public static final String DEFAULT_USERNAME = "CME"; + public static final String DEFAULT_PASSWORD = "CME"; + public final static int NUMBER_OF_SIZE_BYTES = 2; + private List coreChannelListeners; + private final MdpMessageTypes mdpMessageTypes; + private final TCPChannel tcpChannel; + private final static int REQUEST_TIMEOUT_IN_MSEC = 4000; + private final static int LOGON_TEMPLATE_ID = 15; + private final static int LOGOUT_TEMPLATE_ID = 16; + private final static int LOGOUT_TEXT_FIELD_ID = 58; + private final ByteBuffer logon; + private final ByteBuffer logout; + private final MdpPacket mdpPacket = MdpPacket.instance(); + private final ByteBuffer workBuffer = ByteBuffer.allocateDirect(SbeConstants.MDP_PACKET_MAX_SIZE).order(ByteOrder.LITTLE_ENDIAN); + private final SbeString sbeString = SbeString.allocate(500); + private volatile int requestCounter; + private final String channelId; + + public MdpTCPMessageRequester(String channelId, List coreChannelListeners, MdpMessageTypes mdpMessageTypes, TCPChannel tcpChannel, String username, String password) { + this.channelId = channelId; + this.coreChannelListeners = coreChannelListeners; + this.mdpMessageTypes = mdpMessageTypes; + this.tcpChannel = tcpChannel; + logon = prepareLogonMessages(username, password); + logout = prepareLogooutMessages(); + mdpPacket.wrapFromBuffer(workBuffer); + } + + @Override + public synchronized boolean askForLostMessages(long beginSeqNo, long endSeqNo, TCPPacketListener tcpPacketListener) { + ByteBuffer request = prepareRequestMessages(channelId, beginSeqNo, endSeqNo, ++requestCounter); + boolean connected = tcpChannel.connect(); + if(connected) { + try { + onFeedStarted(); + sendPacket(logon); + MdpPacket receivedPacket = receivePacket(); + if (isPacketWithLogon(receivedPacket)) { + tcpChannel.send(request); + long startRequestTime = System.currentTimeMillis(); + long packetSeqNum; + do { + if((System.currentTimeMillis() - startRequestTime) > REQUEST_TIMEOUT_IN_MSEC){ + logger.warn("Request has not been processed for {} msec", REQUEST_TIMEOUT_IN_MSEC); + return false; + } + receivedPacket = receivePacket(); + packetSeqNum = receivedPacket.getMsgSeqNum(); + if (packetSeqNum >= beginSeqNo && packetSeqNum <= endSeqNo) { + tcpPacketListener.onPacket(tcpChannel.getFeedContext(), receivedPacket); + } + } while (packetSeqNum < endSeqNo); + receivedPacket = receivePacket(); + return isPacketWithLogout(receivedPacket); + } else { + MdpMessage firstMessage = receivedPacket.iterator().next(); + int schemaId = firstMessage.getSchemaId(); + firstMessage.setMessageType(mdpMessageTypes.getMessageType(schemaId)); + logger.warn("The message {} has been received instead of logon", firstMessage); + if(schemaId == LOGOUT_TEMPLATE_ID){ + firstMessage.getString(LOGOUT_TEXT_FIELD_ID, sbeString); + logger.warn("Logout has been received with reason '{}'", sbeString.getString()); + } + } + } catch (Exception e) { + logger.error("Last packet [{}] - {}", mdpPacket, e.getMessage(), e); + } finally { + try { + sendPacket(logout); + } catch (IOException e) { + logger.error("Error has occurred during logout", e); + } + tcpChannel.disconnect(); + onFeedStopped(); + } + } + return false; + } + + private void onFeedStopped() { + FeedType feedType = tcpChannel.getFeedContext().getFeedType(); + Feed feed = tcpChannel.getFeedContext().getFeed(); + coreChannelListeners.forEach(coreChannelListener -> coreChannelListener.onFeedStopped(channelId, feedType, feed)); + } + + private void onFeedStarted() { + FeedType feedType = tcpChannel.getFeedContext().getFeedType(); + Feed feed = tcpChannel.getFeedContext().getFeed(); + coreChannelListeners.forEach(coreChannelListener -> coreChannelListener.onFeedStarted(channelId, feedType, feed)); + } + + private void sendPacket(ByteBuffer bb) throws IOException { + tcpChannel.send(bb); + bb.flip(); + } + + private MdpPacket receivePacket() throws IOException { + read(NUMBER_OF_SIZE_BYTES); + int nextPacketSize = workBuffer.getShort() & 0xFFFF; + read(nextPacketSize); + mdpPacket.length(nextPacketSize); + logger.trace("Packet [{}] has been read ", mdpPacket); + return mdpPacket; + } + + private void read(int size) throws IOException { + workBuffer.clear(); + workBuffer.limit(size); + tcpChannel.receive(workBuffer); + workBuffer.flip(); + } + + private boolean isPacketWithLogon(MdpPacket mdpPacket) { + if(mdpPacket.getMsgSeqNum() == 1) { + MdpMessage firstMessage = mdpPacket.iterator().next(); + return firstMessage.getSchemaId() == LOGON_TEMPLATE_ID; + } + return false; + } + + private boolean isPacketWithLogout(MdpPacket mdpPacket){ + MdpMessage firstMessage = mdpPacket.iterator().next(); + return firstMessage.getSchemaId() == LOGOUT_TEMPLATE_ID; + } + + private ByteBuffer prepareLogonMessages(String username, String password) { + String logonMessage = "35=A\u0001553=" + username + "\u0001554=" + password + "\u0001"; + logonMessage = "9=" + logonMessage.length() + "\u0001" + logonMessage; + String logonChecksum = calculateChecksum(logonMessage); + return ByteBuffer.wrap((logonMessage + "10=" + logonChecksum + "\u0001").getBytes()); + } + + private ByteBuffer prepareLogooutMessages() { + String logoutMessage = "35=5\u0001"; + logoutMessage = "9=" + logoutMessage.length() + "\u0001" + logoutMessage; + String logonChecksum = calculateChecksum(logoutMessage); + return ByteBuffer.wrap((logoutMessage + "10=" + logonChecksum + "\u0001").getBytes()); + } + + private ByteBuffer prepareRequestMessages(String channelId, long beginSeqNo, long endSeqNo, int mdReqId) { + String logonMessage = "35=V\u0001" + "1180=" + channelId + "\u0001262=" + channelId + "-" + mdReqId + + "\u00011182=" + beginSeqNo + "\u00011183=" + endSeqNo + "\u0001"; + logonMessage = "9=" + logonMessage.length() + "\u0001" + logonMessage; + String logonChecksum = calculateChecksum(logonMessage); + return ByteBuffer.wrap((logonMessage + "10=" + logonChecksum + "\u0001").getBytes()); + } + + private String calculateChecksum(String message) { + int checksum = 0; + for (int i = 0; i < message.length(); ++i) { + checksum += message.charAt(i); + } + checksum = checksum & 255; + String validChecksum = String.valueOf(checksum); + while(validChecksum.length() < 3) { + validChecksum = "0" + validChecksum; + } + return validChecksum; + } +} diff --git a/core/src/main/java/com/epam/cme/mdp3/core/channel/tcp/TCPChannel.java b/core/src/main/java/com/epam/cme/mdp3/core/channel/tcp/TCPChannel.java new file mode 100644 index 0000000..9eebdb0 --- /dev/null +++ b/core/src/main/java/com/epam/cme/mdp3/core/channel/tcp/TCPChannel.java @@ -0,0 +1,26 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.core.channel.tcp; + +import com.epam.cme.mdp3.core.channel.MdpFeedContext; + +import java.io.IOException; +import java.nio.ByteBuffer; + +public interface TCPChannel { + boolean connect(); + void disconnect(); + void send(ByteBuffer bb) throws IOException; + int receive(final ByteBuffer bb) throws IOException; + MdpFeedContext getFeedContext(); +} diff --git a/core/src/main/java/com/epam/cme/mdp3/core/channel/tcp/TCPMessageRequester.java b/core/src/main/java/com/epam/cme/mdp3/core/channel/tcp/TCPMessageRequester.java new file mode 100644 index 0000000..d77f51d --- /dev/null +++ b/core/src/main/java/com/epam/cme/mdp3/core/channel/tcp/TCPMessageRequester.java @@ -0,0 +1,19 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.core.channel.tcp; + + +public interface TCPMessageRequester { + int MAX_AVAILABLE_MESSAGES = 2000; + boolean askForLostMessages(long beginSeqNo, long endSeqNo, TCPPacketListener tcpPacketListener); +} diff --git a/core/src/main/java/com/epam/cme/mdp3/core/channel/tcp/TCPPacketListener.java b/core/src/main/java/com/epam/cme/mdp3/core/channel/tcp/TCPPacketListener.java new file mode 100644 index 0000000..5f717dc --- /dev/null +++ b/core/src/main/java/com/epam/cme/mdp3/core/channel/tcp/TCPPacketListener.java @@ -0,0 +1,20 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.core.channel.tcp; + +import com.epam.cme.mdp3.MdpPacket; +import com.epam.cme.mdp3.core.channel.MdpFeedContext; + +public interface TCPPacketListener { + void onPacket(MdpFeedContext feedContext, MdpPacket mdpPacket); +} diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/enums/HaltReason.java b/core/src/main/java/com/epam/cme/mdp3/mktdata/enums/HaltReason.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/mktdata/enums/HaltReason.java rename to core/src/main/java/com/epam/cme/mdp3/mktdata/enums/HaltReason.java diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/enums/MDEntryType.java b/core/src/main/java/com/epam/cme/mdp3/mktdata/enums/MDEntryType.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/mktdata/enums/MDEntryType.java rename to core/src/main/java/com/epam/cme/mdp3/mktdata/enums/MDEntryType.java diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/enums/MDUpdateAction.java b/core/src/main/java/com/epam/cme/mdp3/mktdata/enums/MDUpdateAction.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/mktdata/enums/MDUpdateAction.java rename to core/src/main/java/com/epam/cme/mdp3/mktdata/enums/MDUpdateAction.java diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/enums/QuoteType.java b/core/src/main/java/com/epam/cme/mdp3/mktdata/enums/QuoteType.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/mktdata/enums/QuoteType.java rename to core/src/main/java/com/epam/cme/mdp3/mktdata/enums/QuoteType.java diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/enums/SecurityTradingEvent.java b/core/src/main/java/com/epam/cme/mdp3/mktdata/enums/SecurityTradingEvent.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/mktdata/enums/SecurityTradingEvent.java rename to core/src/main/java/com/epam/cme/mdp3/mktdata/enums/SecurityTradingEvent.java diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/enums/SecurityTradingStatus.java b/core/src/main/java/com/epam/cme/mdp3/mktdata/enums/SecurityTradingStatus.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/mktdata/enums/SecurityTradingStatus.java rename to core/src/main/java/com/epam/cme/mdp3/mktdata/enums/SecurityTradingStatus.java diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/enums/Side.java b/core/src/main/java/com/epam/cme/mdp3/mktdata/enums/Side.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/mktdata/enums/Side.java rename to core/src/main/java/com/epam/cme/mdp3/mktdata/enums/Side.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/message/AbstractFieldSet.java b/core/src/main/java/com/epam/cme/mdp3/sbe/message/AbstractFieldSet.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/message/AbstractFieldSet.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/message/AbstractFieldSet.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/message/AbstractSbeBuffer.java b/core/src/main/java/com/epam/cme/mdp3/sbe/message/AbstractSbeBuffer.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/message/AbstractSbeBuffer.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/message/AbstractSbeBuffer.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/message/SbeBuffer.java b/core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeBuffer.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/message/SbeBuffer.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeBuffer.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/message/SbeBufferImpl.java b/core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeBufferImpl.java similarity index 92% rename from src/main/java/com/epam/cme/mdp3/sbe/message/SbeBufferImpl.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeBufferImpl.java index 42672fa..b22de12 100644 --- a/src/main/java/com/epam/cme/mdp3/sbe/message/SbeBufferImpl.java +++ b/core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeBufferImpl.java @@ -49,17 +49,26 @@ public void copyFrom(BytesStore store) { @Override public void copyFrom(SbeBuffer buffer) { final SbeBufferImpl bufferImpl = (SbeBufferImpl) buffer; + final long fromLength = bufferImpl.bytes.length(); if (this.bytes == null) { //this.bytes = Bytes.wrapForRead(ByteBuffer.allocateDirect((int) bufferImpl.bytes.realCapacity()).order(ByteOrder.LITTLE_ENDIAN)); this.bytes = BytesStore.wrap(ByteBuffer.allocateDirect((int) bufferImpl.bytes.realCapacity()).order(ByteOrder.LITTLE_ENDIAN)); } - this.bytes.write(0, bufferImpl.bytes, 0, bufferImpl.bytes.length()); + final long toLength = bytes.length(); + if(toLength < fromLength) { + bytes.write(0, bufferImpl.bytes, 0, toLength); + } else { + bytes.write(0, bufferImpl.bytes, 0, fromLength); + } } @Override public SbeBuffer copy() { final SbeBuffer copyInstance = new SbeBufferImpl(); copyInstance.copyFrom(this); + copyInstance.offset(offset()); + copyInstance.length(length()); + copyInstance.position(position()); return copyInstance; } diff --git a/src/main/java/com/epam/cme/mdp3/sbe/message/SbeConstants.java b/core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeConstants.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/message/SbeConstants.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeConstants.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/message/SbeDouble.java b/core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeDouble.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/message/SbeDouble.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeDouble.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/message/SbeGroup.java b/core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeGroup.java similarity index 87% rename from src/main/java/com/epam/cme/mdp3/sbe/message/SbeGroup.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeGroup.java index ac3dfdc..0ccb67a 100644 --- a/src/main/java/com/epam/cme/mdp3/sbe/message/SbeGroup.java +++ b/core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeGroup.java @@ -64,6 +64,15 @@ public void getEntry(final MdpGroupEntry groupEntry) { ((MutableMdpGroupEntry) groupEntry).reset(this.buffer(), this.sbeGroupType, this.entryOffset, this.blockLength); } + @Override + public void getEntry(int entryNum, MdpGroupEntry groupEntry) { + if (entryNum > numInGroup) { + throw new IllegalArgumentException("Out of group size"); + } + int entryOffset = groupBodyOffset + ((entryNum -1) * blockLength); + ((MutableMdpGroupEntry) groupEntry).reset(this.buffer(), this.sbeGroupType, entryOffset, this.blockLength); + } + @Override public MdpGroup copy() { final MutableMdpGroup copyInstance = (MutableMdpGroup) instance(); diff --git a/src/main/java/com/epam/cme/mdp3/sbe/message/SbeGroupEntry.java b/core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeGroupEntry.java similarity index 94% rename from src/main/java/com/epam/cme/mdp3/sbe/message/SbeGroupEntry.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeGroupEntry.java index d1fb7bb..b350670 100644 --- a/src/main/java/com/epam/cme/mdp3/sbe/message/SbeGroupEntry.java +++ b/core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeGroupEntry.java @@ -15,8 +15,6 @@ import com.epam.cme.mdp3.MdpGroup; import com.epam.cme.mdp3.MdpGroupEntry; import com.epam.cme.mdp3.MutableMdpGroupEntry; -import com.epam.cme.mdp3.sbe.message.meta.MetadataContainer; -import com.epam.cme.mdp3.sbe.message.meta.SbeFieldType; import com.epam.cme.mdp3.sbe.message.meta.SbeGroupType; public class SbeGroupEntry extends SbeGroupFieldSet implements MdpGroupEntry, MutableMdpGroupEntry { diff --git a/src/main/java/com/epam/cme/mdp3/sbe/message/SbeGroupFieldSet.java b/core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeGroupFieldSet.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/message/SbeGroupFieldSet.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeGroupFieldSet.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/message/SbeMessage.java b/core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeMessage.java similarity index 96% rename from src/main/java/com/epam/cme/mdp3/sbe/message/SbeMessage.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeMessage.java index 34640b4..72f0d61 100644 --- a/src/main/java/com/epam/cme/mdp3/sbe/message/SbeMessage.java +++ b/core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeMessage.java @@ -74,7 +74,8 @@ public String toString() { @Override public SemanticMsgType getSemanticMsgType() { - return getMessageType().getSemanticMsgType(); + MdpMessageType messageType = getMessageType(); + return messageType != null ? messageType.getSemanticMsgType() : null; } @Override diff --git a/src/main/java/com/epam/cme/mdp3/sbe/message/SbeMonthYear.java b/core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeMonthYear.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/message/SbeMonthYear.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeMonthYear.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/message/SbeString.java b/core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeString.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/message/SbeString.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/message/SbeString.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/message/meta/ArrayMetadataContainer.java b/core/src/main/java/com/epam/cme/mdp3/sbe/message/meta/ArrayMetadataContainer.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/message/meta/ArrayMetadataContainer.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/message/meta/ArrayMetadataContainer.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/message/meta/MdpMessageType.java b/core/src/main/java/com/epam/cme/mdp3/sbe/message/meta/MdpMessageType.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/message/meta/MdpMessageType.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/message/meta/MdpMessageType.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/message/meta/MetadataContainer.java b/core/src/main/java/com/epam/cme/mdp3/sbe/message/meta/MetadataContainer.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/message/meta/MetadataContainer.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/message/meta/MetadataContainer.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/message/meta/MetadataContainerBuilder.java b/core/src/main/java/com/epam/cme/mdp3/sbe/message/meta/MetadataContainerBuilder.java similarity index 96% rename from src/main/java/com/epam/cme/mdp3/sbe/message/meta/MetadataContainerBuilder.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/message/meta/MetadataContainerBuilder.java index 651d690..ee98032 100644 --- a/src/main/java/com/epam/cme/mdp3/sbe/message/meta/MetadataContainerBuilder.java +++ b/core/src/main/java/com/epam/cme/mdp3/sbe/message/meta/MetadataContainerBuilder.java @@ -45,7 +45,7 @@ public static MetadataContainer build(final MdpMessageType messageType) { fieldContainer.addFieldType(new SbeFieldType(fieldContainer, fieldType)); } container.addGroupType(new SbeGroupType(fieldContainer, groupType, - findDimenstionType(messageType, groupType.getDimensionType()))); + findDimensionType(messageType, groupType.getDimensionType()))); } return container; } @@ -83,7 +83,7 @@ private static MetadataContainer allocate(final MessageSchema schema, final int * @param dimTypeName name of Dimension Type * @return Definition of Dimension Type */ - private static CompositeDataType findDimenstionType(final MdpMessageType messageType, final String dimTypeName) { + private static CompositeDataType findDimensionType(final MdpMessageType messageType, final String dimTypeName) { for (final CompositeDataType compositeDataType : messageType.getSchema().getTypes().get(0).getComposite()) { if (compositeDataType.getName().equals(dimTypeName)) { return compositeDataType; diff --git a/src/main/java/com/epam/cme/mdp3/sbe/message/meta/SbeFieldType.java b/core/src/main/java/com/epam/cme/mdp3/sbe/message/meta/SbeFieldType.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/message/meta/SbeFieldType.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/message/meta/SbeFieldType.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/message/meta/SbeGroupType.java b/core/src/main/java/com/epam/cme/mdp3/sbe/message/meta/SbeGroupType.java similarity index 85% rename from src/main/java/com/epam/cme/mdp3/sbe/message/meta/SbeGroupType.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/message/meta/SbeGroupType.java index 825b626..789a0d4 100644 --- a/src/main/java/com/epam/cme/mdp3/sbe/message/meta/SbeGroupType.java +++ b/core/src/main/java/com/epam/cme/mdp3/sbe/message/meta/SbeGroupType.java @@ -44,9 +44,14 @@ public int getDimensionBlockLength() { public void calcDimensionBlockFields() { final EncodedDataType blockLength = this.dimensionType.getType().get(0); - this.numInGroupOffset = SbePrimitiveType.fromString(blockLength.getPrimitiveType()).getSize(); final EncodedDataType numInGroup = this.dimensionType.getType().get(1); - this.dimensionBlockLength = this.numInGroupOffset + SbePrimitiveType.fromString(numInGroup.getPrimitiveType()).getSize(); + int offset = numInGroup.getOffset(); + if(offset > 0) { + numInGroupOffset = offset; + } else { + numInGroupOffset = SbePrimitiveType.fromString(blockLength.getPrimitiveType()).getSize(); + } + dimensionBlockLength = numInGroupOffset + SbePrimitiveType.fromString(numInGroup.getPrimitiveType()).getSize(); } public MetadataContainer getMetadataContainer() { diff --git a/src/main/java/com/epam/cme/mdp3/sbe/message/meta/SbePrimitiveType.java b/core/src/main/java/com/epam/cme/mdp3/sbe/message/meta/SbePrimitiveType.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/message/meta/SbePrimitiveType.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/message/meta/SbePrimitiveType.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/schema/MdpMessageTypeBuildException.java b/core/src/main/java/com/epam/cme/mdp3/sbe/schema/MdpMessageTypeBuildException.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/schema/MdpMessageTypeBuildException.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/schema/MdpMessageTypeBuildException.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/schema/MdpMessageTypes.java b/core/src/main/java/com/epam/cme/mdp3/sbe/schema/MdpMessageTypes.java similarity index 95% rename from src/main/java/com/epam/cme/mdp3/sbe/schema/MdpMessageTypes.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/schema/MdpMessageTypes.java index 49a2789..5bc0afd 100644 --- a/src/main/java/com/epam/cme/mdp3/sbe/schema/MdpMessageTypes.java +++ b/core/src/main/java/com/epam/cme/mdp3/sbe/schema/MdpMessageTypes.java @@ -13,7 +13,7 @@ package com.epam.cme.mdp3.sbe.schema; import com.epam.cme.mdp3.SemanticMsgType; -import com.epam.cme.mdp3.mktdata.MdConstants; +import com.epam.cme.mdp3.MdConstants; import com.epam.cme.mdp3.sbe.message.meta.MdpMessageType; import com.epam.cme.mdp3.sbe.schema.vo.GroupType; import com.epam.cme.mdp3.sbe.schema.vo.MessageSchema; @@ -87,7 +87,7 @@ private int extractIncrBodyLen(final MdpMessageType messageType) { final SemanticMsgType semanticMsgType = SemanticMsgType.fromFixValue(messageType.getMessageType().getSemanticType()); if (semanticMsgType == SemanticMsgType.MarketDataIncrementalRefresh) { for (final GroupType groupType : messageType.getMessageType().getGroup()) { - if (groupType.getId() == MdConstants.INCR_RFRSH_GRP_TAG && groupType.getBlockLength().intValue() > maxFoundIncrBodyLen) { + if (groupType.getId() == MdConstants.NO_MD_ENTRIES && groupType.getBlockLength().intValue() > maxFoundIncrBodyLen) { maxFoundIncrBodyLen = groupType.getBlockLength().intValue(); } } diff --git a/src/main/java/com/epam/cme/mdp3/sbe/schema/MessageSchemaUnmarshaller.java b/core/src/main/java/com/epam/cme/mdp3/sbe/schema/MessageSchemaUnmarshaller.java similarity index 98% rename from src/main/java/com/epam/cme/mdp3/sbe/schema/MessageSchemaUnmarshaller.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/schema/MessageSchemaUnmarshaller.java index 6ec4e36..93c3864 100644 --- a/src/main/java/com/epam/cme/mdp3/sbe/schema/MessageSchemaUnmarshaller.java +++ b/core/src/main/java/com/epam/cme/mdp3/sbe/schema/MessageSchemaUnmarshaller.java @@ -20,7 +20,6 @@ import javax.xml.bind.JAXBContext; import javax.xml.bind.Unmarshaller; import javax.xml.transform.sax.SAXSource; -import java.io.FileInputStream; import java.io.InputStream; import java.io.InputStreamReader; import java.net.URI; diff --git a/src/main/java/com/epam/cme/mdp3/sbe/schema/NamespaceFilter.java b/core/src/main/java/com/epam/cme/mdp3/sbe/schema/NamespaceFilter.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/schema/NamespaceFilter.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/schema/NamespaceFilter.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/schema/SchemaUnmarshallingException.java b/core/src/main/java/com/epam/cme/mdp3/sbe/schema/SchemaUnmarshallingException.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/schema/SchemaUnmarshallingException.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/schema/SchemaUnmarshallingException.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/Choice.java b/core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/Choice.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/schema/vo/Choice.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/Choice.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/CompositeDataType.java b/core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/CompositeDataType.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/schema/vo/CompositeDataType.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/CompositeDataType.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/EncodedDataType.java b/core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/EncodedDataType.java similarity index 98% rename from src/main/java/com/epam/cme/mdp3/sbe/schema/vo/EncodedDataType.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/EncodedDataType.java index 8ff2e78..d42be1e 100644 --- a/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/EncodedDataType.java +++ b/core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/EncodedDataType.java @@ -107,6 +107,8 @@ public class EncodedDataType { @XmlAttribute(name = "primitiveType", required = true) @XmlJavaTypeAdapter(CollapsedStringAdapter.class) protected String primitiveType; + @XmlAttribute(name = "offset") + protected int offset; /** * Gets the value of the value property. @@ -340,4 +342,11 @@ public void setPrimitiveType(String value) { this.primitiveType = value; } + public int getOffset() { + return offset; + } + + public void setOffset(int offset) { + this.offset = offset; + } } diff --git a/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/EnumType.java b/core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/EnumType.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/schema/vo/EnumType.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/EnumType.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/FieldType.java b/core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/FieldType.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/schema/vo/FieldType.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/FieldType.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/GroupType.java b/core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/GroupType.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/schema/vo/GroupType.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/GroupType.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/MessageSchema.java b/core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/MessageSchema.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/schema/vo/MessageSchema.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/MessageSchema.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/MessageType.java b/core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/MessageType.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/schema/vo/MessageType.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/MessageType.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/ObjectFactory.java b/core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/ObjectFactory.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/schema/vo/ObjectFactory.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/ObjectFactory.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/SetType.java b/core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/SetType.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/schema/vo/SetType.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/SetType.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/ValidValue.java b/core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/ValidValue.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/schema/vo/ValidValue.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/ValidValue.java diff --git a/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/package-info.java b/core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/package-info.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/sbe/schema/vo/package-info.java rename to core/src/main/java/com/epam/cme/mdp3/sbe/schema/vo/package-info.java diff --git a/src/main/java/com/epam/cme/mdp3/service/DefaultScheduledServiceHolder.java b/core/src/main/java/com/epam/cme/mdp3/service/DefaultScheduledServiceHolder.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/service/DefaultScheduledServiceHolder.java rename to core/src/main/java/com/epam/cme/mdp3/service/DefaultScheduledServiceHolder.java diff --git a/dist/version-history.txt b/dist/version-history.txt index 9f2f23e..fb562ab 100644 --- a/dist/version-history.txt +++ b/dist/version-history.txt @@ -1,3 +1,7 @@ +2.0.0 (10/07/2017) +NEW MBO support has been added. +NEW Gap detecting logic has been refactored and changed to handle packets level. + 1.0.0 (11/03/2016) NEW Migration to Chronicle Bytes in internal implementation. diff --git a/gradlew b/gradlew old mode 100644 new mode 100755 diff --git a/mbp-only/build.gradle b/mbp-only/build.gradle new file mode 100644 index 0000000..db6cedc --- /dev/null +++ b/mbp-only/build.gradle @@ -0,0 +1,44 @@ +plugins { + id "java" + id "maven" + id "java-library-distribution" + id "com.github.samueltbrown.cucumber" version "0.9" + id "org.sonarqube" version "2.0.1" + id "me.champeau.gradle.jmh" version "0.3.1" +} +group = 'com.epam.cme' +version = '1.0' +sourceCompatibility = 1.8 +targetCompatibility = 1.8 + +repositories { + mavenCentral() +} + +jar { + baseName 'b2bits-jmdp3' +} + +dependencies { + compile project(':core') + compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.5' + compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.5' + compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.0' + runtime group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.5' + compile group: 'net.openhft', name: 'koloboke-api-jdk8', version: '0.6.8' + runtime group: 'net.openhft', name: 'koloboke-impl-jdk8', version: '0.6.8' + compile group: 'net.openhft', name: 'chronicle-core', version: '1.7.6' + testCompile group: 'junit', name: 'junit', version: '4.12' + testCompile group: 'uk.co.real-logic', name: 'sbe-tool', version: '1.6.0' + cucumberCompile 'info.cukes:cucumber-java:1.2.4' + cucumberCompile 'info.cukes:cucumber-picocontainer:1.2.4' +} + +distributions { + main { + baseName = 'b2bits-jmdp3' + contents { + from { '../dist' } + } + } +} diff --git a/src/cucumber/java/com/epam/cme/mdp3/test/def/IncrementalFeedSteps.java b/mbp-only/src/cucumber/java/com/epam/cme/mdp3/test/def/IncrementalFeedSteps.java similarity index 100% rename from src/cucumber/java/com/epam/cme/mdp3/test/def/IncrementalFeedSteps.java rename to mbp-only/src/cucumber/java/com/epam/cme/mdp3/test/def/IncrementalFeedSteps.java diff --git a/src/cucumber/java/com/epam/cme/mdp3/test/def/InstrumentFeedSteps.java b/mbp-only/src/cucumber/java/com/epam/cme/mdp3/test/def/InstrumentFeedSteps.java similarity index 100% rename from src/cucumber/java/com/epam/cme/mdp3/test/def/InstrumentFeedSteps.java rename to mbp-only/src/cucumber/java/com/epam/cme/mdp3/test/def/InstrumentFeedSteps.java diff --git a/src/cucumber/java/com/epam/cme/mdp3/test/def/MdpFeedSimHelper.java b/mbp-only/src/cucumber/java/com/epam/cme/mdp3/test/def/MdpFeedSimHelper.java similarity index 100% rename from src/cucumber/java/com/epam/cme/mdp3/test/def/MdpFeedSimHelper.java rename to mbp-only/src/cucumber/java/com/epam/cme/mdp3/test/def/MdpFeedSimHelper.java diff --git a/src/cucumber/java/com/epam/cme/mdp3/test/def/MdpHandlerHolder.java b/mbp-only/src/cucumber/java/com/epam/cme/mdp3/test/def/MdpHandlerHolder.java similarity index 100% rename from src/cucumber/java/com/epam/cme/mdp3/test/def/MdpHandlerHolder.java rename to mbp-only/src/cucumber/java/com/epam/cme/mdp3/test/def/MdpHandlerHolder.java diff --git a/src/cucumber/java/com/epam/cme/mdp3/test/def/MdpSimulatorHooks.java b/mbp-only/src/cucumber/java/com/epam/cme/mdp3/test/def/MdpSimulatorHooks.java similarity index 100% rename from src/cucumber/java/com/epam/cme/mdp3/test/def/MdpSimulatorHooks.java rename to mbp-only/src/cucumber/java/com/epam/cme/mdp3/test/def/MdpSimulatorHooks.java diff --git a/src/cucumber/java/com/epam/cme/mdp3/test/def/SecurityRefreshSteps.java b/mbp-only/src/cucumber/java/com/epam/cme/mdp3/test/def/SecurityRefreshSteps.java similarity index 100% rename from src/cucumber/java/com/epam/cme/mdp3/test/def/SecurityRefreshSteps.java rename to mbp-only/src/cucumber/java/com/epam/cme/mdp3/test/def/SecurityRefreshSteps.java diff --git a/src/cucumber/java/com/epam/cme/mdp3/test/def/SnapshotFeedSteps.java b/mbp-only/src/cucumber/java/com/epam/cme/mdp3/test/def/SnapshotFeedSteps.java similarity index 100% rename from src/cucumber/java/com/epam/cme/mdp3/test/def/SnapshotFeedSteps.java rename to mbp-only/src/cucumber/java/com/epam/cme/mdp3/test/def/SnapshotFeedSteps.java diff --git a/src/cucumber/java/com/epam/cme/mdp3/test/def/SyncSteps.java b/mbp-only/src/cucumber/java/com/epam/cme/mdp3/test/def/SyncSteps.java similarity index 100% rename from src/cucumber/java/com/epam/cme/mdp3/test/def/SyncSteps.java rename to mbp-only/src/cucumber/java/com/epam/cme/mdp3/test/def/SyncSteps.java diff --git a/src/cucumber/resources/incr_feed.feature b/mbp-only/src/cucumber/resources/incr_feed.feature similarity index 100% rename from src/cucumber/resources/incr_feed.feature rename to mbp-only/src/cucumber/resources/incr_feed.feature diff --git a/src/cucumber/resources/inst_feed.feature b/mbp-only/src/cucumber/resources/inst_feed.feature similarity index 100% rename from src/cucumber/resources/inst_feed.feature rename to mbp-only/src/cucumber/resources/inst_feed.feature diff --git a/src/cucumber/resources/sec_refresh.feature b/mbp-only/src/cucumber/resources/sec_refresh.feature similarity index 100% rename from src/cucumber/resources/sec_refresh.feature rename to mbp-only/src/cucumber/resources/sec_refresh.feature diff --git a/src/cucumber/resources/snpt_feed.feature b/mbp-only/src/cucumber/resources/snpt_feed.feature similarity index 100% rename from src/cucumber/resources/snpt_feed.feature rename to mbp-only/src/cucumber/resources/snpt_feed.feature diff --git a/src/cucumber/resources/sync.feature b/mbp-only/src/cucumber/resources/sync.feature similarity index 100% rename from src/cucumber/resources/sync.feature rename to mbp-only/src/cucumber/resources/sync.feature diff --git a/src/cucumber/sim/data/incr/311_AX_224.0.31.2_17511.zip b/mbp-only/src/cucumber/sim/data/incr/311_AX_224.0.31.2_17511.zip similarity index 100% rename from src/cucumber/sim/data/incr/311_AX_224.0.31.2_17511.zip rename to mbp-only/src/cucumber/sim/data/incr/311_AX_224.0.31.2_17511.zip diff --git a/src/cucumber/sim/data/inst/311_AD_224.0.31.44_14311.zip b/mbp-only/src/cucumber/sim/data/inst/311_AD_224.0.31.44_14311.zip similarity index 100% rename from src/cucumber/sim/data/inst/311_AD_224.0.31.44_14311.zip rename to mbp-only/src/cucumber/sim/data/inst/311_AD_224.0.31.44_14311.zip diff --git a/src/cucumber/sim/data/snpt/311_AW_224.0.31.23_14411.zip b/mbp-only/src/cucumber/sim/data/snpt/311_AW_224.0.31.23_14411.zip similarity index 100% rename from src/cucumber/sim/data/snpt/311_AW_224.0.31.23_14411.zip rename to mbp-only/src/cucumber/sim/data/snpt/311_AW_224.0.31.23_14411.zip diff --git a/src/jmh/java/com/epam/cme/mdp3/test/perf/IncrementalRefreshPerfTest.java b/mbp-only/src/jmh/java/com/epam/cme/mdp3/test/perf/IncrementalRefreshPerfTest.java similarity index 98% rename from src/jmh/java/com/epam/cme/mdp3/test/perf/IncrementalRefreshPerfTest.java rename to mbp-only/src/jmh/java/com/epam/cme/mdp3/test/perf/IncrementalRefreshPerfTest.java index b10e373..efb3873 100644 --- a/src/jmh/java/com/epam/cme/mdp3/test/perf/IncrementalRefreshPerfTest.java +++ b/mbp-only/src/jmh/java/com/epam/cme/mdp3/test/perf/IncrementalRefreshPerfTest.java @@ -89,7 +89,7 @@ private static void printPacket(final MdpPacket mdpPacket) { final MdpMessageType messageType = mdpHandlerBuilder.getMdpMessageTypes().getMessageType(mdpMessage.getSchemaId()); mdpMessage.setMessageType(messageType); - if (mdpMessage.getGroup(MdConstants.INCR_RFRSH_GRP_TAG, incrGroup)) { + if (mdpMessage.getGroup(MdConstants.NO_MD_ENTRIES, incrGroup)) { while (incrGroup.hashNext()) { incrGroup.next(); final int secId = incrGroup.getInt32(MdConstants.SECURITY_ID); @@ -177,7 +177,7 @@ private MdpPacket findSample(final byte[] testData, final int incrGroupSizeMin, final MdpMessageType messageType = mdpHandlerBuilder.getMdpMessageTypes().getMessageType(mdpMessage.getSchemaId()); mdpMessage.setMessageType(messageType); - if (mdpMessage.getGroup(MdConstants.INCR_RFRSH_GRP_TAG, incrGroup)) { + if (mdpMessage.getGroup(MdConstants.NO_MD_ENTRIES, incrGroup)) { while (incrGroup.hashNext()) { incrGroup.next(); final MDEntryType mdEntryType = MDEntryType.fromFIX(incrGroup.getChar(INCR_RFRSH_MD_ENTRY_TYPE)); @@ -221,7 +221,7 @@ private Set generateTestPackets(final MdpPacket samplePckt, final int t final MdpMessageType messageType = mdpHandlerBuilder.getMdpMessageTypes().getMessageType(mdpMessage.getSchemaId()); mdpMessage.setMessageType(messageType); - if (mdpMessage.getGroup(MdConstants.INCR_RFRSH_GRP_TAG, incrGroup)) { + if (mdpMessage.getGroup(MdConstants.NO_MD_ENTRIES, incrGroup)) { while (incrGroup.hashNext()) { incrGroup.next(); final int secId = incrGroup.getInt32(MdConstants.SECURITY_ID); diff --git a/src/main/java/com/epam/cme/mdp3/ChannelListener.java b/mbp-only/src/main/java/com/epam/cme/mdp3/ChannelListener.java similarity index 99% rename from src/main/java/com/epam/cme/mdp3/ChannelListener.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/ChannelListener.java index 7308730..cc79d59 100644 --- a/src/main/java/com/epam/cme/mdp3/ChannelListener.java +++ b/mbp-only/src/main/java/com/epam/cme/mdp3/ChannelListener.java @@ -73,7 +73,7 @@ public interface ChannelListener { * * @param channelId ID of MDP Channel * @param securityId Security ID - * @param secDesc Security description + * @param secDesc Security description * @param prevState Previous state * @param newState New state */ diff --git a/src/main/java/com/epam/cme/mdp3/MarketDataListener.java b/mbp-only/src/main/java/com/epam/cme/mdp3/MarketDataListener.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/MarketDataListener.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/MarketDataListener.java diff --git a/src/main/java/com/epam/cme/mdp3/MdpChannel.java b/mbp-only/src/main/java/com/epam/cme/mdp3/MdpChannel.java similarity index 98% rename from src/main/java/com/epam/cme/mdp3/MdpChannel.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/MdpChannel.java index 7d49762..bc2aec9 100644 --- a/src/main/java/com/epam/cme/mdp3/MdpChannel.java +++ b/mbp-only/src/main/java/com/epam/cme/mdp3/MdpChannel.java @@ -105,7 +105,7 @@ public interface MdpChannel { /** * Registers Market Data Listener. * - * @param mdListener Instance of Security Status Listener + * @param mdListener Instance of Market Data Listener * @see MarketDataListener */ void registerMarketDataListener(MarketDataListener mdListener); @@ -113,7 +113,7 @@ public interface MdpChannel { /** * Removes Market Data Listener. * - * @param mdListener Instance of Security Status Listener + * @param mdListener Instance of Market Data Listener * @see MarketDataListener */ void removeMarketDataListener(MarketDataListener mdListener); diff --git a/src/main/java/com/epam/cme/mdp3/VoidChannelListener.java b/mbp-only/src/main/java/com/epam/cme/mdp3/VoidChannelListener.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/VoidChannelListener.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/VoidChannelListener.java diff --git a/src/main/java/com/epam/cme/mdp3/core/channel/ChannelContext.java b/mbp-only/src/main/java/com/epam/cme/mdp3/core/channel/ChannelContext.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/core/channel/ChannelContext.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/core/channel/ChannelContext.java diff --git a/src/main/java/com/epam/cme/mdp3/core/channel/ChannelInstruments.java b/mbp-only/src/main/java/com/epam/cme/mdp3/core/channel/ChannelInstruments.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/core/channel/ChannelInstruments.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/core/channel/ChannelInstruments.java diff --git a/src/main/java/com/epam/cme/mdp3/core/channel/MdpChannelBuilder.java b/mbp-only/src/main/java/com/epam/cme/mdp3/core/channel/MdpChannelBuilder.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/core/channel/MdpChannelBuilder.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/core/channel/MdpChannelBuilder.java diff --git a/src/main/java/com/epam/cme/mdp3/core/channel/MdpChannelImpl.java b/mbp-only/src/main/java/com/epam/cme/mdp3/core/channel/MdpChannelImpl.java similarity index 99% rename from src/main/java/com/epam/cme/mdp3/core/channel/MdpChannelImpl.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/core/channel/MdpChannelImpl.java index bf65d50..cd43684 100644 --- a/src/main/java/com/epam/cme/mdp3/core/channel/MdpChannelImpl.java +++ b/mbp-only/src/main/java/com/epam/cme/mdp3/core/channel/MdpChannelImpl.java @@ -492,11 +492,11 @@ void subscribeToSnapshotsForInstrument(final Integer securityId) { void unsubscribeFromSnapshotsForInstrument(final Integer securityId) { if (channelController.removeOutOfSyncInstrument(securityId)) { - if (isSnapshotFeedsActive()) { - if (!channelController.hasOutOfSyncInstruments()) { - stopSnapshotFeeds(); - } - } + if (isSnapshotFeedsActive()) { + if (!channelController.hasOutOfSyncInstruments()) { + stopSnapshotFeeds(); + } + } } } diff --git a/src/main/java/com/epam/cme/mdp3/core/control/ChannelController.java b/mbp-only/src/main/java/com/epam/cme/mdp3/core/control/ChannelController.java similarity index 94% rename from src/main/java/com/epam/cme/mdp3/core/control/ChannelController.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/core/control/ChannelController.java index f3eb26c..f34c65d 100644 --- a/src/main/java/com/epam/cme/mdp3/core/control/ChannelController.java +++ b/mbp-only/src/main/java/com/epam/cme/mdp3/core/control/ChannelController.java @@ -33,6 +33,7 @@ import java.util.concurrent.locks.ReentrantLock; import static com.epam.cme.mdp3.mktdata.MdConstants.INCR_RFRSH_MD_ENTRY_TYPE; +import static com.epam.cme.mdp3.mktdata.MdConstants.LAST_MSG_SEQ_NUM_PROCESSED; public class ChannelController { private static final Logger logger = LoggerFactory.getLogger(ChannelController.class); @@ -106,7 +107,7 @@ public void handleIncrementalPacket(final MdpFeedContext feedContext, final MdpP public void handleIncrementalPacket(final MdpFeedContext feedContext, final MdpPacket mdpPacket, final boolean fromQueue) { final long msgSeqNum = mdpPacket.getMsgSeqNum(); logger.trace("Feed {}{} | handleIncrementalPacket: this.prcdSeqNum={}, mdpPacket.getMsgSeqNum()={}", - feedContext.getFeedType(), feedContext.getFeed(), this.prcdSeqNum, msgSeqNum); + feedContext.getFeedType(), feedContext.getFeed(), this.prcdSeqNum, msgSeqNum); lock.lock(); try { this.lastIncrPcktReceived = System.currentTimeMillis(); @@ -132,7 +133,7 @@ private void updateSecurityFromIncrementalRefresh(final MdpFeedContext feedConte private void handleMarketDataIncrementalRefresh(final MdpFeedContext feedContext, final MdpMessage mdpMessage, final long msgSeqNum, final short matchEventIndicator) { final MdpGroup incrGroup = feedContext.getMdpGroupObj(); InstrumentController instController = null; - mdpMessage.getGroup(MdConstants.INCR_RFRSH_GRP_TAG, incrGroup); + mdpMessage.getGroup(MdConstants.NO_MD_ENTRIES, incrGroup); while (incrGroup.hashNext()) { incrGroup.next(); final MDEntryType mdEntryType = MDEntryType.fromFIX(incrGroup.getChar(INCR_RFRSH_MD_ENTRY_TYPE)); @@ -183,6 +184,8 @@ private void handleIncrementalMessages(final MdpFeedContext feedContext, final l } } else if (messageType.getSemanticMsgType() == SemanticMsgType.SecurityDefinition) { this.channelContext.getInstruments().onMessage(feedContext, mdpMessage); + } else { + logger.trace("Message has been ignored due to its SemanticMsgType '{}'", messageType.getSemanticMsgType()); } } if (this.wasChannelResetInPrcdPacket) { @@ -202,10 +205,10 @@ private void stopSnapshotListening(final MdpFeedContext feedContext) { } private void handleSnapshotMessage(final MdpFeedContext feedContext, final long snptPktSeqNum, final MdpMessage mdpMessage) { - final long lastMsgSeqNumProcessed = mdpMessage.getUInt32(369); - logger.trace("Feed {}{} | handleSnapshotMessage: this.prcdSeqNum={}, this.lastMsgSeqNumPrcd369={}, mdpMessage.getUInt32(369)={}", - feedContext.getFeedType(), feedContext.getFeed(), this.prcdSeqNum, this.lastMsgSeqNumPrcd369, lastMsgSeqNumProcessed); - if (snptPktSeqNum == 1 && canStopSnapshotListening(this.snptMsgCountDown)) { + final long lastMsgSeqNumProcessed = mdpMessage.getUInt32(LAST_MSG_SEQ_NUM_PROCESSED); + logger.trace("Feed {}:{} | handleSnapshotMessage: processedSeqNum={}, lastMsgSeqNumPrcd369={}, mdpMessage.getUInt32(369)={}", + feedContext.getFeedType(), feedContext.getFeed(), prcdSeqNum, lastMsgSeqNumPrcd369, lastMsgSeqNumProcessed); + if (snptPktSeqNum == 1 && canStopSnapshotListening(snptMsgCountDown)) { stopSnapshotListening(feedContext); return; } diff --git a/src/main/java/com/epam/cme/mdp3/core/control/EventCommitFunction.java b/mbp-only/src/main/java/com/epam/cme/mdp3/core/control/EventCommitFunction.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/core/control/EventCommitFunction.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/core/control/EventCommitFunction.java diff --git a/src/main/java/com/epam/cme/mdp3/core/control/EventController.java b/mbp-only/src/main/java/com/epam/cme/mdp3/core/control/EventController.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/core/control/EventController.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/core/control/EventController.java diff --git a/src/main/java/com/epam/cme/mdp3/core/control/InMemoryEventController.java b/mbp-only/src/main/java/com/epam/cme/mdp3/core/control/InMemoryEventController.java similarity index 94% rename from src/main/java/com/epam/cme/mdp3/core/control/InMemoryEventController.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/core/control/InMemoryEventController.java index 7d27a02..77ffce7 100644 --- a/src/main/java/com/epam/cme/mdp3/core/control/InMemoryEventController.java +++ b/mbp-only/src/main/java/com/epam/cme/mdp3/core/control/InMemoryEventController.java @@ -12,6 +12,10 @@ package com.epam.cme.mdp3.core.control; +/** + * This class keeps the securities in the in-memory array. + * The array is created with initial capacity and increased in case of overflow. + */ public class InMemoryEventController implements EventController { private final static int INITIAL_LOG_SIZE = 64; private final static int INCREMENT_LOG_SIZE = 32; diff --git a/src/main/java/com/epam/cme/mdp3/core/control/IncrementalRefreshHolder.java b/mbp-only/src/main/java/com/epam/cme/mdp3/core/control/IncrementalRefreshHolder.java similarity index 95% rename from src/main/java/com/epam/cme/mdp3/core/control/IncrementalRefreshHolder.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/core/control/IncrementalRefreshHolder.java index c184780..3560425 100644 --- a/src/main/java/com/epam/cme/mdp3/core/control/IncrementalRefreshHolder.java +++ b/mbp-only/src/main/java/com/epam/cme/mdp3/core/control/IncrementalRefreshHolder.java @@ -50,7 +50,9 @@ public boolean put(final IncrementalRefreshQueueEntry queueEntry, final long rpt this.sbeGroupType = incrEntry.getSbeGroupType(); return true; } else { - logger.trace("Incremental Refresh Entry #{} data was not stored because too old", rptSeqNum); + if(logger.isTraceEnabled()) { + logger.trace("Incremental Refresh Entry #{} data was not stored because too old", rptSeqNum); + } return false; } } diff --git a/src/main/java/com/epam/cme/mdp3/core/control/IncrementalRefreshQueue.java b/mbp-only/src/main/java/com/epam/cme/mdp3/core/control/IncrementalRefreshQueue.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/core/control/IncrementalRefreshQueue.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/core/control/IncrementalRefreshQueue.java diff --git a/src/main/java/com/epam/cme/mdp3/core/control/InstrumentController.java b/mbp-only/src/main/java/com/epam/cme/mdp3/core/control/InstrumentController.java similarity index 72% rename from src/main/java/com/epam/cme/mdp3/core/control/InstrumentController.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/core/control/InstrumentController.java index af94c43..bee9e15 100644 --- a/src/main/java/com/epam/cme/mdp3/core/control/InstrumentController.java +++ b/mbp-only/src/main/java/com/epam/cme/mdp3/core/control/InstrumentController.java @@ -12,7 +12,10 @@ package com.epam.cme.mdp3.core.control; -import com.epam.cme.mdp3.*; +import com.epam.cme.mdp3.FieldSet; +import com.epam.cme.mdp3.MdEventFlags; +import com.epam.cme.mdp3.MdpGroupEntry; +import com.epam.cme.mdp3.MdpMessage; import com.epam.cme.mdp3.core.channel.ChannelContext; import com.epam.cme.mdp3.core.channel.MdpFeedContext; import com.epam.cme.mdp3.sbe.message.SbeGroupEntry; @@ -29,11 +32,11 @@ public class InstrumentController { private static final Logger logger = LoggerFactory.getLogger(InstrumentController.class); - private final Integer securityId; + private final int securityId; private String secDesc; private final ChannelContext channelContext; private InstrumentState state = InstrumentState.INITIAL; - private long prcdRptSeqNum = 0; + private long processedRptSeqNum = 0; private final InstrumentMdHandler mdHandler; private int gapThreshold = DEF_GAP_THRESHOLD; private final IncrementalRefreshQueue incrRefreshQueue; @@ -79,7 +82,7 @@ public void setSecDesc(String secDesc) { public void discontinue() { switchState(this.state, InstrumentState.DISCONTINUED); this.mdHandler.setSubscriptionFlags(MdEventFlags.NOTHING); - this.prcdRptSeqNum = 0; + this.processedRptSeqNum = 0; resetMdHandlers(); } @@ -97,7 +100,7 @@ public boolean onResubscribe(final int subscriptionFlags) { } public void onChannelReset() { - this.prcdRptSeqNum = 0; + this.processedRptSeqNum = 0; this.incrRefreshQueue.clear(); if (this.state != InstrumentState.DISCONTINUED) { switchState(state, InstrumentState.SYNC); @@ -112,12 +115,12 @@ private void handleSnapshotFullRefreshEntries(final MdpFeedContext feedContext, private boolean handleSecurityRefreshInQueue(final IncrementalRefreshQueueEntry incrQueueEntry) { final long rptSeqNum = incrQueueEntry.groupEntry.getUInt32(RPT_SEQ_NUM); - final long expectedRptSeqNum = this.prcdRptSeqNum + 1; + final long expectedRptSeqNum = this.processedRptSeqNum + 1; final short matchEventIndicator = incrQueueEntry.matchEventIndicator; final MdpGroupEntry incrGroupEntry = incrQueueEntry.groupEntry; if (rptSeqNum == expectedRptSeqNum) { - this.prcdRptSeqNum = rptSeqNum; + this.processedRptSeqNum = rptSeqNum; channelContext.notifyIncrementalRefreshListeners( matchEventIndicator, this.securityId, this.secDesc, incrQueueEntry.incrPcktSeqNum, incrGroupEntry); mdHandler.handleIncrementalRefreshEntry(incrQueueEntry.groupEntry); @@ -130,16 +133,18 @@ private boolean handleSecurityRefreshInQueue(final IncrementalRefreshQueueEntry } private void handleIncrementalQueue(final MdpFeedContext feedContext, final long prcdSeqNum) { - logger.debug("Feed {}{} | handleIncrementalQueue: after {}", - feedContext.getFeedType(), feedContext.getFeed(), prcdSeqNum); - + if(logger.isDebugEnabled()) { + logger.debug("Feed {}:{} | handleIncrementalQueue: after {}", + feedContext.getFeedType(), feedContext.getFeed(), prcdSeqNum); + } final IncrementalRefreshQueue queue = this.incrRefreshQueue; for (long i = prcdSeqNum + 1; i <= queue.getLastRptSeqNum(); i++) { if (queue.poll(i, this.incrQueueEntry) > 0) { - logger.trace("Feed {}{} | Process incremental entry #{} from queue", - feedContext.getFeedType(), feedContext.getFeed(), i); - + if(logger.isTraceEnabled()) { + logger.trace("Feed {}:{} | Process incremental entry #{} from queue", + feedContext.getFeedType(), feedContext.getFeed(), i); + } if (!handleSecurityRefreshInQueue(this.incrQueueEntry)) { return; } @@ -173,7 +178,6 @@ private void pushIncrementalRefreshEntryInQueue(final long msgSeqNum, final shor this.incrQueueEntry.incrPcktSeqNum = msgSeqNum; this.incrQueueEntry.matchEventIndicator = matchEventIndicator; this.incrQueueEntry.groupEntry = incrRefreshEntry; - this.incrRefreshQueue.push(rptSeqNum, this.incrQueueEntry); } @@ -181,43 +185,47 @@ void commitEvent() { mdHandler.commitEvent(); } - public Integer getSecurityId() { + public int getSecurityId() { return securityId; } void onSnapshotFullRefresh(final MdpFeedContext feedContext, final MdpMessage fullRefreshMsg) { - final InstrumentState currentState = this.state; - final long snptSeqNum = fullRefreshMsg.getUInt32(RPT_SEQ_NUM); - if (currentState == InstrumentState.INITIAL) { - /*logger.debug("Feed {}{} | #{} | Instrument: '{}'. State: {}. Got initial Snapshot. Initial prcdSeqNum is {}", - feedContext.getFeedType(), feedContext.getFeed(), snptSeqNum, this.getSecurityId(), this.state, snptSeqNum + 1);*/ - this.prcdRptSeqNum = snptSeqNum; - switchState(currentState, InstrumentState.SYNC); - handleSnapshotFullRefreshEntries(feedContext, fullRefreshMsg); - handleIncrementalQueue(feedContext, snptSeqNum); - /*logger.info("Feed {}{} | Instrument: '{}-({})'. Got initial Snapshot. Initial prcdSeqNum: {}. Last rptSeqNum in queue: {}", - feedContext.getFeedType(), feedContext.getFeed(), this.getSecurityId(), this.secDesc, - snptSeqNum, this.incrRefreshQueue.getLastRptSeqNum());*/ - } else if (currentState == InstrumentState.OUTOFSYNC) { - if (snptSeqNum > this.prcdRptSeqNum) { - /*logger.trace("Feed {}{} | #{} | Instrument: '{}'. State: {}. Got Snapshot to restore. Fast forward from {} to {}", - feedContext.getFeedType(), feedContext.getFeed(), snptSeqNum, this.getSecurityId(), this.state, this.prcdRptSeqNum, snptSeqNum + 1);*/ - this.prcdRptSeqNum = snptSeqNum; - this.mdHandler.reset(); + if (fullRefreshMsg.hasField(RPT_SEQ_NUM)) { + final InstrumentState currentState = this.state; + final long snptSeqNum = fullRefreshMsg.getUInt32(RPT_SEQ_NUM); + if (currentState == InstrumentState.INITIAL) { + /*logger.debug("Feed {}{} | #{} | Instrument: '{}'. State: {}. Got initial Snapshot. Initial prcdSeqNum is {}", + feedContext.getFeedType(), feedContext.getFeed(), snptSeqNum, this.getSecurityId(), this.state, snptSeqNum + 1);*/ + this.processedRptSeqNum = snptSeqNum; switchState(currentState, InstrumentState.SYNC); handleSnapshotFullRefreshEntries(feedContext, fullRefreshMsg); handleIncrementalQueue(feedContext, snptSeqNum); - /*logger.info("Feed {}{} | Instrument: '{}-({})'. Recovered from Snapshot. Snapshot prcdSeqNum: {}. Last rptSeqNum in queue: {}", + /*logger.info("Feed {}{} | Instrument: '{}-({})'. Got initial Snapshot. Initial prcdSeqNum: {}. Last rptSeqNum in queue: {}", feedContext.getFeedType(), feedContext.getFeed(), this.getSecurityId(), this.secDesc, snptSeqNum, this.incrRefreshQueue.getLastRptSeqNum());*/ + } else if (currentState == InstrumentState.OUTOFSYNC) { + if (snptSeqNum > this.processedRptSeqNum) { + /*logger.trace("Feed {}{} | #{} | Instrument: '{}'. State: {}. Got Snapshot to restore. Fast forward from {} to {}", + feedContext.getFeedType(), feedContext.getFeed(), snptSeqNum, this.getSecurityId(), this.state, this.processedRptSeqNum, snptSeqNum + 1);*/ + this.processedRptSeqNum = snptSeqNum; + this.mdHandler.reset(); + switchState(currentState, InstrumentState.SYNC); + handleSnapshotFullRefreshEntries(feedContext, fullRefreshMsg); + handleIncrementalQueue(feedContext, snptSeqNum); + /*logger.info("Feed {}{} | Instrument: '{}-({})'. Recovered from Snapshot. Snapshot prcdSeqNum: {}. Last rptSeqNum in queue: {}", + feedContext.getFeedType(), feedContext.getFeed(), this.getSecurityId(), this.secDesc, + snptSeqNum, this.incrRefreshQueue.getLastRptSeqNum());*/ + } + } else if (currentState == InstrumentState.SYNC && snptSeqNum > this.processedRptSeqNum) { + if(logger.isTraceEnabled()) { + logger.trace("Feed {}:{} | #{} | Instrument: '{}'. State: {}. Snapshot with high sequence comes faster then Increments. Fast forward from {} to {}", + feedContext.getFeedType(), feedContext.getFeed(), snptSeqNum, this.getSecurityId(), this.state, processedRptSeqNum, snptSeqNum + 1); + } + this.processedRptSeqNum = snptSeqNum; + this.mdHandler.reset(); + handleSnapshotFullRefreshEntries(feedContext, fullRefreshMsg); + handleIncrementalQueue(feedContext, snptSeqNum); } - } else if (currentState == InstrumentState.SYNC && snptSeqNum > this.prcdRptSeqNum) { - logger.trace("Feed {}{} | #{} | Instrument: '{}'. State: {}. Snapshot with high sequence comes faster then Increments. Fast forward from {} to {}", - feedContext.getFeedType(), feedContext.getFeed(), snptSeqNum, this.getSecurityId(), this.state, prcdRptSeqNum, snptSeqNum + 1); - this.prcdRptSeqNum = snptSeqNum; - this.mdHandler.reset(); - handleSnapshotFullRefreshEntries(feedContext, fullRefreshMsg); - handleIncrementalQueue(feedContext, snptSeqNum); } } @@ -225,12 +233,14 @@ void onIncrementalRefresh(final MdpFeedContext feedContext, final long msgSeqNum final InstrumentState currentState = this.state; if (incrRefreshEntry.hasField(RPT_SEQ_NUM)) { final long rptSeqNum = incrRefreshEntry.getUInt32(RPT_SEQ_NUM); - logger.debug("Feed {}{} | #{} | RPT#{} | SecurityId={}, state={}, prcd={}", - feedContext.getFeedType(), feedContext.getFeed(), msgSeqNum, rptSeqNum, this.getSecurityId(), this.state, this.prcdRptSeqNum); - final long expectedRptSeqNum = this.prcdRptSeqNum + 1; + if(logger.isDebugEnabled()) { + logger.debug("Feed {}:{} | #{} | RPT#{} | SecurityId={}, state={}, prcd={}", + feedContext.getFeedType(), feedContext.getFeed(), msgSeqNum, rptSeqNum, this.getSecurityId(), this.state, this.processedRptSeqNum); + } + final long expectedRptSeqNum = this.processedRptSeqNum + 1; if (currentState == InstrumentState.SYNC) { if (rptSeqNum == expectedRptSeqNum) { - this.prcdRptSeqNum = rptSeqNum; + this.processedRptSeqNum = rptSeqNum; handleIncrementalRefreshEntry(msgSeqNum, matchEventIndicator, incrRefreshEntry); handleIncrementalQueue(feedContext, rptSeqNum); } else if (rptSeqNum > expectedRptSeqNum) { @@ -238,16 +248,18 @@ void onIncrementalRefresh(final MdpFeedContext feedContext, final long msgSeqNum if (rptSeqNum > (expectedRptSeqNum + gapThreshold)) { /*logger.info("Feed {}{} | SecurityId={}-({}), Processed rptSeqNum:{}. Received:{}", feedContext.getFeedType(), feedContext.getFeed(), this.getSecurityId(), this.secDesc, - this.prcdRptSeqNum, rptSeqNum);*/ + this.processedRptSeqNum, rptSeqNum);*/ this.mdHandler.reset(); switchState(InstrumentState.SYNC, InstrumentState.OUTOFSYNC); } } } else if (currentState == InstrumentState.OUTOFSYNC) { if (rptSeqNum == expectedRptSeqNum) { - logger.trace("Feed {}{} | #{} | Instrument: '{}'. State: {}. Got expected increment to restore: #{}", - feedContext.getFeedType(), feedContext.getFeed(), msgSeqNum, this.getSecurityId(), this.state, expectedRptSeqNum); - this.prcdRptSeqNum = rptSeqNum; + if(logger.isTraceEnabled()) { + logger.trace("Feed {}{} | #{} | Instrument: '{}'. State: {}. Got expected increment to restore: #{}", + feedContext.getFeedType(), feedContext.getFeed(), msgSeqNum, this.getSecurityId(), this.state, expectedRptSeqNum); + } + this.processedRptSeqNum = rptSeqNum; switchState(currentState, InstrumentState.SYNC); handleIncrementalRefreshEntry(msgSeqNum, matchEventIndicator, incrRefreshEntry); handleIncrementalQueue(feedContext, rptSeqNum); @@ -255,8 +267,8 @@ void onIncrementalRefresh(final MdpFeedContext feedContext, final long msgSeqNum pushIncrementalRefreshEntryInQueue(msgSeqNum, matchEventIndicator, rptSeqNum, incrRefreshEntry); } } else if (currentState == InstrumentState.INITIAL) { - if (prcdRptSeqNum == 0 && rptSeqNum == 1) { - this.prcdRptSeqNum = rptSeqNum; + if (processedRptSeqNum == 0 && rptSeqNum == 1) { + this.processedRptSeqNum = rptSeqNum; switchState(currentState, InstrumentState.SYNC); handleIncrementalRefreshEntry(msgSeqNum, matchEventIndicator, incrRefreshEntry); } else { diff --git a/src/main/java/com/epam/cme/mdp3/core/control/InstrumentMdHandler.java b/mbp-only/src/main/java/com/epam/cme/mdp3/core/control/InstrumentMdHandler.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/core/control/InstrumentMdHandler.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/core/control/InstrumentMdHandler.java diff --git a/src/main/java/com/epam/cme/mdp3/core/control/InstrumentState.java b/mbp-only/src/main/java/com/epam/cme/mdp3/core/control/InstrumentState.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/core/control/InstrumentState.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/core/control/InstrumentState.java diff --git a/src/main/java/com/epam/cme/mdp3/core/control/PacketHolder.java b/mbp-only/src/main/java/com/epam/cme/mdp3/core/control/PacketHolder.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/core/control/PacketHolder.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/core/control/PacketHolder.java diff --git a/src/main/java/com/epam/cme/mdp3/core/control/PacketQueue.java b/mbp-only/src/main/java/com/epam/cme/mdp3/core/control/PacketQueue.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/core/control/PacketQueue.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/core/control/PacketQueue.java diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/AbstractMktDataHandler.java b/mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/AbstractMktDataHandler.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/mktdata/AbstractMktDataHandler.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/AbstractMktDataHandler.java diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/AbstractOrderBookHandler.java b/mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/AbstractOrderBookHandler.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/mktdata/AbstractOrderBookHandler.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/AbstractOrderBookHandler.java diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/ImpliedBook.java b/mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/ImpliedBook.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/mktdata/ImpliedBook.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/ImpliedBook.java diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/ImpliedBookHandler.java b/mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/ImpliedBookHandler.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/mktdata/ImpliedBookHandler.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/ImpliedBookHandler.java diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/ImpliedBookPriceEntry.java b/mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/ImpliedBookPriceEntry.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/mktdata/ImpliedBookPriceEntry.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/ImpliedBookPriceEntry.java diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/ImpliedBookPriceLevel.java b/mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/ImpliedBookPriceLevel.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/mktdata/ImpliedBookPriceLevel.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/ImpliedBookPriceLevel.java diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/MdConstants.java b/mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/MdConstants.java similarity index 59% rename from src/main/java/com/epam/cme/mdp3/mktdata/MdConstants.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/MdConstants.java index e789465..106e474 100644 --- a/src/main/java/com/epam/cme/mdp3/mktdata/MdConstants.java +++ b/mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/MdConstants.java @@ -12,21 +12,22 @@ package com.epam.cme.mdp3.mktdata; -public class MdConstants { - private MdConstants() { - } - - public static final byte TOP_OF_THE_BOOK_LEVEL = 1; - - public final static int SECURITY_ID = 48; - public final static int RPT_SEQ_NUM = 83; - public final static int INCR_RFRSH_GRP_TAG = 268; - public final static int INCR_RFRSH_MD_ENTRY_TYPE = 269; - public final static int INCR_RFRSH_MD_ACTION = 279; - public final static int INCR_RFRSH_MD_PRICE_LEVEL = 1023; - public final static int INCR_RFRSH_MD_ENTRY_PX = 270; - public final static int INCR_RFRSH_MD_ENTRY_SIZE = 271; - public final static int INCR_RFRSH_MD_ORDER_NUM = 346; - +public interface MdConstants { + byte TOP_OF_THE_BOOK_LEVEL = 1; + int LAST_MSG_SEQ_NUM_PROCESSED = 369; + int SECURITY_ID = 48; + int RPT_SEQ_NUM = 83; + int NO_MD_ENTRIES = 268; + int INCR_RFRSH_MD_ENTRY_TYPE = 269; + int INCR_RFRSH_MD_ACTION = 279; + int INCR_RFRSH_MD_PRICE_LEVEL = 1023; + int INCR_RFRSH_MD_ENTRY_PX = 270; + int INCR_RFRSH_MD_ENTRY_SIZE = 271; + int INCR_RFRSH_MD_ORDER_NUM = 346; + int NO_ORDER_ID_ENTRIES = 37705; + int NO_CHUNKS = 37709; + int CURRENT_CHUNK = 37710; + int TOT_NUM_REPORTS = 911; + int REFERENCE_ID = 9633; } diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/MultipleDepthBookHandler.java b/mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/MultipleDepthBookHandler.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/mktdata/MultipleDepthBookHandler.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/MultipleDepthBookHandler.java diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/OrderBook.java b/mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/OrderBook.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/mktdata/OrderBook.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/OrderBook.java diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/OrderBookPriceEntry.java b/mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/OrderBookPriceEntry.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/mktdata/OrderBookPriceEntry.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/OrderBookPriceEntry.java diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/OrderBookPriceLevel.java b/mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/OrderBookPriceLevel.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/mktdata/OrderBookPriceLevel.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/OrderBookPriceLevel.java diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/Price.java b/mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/Price.java similarity index 72% rename from src/main/java/com/epam/cme/mdp3/mktdata/Price.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/Price.java index 8f2dc07..c55b36b 100644 --- a/src/main/java/com/epam/cme/mdp3/mktdata/Price.java +++ b/mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/Price.java @@ -13,6 +13,8 @@ package com.epam.cme.mdp3.mktdata; import com.epam.cme.mdp3.sbe.message.meta.SbePrimitiveType; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; public class Price { private long mantissa; @@ -37,4 +39,24 @@ public void setNull() { public double asDouble() { return getMantissa() * Math.pow(10, exponent); } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + + if (o == null || getClass() != o.getClass()) return false; + + Price price = (Price) o; + + return new EqualsBuilder() + .append(mantissa, price.mantissa) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37) + .append(mantissa) + .toHashCode(); + } } diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/RequestForQuoteHandler.java b/mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/RequestForQuoteHandler.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/mktdata/RequestForQuoteHandler.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/RequestForQuoteHandler.java diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/SecurityStatistics.java b/mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/SecurityStatistics.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/mktdata/SecurityStatistics.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/SecurityStatistics.java diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/SecurityStatusHandler.java b/mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/SecurityStatusHandler.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/mktdata/SecurityStatusHandler.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/SecurityStatusHandler.java diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/SettlPriceType.java b/mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/SettlPriceType.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/mktdata/SettlPriceType.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/SettlPriceType.java diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/StatisticsHandler.java b/mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/StatisticsHandler.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/mktdata/StatisticsHandler.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/StatisticsHandler.java diff --git a/src/main/java/com/epam/cme/mdp3/mktdata/TradeHandler.java b/mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/TradeHandler.java similarity index 100% rename from src/main/java/com/epam/cme/mdp3/mktdata/TradeHandler.java rename to mbp-only/src/main/java/com/epam/cme/mdp3/mktdata/TradeHandler.java diff --git a/src/test/java/com/epam/cme/mdp3/test/ChannelHelper.java b/mbp-only/src/test/java/com/epam/cme/mdp3/test/ChannelHelper.java similarity index 68% rename from src/test/java/com/epam/cme/mdp3/test/ChannelHelper.java rename to mbp-only/src/test/java/com/epam/cme/mdp3/test/ChannelHelper.java index c35da53..387e80d 100644 --- a/src/test/java/com/epam/cme/mdp3/test/ChannelHelper.java +++ b/mbp-only/src/test/java/com/epam/cme/mdp3/test/ChannelHelper.java @@ -1,14 +1,23 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + package com.epam.cme.mdp3.test; import com.epam.cme.mdp3.*; import com.epam.cme.mdp3.core.channel.MdpChannelBuilder; -import com.epam.cme.mdp3.core.channel.MdpFeedException; import com.epam.cme.mdp3.sbe.message.SbeString; -import com.epam.cme.mdp3.sbe.schema.MdpMessageTypeBuildException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import java.net.URISyntaxException; import java.util.Arrays; import java.util.HashSet; import java.util.List; @@ -23,12 +32,16 @@ public class ChannelHelper { private final SbeString tag1151value = SbeString.allocate(6); public Set resolveInstruments(final String channelId, - final List symbolGroups) { + final List symbolGroups, String networkInterface) { try { final Set instruments = new HashSet<>(); final MdpChannel mdpChannel = new MdpChannelBuilder(channelId, Main.class.getResource("/config.xml").toURI(), Main.class.getResource("/templates_FixBinary.xml").toURI()) + .setNetworkInterface(FeedType.SMBO, Feed.A, networkInterface).setNetworkInterface(FeedType.SMBO, Feed.B, networkInterface) + .setNetworkInterface(FeedType.S, Feed.A, networkInterface).setNetworkInterface(FeedType.S, Feed.B, networkInterface) + .setNetworkInterface(FeedType.I, Feed.A, networkInterface).setNetworkInterface(FeedType.I, Feed.B, networkInterface) + .setNetworkInterface(FeedType.N, Feed.A, networkInterface).setNetworkInterface(FeedType.N, Feed.B, networkInterface) .usingListener(new VoidChannelListener() { @Override public void onFeedStarted(String channelId, FeedType feedType, Feed feed) { @@ -68,13 +81,7 @@ public int onSecurityDefinition(final String channelId, final MdpMessage secDefM } mdpChannel.close(); return instruments; - } catch (MdpMessageTypeBuildException e) { - e.printStackTrace(); - } catch (URISyntaxException e) { - e.printStackTrace(); - } catch (MdpFeedException e) { - e.printStackTrace(); - } catch (InterruptedException e) { + } catch (Exception e) { e.printStackTrace(); } return null; @@ -82,7 +89,7 @@ public int onSecurityDefinition(final String channelId, final MdpMessage secDefM public static void main(String args[]) { try { - final Set instruments = new ChannelHelper().resolveInstruments("320", Arrays.asList( "6C", "6E", "6M", "6N")); + final Set instruments = new ChannelHelper().resolveInstruments("320", Arrays.asList( "6C", "6E", "6M", "6N"), null); System.out.println(instruments); } catch (Exception e) { e.printStackTrace(); diff --git a/mbp-only/src/test/java/com/epam/cme/mdp3/test/InstrumentInfo.java b/mbp-only/src/test/java/com/epam/cme/mdp3/test/InstrumentInfo.java new file mode 100644 index 0000000..2b5b2af --- /dev/null +++ b/mbp-only/src/test/java/com/epam/cme/mdp3/test/InstrumentInfo.java @@ -0,0 +1,47 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.test; + +public class InstrumentInfo { + final int instrumentId; + final String desc; + + public InstrumentInfo(final int instrumentId, final String desc) { + this.instrumentId = instrumentId; + this.desc = desc; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + InstrumentInfo that = (InstrumentInfo) o; + + if (instrumentId != that.instrumentId) return false; + return desc.equals(that.desc); + + } + + @Override + public int hashCode() { + int result = instrumentId; + result = 31 * result + desc.hashCode(); + return result; + } + + @Override + public String toString() { + return "Instrument{" + instrumentId + ", '" + desc + "'}"; + } +} diff --git a/src/test/java/com/epam/cme/mdp3/test/ListNetworkInterfaces.java b/mbp-only/src/test/java/com/epam/cme/mdp3/test/ListNetworkInterfaces.java similarity index 100% rename from src/test/java/com/epam/cme/mdp3/test/ListNetworkInterfaces.java rename to mbp-only/src/test/java/com/epam/cme/mdp3/test/ListNetworkInterfaces.java diff --git a/src/test/java/com/epam/cme/mdp3/test/Main.java b/mbp-only/src/test/java/com/epam/cme/mdp3/test/Main.java similarity index 96% rename from src/test/java/com/epam/cme/mdp3/test/Main.java rename to mbp-only/src/test/java/com/epam/cme/mdp3/test/Main.java index c067e3f..e2194d6 100644 --- a/src/test/java/com/epam/cme/mdp3/test/Main.java +++ b/mbp-only/src/test/java/com/epam/cme/mdp3/test/Main.java @@ -15,16 +15,12 @@ import com.epam.cme.mdp3.*; import com.epam.cme.mdp3.core.channel.MdpChannelBuilder; import com.epam.cme.mdp3.core.control.InstrumentState; -import com.epam.cme.mdp3.mktdata.enums.SecurityTradingStatus; import org.slf4j.LoggerFactory; import org.slf4j.Logger; import java.util.*; import java.util.concurrent.atomic.AtomicLong; -import static com.epam.cme.mdp3.mktdata.MdConstants.RPT_SEQ_NUM; -import static com.epam.cme.mdp3.mktdata.MdConstants.SECURITY_ID; - public class Main { private static final Logger logger = LoggerFactory.getLogger(Main.class); private static AtomicLong prcdSeqNum = new AtomicLong(0); @@ -148,7 +144,7 @@ public static void main(String args[]) { defineChannel(channelInfos, "344", "ZB", "ZN", "ZF"); final Map> resolvedInstruments = new HashMap<>(); - channelInfos.forEach((s, groups) -> resolvedInstruments.put(s, new ChannelHelper().resolveInstruments(s, groups))); + channelInfos.forEach((s, groups) -> resolvedInstruments.put(s, new ChannelHelper().resolveInstruments(s, groups, null))); final List openChannels = new ArrayList<>(); try { diff --git a/src/test/java/com/epam/cme/mdp3/test/PrintAllSecuritiesTest.java b/mbp-only/src/test/java/com/epam/cme/mdp3/test/PrintAllSecuritiesTest.java similarity index 100% rename from src/test/java/com/epam/cme/mdp3/test/PrintAllSecuritiesTest.java rename to mbp-only/src/test/java/com/epam/cme/mdp3/test/PrintAllSecuritiesTest.java diff --git a/src/test/java/com/epam/cme/mdp3/test/SbeDataDumpHelper.java b/mbp-only/src/test/java/com/epam/cme/mdp3/test/SbeDataDumpHelper.java similarity index 100% rename from src/test/java/com/epam/cme/mdp3/test/SbeDataDumpHelper.java rename to mbp-only/src/test/java/com/epam/cme/mdp3/test/SbeDataDumpHelper.java diff --git a/src/test/java/com/epam/cme/mdp3/test/SbeParserBenchmark.java b/mbp-only/src/test/java/com/epam/cme/mdp3/test/SbeParserBenchmark.java similarity index 100% rename from src/test/java/com/epam/cme/mdp3/test/SbeParserBenchmark.java rename to mbp-only/src/test/java/com/epam/cme/mdp3/test/SbeParserBenchmark.java diff --git a/src/test/resources/prod/config.xml b/mbp-only/src/test/resources/config.xml similarity index 54% rename from src/test/resources/prod/config.xml rename to mbp-only/src/test/resources/config.xml index 8594cfa..5ae6680 100644 --- a/src/test/resources/prod/config.xml +++ b/mbp-only/src/test/resources/config.xml @@ -1,115 +1,145 @@ - + + + + + + - - - Historical Replay - TCP/IP - 205.209.220.72 - 205.209.222.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.1 - 205.209.223.70 - 205.209.221.70 - 14310 - A - - - Incremental - UDP/IP - 224.0.32.1 - 205.209.212.70 - 205.209.211.70 - 15310 - B - - - Instrument Replay - UDP/IP - 224.0.31.43 - 205.209.222.85 - 205.209.222.73 - 14310 - A - - - Instrument Replay - UDP/IP - 224.0.32.43 - 205.209.214.48 - 205.209.213.48 - 15310 - B - - - Snapshot - UDP/IP - 224.0.31.22 - 205.209.222.87 - 205.209.222.77 - 14310 - A - - - Snapshot - UDP/IP - 224.0.32.22 - 205.209.213.52 - 205.209.214.52 - 15310 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.1 - 205.209.222.108 - 205.209.222.109 - 23310 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.64 - 205.209.214.64 - 205.209.213.64 - 22310 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.1 + 205.209.223.70 + 205.209.221.70 + 14310 + A + + + Incremental + UDP/IP + 224.0.32.1 + 205.209.212.70 + 205.209.211.70 + 15310 + B + + + Instrument Replay + UDP/IP + 224.0.31.43 + 205.209.222.85 + 205.209.222.73 + 14310 + A + + + Instrument Replay + UDP/IP + 224.0.32.43 + 205.209.214.48 + 205.209.213.48 + 15310 + B + + + Snapshot + UDP/IP + 224.0.31.22 + 205.209.222.87 + 205.209.222.77 + 14310 + A + + + Snapshot + UDP/IP + 224.0.32.22 + 205.209.213.52 + 205.209.214.52 + 15310 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.1 + 205.209.222.108 + 205.209.222.109 + 23310 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.64 + 205.209.214.64 + 205.209.213.64 + 22310 + B + + + + + + + + + + + - - + + + + + - - + + + + + @@ -123,16 +153,16 @@ - + - + - + - + @@ -141,91 +171,94 @@ - - - Historical Replay - TCP/IP - 205.209.220.72 - 205.209.222.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.2 - 205.209.221.70 - 205.209.223.70 - 14311 - A - - - Incremental - UDP/IP - 224.0.32.2 - 205.209.211.70 - 205.209.212.70 - 15311 - B - - - Instrument Replay - UDP/IP - 224.0.31.44 - 205.209.222.76 - 205.209.222.82 - 14311 - A - - - Instrument Replay - UDP/IP - 224.0.32.44 - 205.209.214.51 - 205.209.213.51 - 15311 - B - - - Snapshot - UDP/IP - 224.0.31.23 - 205.209.222.80 - 205.209.222.84 - 14311 - A - - - Snapshot - UDP/IP - 224.0.32.23 - 205.209.213.55 - 205.209.214.55 - 15311 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.2 - 205.209.222.114 - 205.209.222.115 - 23311 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.65 - 205.209.214.67 - 205.209.213.67 - 22311 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.2 + 205.209.221.70 + 205.209.223.70 + 14311 + A + + + Incremental + UDP/IP + 224.0.32.2 + 205.209.211.70 + 205.209.212.70 + 15311 + B + + + Instrument Replay + UDP/IP + 224.0.31.44 + 205.209.222.76 + 205.209.222.82 + 14311 + A + + + Instrument Replay + UDP/IP + 224.0.32.44 + 205.209.214.51 + 205.209.213.51 + 15311 + B + + + Snapshot + UDP/IP + 224.0.31.23 + 205.209.222.80 + 205.209.222.84 + 14311 + A + + + Snapshot + UDP/IP + 224.0.32.23 + 205.209.213.55 + 205.209.214.55 + 15311 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.2 + 205.209.222.114 + 205.209.222.115 + 23311 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.65 + 205.209.214.67 + 205.209.213.67 + 22311 + B + + + + + @@ -248,91 +281,94 @@ - - - Historical Replay - TCP/IP - 205.209.220.72 - 205.209.222.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.3 - 205.209.221.80 - 205.209.223.80 - 14312 - A - - - Incremental - UDP/IP - 224.0.32.3 - 205.209.211.80 - 205.209.212.80 - 15312 - B - - - Instrument Replay - UDP/IP - 224.0.31.45 - 205.209.222.76 - 205.209.222.82 - 14312 - A - - - Instrument Replay - UDP/IP - 224.0.32.45 - 205.209.214.51 - 205.209.213.51 - 15312 - B - - - Snapshot - UDP/IP - 224.0.31.24 - 205.209.222.80 - 205.209.222.84 - 14312 - A - - - Snapshot - UDP/IP - 224.0.32.24 - 205.209.213.55 - 205.209.214.55 - 15312 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.3 - 205.209.222.114 - 205.209.222.115 - 23312 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.66 - 205.209.214.67 - 205.209.213.67 - 22312 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.3 + 205.209.221.80 + 205.209.223.80 + 14312 + A + + + Incremental + UDP/IP + 224.0.32.3 + 205.209.211.80 + 205.209.212.80 + 15312 + B + + + Instrument Replay + UDP/IP + 224.0.31.45 + 205.209.222.76 + 205.209.222.82 + 14312 + A + + + Instrument Replay + UDP/IP + 224.0.32.45 + 205.209.214.51 + 205.209.213.51 + 15312 + B + + + Snapshot + UDP/IP + 224.0.31.24 + 205.209.222.80 + 205.209.222.84 + 14312 + A + + + Snapshot + UDP/IP + 224.0.32.24 + 205.209.213.55 + 205.209.214.55 + 15312 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.3 + 205.209.222.114 + 205.209.222.115 + 23312 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.66 + 205.209.214.67 + 205.209.213.67 + 22312 + B + + + + + @@ -342,75 +378,51 @@ - - - - - - - - - - - - - - + + - - + + - + - - - - + - - + + - - + + - + - - - - - - - + - - - @@ -418,91 +430,94 @@ - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.4 - 205.209.221.79 - 205.209.223.79 - 14313 - A - - - Incremental - UDP/IP - 224.0.32.4 - 205.209.211.79 - 205.209.212.79 - 15313 - B - - - Instrument Replay - UDP/IP - 224.0.31.46 - 205.209.222.82 - 205.209.222.76 - 14313 - A - - - Instrument Replay - UDP/IP - 224.0.32.46 - 205.209.213.51 - 205.209.214.51 - 15313 - B - - - Snapshot - UDP/IP - 224.0.31.25 - 205.209.222.84 - 205.209.222.80 - 14313 - A - - - Snapshot - UDP/IP - 224.0.32.25 - 205.209.214.55 - 205.209.213.55 - 15313 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.4 - 205.209.222.114 - 205.209.222.115 - 23313 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.67 - 205.209.214.67 - 205.209.213.67 - 22313 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.4 + 205.209.223.79 + 205.209.221.79 + 14313 + A + + + Incremental + UDP/IP + 224.0.32.4 + 205.209.212.79 + 205.209.211.79 + 15313 + B + + + Instrument Replay + UDP/IP + 224.0.31.46 + 205.209.222.76 + 205.209.222.82 + 14313 + A + + + Instrument Replay + UDP/IP + 224.0.32.46 + 205.209.214.51 + 205.209.213.51 + 15313 + B + + + Snapshot + UDP/IP + 224.0.31.25 + 205.209.222.80 + 205.209.222.84 + 14313 + A + + + Snapshot + UDP/IP + 224.0.32.25 + 205.209.213.55 + 205.209.214.55 + 15313 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.4 + 205.209.222.114 + 205.209.222.115 + 23313 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.67 + 205.209.214.67 + 205.209.213.67 + 22313 + B + + + + + @@ -561,126 +576,126 @@ - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.5 - 205.209.221.73 - 205.209.223.73 - 14314 - A - - - Incremental - UDP/IP - 224.0.32.5 - 205.209.211.73 - 205.209.212.73 - 15314 - B - - - Instrument Replay - UDP/IP - 224.0.31.47 - 205.209.222.75 - 205.209.222.81 - 14314 - A - - - Instrument Replay - UDP/IP - 224.0.32.47 - 205.209.214.50 - 205.209.213.50 - 15314 - B - - - Snapshot - UDP/IP - 224.0.31.26 - 205.209.222.83 - 205.209.222.79 - 14314 - A - - - Snapshot - UDP/IP - 224.0.32.26 - 205.209.213.54 - 205.209.214.54 - 15314 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.5 - 205.209.222.113 - 205.209.222.112 - 23314 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.68 - 205.209.213.66 - 205.209.214.66 - 22314 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.5 + 205.209.221.53 + 205.209.223.54 + 14314 + A + + + Incremental + UDP/IP + 224.0.32.5 + 205.209.212.51 + 205.209.211.52 + 15314 + B + + + Instrument Replay + UDP/IP + 224.0.31.47 + 205.209.222.81 + 205.209.222.75 + 14314 + A + + + Instrument Replay + UDP/IP + 224.0.32.47 + 205.209.213.50 + 205.209.214.50 + 15314 + B + + + Snapshot + UDP/IP + 224.0.31.26 + 205.209.222.79 + 205.209.222.83 + 14314 + A + + + Snapshot + UDP/IP + 224.0.32.26 + 205.209.213.54 + 205.209.214.54 + 15314 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.5 + 205.209.222.113 + 205.209.222.112 + 23314 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.68 + 205.209.214.66 + 205.209.213.66 + 22314 + B + + - + + + + + + + - + - - - - + - + + + + - + - - - - - - - - + + @@ -688,12 +703,12 @@ - - - + + + @@ -703,35 +718,35 @@ + + + - - - - - + + - - + + - + - - + + - - + + - - + + - - + + @@ -754,7 +769,7 @@ - + @@ -763,6 +778,9 @@ + + + @@ -775,10 +793,10 @@ - + - + @@ -790,10 +808,10 @@ - + - + @@ -802,10 +820,10 @@ - + - + @@ -814,19 +832,10 @@ - - - - - + + - - - - - - - + @@ -835,7 +844,10 @@ - + + + + @@ -844,7 +856,10 @@ - + + + + @@ -853,7 +868,10 @@ - + + + + @@ -862,6 +880,9 @@ + + + @@ -874,7 +895,7 @@ - + @@ -883,8 +904,8 @@ - - + + @@ -892,7 +913,7 @@ - + @@ -901,13 +922,16 @@ + + + - + @@ -916,92 +940,98 @@ + + + - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.6 - 205.209.223.72 - 205.209.221.72 - 14315 - A - - - Incremental - UDP/IP - 224.0.32.6 - 205.209.212.72 - 205.209.211.72 - 15315 - B - - - Instrument Replay - UDP/IP - 224.0.31.48 - 205.209.222.73 - 205.209.222.85 - 14315 - A - - - Instrument Replay - UDP/IP - 224.0.32.48 - 205.209.214.48 - 205.209.213.48 - 15315 - B - - - Snapshot - UDP/IP - 224.0.31.27 - 205.209.222.87 - 205.209.222.77 - 14315 - A - - - Snapshot - UDP/IP - 224.0.32.27 - 205.209.213.52 - 205.209.214.52 - 15315 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.6 - 205.209.222.109 - 205.209.222.108 - 23315 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.69 - 205.209.213.64 - 205.209.214.64 - 22315 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.6 + 205.209.223.54 + 205.209.221.53 + 14315 + A + + + Incremental + UDP/IP + 224.0.32.6 + 205.209.211.52 + 205.209.212.51 + 15315 + B + + + Instrument Replay + UDP/IP + 224.0.31.48 + 205.209.222.85 + 205.209.222.73 + 14315 + A + + + Instrument Replay + UDP/IP + 224.0.32.48 + 205.209.213.48 + 205.209.214.48 + 15315 + B + + + Snapshot + UDP/IP + 224.0.31.27 + 205.209.222.77 + 205.209.222.87 + 14315 + A + + + Snapshot + UDP/IP + 224.0.32.27 + 205.209.213.52 + 205.209.214.52 + 15315 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.6 + 205.209.222.109 + 205.209.222.108 + 23315 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.69 + 205.209.214.64 + 205.209.213.64 + 22315 + B + + + + + @@ -1246,11 +1276,14 @@ - + + + + @@ -1285,100 +1318,109 @@ - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.7 - 205.209.223.71 - 205.209.221.71 - 14316 - A - - - Incremental - UDP/IP - 224.0.32.7 - 205.209.212.71 - 205.209.211.71 - 15316 - B - - - Instrument Replay - UDP/IP - 224.0.31.49 - 205.209.222.86 - 205.209.222.74 - 14316 - A - - - Instrument Replay - UDP/IP - 224.0.32.49 - 205.209.214.49 - 205.209.213.49 - 15316 - B - - - Snapshot - UDP/IP - 224.0.31.28 - 205.209.222.78 - 205.209.222.88 - 14316 - A - - - Snapshot - UDP/IP - 224.0.32.28 - 205.209.213.53 - 205.209.214.53 - 15316 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.7 - 205.209.222.111 - 205.209.222.110 - 23316 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.70 - 205.209.213.65 - 205.209.214.65 - 22316 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.7 + 205.209.221.71 + 205.209.223.71 + 14316 + A + + + Incremental + UDP/IP + 224.0.32.7 + 205.209.211.71 + 205.209.212.71 + 15316 + B + + + Instrument Replay + UDP/IP + 224.0.31.49 + 205.209.222.74 + 205.209.222.86 + 14316 + A + + + Instrument Replay + UDP/IP + 224.0.32.49 + 205.209.214.49 + 205.209.213.49 + 15316 + B + + + Snapshot + UDP/IP + 224.0.31.28 + 205.209.222.78 + 205.209.222.88 + 14316 + A + + + Snapshot + UDP/IP + 224.0.32.28 + 205.209.213.53 + 205.209.214.53 + 15316 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.7 + 205.209.222.110 + 205.209.222.111 + 23316 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.70 + 205.209.214.65 + 205.209.213.65 + 22316 + B + + - - + + + + + + + + + + + @@ -1394,6 +1436,9 @@ + + + @@ -1406,36 +1451,24 @@ - - - - - - - + - + - - - - - - @@ -1448,26 +1481,26 @@ + + + - - - - - - - + - + + + + @@ -1475,95 +1508,113 @@ + + + + + + + + + - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.8 - 205.209.223.72 - 205.209.221.72 - 14317 - A - - - Incremental - UDP/IP - 224.0.32.8 - 205.209.212.72 - 205.209.211.72 - 15317 - B - - - Instrument Replay - UDP/IP - 224.0.31.50 - 205.209.222.73 - 205.209.222.85 - 14317 - A - - - Instrument Replay - UDP/IP - 224.0.32.50 - 205.209.214.48 - 205.209.213.48 - 15317 - B - - - Snapshot - UDP/IP - 224.0.31.29 - 205.209.222.87 - 205.209.222.77 - 14317 - A - - - Snapshot - UDP/IP - 224.0.32.29 - 205.209.213.52 - 205.209.214.52 - 15317 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.8 - 205.209.222.109 - 205.209.222.108 - 23317 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.71 - 205.209.213.64 - 205.209.214.64 - 22317 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.8 + 205.209.221.74 + 205.209.223.74 + 14317 + A + + + Incremental + UDP/IP + 224.0.32.8 + 205.209.211.74 + 205.209.212.74 + 15317 + B + + + Instrument Replay + UDP/IP + 224.0.31.50 + 205.209.222.85 + 205.209.222.73 + 14317 + A + + + Instrument Replay + UDP/IP + 224.0.32.50 + 205.209.214.48 + 205.209.213.48 + 15317 + B + + + Snapshot + UDP/IP + 224.0.31.29 + 205.209.222.77 + 205.209.222.87 + 14317 + A + + + Snapshot + UDP/IP + 224.0.32.29 + 205.209.213.52 + 205.209.214.52 + 15317 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.8 + 205.209.222.109 + 205.209.222.108 + 23317 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.71 + 205.209.214.64 + 205.209.213.64 + 22317 + B + + + + + + + + + + + @@ -1642,9 +1693,18 @@ + + + + + + + + + @@ -1654,6 +1714,9 @@ + + + @@ -1715,91 +1778,94 @@ - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.9 - 205.209.221.75 - 205.209.223.75 - 14318 - A - - - Incremental - UDP/IP - 224.0.32.9 - 205.209.211.75 - 205.209.212.75 - 15318 - B - - - Instrument Replay - UDP/IP - 224.0.31.51 - 205.209.222.75 - 205.209.222.81 - 14318 - A - - - Instrument Replay - UDP/IP - 224.0.32.51 - 205.209.214.50 - 205.209.213.50 - 15318 - B - - - Snapshot - UDP/IP - 224.0.31.30 - 205.209.222.83 - 205.209.222.79 - 14318 - A - - - Snapshot - UDP/IP - 224.0.32.30 - 205.209.213.54 - 205.209.214.54 - 15318 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.9 - 205.209.222.113 - 205.209.222.112 - 23318 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.72 - 205.209.213.66 - 205.209.214.66 - 22318 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.9 + 205.209.221.75 + 205.209.223.75 + 14318 + A + + + Incremental + UDP/IP + 224.0.32.9 + 205.209.212.75 + 205.209.211.75 + 15318 + B + + + Instrument Replay + UDP/IP + 224.0.31.51 + 205.209.222.75 + 205.209.222.81 + 14318 + A + + + Instrument Replay + UDP/IP + 224.0.32.51 + 205.209.214.50 + 205.209.213.50 + 15318 + B + + + Snapshot + UDP/IP + 224.0.31.30 + 205.209.222.83 + 205.209.222.79 + 14318 + A + + + Snapshot + UDP/IP + 224.0.32.30 + 205.209.213.54 + 205.209.214.54 + 15318 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.9 + 205.209.222.112 + 205.209.222.113 + 23318 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.72 + 205.209.214.66 + 205.209.213.66 + 22318 + B + + + + + @@ -1842,27 +1908,33 @@ - - - - + + + + + + + + + + @@ -1873,91 +1945,94 @@ - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.10 - 205.209.223.70 - 205.209.221.70 - 14319 - A - - - Incremental - UDP/IP - 224.0.32.10 - 205.209.212.70 - 205.209.211.70 - 15319 - B - - - Instrument Replay - UDP/IP - 224.0.31.52 - 205.209.222.82 - 205.209.222.76 - 14319 - A - - - Instrument Replay - UDP/IP - 224.0.32.52 - 205.209.214.51 - 205.209.213.51 - 15319 - B - - - Snapshot - UDP/IP - 224.0.31.31 - 205.209.222.80 - 205.209.222.84 - 14319 - A - - - Snapshot - UDP/IP - 224.0.32.31 - 205.209.213.55 - 205.209.214.55 - 15319 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.10 - 205.209.222.115 - 205.209.222.114 - 23319 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.73 - 205.209.214.67 - 205.209.213.67 - 22319 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.10 + 205.209.223.70 + 205.209.221.70 + 14319 + A + + + Incremental + UDP/IP + 224.0.32.10 + 205.209.212.70 + 205.209.211.70 + 15319 + B + + + Instrument Replay + UDP/IP + 224.0.31.52 + 205.209.222.82 + 205.209.222.76 + 14319 + A + + + Instrument Replay + UDP/IP + 224.0.32.52 + 205.209.213.51 + 205.209.214.51 + 15319 + B + + + Snapshot + UDP/IP + 224.0.31.31 + 205.209.222.84 + 205.209.222.80 + 14319 + A + + + Snapshot + UDP/IP + 224.0.32.31 + 205.209.214.55 + 205.209.213.55 + 15319 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.10 + 205.209.222.115 + 205.209.222.114 + 23319 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.73 + 205.209.213.67 + 205.209.214.67 + 22319 + B + + + + + @@ -2073,129 +2148,126 @@ - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.11 - 205.209.223.73 - 205.209.221.73 - 14320 - A - - - Incremental - UDP/IP - 224.0.32.11 - 205.209.211.73 - 205.209.212.73 - 15320 - B - - - Instrument Replay - UDP/IP - 224.0.31.53 - 205.209.222.73 - 205.209.222.85 - 14320 - A - - - Instrument Replay - UDP/IP - 224.0.32.53 - 205.209.214.48 - 205.209.213.48 - 15320 - B - - - Snapshot - UDP/IP - 224.0.31.32 - 205.209.222.77 - 205.209.222.87 - 14320 - A - - - Snapshot - UDP/IP - 224.0.32.32 - 205.209.214.52 - 205.209.213.52 - 15320 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.26 - 205.209.222.108 - 205.209.222.109 - 23320 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.89 - 205.209.214.64 - 205.209.213.64 - 22320 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.11 + 205.209.223.72 + 205.209.221.72 + 14320 + A + + + Incremental + UDP/IP + 224.0.32.11 + 205.209.211.72 + 205.209.212.72 + 15320 + B + + + Instrument Replay + UDP/IP + 224.0.31.53 + 205.209.222.73 + 205.209.222.85 + 14320 + A + + + Instrument Replay + UDP/IP + 224.0.32.53 + 205.209.214.48 + 205.209.213.48 + 15320 + B + + + Snapshot + UDP/IP + 224.0.31.32 + 205.209.222.87 + 205.209.222.77 + 14320 + A + + + Snapshot + UDP/IP + 224.0.32.32 + 205.209.213.52 + 205.209.214.52 + 15320 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.26 + 205.209.222.109 + 205.209.222.108 + 23320 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.89 + 205.209.213.64 + 205.209.214.64 + 22320 + B + + - - + + - - + + - + + + + - + - + - + - + - + - + - - - - - - - - + + @@ -2203,9 +2275,6 @@ - - - @@ -2228,19 +2297,19 @@ - + - + - + - + @@ -2254,32 +2323,38 @@ - - - - - + + - - + + - - + + - - + + - + + + + + + + + + + - + @@ -2293,20 +2368,20 @@ - + - + - + - + @@ -2341,16 +2416,7 @@ - - - - - - - - - - + @@ -2359,7 +2425,10 @@ - + + + + @@ -2368,6 +2437,9 @@ + + + @@ -2377,7 +2449,7 @@ - + @@ -2386,95 +2458,104 @@ + + + + + + - - - Historical Replay - TCP/IP - 205.209.220.72 - 205.209.222.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.12 - 205.209.221.72 - 205.209.223.72 - 14321 - A - - - Incremental - UDP/IP - 224.0.32.12 - 205.209.212.72 - 205.209.211.72 - 15321 - B - - - Instrument Replay - UDP/IP - 224.0.31.54 - 205.209.222.86 - 205.209.222.74 - 14321 - A - - - Instrument Replay - UDP/IP - 224.0.32.54 - 205.209.213.49 - 205.209.214.49 - 15321 - B - - - Snapshot - UDP/IP - 224.0.31.33 - 205.209.222.88 - 205.209.222.78 - 14321 - A - - - Snapshot - UDP/IP - 224.0.32.33 - 205.209.213.53 - 205.209.214.53 - 15321 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.27 - 205.209.222.110 - 205.209.222.111 - 23321 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.90 - 205.209.213.65 - 205.209.214.65 - 22321 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.12 + 205.209.223.72 + 205.209.221.72 + 14321 + A + + + Incremental + UDP/IP + 224.0.32.12 + 205.209.212.72 + 205.209.211.72 + 15321 + B + + + Instrument Replay + UDP/IP + 224.0.31.54 + 205.209.222.74 + 205.209.222.86 + 14321 + A + + + Instrument Replay + UDP/IP + 224.0.32.54 + 205.209.213.49 + 205.209.214.49 + 15321 + B + + + Snapshot + UDP/IP + 224.0.31.33 + 205.209.222.88 + 205.209.222.78 + 14321 + A + + + Snapshot + UDP/IP + 224.0.32.33 + 205.209.213.53 + 205.209.214.53 + 15321 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.27 + 205.209.222.111 + 205.209.222.110 + 23321 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.90 + 205.209.214.65 + 205.209.213.65 + 22321 + B + + + + + @@ -2544,6 +2625,9 @@ + + + @@ -2578,91 +2662,94 @@ - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.64 - 205.209.223.71 - 205.209.221.71 - 14340 - A - - - Incremental - UDP/IP - 224.0.32.64 - 205.209.212.71 - 205.209.211.71 - 15340 - B - - - Instrument Replay - UDP/IP - 224.0.31.106 - 205.209.222.74 - 205.209.222.86 - 14340 - A - - - Instrument Replay - UDP/IP - 224.0.32.106 - 205.209.214.49 - 205.209.213.49 - 15340 - B - - - Snapshot - UDP/IP - 224.0.31.85 - 205.209.222.78 - 205.209.222.88 - 14340 - A - - - Snapshot - UDP/IP - 224.0.32.85 - 205.209.214.53 - 205.209.213.53 - 15340 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.29 - 205.209.222.110 - 205.209.222.111 - 23340 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.92 - 205.209.214.65 - 205.209.213.65 - 22340 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.64 + 205.209.223.71 + 205.209.221.71 + 14340 + A + + + Incremental + UDP/IP + 224.0.32.64 + 205.209.211.71 + 205.209.212.71 + 15340 + B + + + Instrument Replay + UDP/IP + 224.0.31.106 + 205.209.222.86 + 205.209.222.74 + 14340 + A + + + Instrument Replay + UDP/IP + 224.0.32.106 + 205.209.213.49 + 205.209.214.49 + 15340 + B + + + Snapshot + UDP/IP + 224.0.31.85 + 205.209.222.88 + 205.209.222.78 + 14340 + A + + + Snapshot + UDP/IP + 224.0.32.85 + 205.209.213.53 + 205.209.214.53 + 15340 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.29 + 205.209.222.110 + 205.209.222.111 + 23340 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.92 + 205.209.214.65 + 205.209.213.65 + 22340 + B + + + + + @@ -2768,17 +2855,17 @@ - + - + - + @@ -2802,39 +2889,42 @@ - + - + - - + + - - + + - + - + - + - + - + - + + + + @@ -2882,21 +2972,15 @@ - - - - + - - - @@ -2906,7 +2990,7 @@ - + @@ -2915,7 +2999,7 @@ - + @@ -2924,110 +3008,107 @@ - + - - - - + - - - - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.65 - 205.209.223.74 - 205.209.221.74 - 14341 - A - - - Incremental - UDP/IP - 224.0.32.65 - 205.209.212.74 - 205.209.211.74 - 15341 - B - - - Instrument Replay - UDP/IP - 224.0.31.107 - 205.209.222.81 - 205.209.222.75 - 14341 - A - - - Instrument Replay - UDP/IP - 224.0.32.107 - 205.209.214.50 - 205.209.213.50 - 15341 - B - - - Snapshot - UDP/IP - 224.0.31.86 - 205.209.222.83 - 205.209.222.79 - 14341 - A - - - Snapshot - UDP/IP - 224.0.32.86 - 205.209.214.54 - 205.209.213.54 - 15341 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.30 - 205.209.222.112 - 205.209.222.113 - 23341 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.93 - 205.209.214.66 - 205.209.213.66 - 22341 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.65 + 205.209.223.74 + 205.209.221.74 + 14341 + A + + + Incremental + UDP/IP + 224.0.32.65 + 205.209.211.74 + 205.209.212.74 + 15341 + B + + + Instrument Replay + UDP/IP + 224.0.31.107 + 205.209.222.81 + 205.209.222.75 + 14341 + A + + + Instrument Replay + UDP/IP + 224.0.32.107 + 205.209.213.50 + 205.209.214.50 + 15341 + B + + + Snapshot + UDP/IP + 224.0.31.86 + 205.209.222.79 + 205.209.222.83 + 14341 + A + + + Snapshot + UDP/IP + 224.0.32.86 + 205.209.213.54 + 205.209.214.54 + 15341 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.30 + 205.209.222.112 + 205.209.222.113 + 23341 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.93 + 205.209.214.66 + 205.209.213.66 + 22341 + B + + + + + @@ -3038,91 +3119,94 @@ - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.66 - 205.209.221.76 - 205.209.223.76 - 14342 - A - - - Incremental - UDP/IP - 224.0.32.66 - 205.209.211.76 - 205.209.212.76 - 15342 - B - - - Instrument Replay - UDP/IP - 224.0.31.108 - 205.209.222.85 - 205.209.222.73 - 14342 - A - - - Instrument Replay - UDP/IP - 224.0.32.108 - 205.209.214.48 - 205.209.213.48 - 15342 - B - - - Snapshot - UDP/IP - 224.0.31.87 - 205.209.222.87 - 205.209.222.77 - 14342 - A - - - Snapshot - UDP/IP - 224.0.32.87 - 205.209.214.52 - 205.209.213.52 - 15342 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.31 - 205.209.222.108 - 205.209.222.109 - 23342 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.94 - 205.209.214.64 - 205.209.213.64 - 22342 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.66 + 205.209.221.76 + 205.209.223.76 + 14342 + A + + + Incremental + UDP/IP + 224.0.32.66 + 205.209.211.76 + 205.209.212.76 + 15342 + B + + + Instrument Replay + UDP/IP + 224.0.31.108 + 205.209.222.85 + 205.209.222.73 + 14342 + A + + + Instrument Replay + UDP/IP + 224.0.32.108 + 205.209.213.48 + 205.209.214.48 + 15342 + B + + + Snapshot + UDP/IP + 224.0.31.87 + 205.209.222.87 + 205.209.222.77 + 14342 + A + + + Snapshot + UDP/IP + 224.0.32.87 + 205.209.213.52 + 205.209.214.52 + 15342 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.31 + 205.209.222.108 + 205.209.222.109 + 23342 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.94 + 205.209.214.64 + 205.209.213.64 + 22342 + B + + + + + @@ -3138,104 +3222,107 @@ - - - - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.67 - 205.209.223.74 - 205.209.221.74 - 14343 - A - - - Incremental - UDP/IP - 224.0.32.67 - 205.209.211.74 - 205.209.212.74 - 15343 - B - - - Instrument Replay - UDP/IP - 224.0.31.109 - 205.209.222.73 - 205.209.222.85 - 14343 - A - - - Instrument Replay - UDP/IP - 224.0.32.109 - 205.209.213.48 - 205.209.214.48 - 15343 - B - - - Snapshot - UDP/IP - 224.0.31.88 - 205.209.222.87 - 205.209.222.77 - 14343 - A - - - Snapshot - UDP/IP - 224.0.32.88 - 205.209.213.52 - 205.209.214.52 - 15343 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.32 - 205.209.222.108 - 205.209.222.109 - 23343 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.95 - 205.209.214.64 - 205.209.213.64 - 22343 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.67 + 205.209.221.74 + 205.209.223.74 + 14343 + A + + + Incremental + UDP/IP + 224.0.32.67 + 205.209.212.74 + 205.209.211.74 + 15343 + B + + + Instrument Replay + UDP/IP + 224.0.31.109 + 205.209.222.85 + 205.209.222.73 + 14343 + A + + + Instrument Replay + UDP/IP + 224.0.32.109 + 205.209.214.48 + 205.209.213.48 + 15343 + B + + + Snapshot + UDP/IP + 224.0.31.88 + 205.209.222.77 + 205.209.222.87 + 14343 + A + + + Snapshot + UDP/IP + 224.0.32.88 + 205.209.214.52 + 205.209.213.52 + 15343 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.32 + 205.209.222.109 + 205.209.222.108 + 23343 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.95 + 205.209.214.64 + 205.209.213.64 + 22343 + B + + + + + + + + @@ -3260,6 +3347,9 @@ + + + @@ -3327,10 +3417,10 @@ - + - + @@ -3377,23 +3467,32 @@ + + + - + - + + + + - + - + + + + @@ -3414,96 +3513,96 @@ - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.68 - 205.209.221.81 - 205.209.223.81 - 14344 - A - - - Incremental - UDP/IP - 224.0.32.68 - 205.209.211.81 - 205.209.212.81 - 15344 - B - - - Instrument Replay - UDP/IP - 224.0.31.110 - 205.209.222.81 - 205.209.222.75 - 14344 - A - - - Instrument Replay - UDP/IP - 224.0.32.110 - 205.209.214.50 - 205.209.213.50 - 15344 - B - - - Snapshot - UDP/IP - 224.0.31.89 - 205.209.222.83 - 205.209.222.79 - 14344 - A - - - Snapshot - UDP/IP - 224.0.32.89 - 205.209.213.54 - 205.209.214.54 - 15344 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.33 - 205.209.222.112 - 205.209.222.113 - 23344 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.96 - 205.209.214.66 - 205.209.213.66 - 22344 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.68 + 205.209.223.81 + 205.209.221.81 + 14344 + A + + + Incremental + UDP/IP + 224.0.32.68 + 205.209.211.81 + 205.209.212.81 + 15344 + B + + + Instrument Replay + UDP/IP + 224.0.31.110 + 205.209.222.81 + 205.209.222.75 + 14344 + A + + + Instrument Replay + UDP/IP + 224.0.32.110 + 205.209.214.50 + 205.209.213.50 + 15344 + B + + + Snapshot + UDP/IP + 224.0.31.89 + 205.209.222.79 + 205.209.222.83 + 14344 + A + + + Snapshot + UDP/IP + 224.0.32.89 + 205.209.214.54 + 205.209.213.54 + 15344 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.33 + 205.209.222.113 + 205.209.222.112 + 23344 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.96 + 205.209.214.66 + 205.209.213.66 + 22344 + B + + - - + + - + @@ -3532,14 +3631,11 @@ - - - - + - + @@ -3547,7 +3643,7 @@ - + @@ -3556,27 +3652,78 @@ - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + - + + + + + + + + + + @@ -3586,31 +3733,25 @@ - - - - - - - + - + - - + + - + - + - + @@ -3619,110 +3760,110 @@ - - - - + - - - - + + + + - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.69 - 205.209.221.72 - 205.209.223.72 - 14345 - A - - - Incremental - UDP/IP - 224.0.32.69 - 205.209.212.72 - 205.209.211.72 - 15345 - B - - - Instrument Replay - UDP/IP - 224.0.31.111 - 205.209.222.75 - 205.209.222.81 - 14345 - A - - - Instrument Replay - UDP/IP - 224.0.32.111 - 205.209.213.50 - 205.209.214.50 - 15345 - B - - - Snapshot - UDP/IP - 224.0.31.90 - 205.209.222.83 - 205.209.222.79 - 14345 - A - - - Snapshot - UDP/IP - 224.0.32.90 - 205.209.213.54 - 205.209.214.54 - 15345 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.34 - 205.209.222.113 - 205.209.222.112 - 23345 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.97 - 205.209.214.66 - 205.209.213.66 - 22345 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.69 + 205.209.223.76 + 205.209.221.76 + 14345 + A + + + Incremental + UDP/IP + 224.0.32.69 + 205.209.211.76 + 205.209.212.76 + 15345 + B + + + Instrument Replay + UDP/IP + 224.0.31.111 + 205.209.222.81 + 205.209.222.75 + 14345 + A + + + Instrument Replay + UDP/IP + 224.0.32.111 + 205.209.213.50 + 205.209.214.50 + 15345 + B + + + Snapshot + UDP/IP + 224.0.31.90 + 205.209.222.83 + 205.209.222.79 + 14345 + A + + + Snapshot + UDP/IP + 224.0.32.90 + 205.209.213.54 + 205.209.214.54 + 15345 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.34 + 205.209.222.113 + 205.209.222.112 + 23345 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.97 + 205.209.214.66 + 205.209.213.66 + 22345 + B + + + + + @@ -3832,91 +3973,94 @@ - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.70 - 205.209.223.75 - 205.209.221.75 - 14346 - A - - - Incremental - UDP/IP - 224.0.32.70 - 205.209.211.75 - 205.209.212.75 - 15346 - B - - - Instrument Replay - UDP/IP - 224.0.31.112 - 205.209.222.75 - 205.209.222.81 - 14346 - A - - - Instrument Replay - UDP/IP - 224.0.32.112 - 205.209.214.50 - 205.209.213.50 - 15346 - B - - - Snapshot - UDP/IP - 224.0.31.91 - 205.209.222.83 - 205.209.222.79 - 14346 - A - - - Snapshot - UDP/IP - 224.0.32.91 - 205.209.213.54 - 205.209.214.54 - 15346 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.35 - 205.209.222.113 - 205.209.222.112 - 23346 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.98 - 205.209.214.66 - 205.209.213.66 - 22346 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.70 + 205.209.221.75 + 205.209.223.75 + 14346 + A + + + Incremental + UDP/IP + 224.0.32.70 + 205.209.212.75 + 205.209.211.75 + 15346 + B + + + Instrument Replay + UDP/IP + 224.0.31.112 + 205.209.222.81 + 205.209.222.75 + 14346 + A + + + Instrument Replay + UDP/IP + 224.0.32.112 + 205.209.213.50 + 205.209.214.50 + 15346 + B + + + Snapshot + UDP/IP + 224.0.31.91 + 205.209.222.83 + 205.209.222.79 + 14346 + A + + + Snapshot + UDP/IP + 224.0.32.91 + 205.209.213.54 + 205.209.214.54 + 15346 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.35 + 205.209.222.113 + 205.209.222.112 + 23346 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.98 + 205.209.214.66 + 205.209.213.66 + 22346 + B + + + + + @@ -3930,7 +4074,7 @@ - + @@ -3941,6 +4085,9 @@ + + + @@ -3950,6 +4097,9 @@ + + + @@ -3983,6 +4133,9 @@ + + + @@ -3992,105 +4145,111 @@ + + + - - - Historical Replay - TCP/IP - 205.209.220.72 - 205.209.222.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.192 - 205.209.221.79 - 205.209.223.79 - 14360 - A - - - Incremental - UDP/IP - 224.0.32.192 - 205.209.212.79 - 205.209.211.79 - 15360 - B - - - Instrument Replay - UDP/IP - 224.0.31.212 - 205.209.222.86 - 205.209.222.74 - 14360 - A - - - Instrument Replay - UDP/IP - 224.0.32.212 - 205.209.214.49 - 205.209.213.49 - 15360 - B - - - Snapshot - UDP/IP - 224.0.31.202 - 205.209.222.88 - 205.209.222.78 - 14360 - A - - - Snapshot - UDP/IP - 224.0.32.202 - 205.209.213.53 - 205.209.214.53 - 15360 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.21 - 205.209.222.111 - 205.209.222.110 - 23360 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.84 - 205.209.214.65 - 205.209.213.65 - 22360 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.192 + 205.209.223.79 + 205.209.221.79 + 14360 + A + + + Incremental + UDP/IP + 224.0.32.192 + 205.209.211.79 + 205.209.212.79 + 15360 + B + + + Instrument Replay + UDP/IP + 224.0.31.212 + 205.209.222.86 + 205.209.222.74 + 14360 + A + + + Instrument Replay + UDP/IP + 224.0.32.212 + 205.209.214.49 + 205.209.213.49 + 15360 + B + + + Snapshot + UDP/IP + 224.0.31.202 + 205.209.222.88 + 205.209.222.78 + 14360 + A + + + Snapshot + UDP/IP + 224.0.32.202 + 205.209.214.53 + 205.209.213.53 + 15360 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.21 + 205.209.222.111 + 205.209.222.110 + 23360 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.84 + 205.209.214.65 + 205.209.213.65 + 22360 + B + + + + + - + - + @@ -4111,17 +4270,17 @@ - + - + - + - + @@ -4129,99 +4288,114 @@ - + - + - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.193 - 205.209.223.77 - 205.209.221.77 - 14361 - A - - - Incremental - UDP/IP - 224.0.32.193 - 205.209.212.77 - 205.209.211.77 - 15361 - B - - - Instrument Replay - UDP/IP - 224.0.31.213 - 205.209.222.74 - 205.209.222.86 - 14361 - A - - - Instrument Replay - UDP/IP - 224.0.32.213 - 205.209.213.49 - 205.209.214.49 - 15361 - B - - - Snapshot - UDP/IP - 224.0.31.203 - 205.209.222.78 - 205.209.222.88 - 14361 - A - - - Snapshot - UDP/IP - 224.0.32.203 - 205.209.214.53 - 205.209.213.53 - 15361 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.25 - 205.209.222.111 - 205.209.222.110 - 23361 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.88 - 205.209.214.65 - 205.209.213.65 - 22361 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.193 + 205.209.221.77 + 205.209.223.77 + 14361 + A + + + Incremental + UDP/IP + 224.0.32.193 + 205.209.212.77 + 205.209.211.77 + 15361 + B + + + Instrument Replay + UDP/IP + 224.0.31.213 + 205.209.222.74 + 205.209.222.86 + 14361 + A + + + Instrument Replay + UDP/IP + 224.0.32.213 + 205.209.213.49 + 205.209.214.49 + 15361 + B + + + Snapshot + UDP/IP + 224.0.31.203 + 205.209.222.88 + 205.209.222.78 + 14361 + A + + + Snapshot + UDP/IP + 224.0.32.203 + 205.209.213.53 + 205.209.214.53 + 15361 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.25 + 205.209.222.110 + 205.209.222.111 + 23361 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.88 + 205.209.214.65 + 205.209.213.65 + 22361 + B + + - + + + + + + + + + + + + + + + + @@ -4234,186 +4408,183 @@ - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.128 - 205.209.221.77 - 205.209.223.77 - 14380 - A - - - Incremental - UDP/IP - 224.0.32.128 - 205.209.212.77 - 205.209.211.77 - 15380 - B - - - Instrument Replay - UDP/IP - 224.0.31.170 - 205.209.222.76 - 205.209.222.82 - 14380 - A - - - Instrument Replay - UDP/IP - 224.0.32.170 - 205.209.214.51 - 205.209.213.51 - 15380 - B - - - Snapshot - UDP/IP - 224.0.31.149 - 205.209.222.80 - 205.209.222.84 - 14380 - A - - - Snapshot - UDP/IP - 224.0.32.149 - 205.209.214.55 - 205.209.213.55 - 15380 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.11 - 205.209.222.114 - 205.209.222.115 - 23380 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.74 - 205.209.213.67 - 205.209.214.67 - 22380 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.128 + 205.209.221.77 + 205.209.223.77 + 14380 + A + + + Incremental + UDP/IP + 224.0.32.128 + 205.209.212.77 + 205.209.211.77 + 15380 + B + + + Instrument Replay + UDP/IP + 224.0.31.170 + 205.209.222.76 + 205.209.222.82 + 14380 + A + + + Instrument Replay + UDP/IP + 224.0.32.170 + 205.209.213.51 + 205.209.214.51 + 15380 + B + + + Snapshot + UDP/IP + 224.0.31.149 + 205.209.222.80 + 205.209.222.84 + 14380 + A + + + Snapshot + UDP/IP + 224.0.32.149 + 205.209.214.55 + 205.209.213.55 + 15380 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.11 + 205.209.222.115 + 205.209.222.114 + 23380 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.74 + 205.209.213.67 + 205.209.214.67 + 22380 + B + + - - + + - + - - - - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.129 - 205.209.221.77 - 205.209.223.77 - 14381 - A - - - Incremental - UDP/IP - 224.0.32.129 - 205.209.211.77 - 205.209.212.77 - 15381 - B - - - Instrument Replay - UDP/IP - 224.0.31.171 - 205.209.222.82 - 205.209.222.76 - 14381 - A - - - Instrument Replay - UDP/IP - 224.0.32.171 - 205.209.213.51 - 205.209.214.51 - 15381 - B - - - Snapshot - UDP/IP - 224.0.31.150 - 205.209.222.80 - 205.209.222.84 - 14381 - A - - - Snapshot - UDP/IP - 224.0.32.150 - 205.209.214.55 - 205.209.213.55 - 15381 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.12 - 205.209.222.114 - 205.209.222.115 - 23381 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.75 - 205.209.214.67 - 205.209.213.67 - 22381 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.129 + 205.209.223.77 + 205.209.221.77 + 14381 + A + + + Incremental + UDP/IP + 224.0.32.129 + 205.209.212.77 + 205.209.211.77 + 15381 + B + + + Instrument Replay + UDP/IP + 224.0.31.171 + 205.209.222.76 + 205.209.222.82 + 14381 + A + + + Instrument Replay + UDP/IP + 224.0.32.171 + 205.209.214.51 + 205.209.213.51 + 15381 + B + + + Snapshot + UDP/IP + 224.0.31.150 + 205.209.222.80 + 205.209.222.84 + 14381 + A + + + Snapshot + UDP/IP + 224.0.32.150 + 205.209.214.55 + 205.209.213.55 + 15381 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.12 + 205.209.222.114 + 205.209.222.115 + 23381 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.75 + 205.209.213.67 + 205.209.214.67 + 22381 + B + + @@ -4426,6 +4597,9 @@ + + + @@ -4957,6 +5131,9 @@ + + + @@ -5003,10 +5180,10 @@ - + - + @@ -5054,10 +5231,10 @@ - + - + @@ -5074,6 +5251,15 @@ + + + + + + + + + @@ -5113,18 +5299,9 @@ - - - - - - - - - @@ -5170,6 +5347,12 @@ + + + + + + @@ -5330,10 +5513,10 @@ - + - + @@ -5377,6 +5560,9 @@ + + + @@ -5389,6 +5575,9 @@ + + + @@ -5399,10 +5588,10 @@ - + - + @@ -5429,10 +5618,10 @@ - + - + @@ -5638,26 +5827,11 @@ - - - - - - - - - - - - - - - - - + + @@ -5695,7 +5869,10 @@ - + + + + @@ -5734,9 +5911,15 @@ + + + + + + @@ -5761,6 +5944,9 @@ + + + @@ -5800,6 +5986,9 @@ + + + @@ -5816,96 +6005,96 @@ - - - Historical Replay - TCP/IP - 205.209.220.72 - 205.209.222.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.130 - 205.209.221.78 - 205.209.223.78 - 14382 - A - - - Incremental - UDP/IP - 224.0.32.130 - 205.209.212.78 - 205.209.211.78 - 15382 - B - - - Instrument Replay - UDP/IP - 224.0.31.172 - 205.209.222.82 - 205.209.222.76 - 14382 - A - - - Instrument Replay - UDP/IP - 224.0.32.172 - 205.209.213.51 - 205.209.214.51 - 15382 - B - - - Snapshot - UDP/IP - 224.0.31.151 - 205.209.222.80 - 205.209.222.84 - 14382 - A - - - Snapshot - UDP/IP - 224.0.32.151 - 205.209.214.55 - 205.209.213.55 - 15382 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.18 - 205.209.222.114 - 205.209.222.115 - 23382 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.81 - 205.209.214.67 - 205.209.213.67 - 22382 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.130 + 205.209.223.78 + 205.209.221.78 + 14382 + A + + + Incremental + UDP/IP + 224.0.32.130 + 205.209.212.78 + 205.209.211.78 + 15382 + B + + + Instrument Replay + UDP/IP + 224.0.31.172 + 205.209.222.82 + 205.209.222.76 + 14382 + A + + + Instrument Replay + UDP/IP + 224.0.32.172 + 205.209.213.51 + 205.209.214.51 + 15382 + B + + + Snapshot + UDP/IP + 224.0.31.151 + 205.209.222.80 + 205.209.222.84 + 14382 + A + + + Snapshot + UDP/IP + 224.0.32.151 + 205.209.214.55 + 205.209.213.55 + 15382 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.18 + 205.209.222.115 + 205.209.222.114 + 23382 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.81 + 205.209.213.67 + 205.209.214.67 + 22382 + B + + - - + + - - + + @@ -5919,11 +6108,11 @@ - + - + @@ -5937,48 +6126,42 @@ - + + + + - + - + - + - + - + + + + - - - - - - - - - - - - @@ -6000,155 +6183,140 @@ - - - - - - - - - - + - + - + - + - + - + - + - - - - - - - - - - - - Historical Replay - TCP/IP - 205.209.220.72 - 205.209.222.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.131 - 205.209.221.77 - 205.209.223.77 - 14383 - A - - - Incremental - UDP/IP - 224.0.32.131 - 205.209.212.77 - 205.209.211.77 - 15383 - B - - - Instrument Replay - UDP/IP - 224.0.31.173 - 205.209.222.73 - 205.209.222.85 - 14383 - A - - - Instrument Replay - UDP/IP - 224.0.32.173 - 205.209.214.48 - 205.209.213.48 - 15383 - B - - - Snapshot - UDP/IP - 224.0.31.152 - 205.209.222.77 - 205.209.222.87 - 14383 - A - - - Snapshot - UDP/IP - 224.0.32.152 - 205.209.213.52 - 205.209.214.52 - 15383 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.22 - 205.209.222.108 - 205.209.222.109 - 23383 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.85 - 205.209.213.64 - 205.209.214.64 - 22383 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.131 + 205.209.221.77 + 205.209.223.77 + 14383 + A + + + Incremental + UDP/IP + 224.0.32.131 + 205.209.212.77 + 205.209.211.77 + 15383 + B + + + Instrument Replay + UDP/IP + 224.0.31.173 + 205.209.222.85 + 205.209.222.73 + 14383 + A + + + Instrument Replay + UDP/IP + 224.0.32.173 + 205.209.214.48 + 205.209.213.48 + 15383 + B + + + Snapshot + UDP/IP + 224.0.31.152 + 205.209.222.87 + 205.209.222.77 + 14383 + A + + + Snapshot + UDP/IP + 224.0.32.152 + 205.209.214.52 + 205.209.213.52 + 15383 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.22 + 205.209.222.108 + 205.209.222.109 + 23383 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.85 + 205.209.213.64 + 205.209.214.64 + 22383 + B + + + + + @@ -6159,14 +6327,11 @@ - + - - - @@ -6176,17 +6341,17 @@ + + + - - - - + @@ -6195,96 +6360,102 @@ - - - Historical Replay - TCP/IP - 205.209.220.72 - 205.209.222.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.132 - 205.209.221.79 - 205.209.223.79 - 14384 - A - - - Incremental - UDP/IP - 224.0.32.132 - 205.209.212.79 - 205.209.211.79 - 15384 - B - - - Instrument Replay - UDP/IP - 224.0.31.174 - 205.209.222.82 - 205.209.222.76 - 14384 - A - - - Instrument Replay - UDP/IP - 224.0.32.174 - 205.209.214.51 - 205.209.213.51 - 15384 - B - - - Snapshot - UDP/IP - 224.0.31.153 - 205.209.222.84 - 205.209.222.80 - 14384 - A - - - Snapshot - UDP/IP - 224.0.32.153 - 205.209.213.55 - 205.209.214.55 - 15384 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.20 - 205.209.222.114 - 205.209.222.115 - 23384 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.83 - 205.209.213.67 - 205.209.214.67 - 22384 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.132 + 205.209.223.79 + 205.209.221.79 + 14384 + A + + + Incremental + UDP/IP + 224.0.32.132 + 205.209.211.79 + 205.209.212.79 + 15384 + B + + + Instrument Replay + UDP/IP + 224.0.31.174 + 205.209.222.76 + 205.209.222.82 + 14384 + A + + + Instrument Replay + UDP/IP + 224.0.32.174 + 205.209.214.51 + 205.209.213.51 + 15384 + B + + + Snapshot + UDP/IP + 224.0.31.153 + 205.209.222.80 + 205.209.222.84 + 14384 + A + + + Snapshot + UDP/IP + 224.0.32.153 + 205.209.214.55 + 205.209.213.55 + 15384 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.20 + 205.209.222.115 + 205.209.222.114 + 23384 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.83 + 205.209.214.67 + 205.209.213.67 + 22384 + B + + + + + + + + - + @@ -6293,91 +6464,94 @@ - - - Historical Replay - TCP/IP - 205.209.220.72 - 205.209.222.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.133 - 205.209.221.77 - 205.209.223.77 - 14385 - A - - - Incremental - UDP/IP - 224.0.32.133 - 205.209.212.77 - 205.209.211.77 - 15385 - B - - - Instrument Replay - UDP/IP - 224.0.31.175 - 205.209.222.75 - 205.209.222.81 - 14385 - A - - - Instrument Replay - UDP/IP - 224.0.32.175 - 205.209.214.50 - 205.209.213.50 - 15385 - B - - - Snapshot - UDP/IP - 224.0.31.154 - 205.209.222.79 - 205.209.222.83 - 14385 - A - - - Snapshot - UDP/IP - 224.0.32.154 - 205.209.213.54 - 205.209.214.54 - 15385 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.24 - 205.209.222.112 - 205.209.222.113 - 23385 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.87 - 205.209.213.66 - 205.209.214.66 - 22385 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.133 + 205.209.221.77 + 205.209.223.77 + 14385 + A + + + Incremental + UDP/IP + 224.0.32.133 + 205.209.212.77 + 205.209.211.77 + 15385 + B + + + Instrument Replay + UDP/IP + 224.0.31.175 + 205.209.222.81 + 205.209.222.75 + 14385 + A + + + Instrument Replay + UDP/IP + 224.0.32.175 + 205.209.213.50 + 205.209.214.50 + 15385 + B + + + Snapshot + UDP/IP + 224.0.31.154 + 205.209.222.83 + 205.209.222.79 + 14385 + A + + + Snapshot + UDP/IP + 224.0.32.154 + 205.209.213.54 + 205.209.214.54 + 15385 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.24 + 205.209.222.113 + 205.209.222.112 + 23385 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.87 + 205.209.213.66 + 205.209.214.66 + 22385 + B + + + + + @@ -6663,18 +6837,6 @@ - - - - - - - - - - - - @@ -6804,9 +6966,6 @@ - - - @@ -6885,9 +7044,6 @@ - - - @@ -6954,6 +7110,12 @@ + + + + + + @@ -7059,9 +7221,6 @@ - - - @@ -7107,12 +7266,12 @@ - - - + + + @@ -7188,6 +7347,12 @@ + + + + + + @@ -7356,6 +7521,9 @@ + + + @@ -7395,9 +7563,15 @@ + + + + + + @@ -7542,6 +7716,9 @@ + + + @@ -7764,9 +7941,6 @@ - - - @@ -7794,6 +7968,9 @@ + + + @@ -7821,6 +7998,9 @@ + + + @@ -7842,19 +8022,13 @@ - - - - + - + - - - - + @@ -7866,7 +8040,10 @@ - + + + + @@ -7875,6 +8052,9 @@ + + + @@ -7902,6 +8082,9 @@ + + + @@ -7917,6 +8100,15 @@ + + + + + + + + + @@ -7944,6 +8136,9 @@ + + + @@ -8125,103 +8320,100 @@ - - - Historical Replay - TCP/IP - 205.209.220.72 - 205.209.222.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.134 - 205.209.221.77 - 205.209.223.77 - 14386 - A - - - Incremental - UDP/IP - 224.0.32.134 - 205.209.212.77 - 205.209.211.77 - 15386 - B - - - Instrument Replay - UDP/IP - 224.0.31.176 - 205.209.222.75 - 205.209.222.81 - 14386 - A - - - Instrument Replay - UDP/IP - 224.0.32.176 - 205.209.214.50 - 205.209.213.50 - 15386 - B - - - Snapshot - UDP/IP - 224.0.31.155 - 205.209.222.83 - 205.209.222.79 - 14386 - A - - - Snapshot - UDP/IP - 224.0.32.155 - 205.209.214.54 - 205.209.213.54 - 15386 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.19 - 205.209.222.113 - 205.209.222.112 - 23386 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.82 - 205.209.214.66 - 205.209.213.66 - 22386 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.134 + 205.209.223.77 + 205.209.221.77 + 14386 + A + + + Incremental + UDP/IP + 224.0.32.134 + 205.209.212.77 + 205.209.211.77 + 15386 + B + + + Instrument Replay + UDP/IP + 224.0.31.176 + 205.209.222.81 + 205.209.222.75 + 14386 + A + + + Instrument Replay + UDP/IP + 224.0.32.176 + 205.209.214.50 + 205.209.213.50 + 15386 + B + + + Snapshot + UDP/IP + 224.0.31.155 + 205.209.222.79 + 205.209.222.83 + 14386 + A + + + Snapshot + UDP/IP + 224.0.32.155 + 205.209.214.54 + 205.209.213.54 + 15386 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.19 + 205.209.222.113 + 205.209.222.112 + 23386 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.82 + 205.209.213.66 + 205.209.214.66 + 22386 + B + + + + + - - - - - - @@ -8234,8 +8426,8 @@ - - + + @@ -8243,9 +8435,6 @@ - - - @@ -8258,11 +8447,14 @@ + + + - - + + @@ -8270,20 +8462,17 @@ - - - - + - - + + @@ -8294,14 +8483,8 @@ - - - - - - - - + + @@ -8312,30 +8495,33 @@ - - - - + + + + + + + + + + + + + - - - - - - @@ -8351,792 +8537,344 @@ - + - - - - - + + - - - - - - - - - - - - - - - - + - + - + - + - + - - - - + - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.31.135 - 205.209.221.77 - 205.209.223.77 - 14387 - A - - - Incremental - UDP/IP - 224.0.32.135 - 205.209.212.77 - 205.209.211.77 - 15387 - B - - - Instrument Replay - UDP/IP - 224.0.31.177 - 205.209.222.74 - 205.209.222.86 - 14387 - A - - - Instrument Replay - UDP/IP - 224.0.32.177 - 205.209.214.49 - 205.209.213.49 - 15387 - B - - - Snapshot - UDP/IP - 224.0.31.156 - 205.209.222.88 - 205.209.222.78 - 14387 - A - - - Snapshot - UDP/IP - 224.0.32.156 - 205.209.214.53 - 205.209.213.53 - 15387 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.23 - 205.209.222.110 - 205.209.222.111 - 23387 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.86 - 205.209.214.65 - 205.209.213.65 - 22387 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.135 + 205.209.223.77 + 205.209.221.77 + 14387 + A + + + Incremental + UDP/IP + 224.0.32.135 + 205.209.211.77 + 205.209.212.77 + 15387 + B + + + Instrument Replay + UDP/IP + 224.0.31.177 + 205.209.222.74 + 205.209.222.86 + 14387 + A + + + Instrument Replay + UDP/IP + 224.0.32.177 + 205.209.213.49 + 205.209.214.49 + 15387 + B + + + Snapshot + UDP/IP + 224.0.31.156 + 205.209.222.88 + 205.209.222.78 + 14387 + A + + + Snapshot + UDP/IP + 224.0.32.156 + 205.209.213.53 + 205.209.214.53 + 15387 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.23 + 205.209.222.110 + 205.209.222.111 + 23387 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.86 + 205.209.214.65 + 205.209.213.65 + 22387 + B + + - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.33.1 - 205.209.221.73 - 205.209.223.73 - 14410 - A - - - Incremental - UDP/IP - 224.0.34.1 - 205.209.211.73 - 205.209.212.73 - 15410 - B - - - Instrument Replay - UDP/IP - 224.0.33.43 - 205.209.222.85 - 205.209.222.73 - 14410 - A - - - Instrument Replay - UDP/IP - 224.0.34.43 - 205.209.214.48 - 205.209.213.48 - 15410 - B - - - Snapshot - UDP/IP - 224.0.33.22 - 205.209.222.87 - 205.209.222.77 - 14410 - A - - - Snapshot - UDP/IP - 224.0.34.22 - 205.209.213.52 - 205.209.214.52 - 15410 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.28 - 205.209.222.109 - 205.209.222.108 - 23410 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.91 - 205.209.213.64 - 205.209.214.64 - 22410 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.33.1 + 205.209.221.73 + 205.209.223.73 + 14410 + A + + + Incremental + UDP/IP + 224.0.34.1 + 205.209.211.73 + 205.209.212.73 + 15410 + B + + + Instrument Replay + UDP/IP + 224.0.33.43 + 205.209.222.85 + 205.209.222.73 + 14410 + A + + + Instrument Replay + UDP/IP + 224.0.34.43 + 205.209.214.48 + 205.209.213.48 + 15410 + B + + + Snapshot + UDP/IP + 224.0.33.22 + 205.209.222.87 + 205.209.222.77 + 14410 + A + + + Snapshot + UDP/IP + 224.0.34.22 + 205.209.213.52 + 205.209.214.52 + 15410 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.28 + 205.209.222.109 + 205.209.222.108 + 23410 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.91 + 205.209.213.64 + 205.209.214.64 + 22410 + B + + - - - - - - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.33.2 - 205.209.221.73 - 205.209.223.73 - 14411 - A - - - Incremental - UDP/IP - 224.0.34.2 - 205.209.212.73 - 205.209.211.73 - 15411 - B - - - Instrument Replay - UDP/IP - 224.0.33.44 - 205.209.222.73 - 205.209.222.85 - 14411 - A - - - Instrument Replay - UDP/IP - 224.0.34.44 - 205.209.213.48 - 205.209.214.48 - 15411 - B - - - Snapshot - UDP/IP - 224.0.33.23 - 205.209.222.77 - 205.209.222.87 - 14411 - A - - - Snapshot - UDP/IP - 224.0.34.23 - 205.209.214.52 - 205.209.213.52 - 15411 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.38 - 205.209.222.109 - 205.209.222.108 - 23411 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.101 - 205.209.214.64 - 205.209.213.64 - 22411 - B - - + + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.33.2 + 205.209.221.73 + 205.209.223.73 + 14411 + A + + + Incremental + UDP/IP + 224.0.34.2 + 205.209.212.73 + 205.209.211.73 + 15411 + B + + + Instrument Replay + UDP/IP + 224.0.33.44 + 205.209.222.73 + 205.209.222.85 + 14411 + A + + + Instrument Replay + UDP/IP + 224.0.34.44 + 205.209.213.48 + 205.209.214.48 + 15411 + B + + + Snapshot + UDP/IP + 224.0.33.23 + 205.209.222.77 + 205.209.222.87 + 14411 + A + + + Snapshot + UDP/IP + 224.0.34.23 + 205.209.214.52 + 205.209.213.52 + 15411 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.38 + 205.209.222.109 + 205.209.222.108 + 23411 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.101 + 205.209.214.64 + 205.209.213.64 + 22411 + B + + @@ -9195,88 +8933,88 @@ - - - Historical Replay - TCP/IP - 205.209.220.72 - 205.209.222.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.33.64 - 205.209.223.74 - 205.209.221.74 - 14430 - A - - - Incremental - UDP/IP - 224.0.34.64 - 205.209.211.74 - 205.209.212.74 - 15430 - B - - - Instrument Replay - UDP/IP - 224.0.33.74 - 205.209.222.86 - 205.209.222.74 - 14430 - A - - - Instrument Replay - UDP/IP - 224.0.34.74 - 205.209.213.49 - 205.209.214.49 - 15430 - B - - - Snapshot - UDP/IP - 224.0.33.69 - 205.209.222.78 - 205.209.222.88 - 14430 - A - - - Snapshot - UDP/IP - 224.0.34.69 - 205.209.214.53 - 205.209.213.53 - 15430 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.14 - 205.209.222.110 - 205.209.222.111 - 23430 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.77 - 205.209.213.65 - 205.209.214.65 - 22430 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.33.64 + 205.209.223.74 + 205.209.221.74 + 14430 + A + + + Incremental + UDP/IP + 224.0.34.64 + 205.209.211.74 + 205.209.212.74 + 15430 + B + + + Instrument Replay + UDP/IP + 224.0.33.74 + 205.209.222.86 + 205.209.222.74 + 14430 + A + + + Instrument Replay + UDP/IP + 224.0.34.74 + 205.209.213.49 + 205.209.214.49 + 15430 + B + + + Snapshot + UDP/IP + 224.0.33.69 + 205.209.222.78 + 205.209.222.88 + 14430 + A + + + Snapshot + UDP/IP + 224.0.34.69 + 205.209.214.53 + 205.209.213.53 + 15430 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.14 + 205.209.222.110 + 205.209.222.111 + 23430 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.77 + 205.209.213.65 + 205.209.214.65 + 22430 + B + + @@ -9287,88 +9025,88 @@ - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.33.65 - 205.209.223.74 - 205.209.221.74 - 14431 - A - - - Incremental - UDP/IP - 224.0.34.65 - 205.209.211.74 - 205.209.212.74 - 15431 - B - - - Instrument Replay - UDP/IP - 224.0.33.75 - 205.209.222.86 - 205.209.222.74 - 14431 - A - - - Instrument Replay - UDP/IP - 224.0.34.75 - 205.209.214.49 - 205.209.213.49 - 15431 - B - - - Snapshot - UDP/IP - 224.0.33.70 - 205.209.222.88 - 205.209.222.78 - 14431 - A - - - Snapshot - UDP/IP - 224.0.34.70 - 205.209.214.53 - 205.209.213.53 - 15431 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.15 - 205.209.222.110 - 205.209.222.111 - 23431 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.78 - 205.209.214.65 - 205.209.213.65 - 22431 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.33.65 + 205.209.223.74 + 205.209.221.74 + 14431 + A + + + Incremental + UDP/IP + 224.0.34.65 + 205.209.211.74 + 205.209.212.74 + 15431 + B + + + Instrument Replay + UDP/IP + 224.0.33.75 + 205.209.222.86 + 205.209.222.74 + 14431 + A + + + Instrument Replay + UDP/IP + 224.0.34.75 + 205.209.214.49 + 205.209.213.49 + 15431 + B + + + Snapshot + UDP/IP + 224.0.33.70 + 205.209.222.88 + 205.209.222.78 + 14431 + A + + + Snapshot + UDP/IP + 224.0.34.70 + 205.209.214.53 + 205.209.213.53 + 15431 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.15 + 205.209.222.110 + 205.209.222.111 + 23431 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.78 + 205.209.214.65 + 205.209.213.65 + 22431 + B + + @@ -9408,12 +9146,21 @@ + + + + + + + + + @@ -9427,88 +9174,88 @@ - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.33.80 - 205.209.221.78 - 205.209.223.78 - 14440 - A - - - Incremental - UDP/IP - 224.0.34.80 - 205.209.212.78 - 205.209.211.78 - 15440 - B - - - Instrument Replay - UDP/IP - 224.0.33.90 - 205.209.222.75 - 205.209.222.81 - 14440 - A - - - Instrument Replay - UDP/IP - 224.0.34.90 - 205.209.214.50 - 205.209.213.50 - 15440 - B - - - Snapshot - UDP/IP - 224.0.33.85 - 205.209.222.79 - 205.209.222.83 - 14440 - A - - - Snapshot - UDP/IP - 224.0.34.85 - 205.209.214.54 - 205.209.213.54 - 15440 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.16 - 205.209.222.112 - 205.209.222.113 - 23440 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.79 - 205.209.214.66 - 205.209.213.66 - 22440 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.33.80 + 205.209.221.78 + 205.209.223.78 + 14440 + A + + + Incremental + UDP/IP + 224.0.34.80 + 205.209.212.78 + 205.209.211.78 + 15440 + B + + + Instrument Replay + UDP/IP + 224.0.33.90 + 205.209.222.75 + 205.209.222.81 + 14440 + A + + + Instrument Replay + UDP/IP + 224.0.34.90 + 205.209.214.50 + 205.209.213.50 + 15440 + B + + + Snapshot + UDP/IP + 224.0.33.85 + 205.209.222.79 + 205.209.222.83 + 14440 + A + + + Snapshot + UDP/IP + 224.0.34.85 + 205.209.214.54 + 205.209.213.54 + 15440 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.16 + 205.209.222.112 + 205.209.222.113 + 23440 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.79 + 205.209.214.66 + 205.209.213.66 + 22440 + B + + @@ -9516,88 +9263,88 @@ - - - Historical Replay - TCP/IP - 205.209.220.72 - 205.209.222.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.33.81 - 205.209.221.77 - 205.209.223.77 - 14441 - A - - - Incremental - UDP/IP - 224.0.34.81 - 205.209.212.77 - 205.209.211.77 - 15441 - B - - - Instrument Replay - UDP/IP - 224.0.33.91 - 205.209.222.75 - 205.209.222.81 - 14441 - A - - - Instrument Replay - UDP/IP - 224.0.34.91 - 205.209.213.50 - 205.209.214.50 - 15441 - B - - - Snapshot - UDP/IP - 224.0.33.86 - 205.209.222.79 - 205.209.222.83 - 14441 - A - - - Snapshot - UDP/IP - 224.0.34.86 - 205.209.213.54 - 205.209.214.54 - 15441 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.17 - 205.209.222.112 - 205.209.222.113 - 23441 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.80 - 205.209.213.66 - 205.209.214.66 - 22441 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.33.81 + 205.209.221.77 + 205.209.223.77 + 14441 + A + + + Incremental + UDP/IP + 224.0.34.81 + 205.209.212.77 + 205.209.211.77 + 15441 + B + + + Instrument Replay + UDP/IP + 224.0.33.91 + 205.209.222.75 + 205.209.222.81 + 14441 + A + + + Instrument Replay + UDP/IP + 224.0.34.91 + 205.209.213.50 + 205.209.214.50 + 15441 + B + + + Snapshot + UDP/IP + 224.0.33.86 + 205.209.222.79 + 205.209.222.83 + 14441 + A + + + Snapshot + UDP/IP + 224.0.34.86 + 205.209.213.54 + 205.209.214.54 + 15441 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.17 + 205.209.222.112 + 205.209.222.113 + 23441 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.80 + 205.209.213.66 + 205.209.214.66 + 22441 + B + + @@ -9608,88 +9355,88 @@ - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.33.96 - 205.209.221.74 - 205.209.223.74 - 14450 - A - - - Incremental - UDP/IP - 224.0.34.96 - 205.209.211.74 - 205.209.212.74 - 15450 - B - - - Instrument Replay - UDP/IP - 224.0.33.106 - 205.209.222.86 - 205.209.222.74 - 14450 - A - - - Instrument Replay - UDP/IP - 224.0.34.106 - 205.209.214.49 - 205.209.213.49 - 15450 - B - - - Snapshot - UDP/IP - 224.0.33.101 - 205.209.222.78 - 205.209.222.88 - 14450 - A - - - Snapshot - UDP/IP - 224.0.34.101 - 205.209.214.53 - 205.209.213.53 - 15450 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.13 - 205.209.222.110 - 205.209.222.111 - 23450 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.76 - 205.209.213.65 - 205.209.214.65 - 22450 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.33.96 + 205.209.221.74 + 205.209.223.74 + 14450 + A + + + Incremental + UDP/IP + 224.0.34.96 + 205.209.211.74 + 205.209.212.74 + 15450 + B + + + Instrument Replay + UDP/IP + 224.0.33.106 + 205.209.222.86 + 205.209.222.74 + 14450 + A + + + Instrument Replay + UDP/IP + 224.0.34.106 + 205.209.214.49 + 205.209.213.49 + 15450 + B + + + Snapshot + UDP/IP + 224.0.33.101 + 205.209.222.78 + 205.209.222.88 + 14450 + A + + + Snapshot + UDP/IP + 224.0.34.101 + 205.209.214.53 + 205.209.213.53 + 15450 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.13 + 205.209.222.110 + 205.209.222.111 + 23450 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.76 + 205.209.213.65 + 205.209.214.65 + 22450 + B + + @@ -9739,10 +9486,10 @@ - + - + @@ -9775,88 +9522,88 @@ - - - Historical Replay - TCP/IP - 205.209.220.72 - 205.209.222.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.33.112 - 205.209.221.71 - 205.209.223.71 - 14460 - A - - - Incremental - UDP/IP - 224.0.34.112 - 205.209.212.71 - 205.209.211.71 - 15460 - B - - - Instrument Replay - UDP/IP - 224.0.33.122 - 205.209.222.73 - 205.209.222.85 - 14460 - A - - - Instrument Replay - UDP/IP - 224.0.34.122 - 205.209.213.48 - 205.209.214.48 - 15460 - B - - - Snapshot - UDP/IP - 224.0.33.117 - 205.209.222.77 - 205.209.222.87 - 14460 - A - - - Snapshot - UDP/IP - 224.0.34.117 - 205.209.214.52 - 205.209.213.52 - 15460 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.36 - 205.209.222.109 - 205.209.222.108 - 23460 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.99 - 205.209.214.64 - 205.209.213.64 - 22460 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.33.112 + 205.209.221.71 + 205.209.223.71 + 14460 + A + + + Incremental + UDP/IP + 224.0.34.112 + 205.209.212.71 + 205.209.211.71 + 15460 + B + + + Instrument Replay + UDP/IP + 224.0.33.122 + 205.209.222.73 + 205.209.222.85 + 14460 + A + + + Instrument Replay + UDP/IP + 224.0.34.122 + 205.209.213.48 + 205.209.214.48 + 15460 + B + + + Snapshot + UDP/IP + 224.0.33.117 + 205.209.222.77 + 205.209.222.87 + 14460 + A + + + Snapshot + UDP/IP + 224.0.34.117 + 205.209.214.52 + 205.209.213.52 + 15460 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.36 + 205.209.222.109 + 205.209.222.108 + 23460 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.99 + 205.209.214.64 + 205.209.213.64 + 22460 + B + + @@ -9869,9 +9616,18 @@ + + + + + + + + + @@ -9884,6 +9640,9 @@ + + + @@ -9921,394 +9680,410 @@ - + - + - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.33.113 - 205.209.223.74 - 205.209.221.74 - 14461 - A - - - Incremental - UDP/IP - 224.0.34.113 - 205.209.211.74 - 205.209.212.74 - 15461 - B - - - Instrument Replay - UDP/IP - 224.0.33.123 - 205.209.222.86 - 205.209.222.74 - 14461 - A - - - Instrument Replay - UDP/IP - 224.0.34.123 - 205.209.213.49 - 205.209.214.49 - 15461 - B - - - Snapshot - UDP/IP - 224.0.33.118 - 205.209.222.78 - 205.209.222.88 - 14461 - A - - - Snapshot - UDP/IP - 224.0.34.118 - 205.209.213.53 - 205.209.214.53 - 15461 - B - - - Snapshot-MBO - UDP/IP - 233.72.75.37 - 205.209.222.110 - 205.209.222.111 - 23461 - A - - - Snapshot-MBO - UDP/IP - 233.72.75.100 - 205.209.213.65 - 205.209.214.65 - 22461 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.33.113 + 205.209.223.74 + 205.209.221.74 + 14461 + A + + + Incremental + UDP/IP + 224.0.34.113 + 205.209.211.74 + 205.209.212.74 + 15461 + B + + + Instrument Replay + UDP/IP + 224.0.33.123 + 205.209.222.86 + 205.209.222.74 + 14461 + A + + + Instrument Replay + UDP/IP + 224.0.34.123 + 205.209.213.49 + 205.209.214.49 + 15461 + B + + + Snapshot + UDP/IP + 224.0.33.118 + 205.209.222.78 + 205.209.222.88 + 14461 + A + + + Snapshot + UDP/IP + 224.0.34.118 + 205.209.213.53 + 205.209.214.53 + 15461 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.37 + 205.209.222.110 + 205.209.222.111 + 23461 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.100 + 205.209.213.65 + 205.209.214.65 + 22461 + B + + + + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.33.144 + 205.209.220.70 + 205.209.222.70 + 14520 + A + + + Incremental + UDP/IP + 224.0.34.144 + 205.209.213.46 + 205.209.214.46 + 15520 + B + + + Instrument Replay + UDP/IP + 224.0.33.154 + 205.209.222.76 + 205.209.222.82 + 14520 + A + + + Instrument Replay + UDP/IP + 224.0.34.154 + 205.209.214.51 + 205.209.213.51 + 15520 + B + + + Snapshot + UDP/IP + 224.0.33.149 + 205.209.222.80 + 205.209.222.84 + 14520 + A + + + Snapshot + UDP/IP + 224.0.34.149 + 205.209.214.55 + 205.209.213.55 + 15520 + B + + + + + + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.33.145 + 205.209.220.70 + 205.209.222.70 + 14521 + A + + + Incremental + UDP/IP + 224.0.34.145 + 205.209.213.46 + 205.209.214.46 + 15521 + B + + + Instrument Replay + UDP/IP + 224.0.33.155 + 205.209.222.76 + 205.209.222.82 + 14521 + A + + + Instrument Replay + UDP/IP + 224.0.34.155 + 205.209.214.51 + 205.209.213.51 + 15521 + B + + + Snapshot + UDP/IP + 224.0.33.150 + 205.209.222.80 + 205.209.222.84 + 14521 + A + + + Snapshot + UDP/IP + 224.0.34.150 + 205.209.214.55 + 205.209.213.55 + 15521 + B + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + Incremental + UDP/IP + 224.0.28.125 + 69.50.112.67 + 11644 + A + + + Incremental + UDP/IP + 224.0.25.101 + 69.50.112.67 + 11744 + B + + + Instrument Replay + UDP/IP + 224.0.28.125 + 69.50.112.76 + 16644 + A + + + Snapshot + UDP/IP + 224.0.28.79 + 69.50.112.76 + 19644 + A + + + Snapshot-MBO + UDP/IP + 224.0.25.254 + 69.50.112.66 + 20644 + A + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.33.144 - 205.209.220.70 - 205.209.222.70 - 14520 - A - - - Incremental - UDP/IP - 224.0.34.144 - 205.209.213.46 - 205.209.214.46 - 15520 - B - - - Instrument Replay - UDP/IP - 224.0.33.154 - 205.209.222.76 - 205.209.222.82 - 14520 - A - - - Instrument Replay - UDP/IP - 224.0.34.154 - 205.209.214.51 - 205.209.213.51 - 15520 - B - - - Snapshot - UDP/IP - 224.0.33.149 - 205.209.222.80 - 205.209.222.84 - 14520 - A - - - Snapshot - UDP/IP - 224.0.34.149 - 205.209.214.55 - 205.209.213.55 - 15520 - B - - - - - - - + + - - + + - - - Historical Replay - TCP/IP - 205.209.222.72 - 205.209.220.72 - 10000 - A - - - Incremental - UDP/IP - 224.0.33.145 - 205.209.220.70 - 205.209.222.70 - 14521 - A - - - Incremental - UDP/IP - 224.0.34.145 - 205.209.213.46 - 205.209.214.46 - 15521 - B - - - Instrument Replay - UDP/IP - 224.0.33.155 - 205.209.222.76 - 205.209.222.82 - 14521 - A - - - Instrument Replay - UDP/IP - 224.0.34.155 - 205.209.214.51 - 205.209.213.51 - 15521 - B - - - Snapshot - UDP/IP - 224.0.33.150 - 205.209.222.80 - 205.209.222.84 - 14521 - A - - - Snapshot - UDP/IP - 224.0.34.150 - 205.209.214.55 - 205.209.213.55 - 15521 - B - - + + + Incremental + UDP/IP + 224.0.28.126 + 69.50.112.67 + 11648 + A + + + Incremental + UDP/IP + 224.0.25.101 + 69.50.112.67 + 11748 + B + + + Instrument Replay + UDP/IP + 224.0.28.126 + 69.50.112.77 + 16648 + A + + + Snapshot + UDP/IP + 224.0.25.127 + 69.50.112.77 + 19648 + A + + + Snapshot-MBO + UDP/IP + 224.0.25.254 + 69.50.112.77 + 20648 + A + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + diff --git a/src/test/resources/log4j2.xml b/mbp-only/src/test/resources/log4j2.xml similarity index 100% rename from src/test/resources/log4j2.xml rename to mbp-only/src/test/resources/log4j2.xml diff --git a/src/test/resources/prod/templates_FixBinary.xml b/mbp-only/src/test/resources/templates_FixBinary.xml similarity index 100% rename from src/test/resources/prod/templates_FixBinary.xml rename to mbp-only/src/test/resources/templates_FixBinary.xml diff --git a/mbp-with-mbo/build.gradle b/mbp-with-mbo/build.gradle new file mode 100644 index 0000000..e1b96bd --- /dev/null +++ b/mbp-with-mbo/build.gradle @@ -0,0 +1,50 @@ +plugins { + id "java" + id "maven" + id "java-library-distribution" + id "me.champeau.gradle.jmh" version "0.3.1" +} + +group = 'com.epam.cme' +version = '2.0' +sourceCompatibility = 1.8 +targetCompatibility = 1.8 + +repositories { + mavenCentral() +} + +jar { + baseName 'b2bits-jmdp3' +} + +dependencies { + compile project(':core') + compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.5' + compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.5' + compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.0' + runtime group: 'org.apache.logging.log4j', name: 'log4j-slf4j-impl', version: '2.5' + compile group: 'net.openhft', name: 'koloboke-api-jdk8', version: '0.6.8' + runtime group: 'net.openhft', name: 'koloboke-impl-jdk8', version: '0.6.8' + compile group: 'net.openhft', name: 'chronicle-core', version: '1.7.6' + compile group: 'org.agrona', name: 'agrona', version: '0.9.5' + testCompile group: 'junit', name: 'junit', version: '4.12' + testCompile group: 'uk.co.real-logic', name: 'sbe-tool', version: '1.6.0' +} + +distributions { + main { + baseName = 'b2bits-jmdp3' + contents { + from { '../dist' } + } + } +} + +task testJar(type: Jar) { + classifier = 'tests' + from sourceSets.test.output + manifest { + attributes 'Main-Class': 'com.epam.cme.mdp3.test.MBOWithMBPMain' + } +} diff --git a/mbp-with-mbo/src/jmh/java/com/epam/cme/mdp3/test/perf/BufferBenchmarkTest.java b/mbp-with-mbo/src/jmh/java/com/epam/cme/mdp3/test/perf/BufferBenchmarkTest.java new file mode 100644 index 0000000..21c6c33 --- /dev/null +++ b/mbp-with-mbo/src/jmh/java/com/epam/cme/mdp3/test/perf/BufferBenchmarkTest.java @@ -0,0 +1,43 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.test.perf; + +import com.epam.cme.mdp3.MdpPacket; +import com.epam.cme.mdp3.control.MDPOffHeapBuffer; +import com.epam.cme.mdp3.test.ModelUtils; +import org.openjdk.jmh.annotations.*; + +import java.util.concurrent.TimeUnit; + +@State(Scope.Thread) +public class BufferBenchmarkTest { + private MDPOffHeapBuffer buffer; + private MdpPacket n1; + + @Setup + public void init(){ + buffer = new MDPOffHeapBuffer(2); + n1 = MdpPacket.allocate(); n1.wrapFromBuffer(ModelUtils.getMBOIncrementTestMessage(1)); + } + + @Benchmark + @BenchmarkMode(Mode.SampleTime) + @OutputTimeUnit(TimeUnit.MICROSECONDS) + @Fork(1) + @Warmup(iterations = 2, time = 3) + @Measurement(iterations = 3, time = 7) + public void test(){ + buffer.add(n1); + buffer.remove(); + } +} diff --git a/mbp-with-mbo/src/jmh/java/com/epam/cme/mdp3/test/perf/IncrementalRefreshPerfTest.java b/mbp-with-mbo/src/jmh/java/com/epam/cme/mdp3/test/perf/IncrementalRefreshPerfTest.java new file mode 100644 index 0000000..b8db092 --- /dev/null +++ b/mbp-with-mbo/src/jmh/java/com/epam/cme/mdp3/test/perf/IncrementalRefreshPerfTest.java @@ -0,0 +1,266 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.test.perf; + +import com.epam.cme.mdp3.*; +import com.epam.cme.mdp3.channel.LowLevelMdpChannel; +import com.epam.cme.mdp3.channel.MdpChannelBuilder; +import com.epam.cme.mdp3.core.channel.MdpFeedContext; +import com.epam.cme.mdp3.core.channel.MdpFeedListener; +import com.epam.cme.mdp3.mktdata.enums.MDEntryType; +import com.epam.cme.mdp3.mktdata.enums.MDUpdateAction; +import com.epam.cme.mdp3.sbe.message.SbeConstants; +import com.epam.cme.mdp3.sbe.message.SbeDouble; +import org.openjdk.jmh.annotations.*; +import com.epam.cme.mdp3.test.ModelUtils; + +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.concurrent.TimeUnit; + +import static com.epam.cme.mdp3.MdConstants.*; + + +public class IncrementalRefreshPerfTest { + private static MdpChannelBuilder mdpHandlerBuilder; + private static final int TEST_CHANNEL_ID = 310; + private static SbeDouble doubleVal = SbeDouble.instance(); + private volatile static boolean print = false; + + static { + try { + mdpHandlerBuilder = new MdpChannelBuilder(String.valueOf(TEST_CHANNEL_ID), + IncrementalRefreshPerfTest.class.getResource("/config.xml").toURI(), + IncrementalRefreshPerfTest.class.getResource("/templates_FixBinary.xml").toURI()) + .usingListener(new VoidChannelListener() { + @Override + public void onIncrementalMBORefresh(final String channelId, final short matchEventIndicator, final int securityId, + final String secDesc, final long msgSeqNum, final FieldSet orderIDEntry, final FieldSet mdEntry){ + printMBOEntity(channelId, matchEventIndicator, securityId, secDesc, msgSeqNum, orderIDEntry, mdEntry, print); + } + + @Override + public void onIncrementalMBPRefresh(final String channelId, final short matchEventIndicator, final int securityId, + final String secDesc, final long msgSeqNum, final FieldSet mdEntry){ + printMBPEntity(channelId, matchEventIndicator, securityId, secDesc, msgSeqNum, mdEntry, print); + } + + @Override + public int onSecurityDefinition(final String channelId, final MdpMessage secDefMessage) { + return MdEventFlags.MESSAGE; + } + }); + } catch (Exception e) { + e.printStackTrace(); + } + } + + @Benchmark + @BenchmarkMode(Mode.SampleTime) + @OutputTimeUnit(TimeUnit.MICROSECONDS) + @Fork(1) + @Warmup(iterations = 2, time = 3) + @Measurement(iterations = 5, time = 5) + public void mboWithMBP(MBOIncrementalRefreshTestState testState) { + testState.handleNextTestPacket(); + } + + @Benchmark + @BenchmarkMode(Mode.SampleTime) + @OutputTimeUnit(TimeUnit.MICROSECONDS) + @Fork(1) + @Warmup(iterations = 2, time = 3) + @Measurement(iterations = 5, time = 5) + public void MBPOnly(MBPOnlyIncrementalRefreshTestState testState) { + testState.handleNextTestPacket(); + } + + @Benchmark + @BenchmarkMode(Mode.SampleTime) + @OutputTimeUnit(TimeUnit.MICROSECONDS) + @Fork(1) + @Warmup(iterations = 2, time = 3) + @Measurement(iterations = 5, time = 5) + public void MBOOnly(MBOOnlyIncrementalRefreshTestState testState) { + testState.handleNextTestPacket(); + } + + + private static void printMBOEntity(final String channelId, final short matchEventIndicator, final int securityId, + final String secDesc, final long msgSeqNum, final FieldSet orderIDEntry, final FieldSet mdEntry, boolean print){ + MDUpdateAction mdUpdateAction; + long orderId = orderIDEntry.getUInt64(37); + long mdOrderPriority = orderIDEntry.getUInt64(37707); + long mdDisplayQty = orderIDEntry.getInt32(37706); + MDEntryType mdEntryType; + if(mdEntry == null) {//MBO only + orderIDEntry.getDouble(270, doubleVal); + mdUpdateAction = MDUpdateAction.fromFIX(orderIDEntry.getUInt8(279)); + mdEntryType = MDEntryType.fromFIX(orderIDEntry.getChar(269)); + if(print) { + System.out.printf("\tsecurityId: %s-%s, orderId - '%s', mdOrderPriority - '%s', priceMantissa - '%s', mdDisplayQty - '%s', mdEntryType - '%s', mdUpdateAction - '%s'\n", + securityId, secDesc, orderId, mdOrderPriority, doubleVal.getMantissa(), mdDisplayQty, mdEntryType, mdUpdateAction); + } + } else { + mdEntry.getDouble(270, doubleVal); + mdUpdateAction = MDUpdateAction.fromFIX(orderIDEntry.getUInt8(37708)); + mdEntryType = MDEntryType.fromFIX(mdEntry.getChar(269)); + if(print) { + System.out.printf("\tsecurityId: %s-%s, orderId - '%s', mdOrderPriority - '%s', priceMantissa - '%s', mdDisplayQty - '%s', mdEntryType - '%s', mdUpdateAction - '%s'\n", + securityId, secDesc, orderId, mdOrderPriority, doubleVal.getMantissa(), mdDisplayQty, mdEntryType, mdUpdateAction); + } + } + + } + + private static void printMBPEntity(final String channelId, final short matchEventIndicator, final int securityId, + final String secDesc, final long msgSeqNum, final FieldSet mdEntry, boolean print){ + final MDEntryType mdEntryType = MDEntryType.fromFIX(mdEntry.getChar(INCR_RFRSH_MD_ENTRY_TYPE)); + final MDUpdateAction mdUpdateAction = MDUpdateAction.fromFIX(mdEntry.getUInt8(INCR_RFRSH_MD_ACTION)); + final long rptSeqNum = mdEntry.getUInt32(RPT_SEQ_NUM); + + mdEntry.getDouble(INCR_RFRSH_MD_ENTRY_PX, doubleVal); + int entrySize = mdEntry.getInt32(INCR_RFRSH_MD_ENTRY_SIZE); + int orderNum = mdEntry.getInt32(INCR_RFRSH_MD_ORDER_NUM); + final short level = mdEntry.getUInt8(INCR_RFRSH_MD_PRICE_LEVEL); + + if (print){ + System.out.printf("\tmsgSeqNum=%1$d; secId=%2$d; rptSeqNum=%3$d; mdEntryType=%4$s; mdAction=%5$s; level=%6$d; entrySize=%7$d; orderNum=%8$d; priceMantissa=%9$d%n", + msgSeqNum, securityId, rptSeqNum, mdEntryType, mdUpdateAction, level, entrySize, orderNum, doubleVal.getMantissa()); + } + + } + + @State(Scope.Benchmark) + public static class MBOIncrementalRefreshTestState { + public static final int SECURITY_ID = 998350; + MdpChannel mdpChannel; + MdpFeedListener mdpFeedListener; + final MdpFeedContext incrementContext = new MdpFeedContext(Feed.A, FeedType.I); + final MdpFeedContext instrumentContext = new MdpFeedContext(Feed.A, FeedType.N); + private final MdpFeedContext mboSnapshotContext = new MdpFeedContext(Feed.A, FeedType.SMBO); + private int testPkctSeqNum = 0; + final MdpPacket testPacket = MdpPacket.instance(); + final ByteBuffer testBuffer = ByteBuffer.allocateDirect(SbeConstants.MDP_PACKET_MAX_SIZE).order(ByteOrder.LITTLE_ENDIAN); + byte[] incrementBytes; + final int sequenceLength = 4; + + public void handleNextTestPacket() { + handleNextTestPacket(incrementContext, incrementBytes, ++testPkctSeqNum); + } + + private void handleNextTestPacket(MdpFeedContext context, byte[] bytes, int sequence) { + testBuffer.clear(); + testBuffer.putInt(sequence); + testBuffer.put(bytes); + testBuffer.flip(); + testPacket.length(sequenceLength + bytes.length); + mdpFeedListener.onPacket(context, testPacket); + } + + void handleNextTestPacketWithSequenceReplace(MdpFeedContext context, ByteBuffer bb, int sequence) { + byte[] bytes = new byte[bb.remaining() - sequenceLength]; + bb.position(sequenceLength); + bb.get(bytes); + handleNextTestPacket(context, bytes, sequence); + } + + @Setup(Level.Trial) + public void doSetup() throws Exception { + testPacket.wrapFromBuffer(testBuffer); + ByteBuffer incrementBB = getTestPacket(); + incrementBytes = new byte[incrementBB.remaining() - sequenceLength]; + incrementBB.position(sequenceLength); + incrementBB.get(incrementBytes); + LowLevelMdpChannel lowLevelMdpChannel = (LowLevelMdpChannel)mdpHandlerBuilder.build(); + mdpFeedListener = lowLevelMdpChannel.getFeedListener(); + mdpChannel = lowLevelMdpChannel; + ByteBuffer snapshotMBOBBFirstCycle = ModelUtils.getMBOSnapshotTestMessage(1, SECURITY_ID, 0, 1, 1, 1); + ByteBuffer snapshotMBPBBFirstCycle = ModelUtils.getMBPSnapshotTestMessage(1, SECURITY_ID, 0, 1); + ByteBuffer snapshotMBOBBSecondCycle = ModelUtils.getMBOSnapshotTestMessage(1, SECURITY_ID, 0, 1, 1, 1); + ByteBuffer snapshotMBPBBSecondCycle = ModelUtils.getMBPSnapshotTestMessage(1, SECURITY_ID, 0, 1); + ByteBuffer instrumentBB = ModelUtils.getMDInstrumentDefinitionFuture27(1, SECURITY_ID); + handleNextTestPacketWithSequenceReplace(instrumentContext, instrumentBB, 1); + handleNextTestPacketWithSequenceReplace(mboSnapshotContext, snapshotMBOBBFirstCycle, 1); + handleNextTestPacketWithSequenceReplace(mboSnapshotContext, snapshotMBPBBFirstCycle, 1); + handleNextTestPacketWithSequenceReplace(mboSnapshotContext, snapshotMBOBBSecondCycle, 1);//next cycle + handleNextTestPacketWithSequenceReplace(mboSnapshotContext, snapshotMBPBBSecondCycle, 1);//next cycle + System.out.println("Initialized"); + } + + @TearDown(Level.Trial) + public void doShutdown() throws Exception { + testPacket.release(); + mdpChannel.close(); + } + + protected ByteBuffer getTestPacket(){ + return ModelUtils.getMBOWithMBPIncrementWith12TestEntries(0, SECURITY_ID); + } + } + + @State(Scope.Benchmark) + public static class MBOOnlyIncrementalRefreshTestState extends MBOIncrementalRefreshTestState { + protected ByteBuffer getTestPacket(){ + return ModelUtils.getMBOOnlyIncrementWith12TestEntries(0, SECURITY_ID); + } + } + + @State(Scope.Benchmark) + public static class MBPOnlyIncrementalRefreshTestState extends MBOIncrementalRefreshTestState { + private final MdpFeedContext mbpSnapshotContext = new MdpFeedContext(Feed.A, FeedType.S); + + protected ByteBuffer getTestPacket(){ + return ModelUtils.getMBPOnlyIncrementWith12TestEntries(0, SECURITY_ID); + } + + @Setup(Level.Trial) + public void doSetup() throws Exception { + testPacket.wrapFromBuffer(testBuffer); + ByteBuffer incrementBB = getTestPacket(); + incrementBytes = new byte[incrementBB.remaining() - sequenceLength]; + incrementBB.position(sequenceLength); + incrementBB.get(incrementBytes); + LowLevelMdpChannel lowLevelMdpChannel = (LowLevelMdpChannel)mdpHandlerBuilder.build(); + mdpFeedListener = lowLevelMdpChannel.getFeedListener(); + mdpChannel = lowLevelMdpChannel; + ByteBuffer snapshotMBPBBFirstCycle = ModelUtils.getMBPSnapshotTestMessage(1, SECURITY_ID, 0, 1); + ByteBuffer snapshotMBPBBSecondCycle = ModelUtils.getMBPSnapshotTestMessage(1, SECURITY_ID, 0, 1); + ByteBuffer instrumentBB = ModelUtils.getMDInstrumentDefinitionFuture27(1, SECURITY_ID); + handleNextTestPacketWithSequenceReplace(instrumentContext, instrumentBB, 1); + handleNextTestPacketWithSequenceReplace(mbpSnapshotContext, snapshotMBPBBFirstCycle, 1); + handleNextTestPacketWithSequenceReplace(mbpSnapshotContext, snapshotMBPBBSecondCycle, 1);//next cycle + System.out.println("Initialized"); + } + } + + public static void main(String[] args) throws Exception { + print = true; + MBOIncrementalRefreshTestState mboIncrementalRefreshTestState = new MBOIncrementalRefreshTestState(); + mboIncrementalRefreshTestState.doSetup(); + mboIncrementalRefreshTestState.handleNextTestPacket(); + mboIncrementalRefreshTestState.doShutdown(); + + MBOIncrementalRefreshTestState mboWithMbpIncrementalRefreshTestState = new MBPOnlyIncrementalRefreshTestState(); + mboWithMbpIncrementalRefreshTestState.doSetup(); + mboWithMbpIncrementalRefreshTestState.handleNextTestPacket(); + mboWithMbpIncrementalRefreshTestState.doShutdown(); + + MBOOnlyIncrementalRefreshTestState mboOnlyIncrementalRefreshTestState = new MBOOnlyIncrementalRefreshTestState(); + mboOnlyIncrementalRefreshTestState.doSetup(); + mboOnlyIncrementalRefreshTestState.handleNextTestPacket(); + mboOnlyIncrementalRefreshTestState.doShutdown(); + } + + +} diff --git a/mbp-with-mbo/src/jmh/java/com/epam/cme/mdp3/test/perf/SnapshotCycleHandlerTest.java b/mbp-with-mbo/src/jmh/java/com/epam/cme/mdp3/test/perf/SnapshotCycleHandlerTest.java new file mode 100644 index 0000000..3295753 --- /dev/null +++ b/mbp-with-mbo/src/jmh/java/com/epam/cme/mdp3/test/perf/SnapshotCycleHandlerTest.java @@ -0,0 +1,50 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.test.perf; + +import com.epam.cme.mdp3.control.OffHeapSnapshotCycleHandler; +import com.epam.cme.mdp3.control.SnapshotCycleHandler; +import org.openjdk.jmh.annotations.*; + +import java.util.concurrent.TimeUnit; + +@State(Scope.Thread) +public class SnapshotCycleHandlerTest { + private SnapshotCycleHandler cycleHandler = new OffHeapSnapshotCycleHandler(); + private long totNumReports = 2; + private int securityId1 = 10; + private int securityId2 = 20; + private long securityId1NoChunks = 2; + private long securityId2NoChunks = 1; + private long lastMsgSeqNumProcessed = 1001; + + + @Benchmark + @BenchmarkMode(Mode.SampleTime) + @OutputTimeUnit(TimeUnit.MICROSECONDS) + @Fork(1) + @Warmup(iterations = 2, time = 3) + @Measurement(iterations = 3, time = 20) + public void test(){ + cycleHandler.getSnapshotSequence(securityId1); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId1, securityId1NoChunks, 1); + cycleHandler.getSnapshotSequence(securityId1); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId1, securityId1NoChunks, 2); + cycleHandler.getSnapshotSequence(securityId2); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId2, securityId2NoChunks, 1); + if(cycleHandler.getSnapshotSequence(securityId1) == SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED){ + throw new RuntimeException(); + } + cycleHandler.reset(); + } +} diff --git a/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/ChannelListener.java b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/ChannelListener.java new file mode 100644 index 0000000..e2da7b6 --- /dev/null +++ b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/ChannelListener.java @@ -0,0 +1,65 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3; + + +import com.epam.cme.mdp3.core.channel.CoreChannelListener; + +public interface ChannelListener extends CoreChannelListener { + /** + * Called when MDP Incremental Refresh Message is received and Security-related entry is processed. + * + * Only when MBO is enabled. + * + * @param channelId ID of MDP Channel + * @param matchEventIndicator MDP Event indicator (bitset, @see MDP 3.0 - Market Data Incremental Refresh) + * @param secDesc Security description + * @param msgSeqNum Message sequence number of message. + * @param securityId Security ID + * @param orderEntry MBO Entry of Group from MDP Incremental Refresh Message. It can not be null. + * @param mdEntry MBP Entry of Group from MDP Incremental Refresh Message. It can be null when MBO Incremental Refresh is received in separated template. + */ + void onIncrementalMBORefresh(final String channelId, final short matchEventIndicator, final int securityId, + final String secDesc, final long msgSeqNum, final FieldSet orderEntry, final FieldSet mdEntry); + + /** + * + * @param channelId ID of MDP Channel + * @param matchEventIndicator MDP Event indicator (bitset, @see MDP 3.0 - Market Data Incremental Refresh) + * @param securityId Security ID + * @param secDesc Security description + * @param msgSeqNum Message sequence number of message. + * @param mdEntry MBP Entry of Group from MDP Incremental Refresh Message. It can not be null. + */ + void onIncrementalMBPRefresh(final String channelId, final short matchEventIndicator, final int securityId, + final String secDesc, final long msgSeqNum, final FieldSet mdEntry); + + /** + * Called when MDP Snapshot Full Refresh Message for MBO is received and processed. + * + * @param channelId ID of MDP Channel + * @param secDesc Security description + * @param snptMessage MDP Snapshot Full Refresh Message for MBO + */ + void onSnapshotMBOFullRefresh(final String channelId, final String secDesc, final MdpMessage snptMessage); + + /** + * Called when MDP Snapshot Full Refresh Message is received and processed. + * + * @param channelId ID of MDP Channel + * @param secDesc Security description + * @param snptMessage MDP Snapshot Full Refresh Message for MBP + */ + void onSnapshotMBPFullRefresh(final String channelId, final String secDesc, final MdpMessage snptMessage); + +} diff --git a/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/MdpChannel.java b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/MdpChannel.java new file mode 100644 index 0000000..002319b --- /dev/null +++ b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/MdpChannel.java @@ -0,0 +1,101 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3; + +import com.epam.cme.mdp3.core.channel.MdpFeedException; + +import java.util.List; + +/** + * Interface to MDP Channel with its lifecycle and all included Feeds inside too. + */ +public interface MdpChannel { + /** + * Gets ID of MDP Channel. + * + * @return Channel ID + */ + String getId(); + + /** + * Closes MDP Channel and releases all resources. + */ + void close(); + + + /** + * Gets current State of the channel. + * + * @return Channel State + */ + ChannelState getState(); + + /** + * Registers Channel Listener. + * + * @param channelListener Instance of Channel Listener + * @see ChannelListener + */ + void registerListener(ChannelListener channelListener); + + /** + * Removes Channel Listener. + * + * @param channelListener Instance of Channel Listener + * @see ChannelListener + */ + void removeListener(ChannelListener channelListener); + + /** + * Gets all registered Channel Listeners. + * + * @return List of ChannelListeners + * @see ChannelListener + */ + List getListeners(); + + /** + * Starts defined feed. + * @param feedType + * @param feed + * @throws MdpFeedException + */ + void startFeed(FeedType feedType, Feed feed) throws MdpFeedException; + + /** + * Stops defined feed. + * @param feedType + * @param feed + */ + void stopFeed(FeedType feedType, Feed feed); + + /** + * Stops all Feeds. + */ + void stopAllFeeds(); + + /** + * Subscribes to the given security. + * + * @param securityId Security ID + * @return true if subscribed with success + */ + boolean subscribe(int securityId, final String secDesc); + + /** + * Removes subscription to the given security. + * + * @param securityId Security ID + */ + void discontinueSecurity(int securityId); +} diff --git a/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/VoidChannelListener.java b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/VoidChannelListener.java new file mode 100644 index 0000000..8b2330b --- /dev/null +++ b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/VoidChannelListener.java @@ -0,0 +1,81 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General default License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General default License for more details. + * You should have received a copy of the GNU General default License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3; + +public interface VoidChannelListener extends ChannelListener { + + @Override + default void onFeedStarted(String channelId, FeedType feedType, Feed feed) { + + } + + @Override + default void onFeedStopped(String channelId, FeedType feedType, Feed feed) { + + } + + @Override + default void onPacket(String channelId, FeedType feedType, Feed feed, MdpPacket mdpPacket) { + + } + + @Override + default void onBeforeChannelReset(String channelId, MdpMessage resetMessage) { + + } + + @Override + default void onFinishedChannelReset(String channelId, MdpMessage resetMessage) { + + } + + @Override + default void onChannelStateChanged(String channelId, ChannelState prevState, ChannelState newState) { + + } + + @Override + default int onSecurityDefinition(String channelId, MdpMessage secDefMessage) { + return MatchEventIndicator.NOTHING; + } + + @Override + default void onRequestForQuote(String channelId, MdpMessage rfqMessage) { + + } + + @Override + default void onSecurityStatus(String channelId, int securityId, MdpMessage secStatusMessage) { + + } + + @Override + default void onIncrementalMBORefresh(String channelId, short matchEventIndicator, int securityId, String secDesc, long msgSeqNum, FieldSet orderEntry, FieldSet mdEntry) { + + } + + @Override + default void onIncrementalMBPRefresh(String channelId, short matchEventIndicator, int securityId, String secDesc, long msgSeqNum, FieldSet mdEntry) { + + } + + @Override + default void onSnapshotMBOFullRefresh(String channelId, String secDesc, MdpMessage snptMessage) { + + } + + @Override + default void onSnapshotMBPFullRefresh(String channelId, String secDesc, MdpMessage snptMessage) { + + } +} diff --git a/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/channel/LowLevelMdpChannel.java b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/channel/LowLevelMdpChannel.java new file mode 100644 index 0000000..c2d670f --- /dev/null +++ b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/channel/LowLevelMdpChannel.java @@ -0,0 +1,392 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.channel; + +import com.epam.cme.mdp3.*; +import com.epam.cme.mdp3.control.*; +import com.epam.cme.mdp3.core.cfg.ChannelCfg; +import com.epam.cme.mdp3.core.cfg.ConnectionCfg; +import com.epam.cme.mdp3.core.channel.*; +import com.epam.cme.mdp3.core.channel.tcp.MdpTCPChannel; +import com.epam.cme.mdp3.core.channel.tcp.MdpTCPMessageRequester; +import com.epam.cme.mdp3.core.channel.tcp.TCPChannel; +import com.epam.cme.mdp3.core.channel.tcp.TCPMessageRequester; +import com.epam.cme.mdp3.control.ChannelController; +import com.epam.cme.mdp3.sbe.message.SbeString; +import com.epam.cme.mdp3.sbe.message.meta.MdpMessageType; +import com.epam.cme.mdp3.sbe.schema.MdpMessageTypes; +import org.apache.commons.lang3.tuple.MutablePair; +import org.apache.commons.lang3.tuple.Pair; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.ScheduledFuture; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicInteger; +import java.util.function.Consumer; + +public class LowLevelMdpChannel implements MdpChannel { + private static final Logger logger = LoggerFactory.getLogger(LowLevelMdpChannel.class); + + private static final int FEED_IDLE_CHECK_DELAY = 100; + private static final TimeUnit FEED_IDLE_CHECK_DELAY_UNIT = TimeUnit.SECONDS; + private final ChannelCfg channelCfg; + private final ScheduledExecutorService scheduledExecutorService; + private int rcvBufSize; + private Map> feedsA = new ConcurrentHashMap<>(); + private Map> feedsB = new ConcurrentHashMap<>(); + private Map feedANetworkInterfaces; + private Map feedBNetworkInterfaces; + private volatile Feed snptFeedToUse = Feed.A; + private final MdpFeedListener feedListener = new FeedListenerImpl(); + private final List listeners = new ArrayList<>(); + private long idleWindowInMillis = FEED_IDLE_CHECK_DELAY_UNIT.toMillis(FEED_IDLE_CHECK_DELAY); + private final GapChannelController channelController; + private volatile ScheduledFuture checkFeedIdleStateFuture; + private volatile long lastIncrPcktReceived = 0; + private final InstrumentManager instrumentManager; + private final MdpMessageTypes mdpMessageTypes; + private final boolean mboEnabled; + private final InstrumentObserver instrumentObserver = new InstrumentObserverImpl(); + private final GapChannelController.SnapshotRecoveryManager recoveryManager; + + LowLevelMdpChannel(final ScheduledExecutorService scheduledExecutorService, + final ChannelCfg channelCfg, + final MdpMessageTypes mdpMessageTypes, + final int incrQueueSize, + final int rcvBufSize, + final int gapThreshold, + final String tcpUsername, + final String tcpPassword, + final Map feedANetworkInterfaces, + final Map feedBNetworkInterfaces, + boolean mboEnabled) { + this.scheduledExecutorService = scheduledExecutorService; + this.channelCfg = channelCfg; + this.rcvBufSize = rcvBufSize; + this.feedANetworkInterfaces = feedANetworkInterfaces; + this.feedBNetworkInterfaces = feedBNetworkInterfaces; + this.mdpMessageTypes = mdpMessageTypes; + this.mboEnabled = mboEnabled; + String channelId = channelCfg.getId(); + instrumentManager = new MdpInstrumentManager(channelId, listeners); + Buffer buffer = new MDPOffHeapBuffer(incrQueueSize); + List> emptyBookConsumers = new ArrayList<>(); + ChannelController target = new ChannelControllerRouter(channelId, instrumentManager, mdpMessageTypes, listeners, + instrumentObserver, emptyBookConsumers); + SnapshotCycleHandler mbpCycleHandler = new OffHeapSnapshotCycleHandler(); + SnapshotCycleHandler mboCycleHandler; + FeedType recoveryFeedType; + if(mboEnabled) { + recoveryFeedType = FeedType.SMBO; + mboCycleHandler = new OffHeapSnapshotCycleHandler(); + } else { + recoveryFeedType = FeedType.S; + mboCycleHandler = mbpCycleHandler; + } + recoveryManager = getRecoveryManager(recoveryFeedType); + ChannelController targetForBuffered = new BufferedMessageRouter(channelId, instrumentManager, mdpMessageTypes, + listeners, mboCycleHandler, instrumentObserver, emptyBookConsumers); + ConnectionCfg connectionCfg = channelCfg.getConnectionCfg(FeedType.H, Feed.A); + TCPChannel tcpChannel = new MdpTCPChannel(connectionCfg); + TCPMessageRequester tcpMessageRequester = new MdpTCPMessageRequester<>(channelId, listeners, mdpMessageTypes, tcpChannel, tcpUsername, tcpPassword); + this.channelController = new GapChannelController(listeners, target, targetForBuffered, recoveryManager, buffer, gapThreshold, + channelId, mdpMessageTypes, mboCycleHandler, mbpCycleHandler, scheduledExecutorService, tcpMessageRequester); + emptyBookConsumers.add(channelController); + if (scheduledExecutorService != null) initChannelStateThread(); + } + + @Override + public String getId() { + return this.channelCfg.getId(); + } + + @Override + public void close() { + if(checkFeedIdleStateFuture != null){ + checkFeedIdleStateFuture.cancel(true); + } + channelController.preClose(); + stopAllFeeds(); + feedsA.values().forEach(this::closeFeed); + feedsB.values().forEach(this::closeFeed); + channelController.close(); + } + + @Override + public ChannelState getState() { + return channelController.getState(); + } + + private void initChannelStateThread() { + checkFeedIdleStateFuture = scheduledExecutorService.scheduleWithFixedDelay(this::checkFeedIdleState, + FEED_IDLE_CHECK_DELAY, FEED_IDLE_CHECK_DELAY, FEED_IDLE_CHECK_DELAY_UNIT); + } + + @Override + public void registerListener(final ChannelListener channelListener) { + if (channelListener != null) { + synchronized (listeners) { + listeners.add(channelListener); + } + } + } + + @Override + public void removeListener(final ChannelListener channelListener) { + if (channelListener != null) { + synchronized (listeners) { + listeners.remove(channelListener); + } + } + } + + @Override + public List getListeners() { + return listeners; + } + + @Override + public void stopAllFeeds() { + stopFeed(FeedType.I, Feed.A); + stopFeed(FeedType.I, Feed.B); + stopFeed(mboEnabled ? FeedType.SMBO : FeedType.S, Feed.A); + stopFeed(mboEnabled ? FeedType.SMBO : FeedType.S, Feed.B); + stopFeed(FeedType.H, Feed.A); + stopFeed(FeedType.H, Feed.B); + } + + @Override + public boolean subscribe(final int securityId, final String secDesc) { + instrumentManager.registerSecurity(securityId, secDesc); + return true; + } + + @Override + public void discontinueSecurity(final int securityId) { + instrumentManager.discontinueSecurity(securityId); + } + + public MdpFeedListener getFeedListener() { + return feedListener; + } + + private final class FeedListenerImpl implements MdpFeedListener { + @Override + public void onFeedStarted(FeedType feedType, Feed feed) { + listeners.forEach(channelListener -> channelListener.onFeedStarted(getId(), feedType, feed)); + } + + @Override + public void onFeedStopped(FeedType feedType, Feed feed) { + listeners.forEach(channelListener -> channelListener.onFeedStopped(getId(), feedType, feed)); + } + + @Override + public void onPacket(final MdpFeedContext feedContext, final MdpPacket mdpPacket) { + final FeedType feedType = feedContext.getFeedType(); + final Feed feed = feedContext.getFeed(); + if (logger.isTraceEnabled()) { + logger.trace("New MDP Packet: #{} from Feed {}:{}", mdpPacket.getMsgSeqNum(), feedType, feed); + } + for (ChannelListener mboChannelListener : listeners) { + mboChannelListener.onPacket(getId(), feedType, feed, mdpPacket); + } + if (feedType == FeedType.N) { + instrumentObserver.onPacket(feedContext, mdpPacket); + } else if (feedType == FeedType.I) { + lastIncrPcktReceived = System.currentTimeMillis(); + channelController.handleIncrementalPacket(feedContext, mdpPacket); + } else if (feedType == FeedType.SMBO || feedType == FeedType.S) { + channelController.handleSnapshotPacket(feedContext, mdpPacket); + } + } + } + + @Override + public void startFeed(FeedType feedType, Feed feed) throws MdpFeedException { + Map> currentFeed; + Map networkInterfaces; + + if(mboEnabled && FeedType.S.equals(feedType)) { + throw new MdpFeedException("It is not allowed to use MBP snapshot feed when MBO is enabled"); + } + + if(Feed.A.equals(feed)){ + currentFeed = feedsA; + networkInterfaces = feedANetworkInterfaces; + } else if(Feed.B.equals(feed)){ + currentFeed = feedsB; + networkInterfaces = feedBNetworkInterfaces; + } else { + throw new IllegalArgumentException(String.format("%s feed is not supported", feed)); + } + + if (!currentFeed.containsKey(feedType)) { + synchronized (this) { + if (!currentFeed.containsKey(feedType)) { + MdpFeedWorker mdpFeedWorker = new MdpFeedWorker(channelCfg.getConnectionCfg(feedType, feed), networkInterfaces.get(feedType), rcvBufSize); + mdpFeedWorker.addListener(feedListener); + currentFeed.put(feedType, MutablePair.of(mdpFeedWorker, null)); + } + } + } + Pair feedThread = currentFeed.get(feedType); + MdpFeedWorker mdpFeedWorker = feedThread.getLeft(); + if (!mdpFeedWorker.cancelShutdownIfStarted()) { + if (!mdpFeedWorker.isActive()) { + Thread thread = new Thread(mdpFeedWorker); + feedThread.setValue(thread); + thread.start(); + } + } + } + + private void checkFeedIdleState() { + try { + synchronized (this) { + MdpFeedWorker incrementalFeedA = feedsA.get(FeedType.I).getLeft(); + MdpFeedWorker incrementalFeedB = feedsB.get(FeedType.I).getLeft(); + final long allowedInactiveEndTime = lastIncrPcktReceived + idleWindowInMillis; + if (allowedInactiveEndTime < System.currentTimeMillis() && + (incrementalFeedA.isActiveAndNotShutdown() || incrementalFeedB.isActiveAndNotShutdown())) { + recoveryManager.startRecovery(); + } + } + } catch (Exception e){ + logger.error(e.getMessage(), e); + } + } + + @Override + public void stopFeed(FeedType feedType, Feed feed){ + Map> currentFeed; + if(Feed.A.equals(feed)){ + currentFeed = feedsA; + } else if(Feed.B.equals(feed)){ + currentFeed = feedsB; + } else { + throw new IllegalArgumentException(String.format("%s feed is not supported", feed)); + } + if(currentFeed.containsKey(feedType)){ + Pair feedThread = currentFeed.get(feedType); + MdpFeedWorker mdpFeedWorker = feedThread.getLeft(); + if(mdpFeedWorker.isActive()){ + mdpFeedWorker.shutdown(); + } + } + } + + private void closeFeed(Pair feedThread){ + try { + Thread thread = feedThread.getRight(); + MdpFeedWorker feedWorker = feedThread.getLeft(); + if (thread.isAlive()) { + thread.join(); + feedWorker.close(); + } + } catch (Exception e) { + logger.error("Failed to stop Feed Worker: " + e.getMessage(), e); + } + } + + private GapChannelController.SnapshotRecoveryManager getRecoveryManager(FeedType feedType){ + return new GapChannelController.SnapshotRecoveryManager() { + @Override + public void startRecovery() { + try { + startFeed(feedType, snptFeedToUse); + } catch (MdpFeedException e) { + logger.error(e.getMessage(), e); + } + } + + @Override + public void stopRecovery() { + stopFeed(feedType, snptFeedToUse); + } + }; + } + + private class InstrumentObserverImpl implements InstrumentObserver { + private static final int PRCD_MSG_COUNT_NULL = Integer.MAX_VALUE; // max value used as undefined (null) + private static final int INSTRUMENT_CYCLES_MAX = 2; // do we need an option in configuration for this? + private AtomicInteger msgCountDown = new AtomicInteger(PRCD_MSG_COUNT_NULL); + private final SbeString strValObj = SbeString.allocate(256); + + @Override + public void onPacket(final MdpFeedContext feedContext, final MdpPacket instrumentPacket) { + final Iterator mdpMessageIterator = instrumentPacket.iterator(); + MdpMessage mdpMessage; + while (mdpMessageIterator.hasNext()) { + mdpMessage = mdpMessageIterator.next(); + final MdpMessageType messageType = mdpMessageTypes.getMessageType(mdpMessage.getSchemaId()); + final SemanticMsgType semanticMsgType = messageType.getSemanticMsgType(); + if (semanticMsgType == SemanticMsgType.SecurityDefinition) { + mdpMessage.setMessageType(messageType); + } + onMessage(feedContext, mdpMessage); + } + } + + @Override + public void onMessage(final MdpFeedContext feedContext, final MdpMessage secDefMsg) { + final int subscriptionFlags = notifySecurityDefinitionListeners(secDefMsg); + final int securityId = secDefMsg.getInt32(MdConstants.SECURITY_ID); + if(logger.isDebugEnabled()) { + logger.debug("Subscription flags for channel '{}' and instrument '{}' are '{}'", getId(), securityId, subscriptionFlags); + } + String secDesc = null; + if(secDefMsg.getString(MdConstants.SEC_DESC_TAG, strValObj)) { + secDesc = strValObj.getString(); + } + if (MdEventFlags.hasMessage(subscriptionFlags)) { + instrumentManager.registerSecurity(securityId, secDesc); + } else { + instrumentManager.updateSecDesc(securityId, secDesc); + } + if (msgCountDown.get() == PRCD_MSG_COUNT_NULL) { + final int totalNumReports = getTotalReportNum(secDefMsg) * INSTRUMENT_CYCLES_MAX; + this.msgCountDown.compareAndSet(PRCD_MSG_COUNT_NULL, totalNumReports); + } + final int msgLeft = msgCountDown.decrementAndGet(); + if (canStopInstrumentListening(msgLeft)) { + stopFeed(FeedType.N, Feed.A); + stopFeed(FeedType.N, Feed.B); + } + } + } + + private int notifySecurityDefinitionListeners(final MdpMessage mdpMessage) { + int flags = MdEventFlags.NOTHING; + for (int i = 0; i < listeners.size(); i++) { + final int clbFlags = listeners.get(i).onSecurityDefinition(getId(), mdpMessage); + flags |= clbFlags; + } + return flags; + } + + private int getTotalReportNum(final MdpMessage mdpMessage) { + return (int) mdpMessage.getUInt32(MdConstants.TOT_NUM_REPORTS); + } + + private boolean canStopInstrumentListening(final int cyclesLeft) { + return cyclesLeft <= 0; + } +} diff --git a/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/channel/MdpChannelBuilder.java b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/channel/MdpChannelBuilder.java new file mode 100644 index 0000000..a51b7fb --- /dev/null +++ b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/channel/MdpChannelBuilder.java @@ -0,0 +1,130 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.channel; + +import com.epam.cme.mdp3.ChannelListener; +import com.epam.cme.mdp3.Feed; +import com.epam.cme.mdp3.FeedType; +import com.epam.cme.mdp3.MdpChannel; +import com.epam.cme.mdp3.core.cfg.Configuration; +import com.epam.cme.mdp3.core.channel.MdpFeedWorker; +import com.epam.cme.mdp3.core.channel.tcp.MdpTCPMessageRequester; +import com.epam.cme.mdp3.sbe.schema.MdpMessageTypeBuildException; +import com.epam.cme.mdp3.sbe.schema.MdpMessageTypes; + +import java.net.URI; +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.ScheduledExecutorService; + +public class MdpChannelBuilder { + public static final int DEF_INCR_QUEUE_SIZE = 15000; + public static final int DEF_GAP_THRESHOLD = 5; + private final String channelId; + private URI cfgURI; + private URI schemaURI; + private MdpMessageTypes mdpMessageTypes; + private Map feedANetworkInterfaces = new HashMap<>(); + private Map feedBNetworkInterfaces = new HashMap<>(); + private ChannelListener channelListener; + private ScheduledExecutorService scheduler; + private int incrQueueSize = DEF_INCR_QUEUE_SIZE; + private int gapThreshold = DEF_GAP_THRESHOLD; + private int rcvBufSize = MdpFeedWorker.RCV_BUFFER_SIZE; + private String tcpUsername = MdpTCPMessageRequester.DEFAULT_USERNAME; + private String tcpPassword = MdpTCPMessageRequester.DEFAULT_PASSWORD; + private boolean mboEnabled; + + public MdpChannelBuilder(final String channelId) { + this.channelId = channelId; + } + + public MdpChannelBuilder(final String channelId, final URI cfgURI, final URI schemaURI) throws MdpMessageTypeBuildException { + this.channelId = channelId; + this.cfgURI = cfgURI; + setSchema(schemaURI); + } + + public MdpChannelBuilder setConfiguration(final URI cfgURI) { + this.cfgURI = cfgURI; + return this; + } + + public MdpChannelBuilder setSchema(final URI schemaURI) throws MdpMessageTypeBuildException { + this.schemaURI = schemaURI; + this.mdpMessageTypes = new MdpMessageTypes(this.schemaURI); + return this; + } + + public MdpChannelBuilder setNetworkInterface(final FeedType feedType, final Feed feed, final String networkInterface) { + if (feed == Feed.A) { + feedANetworkInterfaces.put(feedType, networkInterface); + } else if (feed == Feed.B) { + feedBNetworkInterfaces.put(feedType, networkInterface); + } + return this; + } + + public MdpChannelBuilder usingListener(final ChannelListener channelListener) { + this.channelListener = channelListener; + return this; + } + + public MdpChannelBuilder usingScheduler(final ScheduledExecutorService scheduler) { + this.scheduler = scheduler; + return this; + } + + public MdpChannelBuilder usingIncrQueueSize(final int incrQueueSize) { + this.incrQueueSize = incrQueueSize; + return this; + } + + public MdpChannelBuilder usingGapThreshold(final int gapThreshold) { + this.gapThreshold = gapThreshold; + return this; + } + + public MdpChannelBuilder usingRcvBufSize(final int rcvBufSize) { + this.rcvBufSize = rcvBufSize; + return this; + } + + public MdpChannelBuilder setTcpUsername(final String tcpUsername) { + this.tcpUsername = tcpUsername; + return this; + } + + public MdpChannelBuilder setTcpPassword(final String tcpPassword) { + this.tcpPassword = tcpPassword; + return this; + } + + public MdpChannelBuilder setMBOEnable(final boolean enabled) { + mboEnabled = enabled; + return this; + } + + public MdpChannel build() { + try { + final Configuration cfg = new Configuration(this.cfgURI); + final MdpMessageTypes mdpMessageTypes = new MdpMessageTypes(this.schemaURI); + MdpChannel mdpChannel = new LowLevelMdpChannel(scheduler, cfg.getChannel(this.channelId), mdpMessageTypes, + incrQueueSize, rcvBufSize, gapThreshold, tcpUsername, tcpPassword, feedANetworkInterfaces, feedBNetworkInterfaces, mboEnabled); + if (channelListener != null) mdpChannel.registerListener(channelListener); + return mdpChannel; + } catch (Exception e) { + throw new IllegalStateException("Failed to build MDP Channel", e); + } + } +} diff --git a/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/Buffer.java b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/Buffer.java new file mode 100644 index 0000000..c71750e --- /dev/null +++ b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/Buffer.java @@ -0,0 +1,31 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.control; + + +public interface Buffer { + + /** + * It copies the data from the entry. + * @param entity + */ + void add(T entity); + + /** + * It returns the entities in sorted order and removes them after. + * @return T or null if buffer is empty. + */ + T remove(); + + boolean isEmpty(); +} diff --git a/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/BufferedMessageRouter.java b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/BufferedMessageRouter.java new file mode 100644 index 0000000..d5e8c8d --- /dev/null +++ b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/BufferedMessageRouter.java @@ -0,0 +1,48 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.control; + +import com.epam.cme.mdp3.ChannelListener; +import com.epam.cme.mdp3.MdpGroupEntry; +import com.epam.cme.mdp3.MdpMessage; +import com.epam.cme.mdp3.sbe.schema.MdpMessageTypes; + +import java.util.List; +import java.util.function.Consumer; + +public class BufferedMessageRouter extends ChannelControllerRouter { + private SnapshotCycleHandler cycleHandler; + + public BufferedMessageRouter(String channelId, InstrumentManager instrumentManager, MdpMessageTypes mdpMessageTypes, + List channelListeners, SnapshotCycleHandler cycleHandler, + InstrumentObserver instrumentObserver, List> emptyBookConsumers) { + super(channelId, instrumentManager, mdpMessageTypes, channelListeners, instrumentObserver, emptyBookConsumers); + this.cycleHandler = cycleHandler; + } + + @Override + protected void routeMBOEntry(int securityId, MdpMessage mdpMessage, MdpGroupEntry orderIDEntry, MdpGroupEntry mdEntry, long msgSeqNum){ + long snapshotSequence = cycleHandler.getSnapshotSequence(securityId); + if(snapshotSequence < msgSeqNum) { + super.routeMBOEntry(securityId, mdpMessage, orderIDEntry, mdEntry, msgSeqNum); + } + } + + @Override + protected void routeMBPEntry(int securityId, MdpMessage mdpMessage, MdpGroupEntry mdEntry, long msgSeqNum){ + long snapshotSequence = cycleHandler.getSnapshotSequence(securityId); + if(snapshotSequence < msgSeqNum) { + super.routeMBPEntry(securityId, mdpMessage, mdEntry, msgSeqNum); + } + } +} diff --git a/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/ChannelController.java b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/ChannelController.java new file mode 100644 index 0000000..9fdc364 --- /dev/null +++ b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/ChannelController.java @@ -0,0 +1,24 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.control; + +import com.epam.cme.mdp3.MdpPacket; +import com.epam.cme.mdp3.core.channel.MdpFeedContext; + +public interface ChannelController { + void handleSnapshotPacket(MdpFeedContext feedContext, MdpPacket mdpPacket); + void handleIncrementalPacket(MdpFeedContext feedContext, MdpPacket mdpPacket); + + void preClose(); + void close(); +} diff --git a/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/ChannelControllerRouter.java b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/ChannelControllerRouter.java new file mode 100644 index 0000000..4f3e46b --- /dev/null +++ b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/ChannelControllerRouter.java @@ -0,0 +1,191 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.control; + + +import com.epam.cme.mdp3.*; +import com.epam.cme.mdp3.core.channel.MdpFeedContext; +import com.epam.cme.mdp3.mktdata.enums.MDEntryType; +import com.epam.cme.mdp3.sbe.message.SbeGroup; +import com.epam.cme.mdp3.sbe.message.SbeGroupEntry; +import com.epam.cme.mdp3.sbe.schema.MdpMessageTypes; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; +import java.util.function.Consumer; + +import static com.epam.cme.mdp3.MdConstants.INCR_RFRSH_MD_ENTRY_TYPE; + +public class ChannelControllerRouter implements MdpChannelController { + private static final Logger logger = LoggerFactory.getLogger(ChannelControllerRouter.class); + private final InstrumentManager instrumentManager; + private final MdpGroupEntry mdEntry = SbeGroupEntry.instance(); + private final MdpGroup noMdEntriesGroup = SbeGroup.instance(); + private MdpMessageTypes mdpMessageTypes; + private final List channelListeners; + private final InstrumentObserver instrumentObserver; + private final List> emptyBookConsumers; + private final String channelId; + + public ChannelControllerRouter(String channelId, InstrumentManager instrumentManager, + MdpMessageTypes mdpMessageTypes, List channelListeners, + InstrumentObserver instrumentObserver, List> emptyBookConsumers){ + this.channelId = channelId; + this.instrumentManager = instrumentManager; + this.mdpMessageTypes = mdpMessageTypes; + this.channelListeners = channelListeners; + this.instrumentObserver = instrumentObserver; + this.emptyBookConsumers = emptyBookConsumers; + } + + @Override + public void handleSnapshotPacket(MdpFeedContext feedContext, MdpPacket mdpPacket) { + for (MdpMessage mdpMessage : mdpPacket) { + updateSemanticMsgType(mdpMessageTypes, mdpMessage); + int securityId = getSecurityId(mdpMessage); + InstrumentController instrumentController = instrumentManager.getInstrumentController(securityId); + if (instrumentController != null) { + if (isMBOSnapshot(mdpMessage)) { + instrumentController.handleMBOSnapshotMDEntry(mdpMessage); + } else { + instrumentController.handleMBPSnapshotMDEntry(mdpMessage); + } + } + } + } + + @Override + public void handleIncrementalPacket(MdpFeedContext feedContext, MdpPacket mdpPacket) { + MdpGroup mdpGroup = feedContext.getMdpGroupObj(); + MdpGroupEntry mdpGroupEntry = feedContext.getMdpGroupEntryObj(); + long msgSeqNum = mdpPacket.getMsgSeqNum(); + for (MdpMessage mdpMessage : mdpPacket) { + updateSemanticMsgType(mdpMessageTypes, mdpMessage); + SemanticMsgType semanticMsgType = mdpMessage.getSemanticMsgType(); + switch (semanticMsgType) { + case MarketDataIncrementalRefresh: + handleIncrementalMessage(mdpMessage, mdpGroup, mdpGroupEntry, msgSeqNum); + break; + case QuoteRequest: + handleQuoteRequest(mdpMessage); + break; + case SecurityStatus: + handleSecurityStatus(mdpMessage); + break; + case SecurityDefinition: + instrumentObserver.onMessage(feedContext, mdpMessage); + break; + default: + logger.debug("Message has been ignored due to its SemanticMsgType '{}'", semanticMsgType); + } + } + } + + @Override + public void preClose() { + + } + + @Override + public void close() { + + } + + protected void routeMBOEntry(int securityId, MdpMessage mdpMessage, MdpGroupEntry orderIDEntry, MdpGroupEntry mdEntry, long msgSeqNum){ + InstrumentController instrumentController = instrumentManager.getInstrumentController(securityId); + if (instrumentController != null) { + instrumentController.handleMBOIncrementMDEntry(mdpMessage, orderIDEntry, mdEntry, msgSeqNum); + } + } + + protected void routeMBPEntry(int securityId, MdpMessage mdpMessage, MdpGroupEntry mdEntry, long msgSeqNum){ + InstrumentController instrumentController = instrumentManager.getInstrumentController(securityId); + if (instrumentController != null) { + instrumentController.handleMBPIncrementMDEntry(mdpMessage, mdEntry, msgSeqNum); + } + } + + private void handleIncrementalMessage(MdpMessage mdpMessage, MdpGroup mdpGroup, MdpGroupEntry mdpGroupEntry, long msgSeqNum){ + if (isIncrementalMessageSupported(mdpMessage)) { + if (isIncrementOnlyForMBO(mdpMessage)) { + mdpMessage.getGroup(MdConstants.NO_MD_ENTRIES, mdpGroup); + while (mdpGroup.hashNext()) { + mdpGroup.next(); + mdpGroup.getEntry(mdpGroupEntry); + int securityId = getSecurityId(mdpGroupEntry); + routeMBOEntry(securityId, mdpMessage, mdpGroupEntry, null, msgSeqNum); + } + } else { + if (mdpMessage.getGroup(MdConstants.NO_MD_ENTRIES, noMdEntriesGroup)) { + while (noMdEntriesGroup.hashNext()) { + noMdEntriesGroup.next(); + noMdEntriesGroup.getEntry(mdEntry); + final MDEntryType mdEntryType = MDEntryType.fromFIX(mdEntry.getChar(INCR_RFRSH_MD_ENTRY_TYPE)); + if (mdEntryType == MDEntryType.EmptyBook) { + emptyBookConsumers.forEach(mdpMessageConsumer -> mdpMessageConsumer.accept(mdpMessage)); + } else { + int securityId = mdEntry.getInt32(MdConstants.SECURITY_ID); + routeMBPEntry(securityId, mdpMessage, mdEntry, msgSeqNum); + } + } + } + if (mdpMessage.getGroup(MdConstants.NO_ORDER_ID_ENTRIES, mdpGroup) && isOrderEntityContainsReference(mdpGroup, mdpGroupEntry)) { + while (mdpGroup.hashNext()) { + mdpMessage.getGroup(MdConstants.NO_MD_ENTRIES, noMdEntriesGroup); + mdpGroup.next(); + mdpGroup.getEntry(mdpGroupEntry); + short entryNum = mdpGroupEntry.getUInt8(MdConstants.REFERENCE_ID); + noMdEntriesGroup.getEntry(entryNum, mdEntry); + int securityId = mdEntry.getInt32(MdConstants.SECURITY_ID); + routeMBOEntry(securityId, mdpMessage, mdpGroupEntry, mdEntry, msgSeqNum); + } + } + } + } + } + + /** + * + * @return true if it is not TradeSummary order entity + */ + private boolean isOrderEntityContainsReference(MdpGroup mdpGroup, MdpGroupEntry mdpGroupEntry){ + if(mdpGroup.hashNext()) { + mdpGroup.getEntry(1, mdpGroupEntry); + return mdpGroupEntry.hasField(MdConstants.REFERENCE_ID); + } else { + return false; + } + } + + private void handleQuoteRequest(MdpMessage mdpMessage){ + for (ChannelListener listener : channelListeners) { + listener.onRequestForQuote(channelId, mdpMessage); + } + } + + private void handleSecurityStatus(MdpMessage mdpMessage){ + int securityId = getSecurityId(mdpMessage); + for (ChannelListener listener : channelListeners) { + listener.onSecurityStatus(channelId, securityId, mdpMessage); + } + } + + private int getSecurityId(MdpMessage mdpMessage){ + return mdpMessage.getInt32(MdConstants.SECURITY_ID); + } + + private int getSecurityId(MdpGroupEntry mdpGroupEntry){ + return mdpGroupEntry.getInt32(MdConstants.SECURITY_ID); + } +} diff --git a/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/GapChannelController.java b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/GapChannelController.java new file mode 100644 index 0000000..1eb9e19 --- /dev/null +++ b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/GapChannelController.java @@ -0,0 +1,305 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.control; + +import com.epam.cme.mdp3.*; +import com.epam.cme.mdp3.core.channel.MdpFeedContext; +import com.epam.cme.mdp3.core.channel.tcp.TCPMessageRequester; +import com.epam.cme.mdp3.core.channel.tcp.TCPPacketListener; +import com.epam.cme.mdp3.sbe.schema.MdpMessageTypes; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; +import java.util.concurrent.ScheduledExecutorService; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; +import java.util.function.Consumer; + +public class GapChannelController implements MdpChannelController, Consumer { + private static final Logger log = LoggerFactory.getLogger(GapChannelController.class); + public static final int MAX_NUMBER_OF_TCP_ATTEMPTS = 3; + private final Lock lock = new ReentrantLock(); + private final int gapThreshold; + private final Buffer buffer; + private final SnapshotRecoveryManager snapshotRecoveryManager; + private final ChannelController target; + private final ChannelController targetForBuffered; + private final String channelId; + private final SnapshotCycleHandler mboCycleHandler; + private final SnapshotCycleHandler mbpCycleHandler; + private long lastProcessedSeqNum; + private long smallestSnapshotSequence; + private long highestSnapshotSequence; + private boolean wasChannelResetInPrcdPacket; + private ChannelState currentState = ChannelState.INITIAL; + private MdpMessageTypes mdpMessageTypes; + private boolean receivingCycle = false; + private final List channelListeners; + private final ScheduledExecutorService executor; + private TCPRecoveryProcessor tcpRecoveryProcessor; + private int numberOfTCPAttempts; + + public GapChannelController(List channelListeners, ChannelController target, + ChannelController targetForBuffered, SnapshotRecoveryManager snapshotRecoveryManager, + Buffer buffer, int gapThreshold, String channelId, MdpMessageTypes mdpMessageTypes, + SnapshotCycleHandler mboCycleHandler, SnapshotCycleHandler mbpCycleHandler, + ScheduledExecutorService executor, TCPMessageRequester tcpMessageRequester) { + this.channelListeners = channelListeners; + this.buffer = buffer; + this.snapshotRecoveryManager = snapshotRecoveryManager; + this.target = target; + this.gapThreshold = gapThreshold; + this.channelId = channelId; + this.mdpMessageTypes = mdpMessageTypes; + this.mboCycleHandler = mboCycleHandler; + this.mbpCycleHandler = mbpCycleHandler; + this.targetForBuffered = targetForBuffered; + this.executor = executor; + if(tcpMessageRequester != null) { + TCPPacketListener tcpPacketListener = new TCPPacketListenerImpl(); + this.tcpRecoveryProcessor = new TCPRecoveryProcessor(tcpMessageRequester, tcpPacketListener); + } + } + + @Override + public void handleSnapshotPacket(MdpFeedContext feedContext, MdpPacket mdpPacket) { + final long pkgSequence = mdpPacket.getMsgSeqNum(); + if(log.isTraceEnabled()) { + log.trace("Feed {}:{} | handleSnapshotPacket: previous processed sequence '{}', current packet's sequence '{}'", + feedContext.getFeedType(), feedContext.getFeed(), lastProcessedSeqNum, pkgSequence); + } + try { + lock.lock(); + if(mdpPacket.getMsgSeqNum() == 1) { + if(receivingCycle) { + smallestSnapshotSequence = mboCycleHandler.getSmallestSnapshotSequence(); + highestSnapshotSequence = mboCycleHandler.getHighestSnapshotSequence(); + if (smallestSnapshotSequence != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED + && highestSnapshotSequence != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED + && mbpCycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED + && mbpCycleHandler.getHighestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED) { + if(mbpCycleHandler.getSmallestSnapshotSequence() != smallestSnapshotSequence + || mbpCycleHandler.getHighestSnapshotSequence() != highestSnapshotSequence) { + log.error("MBP(Highest '{}', Smallest '{}') and MBO(Highest '{}', Smallest '{}') snapshots are not synchronized", + mbpCycleHandler.getHighestSnapshotSequence(), mbpCycleHandler.getSmallestSnapshotSequence(), + mboCycleHandler.getHighestSnapshotSequence(), mboCycleHandler.getSmallestSnapshotSequence()); + } + lastProcessedSeqNum = highestSnapshotSequence; + snapshotRecoveryManager.stopRecovery(); + switchState(ChannelState.SYNC); + processMessagesFromBuffer(feedContext); + receivingCycle = false; + numberOfTCPAttempts = 0; + } + } else { + mboCycleHandler.reset(); + mbpCycleHandler.reset(); + receivingCycle = true; + } + } + switch (currentState) { + case INITIAL: + case OUTOFSYNC: + if(receivingCycle) { + for (MdpMessage mdpMessage : mdpPacket) { + updateSemanticMsgType(mdpMessageTypes, mdpMessage); + long lastMsgSeqNumProcessed = mdpMessage.getUInt32(MdConstants.LAST_MSG_SEQ_NUM_PROCESSED); + int securityId = mdpMessage.getInt32(MdConstants.SECURITY_ID); + long totNumReports = mdpMessage.getUInt32(MdConstants.TOT_NUM_REPORTS); + if (isMBOSnapshot(mdpMessage)) { + long noChunks = mdpMessage.getUInt32(MdConstants.NO_CHUNKS); + long currentChunk = mdpMessage.getUInt32(MdConstants.CURRENT_CHUNK); + mboCycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId, noChunks, currentChunk); + } else { + mbpCycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId, 1, 1); + } + } + target.handleSnapshotPacket(feedContext, mdpPacket); + } + break; + } + } finally { + lock.unlock(); + } + } + + @Override + public void handleIncrementalPacket(MdpFeedContext feedContext, MdpPacket mdpPacket) { + final long pkgSequence = mdpPacket.getMsgSeqNum(); + if(log.isTraceEnabled()) { + log.trace("Feed {}:{} | handleIncrementalPacket: previous processed sequence '{}', current packet's sequence '{}'", + feedContext.getFeedType(), feedContext.getFeed(), lastProcessedSeqNum, pkgSequence); + } + try { + lock.lock(); + switch (currentState) { + case SYNC: + long expectedSequence = lastProcessedSeqNum + 1; + if(pkgSequence == expectedSequence) { + target.handleIncrementalPacket(feedContext, mdpPacket); + if (wasChannelResetInPrcdPacket) { + wasChannelResetInPrcdPacket = false; + } else { + lastProcessedSeqNum = pkgSequence; + } + processMessagesFromBuffer(feedContext); + } else if(pkgSequence > expectedSequence) { + buffer.add(mdpPacket); + if(pkgSequence > (expectedSequence + gapThreshold)) { + switchState(ChannelState.OUTOFSYNC); + long amountOfLostMessages = (pkgSequence - 1) - expectedSequence; + if(numberOfTCPAttempts < MAX_NUMBER_OF_TCP_ATTEMPTS && amountOfLostMessages < TCPMessageRequester.MAX_AVAILABLE_MESSAGES + && tcpRecoveryProcessor != null && executor != null) { + tcpRecoveryProcessor.setBeginSeqNo(expectedSequence); + tcpRecoveryProcessor.setEndSeqNo(pkgSequence - 1); + executor.execute(tcpRecoveryProcessor); + numberOfTCPAttempts++; + } else { + snapshotRecoveryManager.startRecovery(); + } + } + } else { + if(log.isTraceEnabled()) { + log.trace("Feed {}:{} | handleIncrementalPacket: packet that has sequence '{}' has been skipped. Expected sequence '{}'", + feedContext.getFeedType(), feedContext.getFeed(), pkgSequence, expectedSequence); + } + } + break; + case INITIAL: + case OUTOFSYNC: + buffer.add(mdpPacket); + if(log.isTraceEnabled()) { + log.trace("Feed {}:{} | handleIncrementalPacket: current state is '{}', so the packet with sequence '{}' has been put into buffer", + feedContext.getFeedType(), feedContext.getFeed(), currentState, pkgSequence); + } + break; + } + } finally { + lock.unlock(); + } + } + + @Override + public void preClose() { + switchState(ChannelState.CLOSING); + } + + @Override + public void close() { + switchState(ChannelState.CLOSED); + } + + public ChannelState getState() { + return currentState; + } + + @Override + public void accept(MdpMessage resetMessage) { + channelListeners.forEach(channelListener -> channelListener.onBeforeChannelReset(channelId, resetMessage)); + lastProcessedSeqNum = 0; + smallestSnapshotSequence = 0; + highestSnapshotSequence = 0; + wasChannelResetInPrcdPacket = true; + if(currentState != ChannelState.SYNC) { + switchState(ChannelState.SYNC); + snapshotRecoveryManager.stopRecovery(); + } + channelListeners.forEach(channelListener -> channelListener.onFinishedChannelReset(channelId, resetMessage)); + } + + public interface SnapshotRecoveryManager { + void startRecovery(); + void stopRecovery(); + } + + private void switchState(ChannelState newState) { + log.debug("Channel '{}' has changed its state from '{}' to '{}'", channelId, currentState, newState); + channelListeners.forEach(ChannelListener -> ChannelListener.onChannelStateChanged(channelId, currentState, newState)); + currentState = newState; + } + + private void processMessagesFromBuffer(MdpFeedContext feedContext){ + while (!buffer.isEmpty()) { + MdpPacket mdpPacket = buffer.remove(); + long pkgSequence = mdpPacket.getMsgSeqNum(); + long expectedSequence = lastProcessedSeqNum + 1; + if(pkgSequence == expectedSequence) { + target.handleIncrementalPacket(feedContext, mdpPacket); + lastProcessedSeqNum = pkgSequence; + } else if(pkgSequence < expectedSequence && pkgSequence <= highestSnapshotSequence){ + long expectedSmallestSequence = smallestSnapshotSequence + 1; + if(pkgSequence == expectedSmallestSequence){ + targetForBuffered.handleIncrementalPacket(feedContext, mdpPacket); + smallestSnapshotSequence = expectedSmallestSequence; + } if(pkgSequence > expectedSmallestSequence) { + buffer.add(mdpPacket); + break; + } + } else if(pkgSequence > expectedSequence){ + buffer.add(mdpPacket); + break; + } + } + } + + private class TCPRecoveryProcessor implements Runnable { + private final TCPMessageRequester tcpMessageRequester; + private final TCPPacketListener tcpPacketListener; + private long beginSeqNo; + private long endSeqNo; + private final MdpFeedContext feedContext; + + private TCPRecoveryProcessor(TCPMessageRequester tcpMessageRequester, TCPPacketListener tcpPacketListener) { + this.tcpMessageRequester = tcpMessageRequester; + this.tcpPacketListener = tcpPacketListener; + this.feedContext = new MdpFeedContext(Feed.A, FeedType.I); + } + + @Override + public void run() { + try { + boolean result = tcpMessageRequester.askForLostMessages(beginSeqNo, endSeqNo, tcpPacketListener); + if (result) { + try { + lock.lock(); + switchState(ChannelState.SYNC); + processMessagesFromBuffer(feedContext); + } finally { + lock.unlock(); + } + } else { + snapshotRecoveryManager.startRecovery(); + } + } catch (Exception e) { + log.error(e.getMessage(), e); + } + } + + public void setBeginSeqNo(long beginSeqNo) { + this.beginSeqNo = beginSeqNo; + } + + public void setEndSeqNo(long endSeqNo) { + this.endSeqNo = endSeqNo; + } + } + + private class TCPPacketListenerImpl implements TCPPacketListener { + + @Override + public void onPacket(MdpFeedContext feedContext, MdpPacket mdpPacket) { + handleIncrementalPacket(feedContext, mdpPacket); + } + } +} diff --git a/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/HeapSnapshotCycleHandler.java b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/HeapSnapshotCycleHandler.java new file mode 100644 index 0000000..24b6cc2 --- /dev/null +++ b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/HeapSnapshotCycleHandler.java @@ -0,0 +1,100 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.control; + +import java.util.HashMap; +import java.util.Map; + +/** + * Now it is dirty implementation for unit tests and debug. It must be implemented to not allocate data in future, use one off-heap structure. + */ +@Deprecated +public class HeapSnapshotCycleHandler implements SnapshotCycleHandler { + private final static long SNAPSHOT_SEQUENCE_UNDEFINED = -1; + private volatile Map metaData; + private volatile int metaDataSize; + + public void reset(){ + metaData = null; + } + + public void update(long totNumReports, long lastMsgSeqNumProcessed, int securityId, long noChunks, long currentChunk){ + if(metaData == null || metaDataSize != totNumReports){ + metaDataSize = (int)totNumReports; + metaData = new HashMap<>(metaDataSize); + } + long[] securityIdMetaData = metaData.computeIfAbsent(securityId, k -> getEmptyArray((int) noChunks)); + if(securityIdMetaData.length != noChunks){ + securityIdMetaData = getEmptyArray((int) noChunks); + metaData.put(securityId, securityIdMetaData); + } + securityIdMetaData[(int) currentChunk - 1] = lastMsgSeqNumProcessed; + } + + @Override + public long getSnapshotSequence(int securityId) { + if(metaData == null){ + return SNAPSHOT_SEQUENCE_UNDEFINED; + } + long[] array = metaData.get(securityId); + return array != null ? array[0] : SNAPSHOT_SEQUENCE_UNDEFINED; + } + + @Override + public long getSmallestSnapshotSequence() { + return getSnapshotSequence(false); + } + + @Override + public long getHighestSnapshotSequence() { + return getSnapshotSequence(true); + } + + public long getSnapshotSequence(boolean highest) { + long sequence = SNAPSHOT_SEQUENCE_UNDEFINED; + boolean result = true; + if(metaData != null && metaData.size() == metaDataSize){ + for (long[] securityMetaData : metaData.values()) { + for (int j = 0; j < securityMetaData.length; j++) { + long seq = securityMetaData[j]; + if(seq != SNAPSHOT_SEQUENCE_UNDEFINED){ + if(sequence == SNAPSHOT_SEQUENCE_UNDEFINED) { + sequence = seq; + } else if(highest && seq > sequence){ + sequence = seq; + } else if(!highest && seq < sequence){ + sequence = seq; + } + } else { + result = false; + break; + } + } + } + } else { + result = false; + } + if(!result){ + sequence = SNAPSHOT_SEQUENCE_UNDEFINED; + } + return sequence; + } + + private long[] getEmptyArray(int length){ + long[] result = new long[length]; + for (int i = 0; i < result.length; i++) { + result[i] = SNAPSHOT_SEQUENCE_UNDEFINED; + } + return result; + } +} diff --git a/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/InstrumentController.java b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/InstrumentController.java new file mode 100644 index 0000000..52a4443 --- /dev/null +++ b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/InstrumentController.java @@ -0,0 +1,81 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.control; + +import com.epam.cme.mdp3.ChannelListener; +import com.epam.cme.mdp3.MdpGroupEntry; +import com.epam.cme.mdp3.MdpMessage; +import com.epam.cme.mdp3.sbe.message.SbeConstants; + +import java.util.List; + +public class InstrumentController { + private List listeners; + private final String channelId; + private final int securityId; + private String secDesc; + private volatile boolean enable = true; + + public InstrumentController(List listeners, String channelId, int securityId, String secDesc) { + this.listeners = listeners; + this.channelId = channelId; + this.securityId = securityId; + this.secDesc = secDesc; + } + + public void handleMBOIncrementMDEntry(MdpMessage mdpMessage, MdpGroupEntry orderIDEntry, MdpGroupEntry mdEntry, long msgSeqNum){ + if(enable) { + short matchEventIndicator = mdpMessage.getUInt8(SbeConstants.MATCHEVENTINDICATOR_TAG); + for (ChannelListener channelListener : listeners) { + channelListener.onIncrementalMBORefresh(channelId, matchEventIndicator, securityId, secDesc, msgSeqNum, orderIDEntry, mdEntry); + } + } + } + + public void handleMBPIncrementMDEntry(MdpMessage mdpMessage, MdpGroupEntry mdEntry, long msgSeqNum){ + if(enable) { + short matchEventIndicator = mdpMessage.getUInt8(SbeConstants.MATCHEVENTINDICATOR_TAG); + for (ChannelListener channelListener : listeners) { + channelListener.onIncrementalMBPRefresh(channelId, matchEventIndicator, securityId, secDesc, msgSeqNum, mdEntry); + } + } + } + + public void handleMBOSnapshotMDEntry(MdpMessage mdpMessage){ + if(enable) { + for (ChannelListener channelListener : listeners) { + channelListener.onSnapshotMBOFullRefresh(channelId, secDesc, mdpMessage); + } + } + } + + public void handleMBPSnapshotMDEntry(MdpMessage mdpMessage){ + if(enable) { + for (ChannelListener channelListener : listeners) { + channelListener.onSnapshotMBPFullRefresh(channelId, secDesc, mdpMessage); + } + } + } + + public void enable(){ + enable = true; + } + + public void disable(){ + enable = false; + } + + public void updateSecDesc(String secDesc) { + this.secDesc = secDesc; + } +} diff --git a/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/InstrumentManager.java b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/InstrumentManager.java new file mode 100644 index 0000000..0bf0b06 --- /dev/null +++ b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/InstrumentManager.java @@ -0,0 +1,21 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.control; + + +public interface InstrumentManager { + InstrumentController getInstrumentController(int securityId); + void registerSecurity(int securityId, String secDesc); + void discontinueSecurity(int securityId); + void updateSecDesc(int securityId, String secDesc); +} diff --git a/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/InstrumentObserver.java b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/InstrumentObserver.java new file mode 100644 index 0000000..51123b3 --- /dev/null +++ b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/InstrumentObserver.java @@ -0,0 +1,22 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.control; + +import com.epam.cme.mdp3.MdpMessage; +import com.epam.cme.mdp3.MdpPacket; +import com.epam.cme.mdp3.core.channel.MdpFeedContext; + +public interface InstrumentObserver { + void onPacket(final MdpFeedContext feedContext, final MdpPacket instrumentPacket); + void onMessage(final MdpFeedContext feedContext, final MdpMessage secDefMsg); +} diff --git a/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/MDPHeapBuffer.java b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/MDPHeapBuffer.java new file mode 100644 index 0000000..6185a5a --- /dev/null +++ b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/MDPHeapBuffer.java @@ -0,0 +1,61 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.control; + + +import com.epam.cme.mdp3.MdpPacket; + +import java.util.Comparator; +import java.util.PriorityQueue; + +/** + * This is dirty implementation. It has been created as quick implementation of Buffer. + */ +@Deprecated +public class MDPHeapBuffer implements Buffer { + private PriorityQueue queue = new PriorityQueue<>(new MdpPacketComparator()); + private final int capacity; + + public MDPHeapBuffer(int capacity) { + this.capacity = capacity; + } + + @Override + public void add(MdpPacket entity) { + if(queue.size() == capacity){ + queue.poll(); + } + queue.add(entity.copy()); + } + + @Override + public MdpPacket remove() { + return queue.poll(); + } + + @Override + public boolean isEmpty() { + return queue.isEmpty(); + } + + private class MdpPacketComparator implements Comparator{ + + @Override + public int compare(MdpPacket o1, MdpPacket o2) { + long sequence1 = o1.getMsgSeqNum(); + long sequence2 = o2.getMsgSeqNum(); + return Long.compare(sequence1, sequence2); + } + } + +} diff --git a/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/MDPOffHeapBuffer.java b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/MDPOffHeapBuffer.java new file mode 100644 index 0000000..30b6e0f --- /dev/null +++ b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/MDPOffHeapBuffer.java @@ -0,0 +1,105 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.control; + +import com.epam.cme.mdp3.MdpPacket; +import com.epam.cme.mdp3.sbe.message.SbeConstants; +import net.openhft.chronicle.bytes.NativeBytesStore; + +import java.util.Arrays; + +import static com.epam.cme.mdp3.sbe.message.SbeConstants.MESSAGE_SEQ_NUM_OFFSET; + +public class MDPOffHeapBuffer implements Buffer { + private final static long UNDEFINED_VALUE = Integer.MAX_VALUE; + private final MdpPacket[] data; + private MdpPacket resultPacket = MdpPacket.allocate(); + private final MdpPacket emptyPacket = MdpPacket.allocate(); + private boolean full; + + public MDPOffHeapBuffer(int capacity) { + NativeBytesStore emptyStore = NativeBytesStore.nativeStoreWithFixedCapacity(SbeConstants.MDP_PACKET_MAX_SIZE); + emptyStore.writeUnsignedInt(MESSAGE_SEQ_NUM_OFFSET, UNDEFINED_VALUE); + emptyPacket.buffer().copyFrom(emptyStore); + data = new MdpPacket[capacity]; + for (int i = 0; i < capacity; i++) { + MdpPacket mdpPacket = MdpPacket.allocate(); + mdpPacket.buffer().copyFrom(emptyStore); + data[i] = mdpPacket; + } + } + + @Override + public synchronized void add(MdpPacket entity) { + int firstEmptyPosition = calculateFirstEmptyPosition(); + MdpPacket mdpPacket = data[firstEmptyPosition]; + copy(entity, mdpPacket); + sort(); + } + + /** + * It returns the entities in sorted order and removes them after. + * Entry was returned in previous call will be filled the data of next entry. Make sure you took data from it and don't use it anymore. + * @return T or null if buffer is empty. + */ + @Override + public synchronized MdpPacket remove() { + MdpPacket nextPackage = data[0]; + if(isPacketEmpty(nextPackage)){ + return null; + } + copy(nextPackage, resultPacket); + copy(emptyPacket, nextPackage); + System.arraycopy(data, 1, data, 0, data.length - 1); + data[data.length - 1] = nextPackage; + full = false; + return resultPacket; + } + + @Override + public boolean isEmpty() { + return !full && isPacketEmpty(data[0]); + } + + private int calculateFirstEmptyPosition(){ + if(full){ + return 0; + } + for (int i = 0; i < data.length; i++) { + MdpPacket nextPackage = data[i]; + if(isPacketEmpty(nextPackage)){ + return i; + } + } + full = true; + return 0; + } + + private void sort(){ + //Arrays.sort is not the best variant here because it allocates TimSort class and array into it every time. + Arrays.sort(data, (o1, o2) -> { + long sequence1 = o1.getMsgSeqNum(); + long sequence2 = o2.getMsgSeqNum(); + return Long.compare(sequence1, sequence2); + }); + } + + private void copy(MdpPacket from, MdpPacket to){ + to.buffer().copyFrom(from.buffer()); + to.length(from.getPacketSize()); + } + + private boolean isPacketEmpty(MdpPacket mdpPacket){ + return mdpPacket.getMsgSeqNum() == UNDEFINED_VALUE; + } +} diff --git a/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/MdpChannelController.java b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/MdpChannelController.java new file mode 100644 index 0000000..1f72ff4 --- /dev/null +++ b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/MdpChannelController.java @@ -0,0 +1,46 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.control; + +import com.epam.cme.mdp3.MdpMessage; +import com.epam.cme.mdp3.SemanticMsgType; +import com.epam.cme.mdp3.sbe.message.meta.MdpMessageType; +import com.epam.cme.mdp3.sbe.schema.MdpMessageTypes; + +public interface MdpChannelController extends ChannelController { + int MBO_INCREMENT_MESSAGE_TEMPLATE_ID = 43; + int MBO_SNAPSHOT_MESSAGE_TEMPLATE_ID = 44; + + default void updateSemanticMsgType(MdpMessageTypes mdpMessageTypes, MdpMessage mdpMessage) { + int schemaId = mdpMessage.getSchemaId(); + MdpMessageType messageType = mdpMessageTypes.getMessageType(schemaId); + mdpMessage.setMessageType(messageType); + } + + default boolean isIncrementalMessageSupported(MdpMessage mdpMessage){ + SemanticMsgType semanticMsgType = mdpMessage.getSemanticMsgType(); + return SemanticMsgType.MarketDataIncrementalRefresh.equals(semanticMsgType); + } + + default boolean isIncrementOnlyForMBO(MdpMessage mdpMessage){ + SemanticMsgType semanticMsgType = mdpMessage.getSemanticMsgType(); + int schemaId = mdpMessage.getSchemaId(); + return SemanticMsgType.MarketDataIncrementalRefresh.equals(semanticMsgType) + && MBO_INCREMENT_MESSAGE_TEMPLATE_ID == schemaId; + } + + default boolean isMBOSnapshot(MdpMessage mdpMessage){ + int schemaId = mdpMessage.getSchemaId(); + return MBO_SNAPSHOT_MESSAGE_TEMPLATE_ID == schemaId; + } +} diff --git a/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/MdpInstrumentManager.java b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/MdpInstrumentManager.java new file mode 100644 index 0000000..1a475c5 --- /dev/null +++ b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/MdpInstrumentManager.java @@ -0,0 +1,70 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.control; + + +import com.epam.cme.mdp3.ChannelListener; +import net.openhft.koloboke.collect.map.IntObjMap; +import net.openhft.koloboke.collect.map.hash.HashIntObjMaps; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; + + +public class MdpInstrumentManager implements InstrumentManager { + private static final Logger log = LoggerFactory.getLogger(MdpInstrumentManager.class); + private final IntObjMap instruments = HashIntObjMaps.newMutableMap(); + private final String channelId; + private final List listeners; + + public MdpInstrumentManager(String channelId, List listeners) { + this.channelId = channelId; + this.listeners = listeners; + } + + @Override + public InstrumentController getInstrumentController(int securityId) { + return instruments.get(securityId); + } + + @Override + public void registerSecurity(int securityId, String secDesc) { + InstrumentController instrumentController = instruments.get(securityId); + if(instrumentController == null) { + instruments.put(securityId, new InstrumentController(listeners, channelId, securityId, secDesc)); + } else { + instrumentController.enable(); + } + } + + @Override + public void discontinueSecurity(int securityId) { + InstrumentController instrumentController = instruments.get(securityId); + if(instrumentController == null) { + log.warn("discontinueSecurity method was called but there is no security with id '{}'", securityId); + } else { + instrumentController.disable(); + } + } + + @Override + public void updateSecDesc(int securityId, String secDesc) { + InstrumentController instrumentController = instruments.get(securityId); + if(instrumentController == null) { + log.debug("updateSecDesc method was called but there is no security with id '{}'", securityId); + } else { + instrumentController.updateSecDesc(secDesc); + } + } +} diff --git a/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/OffHeapSnapshotCycleHandler.java b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/OffHeapSnapshotCycleHandler.java new file mode 100644 index 0000000..2ef0052 --- /dev/null +++ b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/OffHeapSnapshotCycleHandler.java @@ -0,0 +1,212 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.control; + +import net.openhft.chronicle.bytes.BytesStore; +import net.openhft.chronicle.bytes.NativeBytesStore; +import org.agrona.collections.Long2ObjectHashMap; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.nio.BufferUnderflowException; + + +public class OffHeapSnapshotCycleHandler implements SnapshotCycleHandler { + private static final Logger logger = LoggerFactory.getLogger(OffHeapSnapshotCycleHandler.class); + private final Long2ObjectHashMap> dataCache = new Long2ObjectHashMap<>(); + private final Long2ObjectHashMap> data = new Long2ObjectHashMap<>(); + private volatile int dataSize; + + @Override + public void reset(){ + data.forEach((ignore, pair) -> { + clearArray(pair.getValue()); + pair.setKey(0); + }); + } + + @Override + public void update(long totNumReports, long lastMsgSeqNumProcessed, int securityId, long noChunks, long currentChunk) { + if(currentChunk > noChunks) { + logger.error("Current chunk number '{}' is more than noChunks number '{}' for securityId '{}'", currentChunk, noChunks, securityId); + return; + } + if(dataSize != totNumReports){ + dataSize = (int)totNumReports; + dataCache.putAll(data); + data.clear(); + } + MutableLongToObjPair securityIdMetaData = data.computeIfAbsent(securityId, ignore -> { + if (dataCache.containsKey(securityId)) { + return dataCache.remove(securityId); + } else { + long arrayLength = noChunks > MAX_NO_CHUNK_VALUE ? noChunks : MAX_NO_CHUNK_VALUE; + LongArray newArray = new LongArray(arrayLength); + clearArray(newArray); + return new MutableLongToObjPair<>(noChunks, newArray); + } + }); + + LongArray currentArray = securityIdMetaData.getValue(); + if(securityIdMetaData.getKey() != noChunks) { + if(currentArray.getLength() < noChunks) { + currentArray.reInit(noChunks); + } + securityIdMetaData.setKey(noChunks); + clearArray(currentArray); + } + currentArray.setValue(currentChunk - 1, lastMsgSeqNumProcessed); + } + + @Override + public long getSnapshotSequence(int securityId) { + MutableLongToObjPair pair = data.get(securityId); + return pair != null ? pair.getValue().getValue(0) : SNAPSHOT_SEQUENCE_UNDEFINED; + } + + @Override + public long getSmallestSnapshotSequence() { + return getSnapshotSequence(false); + } + + @Override + public long getHighestSnapshotSequence() { + return getSnapshotSequence(true); + } + + private long getSnapshotSequence(boolean highest) { + long result = SNAPSHOT_SEQUENCE_UNDEFINED; + boolean existUndefined = false; + if(data.size() == dataSize) { + for (MutableLongToObjPair pair : data.values()) { + for (int j = 0; j < pair.getKey(); j++) { + long seq = pair.getValue().getValue(j); + if(seq != SNAPSHOT_SEQUENCE_UNDEFINED){ + if(result == SNAPSHOT_SEQUENCE_UNDEFINED) { + result = seq; + } else if(highest && seq > result) { + result = seq; + } else if(!highest && seq < result) { + result = seq; + } + } else { + existUndefined = true; + break; + } + } + } + } else { + existUndefined = true; + } + if(existUndefined){ + result = SNAPSHOT_SEQUENCE_UNDEFINED; + } + return result; + } + + private void clearArray(LongArray array) { + for (int i = 0; i < array.getLength(); i++) { + array.setValue(i, SNAPSHOT_SEQUENCE_UNDEFINED); + } + } + + private class LongArray { + private BytesStore bytes; + private long length; + + public LongArray(long length) { + this.bytes = NativeBytesStore.nativeStore(length * Long.BYTES); + this.length = length; + } + + public void reInit(long length){ + bytes.release(); + this.bytes = NativeBytesStore.nativeStore(length * Long.BYTES); + this.length = length; + } + + public long getValue(long index) throws BufferUnderflowException { + return bytes.readLong(index * Long.BYTES); + } + + public void setValue(long index, long value) { + if(index < length){ + bytes.writeLong(index * Long.BYTES, value); + } else { + logger.error("It tries to set value at '{}' index in array, but the array has '{}' length", index, length); + } + } + + public BytesStore getBytes() { + return bytes; + } + + public void setBytes(BytesStore bytes) { + this.bytes = bytes; + } + + public long getLength() { + return length; + } + } + + private class MutableLongToObjPair { + private long key; + private T value; + + public MutableLongToObjPair(long key, T value) { + this.key = key; + this.value = value; + } + + public long getKey() { + return key; + } + + public void setKey(long key) { + this.key = key; + } + + public T getValue() { + return value; + } + + public void setValue(T value) { + this.value = value; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + + if (o == null || getClass() != o.getClass()) return false; + + MutableLongToObjPair that = (MutableLongToObjPair) o; + + return new EqualsBuilder() + .append(key, that.key) + .append(value, that.value) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37) + .append(key) + .append(value) + .toHashCode(); + } + } +} diff --git a/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/SnapshotCycleHandler.java b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/SnapshotCycleHandler.java new file mode 100644 index 0000000..ea390ae --- /dev/null +++ b/mbp-with-mbo/src/main/java/com/epam/cme/mdp3/control/SnapshotCycleHandler.java @@ -0,0 +1,32 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.control; + +public interface SnapshotCycleHandler { + long SNAPSHOT_SEQUENCE_UNDEFINED = -1; + long MAX_NO_CHUNK_VALUE = 400; + void reset(); + void update(long totNumReports, long lastMsgSeqNumProcessed, int securityId, long noChunks, long currentChunk); + long getSnapshotSequence(int securityId); + + /** + * + * @return the smallest snapshot sequence or value of SNAPSHOT_SEQUENCE_UNDEFINED if there are gaps. + */ + long getSmallestSnapshotSequence(); + /** + * + * @return the smallest snapshot sequence or value of SNAPSHOT_SEQUENCE_UNDEFINED if there are gaps. + */ + long getHighestSnapshotSequence(); +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/ChannelHelper.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/ChannelHelper.java new file mode 100644 index 0000000..73b1966 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/ChannelHelper.java @@ -0,0 +1,98 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.test; + +import com.epam.cme.mdp3.*; +import com.epam.cme.mdp3.channel.MdpChannelBuilder; +import com.epam.cme.mdp3.sbe.message.SbeString; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +public class ChannelHelper { + private static final Logger logger = LoggerFactory.getLogger(ChannelHelper.class); + + private final Object channelInstsHandled = new Object(); + private final SbeString tag55value = SbeString.allocate(20); + private final SbeString tag1151value = SbeString.allocate(6); + + public Set resolveInstruments(final String channelId, + final List symbolGroups, String networkInterface) { + try { + final Set instruments = new HashSet<>(); + final MdpChannel mdpChannel = new MdpChannelBuilder(channelId, + ChannelHelper.class.getResource("/config.xml").toURI(), + ChannelHelper.class.getResource("/templates_FixBinary.xml").toURI()) + .setNetworkInterface(FeedType.SMBO, Feed.A, networkInterface).setNetworkInterface(FeedType.SMBO, Feed.B, networkInterface) + .setNetworkInterface(FeedType.S, Feed.A, networkInterface).setNetworkInterface(FeedType.S, Feed.B, networkInterface) + .setNetworkInterface(FeedType.I, Feed.A, networkInterface).setNetworkInterface(FeedType.I, Feed.B, networkInterface) + .setNetworkInterface(FeedType.N, Feed.A, networkInterface).setNetworkInterface(FeedType.N, Feed.B, networkInterface) + .usingListener(new VoidChannelListener() { + @Override + public void onFeedStarted(String channelId, FeedType feedType, Feed feed) { + logger.info("Channel '{}': {} feed {} is started", channelId, feedType, feed); + + } + + @Override + public void onFeedStopped(final String channelId, final FeedType feedType, final Feed feed) { + if (feedType == FeedType.N) { + logger.info("Channel '{}': {} feed {} is stopped", channelId, feedType, feed); + synchronized (channelInstsHandled) { + channelInstsHandled.notify(); + } + } + } + + @Override + public int onSecurityDefinition(final String channelId, final MdpMessage secDefMessage) { + final int securityId = secDefMessage.getInt32(48); + secDefMessage.getString(55, tag55value); + secDefMessage.getString(1151, tag1151value); + + final String secGroup = tag1151value.getString(); +// if (symbolGroups.contains(secGroup)) { + instruments.add(new InstrumentInfo(securityId, tag55value.getString())); +// } + + return MdEventFlags.NOTHING; + } + }) + .build(); + + mdpChannel.startFeed(FeedType.N, Feed.A); + synchronized (channelInstsHandled) { + channelInstsHandled.wait(TimeUnit.MINUTES.toMillis(2)); + } + mdpChannel.close(); + return instruments; + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + public static void main(String args[]) { + try { + final Set instruments = new ChannelHelper().resolveInstruments("320", Arrays.asList( "6C", "6E", "6M", "6N"), null); + System.out.println(instruments); + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/Constants.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/Constants.java new file mode 100644 index 0000000..1f95072 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/Constants.java @@ -0,0 +1,8 @@ +package com.epam.cme.mdp3.test; + + +public interface Constants { + String TEMPLATE_NAME = "templates_FixBinary.xml"; + String CONFIG_NAME = "config.xml"; + int WAITING_TIME_IN_MILLIS = 700; +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/InstrumentInfo.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/InstrumentInfo.java new file mode 100644 index 0000000..2b5b2af --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/InstrumentInfo.java @@ -0,0 +1,47 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.test; + +public class InstrumentInfo { + final int instrumentId; + final String desc; + + public InstrumentInfo(final int instrumentId, final String desc) { + this.instrumentId = instrumentId; + this.desc = desc; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + InstrumentInfo that = (InstrumentInfo) o; + + if (instrumentId != that.instrumentId) return false; + return desc.equals(that.desc); + + } + + @Override + public int hashCode() { + int result = instrumentId; + result = 31 * result + desc.hashCode(); + return result; + } + + @Override + public String toString() { + return "Instrument{" + instrumentId + ", '" + desc + "'}"; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/MBOBook.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/MBOBook.java new file mode 100644 index 0000000..447b88d --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/MBOBook.java @@ -0,0 +1,169 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.test; + +import java.util.*; + +public class MBOBook { + private Set bidEntities = Collections.synchronizedSet(new TreeSet<>(new BidComparator())); + private Set askEntities = Collections.synchronizedSet(new TreeSet<>(new AskComparator())); + + + public boolean remove(Side side, BookEntity entityToRemove){ + Iterator iterator; + boolean result = false; + if(side.equals(Side.BID)) { + iterator = bidEntities.iterator(); + } else { + iterator = askEntities.iterator(); + } + while (iterator.hasNext()){ + BookEntity bookEntity = iterator.next(); + if(entityToRemove.getOrderId() == bookEntity.getOrderId()){ + iterator.remove(); + result = true; + break; + } + } + return result; + } + + public void add(Side side, BookEntity entityToAdd){ + if(side.equals(Side.BID)) { + bidEntities.add(entityToAdd); + } else { + askEntities.add(entityToAdd); + } + } + + public boolean update(Side side, BookEntity entityToUpdate){ + Set entities; + boolean result = false; + if(side.equals(Side.BID)) { + entities = bidEntities; + } else { + entities = askEntities; + } + Iterator iterator = entities.iterator(); + while (iterator.hasNext()){ + BookEntity bookEntity = iterator.next(); + if(entityToUpdate.getOrderId() == bookEntity.getOrderId()){ + iterator.remove(); + entities.add(entityToUpdate); + result = true; + break; + } + } + return result; + } + + @Override + public String toString(){ + StringBuffer sb = new StringBuffer(); + sb.append("___________________BIDS___________________\n"); + bidEntities.forEach(bookEntity -> + sb.append(bookEntity.getMdEntryPx()).append(" ").append(bookEntity.getMdDisplayQty()).append("\n") + ); + sb.append("___________________ASKS___________________\n"); + askEntities.forEach(bookEntity -> + sb.append(bookEntity.getMdEntryPx()).append(" ").append(bookEntity.getMdDisplayQty()).append("\n") + ); + return sb.toString(); + } + + public void clear() { + bidEntities.clear(); + askEntities.clear(); + } + + + public enum Side { + BID, ASK + } + + class BidComparator implements Comparator { + @Override + public int compare(BookEntity o1, BookEntity o2) { + int priceCompared = Double.compare(o2.getMdEntryPx(), o1.getMdEntryPx()); + if(priceCompared == 0){ + return Long.compare(o1.getMdOrderPriority(), o2.getMdOrderPriority()); + } else { + return priceCompared; + } + } + } + + class AskComparator implements Comparator { + @Override + public int compare(BookEntity o1, BookEntity o2) { + int priceCompared = Double.compare(o1.getMdEntryPx(), o2.getMdEntryPx()); + if(priceCompared == 0){ + return Long.compare(o1.getMdOrderPriority(), o2.getMdOrderPriority()); + } else { + return priceCompared; + } + } + } + + + public static class BookEntity { + private long mdOrderPriority; + private double mdEntryPx; + private long mdDisplayQty; + private long orderId; + + public BookEntity(long orderId, long mdOrderPriority, double mdEntryPx, long mdDisplayQty) { + this.mdOrderPriority = mdOrderPriority; + this.mdEntryPx = mdEntryPx; + this.orderId = orderId; + this.mdDisplayQty = mdDisplayQty; + } + + public long getMdOrderPriority() { + return mdOrderPriority; + } + + public double getMdEntryPx() { + return mdEntryPx; + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + BookEntity that = (BookEntity) o; + + if (mdOrderPriority != that.mdOrderPriority) return false; + return Double.compare(that.mdEntryPx, mdEntryPx) == 0; + } + + @Override + public int hashCode() { + int result; + long temp; + result = (int) (mdOrderPriority ^ (mdOrderPriority >>> 32)); + temp = Double.doubleToLongBits(mdEntryPx); + result = 31 * result + (int) (temp ^ (temp >>> 32)); + return result; + } + + public long getOrderId() { + return orderId; + } + + public long getMdDisplayQty() { + return mdDisplayQty; + } + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/MBOWithMBPMain.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/MBOWithMBPMain.java new file mode 100644 index 0000000..bd9c40a --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/MBOWithMBPMain.java @@ -0,0 +1,384 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.test; + +import com.epam.cme.mdp3.*; +import com.epam.cme.mdp3.channel.MdpChannelBuilder; +import com.epam.cme.mdp3.sbe.message.SbeDouble; +import com.epam.cme.mdp3.sbe.message.SbeGroup; +import com.epam.cme.mdp3.sbe.message.SbeGroupEntry; +import com.epam.cme.mdp3.sbe.message.SbeString; +import com.epam.cme.mdp3.test.mbpbook.MultipleDepthBookHandler; +import com.epam.cme.mdp3.test.mbpbook.OrderBookPriceLevel; +import org.apache.commons.lang3.time.DateFormatUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.Executors; +import java.util.concurrent.ScheduledExecutorService; + +import static com.epam.cme.mdp3.FeedType.S; +import static com.epam.cme.mdp3.FeedType.SMBO; +import static com.epam.cme.mdp3.MdConstants.SECURITY_ID; + +public class MBOWithMBPMain { + private static final Logger logger = LoggerFactory.getLogger(MBOWithMBPMain.class); + private static Map mboBook = new HashMap<>(); + private static Map multipleDepthBookHandlers = new ConcurrentHashMap<>(); + + private static class ChannelListenerImpl implements ChannelListener { + private final MdpGroup mdpGroup = SbeGroup.instance(); + private final SbeDouble sbeDouble = SbeDouble.instance(); + private final boolean traceEnabled = logger.isTraceEnabled(); + + @Override + public void onFeedStarted(String channelId, FeedType feedType, Feed feed) { + logger.info("Channel '{}': {} feed {} is started", channelId, feedType, feed); + clearBooks(); + } + + @Override + public void onFeedStopped(String channelId, FeedType feedType, Feed feed) { + logger.info("Channel '{}': {} feed {} is stopped", channelId, feedType, feed); + } + + @Override + public void onPacket(String channelId, FeedType feedType, Feed feed, MdpPacket mdpPacket) { +// if (feedType != FeedType.S) { +// logger.info("{} - {} {}: {}", channelId, feedType, feed, mdpPacket.getMsgSeqNum()); +// } + /*if (feedType != FeedType.S) { + logger.info("{} {}: {}", feedType, feed, mdpPacket); + /*final long seqNum = mdpPacket.getMsgSeqNum(); + if (!prcdSeqNum.compareAndSet(0, seqNum)) { + if (!prcdSeqNum.compareAndSet(seqNum-1, seqNum)) { + if (prcdSeqNum.get() + 3 < seqNum) { + final long prevPrcdSeqNum = prcdSeqNum.get(); + prcdSeqNum.set(seqNum); + logger.warn("!!!! GAP {}:{}", prevPrcdSeqNum, seqNum); + } + } + } + }*/ + } + + @Override + public void onBeforeChannelReset(String channelId, MdpMessage resetMessage) { + clearBooks(); + logger.info("Channel '{}' is broken, all books should be restored", channelId); + } + + @Override + public void onFinishedChannelReset(String channelId, MdpMessage resetMessage) { + clearBooks(); + logger.info("Channel '{}' has been reset and restored", channelId); + } + + @Override + public void onChannelStateChanged(String channelId, ChannelState prevState, ChannelState newState) { + logger.info("Channel '{}' state is changed from '{}' to '{}'", channelId, prevState, newState); + } + + @Override + public int onSecurityDefinition(final String channelId, final MdpMessage mdpMessage) { + SbeString secGroup = SbeString.allocate(10); + mdpMessage.getString(1151, secGroup); + int securityID = mdpMessage.getInt32(48); + short marketSegmentID = mdpMessage.getUInt8(1300); + double strikePrice = 0; + if(mdpMessage.hasField(202)) { + strikePrice = mdpMessage.getInt64(202) * Math.pow(10, -7); + } + String securityGroup = secGroup.getString(); + MdpGroup mdpGroup = SbeGroup.instance(); + mdpMessage.getGroup(864, mdpGroup); + MdpGroupEntry mdpGroupEntry = SbeGroupEntry.instance(); + + logger.info("Received SecurityDefinition(d). securityID '{}', ChannelId: {}, Schema Id: {}, securityGroup '{}', marketSegmentID '{}', strikePrice '{}'", securityID, channelId, mdpMessage.getSchemaId(), securityGroup, marketSegmentID, strikePrice); + while (mdpGroup.hashNext()){ + mdpGroup.next(); + mdpGroup.getEntry(mdpGroupEntry); + long eventTime = mdpGroupEntry.getUInt64(1145); + short eventType = mdpGroupEntry.getUInt8(865); + logger.info("eventTime - '{}'({}), eventType - '{}'", DateFormatUtils.format(eventTime/1000000, "yyyyMMdd HHmm", TimeZone.getTimeZone("UTC")), eventTime, eventType); + } + return MdEventFlags.MESSAGE; + } + + @Override + public void onIncrementalMBPRefresh(final String channelId, final short matchEventIndicator, final int securityId, + final String secDesc, final long msgSeqNum, final FieldSet mdEntry){ + MultipleDepthBookHandler multipleDepthBookHandler = multipleDepthBookHandlers.computeIfAbsent(securityId, integer -> new MultipleDepthBookHandler(integer, MdEventFlags.BOOK, (byte) 20)); + char mdEntryType = mdEntry.getChar(269); + if (mdEntry.getSchemaId() == 32) { + if (mdEntryType == '0') { + multipleDepthBookHandler.handleIncrementBidEntry(mdEntry); + } else { + multipleDepthBookHandler.handleIncrementOfferEntry(mdEntry); + } + } + } + + @Override + public void onIncrementalMBORefresh(final String channelId, final short matchEventIndicator, final int securityId, + final String secDesc, final long msgSeqNum, final FieldSet orderIDEntry, final FieldSet mdEntry){ + try { + long orderId; + long mdOrderPriority; + double mdEntryPx; + long mdDisplayQty; + int mdUpdateAction; + char mdEntryType; + if (mdEntry == null) {//MBO only + orderId = orderIDEntry.getUInt64(37); + mdOrderPriority = orderIDEntry.getUInt64(37707); + orderIDEntry.getDouble(270, sbeDouble); + mdEntryPx = sbeDouble.asDouble(); + mdDisplayQty = orderIDEntry.getInt32(37706); + mdUpdateAction = orderIDEntry.getUInt8(279); + mdEntryType = orderIDEntry.getChar(269); + if (traceEnabled) { + String result = String.format("MBO only onIncrementalMBORefresh : ChannelId: %s, SecurityId: %s-%s, orderId - '%s', mdOrderPriority - '%s', mdEntryPx - '%s', mdDisplayQty - '%s', mdEntryType - '%s', mdUpdateAction - '%s', MatchEventIndicator: %s (byte representation: '%s')", + channelId, securityId, secDesc, orderId, mdOrderPriority, mdEntryPx, mdDisplayQty, mdEntryType, mdUpdateAction, matchEventIndicator, String.format("%08d", Integer.parseInt(Integer.toBinaryString(0xFFFF & matchEventIndicator)))); + logger.trace(result); + } + } else { + orderId = orderIDEntry.getUInt64(37); + mdOrderPriority = orderIDEntry.getUInt64(37707); + mdDisplayQty = orderIDEntry.getInt32(37706); + mdUpdateAction = orderIDEntry.getUInt8(37708); + + mdEntry.getDouble(270, sbeDouble); + mdEntryPx = sbeDouble.asDouble(); + mdEntryType = mdEntry.getChar(269); + if (traceEnabled) { + String result = String.format("MBO with MBP onIncrementalMBORefresh : ChannelId: %s, SecurityId: %s-%s, orderId - '%s', mdOrderPriority - '%s', mdEntryPx - '%s', mdDisplayQty - '%s', mdEntryType - '%s', mdUpdateAction - '%s', MatchEventIndicator: %s (byte representation: '%s')", + channelId, securityId, secDesc, orderId, mdOrderPriority, mdEntryPx, mdDisplayQty, mdEntryType, mdUpdateAction, matchEventIndicator, String.format("%08d", Integer.parseInt(Integer.toBinaryString(0xFFFF & matchEventIndicator)))); + logger.trace(result); + } + + } + updateBook(securityId + "-" + secDesc, orderId, mdOrderPriority, mdEntryPx, mdDisplayQty, mdUpdateAction, mdEntryType); + } catch (Exception e) { + if(mdEntry != null) { + logger.error("mdEntry, SchemaId - {}", mdEntry.getSchemaId(), e); + } else { + logger.error(e.getMessage(), e); + } + } + } + + @Override + public void onSnapshotMBOFullRefresh(final String channelId, final String secDesc, final MdpMessage snptMessage){ + int securityId = snptMessage.getInt32(SECURITY_ID); + + snptMessage.getGroup(268, mdpGroup); + + while (mdpGroup.hashNext()){ + mdpGroup.next(); + long orderId = mdpGroup.getUInt64(37); + long mdOrderPriority = mdpGroup.getUInt64(37707); + mdpGroup.getDouble(270, sbeDouble); + double mdEntryPx = sbeDouble.asDouble(); + long mdDisplayQty = mdpGroup.getInt32(37706); + char mdEntryType = mdpGroup.getChar(269); + if(traceEnabled) { + String result = String.format("onSnapshotMBOFullRefresh : ChannelId: %s, SecurityId: %s-%s, orderId - '%s', mdOrderPriority - '%s', mdEntryPx - '%s', mdDisplayQty - '%s', mdEntryType - '%s'", + channelId, securityId, secDesc, orderId, mdOrderPriority, mdEntryPx, mdDisplayQty, mdEntryType); + logger.trace(result); + } + updateBook(securityId + "-" + secDesc, orderId, mdOrderPriority, mdEntryPx, mdDisplayQty, 0, mdEntryType); + } + } + + @Override + public void onSnapshotMBPFullRefresh(String channelId, String secDesc, MdpMessage snptMessage) { + int securityId = snptMessage.getInt32(SECURITY_ID); + MultipleDepthBookHandler multipleDepthBookHandler = multipleDepthBookHandlers.computeIfAbsent(securityId, integer -> new MultipleDepthBookHandler(integer, MdEventFlags.BOOK, (byte) 20)); + snptMessage.getGroup(268, mdpGroup); + while (mdpGroup.hashNext()) { + mdpGroup.next(); + if(mdpGroup.getChar(269) == '0'){ + multipleDepthBookHandler.handleSnapshotBidEntry(mdpGroup); + } else { + multipleDepthBookHandler.handleSnapshotOfferEntry(mdpGroup); + } + } + } + + private void updateBook(String instrumentId, long orderId, long mdOrderPriority, double mdEntryPx, long mdDisplayQty, int mdUpdateAction, char mdEntryType){ + if(!mboBook.containsKey(instrumentId)){ + mboBook.put(instrumentId, new MBOBook()); + } + MBOBook currentMBOBook = mboBook.get(instrumentId); + MBOBook.Side side; + if(mdEntryType == '0'){ + side = MBOBook.Side.BID; + } else { + side = MBOBook.Side.ASK; + } + MBOBook.BookEntity bookEntity = new MBOBook.BookEntity(orderId, mdOrderPriority, mdEntryPx, mdDisplayQty); + switch (mdUpdateAction) { + case 0: + currentMBOBook.add(side, bookEntity); + break; + case 1: + boolean updated = currentMBOBook.update(side, bookEntity); + if(!updated) { + logger.error("Update failed"); + } + break; + case 2: + boolean removed = currentMBOBook.remove(side, bookEntity); + if(!removed) { + logger.error("Remove failed"); + } + break; + } + } + + @Override + public void onRequestForQuote(String channelId, MdpMessage rfqMessage) { + MdpGroup mdpGroup = SbeGroup.instance(); + rfqMessage.getGroup(146, mdpGroup); + MdpGroupEntry mdpGroupEntry = SbeGroupEntry.instance(); + while (mdpGroup.hashNext()) { + mdpGroup.next(); + mdpGroup.getEntry(mdpGroupEntry); + int orderQty = mdpGroupEntry.getInt32(38); + logger.info("onRequestForQuote orderQty - '{}'", orderQty); + } + } + + @Override + public void onSecurityStatus(String channelId, int securityId, MdpMessage secStatusMessage) { + //logger.info("onSecurityStatus. ChannelId: {}, SecurityId: {}, SecurityTradingStatus(326): {}", channelId, securityId, SecurityTradingStatus.fromFIX(secStatusMessage.getUInt8(326))); + } + } + + private static void defineChannel(final Map> channelInfos, final String channelId, String... groups) { + channelInfos.put(channelId, Arrays.asList(groups)); + } + + private static void clearBooks(){ + mboBook.forEach((s, book) -> book.clear()); + multipleDepthBookHandlers.forEach((integer, multipleDepthBookHandler) -> multipleDepthBookHandler.clear()); + } + + private static MdpChannel openChannel(final String channelId, final Set instruments, + String networkInterface, ScheduledExecutorService executorService, boolean mboEnabled) throws Exception { + final MdpChannel mdpChannel = new MdpChannelBuilder(channelId, + MBOWithMBPMain.class.getResource("/config.xml").toURI(), + MBOWithMBPMain.class.getResource("/templates_FixBinary.xml").toURI()) + .usingListener(new ChannelListenerImpl()) + .setNetworkInterface(SMBO, Feed.A, networkInterface).setNetworkInterface(SMBO, Feed.B, networkInterface) + .setNetworkInterface(S, Feed.A, networkInterface).setNetworkInterface(S, Feed.B, networkInterface) + .setNetworkInterface(FeedType.I, Feed.A, networkInterface).setNetworkInterface(FeedType.I, Feed.B, networkInterface) + .setNetworkInterface(FeedType.N, Feed.A, networkInterface).setNetworkInterface(FeedType.N, Feed.B, networkInterface) + .usingIncrQueueSize(MdpChannelBuilder.DEF_INCR_QUEUE_SIZE) + .usingScheduler(executorService) + .setMBOEnable(mboEnabled) + .build(); + instruments.forEach(instrumentInfo -> mdpChannel.subscribe(instrumentInfo.instrumentId, instrumentInfo.desc)); + mdpChannel.startFeed(FeedType.I, Feed.A); + mdpChannel.startFeed(FeedType.I, Feed.B); + if(mboEnabled) { + mdpChannel.startFeed(SMBO, Feed.A); + } else { + mdpChannel.startFeed(S, Feed.A); + } + return mdpChannel; + } + + public static void main(String args[]) throws Exception { +// # 310 for ES +// # 314 for 6A, 6B, 6J, 6S +// # 318 for NQ +// # 382 for CL +// # 360 for HG, GC, SI +// # 320 for 6C, 6E, 6M, 6N +// # 342 for YM +// # 344 for ZB, ZN, ZF + final String networkInterface; +// if(args.length > 0) { +// networkInterface =args[0]; +// } else { + networkInterface = null; +// } + + + + final Map> channelInfos = new HashMap<>(); + defineChannel(channelInfos, args[0]); + boolean mboEnabled = Boolean.valueOf(args[1]); +// defineChannel(channelInfos, "310", "ES"); +// defineChannel(channelInfos, "314", "6A", "6B", "6J", "6S"); +// defineChannel(channelInfos, "318", "NQ"); +// defineChannel(channelInfos, "382", "CL"); +// defineChannel(channelInfos, "360", "HG", "GC", "SI"); +// defineChannel(channelInfos, "320", "6C", "6E", "6M", "6N"); +// defineChannel(channelInfos, "342", "YM"); +// defineChannel(channelInfos, "344", "ZB", "ZN", "ZF"); + + final ScheduledExecutorService executorService = Executors.newScheduledThreadPool(channelInfos.size()); + + final Map> resolvedInstruments = new HashMap<>(); + channelInfos.forEach((s, groups) -> resolvedInstruments.put(s, new ChannelHelper().resolveInstruments(s, groups, networkInterface))); + + final List openChannels = new ArrayList<>(); + try { + resolvedInstruments.forEach((s, instrumentInfos) -> { + if (!resolvedInstruments.isEmpty()) { + try { + openChannels.add(openChannel(s, instrumentInfos, networkInterface, executorService, mboEnabled)); + } catch (Exception e) { + e.printStackTrace(); + } + } + }); + System.out.println("Press enter to shutdown."); + while (true) { + int read = System.in.read(); + if(((char)read) == '1') { + mboBook.forEach((s, book) -> { + logger.info("MBO MBOBook for '{}'\n{}", s, book.toString()); + }); + multipleDepthBookHandlers.forEach((security, multipleDepthBookHandler) -> { + logger.info("MBP Book for '{}'", security); + StringBuilder sb = new StringBuilder(); + for (int i = 1; i <= multipleDepthBookHandler.getDepth(); i++) { + OrderBookPriceLevel bid = multipleDepthBookHandler.getBid((byte)i); + OrderBookPriceLevel ask = multipleDepthBookHandler.getOffer((byte)i); + sb.append(String.format("%s - bid['%s' - '%s' == '%s'] ask['%s' - '%s' == '%s']", i, + bid.getPrice().asDouble(), bid.getQuantity(), bid.getOrderCount(), + ask.getPrice().asDouble(), ask.getQuantity(), ask.getOrderCount())).append("\n"); + + } + logger.info(sb.toString()); + }); + + } else if(((char)read) == '0') { + clearBooks(); + } else if(((char)read) == '3') { + openChannels.forEach(MdpChannel::close); + executorService.shutdownNow(); + return; + } + } + } catch (Exception e) { + e.printStackTrace(); + } + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/MdpPacketTest.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/MdpPacketTest.java new file mode 100644 index 0000000..0dae9e7 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/MdpPacketTest.java @@ -0,0 +1,68 @@ +package com.epam.cme.mdp3.test; + +import com.epam.cme.mdp3.*; +import com.epam.cme.mdp3.sbe.message.SbeGroup; +import com.epam.cme.mdp3.sbe.message.SbeGroupEntry; +import com.epam.cme.mdp3.sbe.schema.MdpMessageTypes; +import com.epam.cme.mdp3.test.gen.MDEntryTypeBook; +import org.junit.Test; + +import java.util.Iterator; + +import static com.epam.cme.mdp3.test.Constants.TEMPLATE_NAME; +import static org.junit.Assert.*; + + +public class MdpPacketTest { + + @Test + public void itMustBeCopyItselfCompletely(){ + MdpPacket packet = MdpPacket.allocate(); + int expectedSchemaId = 43; + packet.wrapFromBuffer(ModelUtils.getMBOIncrementTestMessage(1)); + MdpPacket copy = packet.copy(); + Iterator realIterator = packet.iterator(); + Iterator copyIterator = copy.iterator(); + while (realIterator.hasNext()){ + MdpMessage mdpMessage = realIterator.next(); + int schemaId = mdpMessage.getSchemaId(); + assertEquals(expectedSchemaId, schemaId); + } + while (copyIterator.hasNext()){ + MdpMessage mdpMessage = copyIterator.next(); + int schemaId = mdpMessage.getSchemaId(); + assertEquals(expectedSchemaId, schemaId); + } + } + + @Test + public void fieldSetMustBeCopiedCompletely() throws Exception { + ClassLoader classLoader = getClass().getClassLoader(); + MdpMessageTypes mdpMessageTypes = new MdpMessageTypes(classLoader.getResource(TEMPLATE_NAME).toURI()); + MdpPacket packet = MdpPacket.allocate(); + long sequence = 1; + int securityId = 2; + long orderID = 3; + long mDOrderPriority = 4; + short mDUpdateAction = 5; + byte mDEntryType = MDEntryTypeBook.Bid.value(); + int mDDisplayQty = 7; + int mDEntryPx = 8; + packet.wrapFromBuffer(ModelUtils.getMBOIncrementTestMessage(sequence, securityId, orderID, mDOrderPriority, mDUpdateAction, mDEntryType, mDDisplayQty, mDEntryPx)); + MdpMessage message = packet.iterator().next(); + message.setMessageType(mdpMessageTypes.getMessageType(message.getSchemaId())); + MdpGroup mdpGroup = SbeGroup.instance(); + message.getGroup(MdConstants.NO_MD_ENTRIES, mdpGroup); + MdpGroupEntry groupEntry = SbeGroupEntry.instance(); + mdpGroup.getEntry(1, groupEntry); + MdpGroupEntry copied = groupEntry.copy(); + + assertEquals(orderID, copied.getUInt64(37)); + assertEquals(mDOrderPriority, copied.getUInt64(37707)); + assertEquals(mDUpdateAction, copied.getInt8(279)); + assertEquals(mDEntryType, copied.getUInt8(269)); + assertEquals(mDDisplayQty, copied.getInt32(37706)); + assertEquals(mDEntryPx, copied.getInt64(270)); + } + +} \ No newline at end of file diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/ModelGenerator.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/ModelGenerator.java new file mode 100644 index 0000000..c77153b --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/ModelGenerator.java @@ -0,0 +1,32 @@ +package com.epam.cme.mdp3.test; +import uk.co.real_logic.sbe.SbeTool; +import uk.co.real_logic.sbe.ir.Ir; +import uk.co.real_logic.sbe.xml.IrGenerator; +import uk.co.real_logic.sbe.xml.MessageSchema; +import uk.co.real_logic.sbe.xml.ParserOptions; +import uk.co.real_logic.sbe.xml.XmlSchemaParser; + +import java.io.InputStream; +import java.lang.reflect.Field; + + +public class ModelGenerator { + public static final String TEMPLATE_NAME = "templates_FixBinary.xml"; + public static final String MODEL_OUTPUT_DIR = ".\\src\\test\\java"; + public static final String MODEL_PACKAGE = "com.epam.cme.mdp3.test.gen"; + + public static void main(String[] args) throws Exception { + ClassLoader classLoader = ModelGenerator.class.getClassLoader(); + System.setProperty(SbeTool.KEYWORD_APPEND_TOKEN, "1"); + try(InputStream templateStream = classLoader.getResourceAsStream(TEMPLATE_NAME)){ + final ParserOptions options = ParserOptions.builder().stopOnError(true).build(); + final MessageSchema schema = XmlSchemaParser.parse(templateStream, options); + Field packageNameField = schema.getClass().getDeclaredField("packageName"); + packageNameField.setAccessible(true); + packageNameField.set(schema, MODEL_PACKAGE); + final IrGenerator irg = new IrGenerator(); + Ir ir = irg.generate(schema); + SbeTool.generate(ir, MODEL_OUTPUT_DIR, "Java"); + } + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/ModelUtils.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/ModelUtils.java new file mode 100644 index 0000000..1891809 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/ModelUtils.java @@ -0,0 +1,319 @@ +package com.epam.cme.mdp3.test; + + +import com.epam.cme.mdp3.test.gen.*; +import net.openhft.chronicle.bytes.NativeBytesStore; +import org.agrona.ExpandableArrayBuffer; +import org.agrona.MutableDirectBuffer; + +import java.nio.ByteBuffer; + +import static com.epam.cme.mdp3.sbe.message.SbeConstants.*; + +public class ModelUtils { + + public static ByteBuffer getMBOSnapshotTestMessage(long sequence, int securityId){ + return getMBOSnapshotTestMessage(sequence, securityId, 100, 1, 1, 1); + } + + public static ByteBuffer getMBPSnapshotTestMessage(long sequence, int securityId) { + return getMBPSnapshotTestMessage(sequence, securityId, 100, 1); + } + + public static ByteBuffer getMBOOnlyIncrementWith12TestEntries(long sequence, int securityId){ + short bufferOffset = 0; + final MutableDirectBuffer mutableDirectBuffer = new ExpandableArrayBuffer(); + MessageHeaderEncoder messageHeaderEncoder = new MessageHeaderEncoder(); + MDIncrementalRefreshOrderBook43Encoder incrementalRefreshOrderBook43Encoder = new MDIncrementalRefreshOrderBook43Encoder(); + messageHeaderEncoder.wrap(mutableDirectBuffer, bufferOffset) + .blockLength(incrementalRefreshOrderBook43Encoder.sbeBlockLength()) + .templateId(incrementalRefreshOrderBook43Encoder.sbeTemplateId()) + .schemaId(incrementalRefreshOrderBook43Encoder.sbeSchemaId()) + .version(incrementalRefreshOrderBook43Encoder.sbeSchemaVersion()); + bufferOffset += messageHeaderEncoder.encodedLength(); + incrementalRefreshOrderBook43Encoder.wrap(mutableDirectBuffer, bufferOffset) + .transactTime(System.currentTimeMillis()); + MatchEventIndicatorEncoder matchEventIndicatorEncoder = incrementalRefreshOrderBook43Encoder.matchEventIndicator(); + matchEventIndicatorEncoder.lastQuoteMsg(true); + MDIncrementalRefreshOrderBook43Encoder.NoMDEntriesEncoder noMDEntriesEncoder = incrementalRefreshOrderBook43Encoder.noMDEntriesCount(12); + noMDEntriesEncoder.next().orderID(9926951995L).mDOrderPriority(414).securityID(securityId).mDUpdateAction(MDUpdateAction.Delete).mDEntryType(MDEntryTypeBook.Bid).mDDisplayQty(23).mDEntryPx().mantissa(98682500000L); + noMDEntriesEncoder.next().orderID(9926951993L).mDOrderPriority(412).securityID(securityId).mDUpdateAction(MDUpdateAction.Delete).mDEntryType(MDEntryTypeBook.Offer).mDDisplayQty(59).mDEntryPx().mantissa(98685000000L); + noMDEntriesEncoder.next().orderID(9926951992L).mDOrderPriority(411).securityID(securityId).mDUpdateAction(MDUpdateAction.Delete).mDEntryType(MDEntryTypeBook.Bid).mDDisplayQty(12).mDEntryPx().mantissa(98692500000L); + noMDEntriesEncoder.next().orderID(9926951997L).mDOrderPriority(416).securityID(securityId).mDUpdateAction(MDUpdateAction.Change).mDEntryType(MDEntryTypeBook.Offer).mDDisplayQty(49).mDEntryPx().mantissa(98677500000L); + noMDEntriesEncoder.next().orderID(9926951996L).mDOrderPriority(415).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryType(MDEntryTypeBook.Offer).mDDisplayQty(92).mDEntryPx().mantissa(98687500000L); + noMDEntriesEncoder.next().orderID(9926952003L).mDOrderPriority(422).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryType(MDEntryTypeBook.Offer).mDDisplayQty(88).mDEntryPx().mantissa(98672500000L); + noMDEntriesEncoder.next().orderID(9926952002L).mDOrderPriority(421).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryType(MDEntryTypeBook.Bid).mDDisplayQty(32).mDEntryPx().mantissa(98677500000L); + noMDEntriesEncoder.next().orderID(9926952001L).mDOrderPriority(420).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryType(MDEntryTypeBook.Bid).mDDisplayQty(99).mDEntryPx().mantissa(98702500000L); + noMDEntriesEncoder.next().orderID(9926952000L).mDOrderPriority(419).securityID(securityId).mDUpdateAction(MDUpdateAction.Delete).mDEntryType(MDEntryTypeBook.Bid).mDDisplayQty(94).mDEntryPx().mantissa(98680000000L); + noMDEntriesEncoder.next().orderID(9926952005L).mDOrderPriority(424).securityID(securityId).mDUpdateAction(MDUpdateAction.Change).mDEntryType(MDEntryTypeBook.Bid).mDDisplayQty(49).mDEntryPx().mantissa(98675000000L); + noMDEntriesEncoder.next().orderID(9926952004L).mDOrderPriority(423).securityID(securityId).mDUpdateAction(MDUpdateAction.Change).mDEntryType(MDEntryTypeBook.Offer).mDDisplayQty(54).mDEntryPx().mantissa(98702500000L); + noMDEntriesEncoder.next().orderID(9926951983L).mDOrderPriority(402).securityID(securityId).mDUpdateAction(MDUpdateAction.Delete).mDEntryType(MDEntryTypeBook.Offer).mDDisplayQty(16).mDEntryPx().mantissa(98670000000L); + bufferOffset += incrementalRefreshOrderBook43Encoder.encodedLength(); + return packMessage(sequence, mutableDirectBuffer.byteArray(), bufferOffset); + } + + public static ByteBuffer getMBOWithMBPIncrementWith12TestEntries(int sequence, int securityId) { + short bufferOffset = 0; + final MutableDirectBuffer mutableDirectBuffer = new ExpandableArrayBuffer(); + MessageHeaderEncoder messageHeaderEncoder = new MessageHeaderEncoder(); + MDIncrementalRefreshBook32Encoder mdIncrementalRefreshBook32Encoder = new MDIncrementalRefreshBook32Encoder(); + messageHeaderEncoder.wrap(mutableDirectBuffer, bufferOffset) + .blockLength(mdIncrementalRefreshBook32Encoder.sbeBlockLength()) + .templateId(mdIncrementalRefreshBook32Encoder.sbeTemplateId()) + .schemaId(mdIncrementalRefreshBook32Encoder.sbeSchemaId()) + .version(mdIncrementalRefreshBook32Encoder.sbeSchemaVersion()); + bufferOffset += messageHeaderEncoder.encodedLength(); + MDIncrementalRefreshBook32Encoder.NoMDEntriesEncoder noMDEntriesEncoder = mdIncrementalRefreshBook32Encoder.wrap(mutableDirectBuffer, bufferOffset) + .transactTime(System.currentTimeMillis()).noMDEntriesCount(12); + MatchEventIndicatorEncoder matchEventIndicatorEncoder = mdIncrementalRefreshBook32Encoder.matchEventIndicator(); + matchEventIndicatorEncoder.lastTradeMsg(true); + noMDEntriesEncoder.next().mDEntrySize(4 ).mDEntryType(MDEntryTypeBook.Bid ).mDPriceLevel((short) 1).rptSeq(1254).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryPx().mantissa(98745000000L); + noMDEntriesEncoder.next().mDEntrySize(1 ).mDEntryType(MDEntryTypeBook.Offer).mDPriceLevel((short) 1).rptSeq(1255).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryPx().mantissa(987075000000L); + noMDEntriesEncoder.next().mDEntrySize(45).mDEntryType(MDEntryTypeBook.Bid ).mDPriceLevel((short) 2).rptSeq(1256).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryPx().mantissa(987125000000L); + noMDEntriesEncoder.next().mDEntrySize(22).mDEntryType(MDEntryTypeBook.Offer).mDPriceLevel((short) 2).rptSeq(1257).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryPx().mantissa(98745000000L); + noMDEntriesEncoder.next().mDEntrySize(98).mDEntryType(MDEntryTypeBook.Bid ).mDPriceLevel((short) 3).rptSeq(1258).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryPx().mantissa(98720000000L); + noMDEntriesEncoder.next().mDEntrySize(43).mDEntryType(MDEntryTypeBook.Offer).mDPriceLevel((short) 3).rptSeq(1259).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryPx().mantissa(98725000000L); + noMDEntriesEncoder.next().mDEntrySize(12).mDEntryType(MDEntryTypeBook.Bid ).mDPriceLevel((short) 4).rptSeq(1260).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryPx().mantissa(98715000000L); + noMDEntriesEncoder.next().mDEntrySize(83).mDEntryType(MDEntryTypeBook.Offer).mDPriceLevel((short) 4).rptSeq(1261).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryPx().mantissa(98670000000L); + noMDEntriesEncoder.next().mDEntrySize(38).mDEntryType(MDEntryTypeBook.Bid ).mDPriceLevel((short) 5).rptSeq(1262).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryPx().mantissa(98695000000L); + noMDEntriesEncoder.next().mDEntrySize(99).mDEntryType(MDEntryTypeBook.Offer).mDPriceLevel((short) 5).rptSeq(1263).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryPx().mantissa(98690000000L); + noMDEntriesEncoder.next().mDEntrySize(1 ).mDEntryType(MDEntryTypeBook.Bid ).mDPriceLevel((short) 3).rptSeq(1264).securityID(securityId).mDUpdateAction(MDUpdateAction.Delete).mDEntryPx().mantissa(987025000000L); + noMDEntriesEncoder.next().mDEntrySize(99).mDEntryType(MDEntryTypeBook.Offer).mDPriceLevel((short) 3).rptSeq(1265).securityID(securityId).mDUpdateAction(MDUpdateAction.Delete).mDEntryPx().mantissa(98677500000L); + + MDIncrementalRefreshBook32Encoder.NoOrderIDEntriesEncoder noOrderIDEntriesEncoder = mdIncrementalRefreshBook32Encoder.noOrderIDEntriesCount(12); + noOrderIDEntriesEncoder.next().orderUpdateAction(OrderUpdateAction.New ).mDDisplayQty(61).mDOrderPriority(5394).orderID(9927057956L).referenceID((short)1); + noOrderIDEntriesEncoder.next().orderUpdateAction(OrderUpdateAction.New ).mDDisplayQty(3 ).mDOrderPriority(5395).orderID(9927057957L).referenceID((short)2); + noOrderIDEntriesEncoder.next().orderUpdateAction(OrderUpdateAction.New ).mDDisplayQty(7 ).mDOrderPriority(5396).orderID(9927057958L).referenceID((short)3); + noOrderIDEntriesEncoder.next().orderUpdateAction(OrderUpdateAction.New ).mDDisplayQty(44).mDOrderPriority(5397).orderID(9927057959L).referenceID((short)4); + noOrderIDEntriesEncoder.next().orderUpdateAction(OrderUpdateAction.New ).mDDisplayQty(55).mDOrderPriority(5398).orderID(9927057960L).referenceID((short)5); + noOrderIDEntriesEncoder.next().orderUpdateAction(OrderUpdateAction.New ).mDDisplayQty(68).mDOrderPriority(5399).orderID(9927057961L).referenceID((short)6); + noOrderIDEntriesEncoder.next().orderUpdateAction(OrderUpdateAction.New ).mDDisplayQty(70).mDOrderPriority(5400).orderID(9927057962L).referenceID((short)7); + noOrderIDEntriesEncoder.next().orderUpdateAction(OrderUpdateAction.New ).mDDisplayQty(56).mDOrderPriority(5401).orderID(9927057963L).referenceID((short)8); + noOrderIDEntriesEncoder.next().orderUpdateAction(OrderUpdateAction.New ).mDDisplayQty(6 ).mDOrderPriority(5402).orderID(9927057964L).referenceID((short)9); + noOrderIDEntriesEncoder.next().orderUpdateAction(OrderUpdateAction.New ).mDDisplayQty(20).mDOrderPriority(5403).orderID(9927057965L).referenceID((short)10); + noOrderIDEntriesEncoder.next().orderUpdateAction(OrderUpdateAction.Delete).mDDisplayQty(9 ).mDOrderPriority(5404).orderID(9927057966L).referenceID((short)11); + noOrderIDEntriesEncoder.next().orderUpdateAction(OrderUpdateAction.Delete).mDDisplayQty(29).mDOrderPriority(5405).orderID(9927057967L).referenceID((short)12); + bufferOffset += mdIncrementalRefreshBook32Encoder.encodedLength(); + return packMessage(sequence, mutableDirectBuffer.byteArray(), bufferOffset); + } + + public static ByteBuffer getMBPOnlyIncrementWith12TestEntries(int sequence, int securityId) { + short bufferOffset = 0; + final MutableDirectBuffer mutableDirectBuffer = new ExpandableArrayBuffer(); + MessageHeaderEncoder messageHeaderEncoder = new MessageHeaderEncoder(); + MDIncrementalRefreshBook32Encoder mdIncrementalRefreshBook32Encoder = new MDIncrementalRefreshBook32Encoder(); + messageHeaderEncoder.wrap(mutableDirectBuffer, bufferOffset) + .blockLength(mdIncrementalRefreshBook32Encoder.sbeBlockLength()) + .templateId(mdIncrementalRefreshBook32Encoder.sbeTemplateId()) + .schemaId(mdIncrementalRefreshBook32Encoder.sbeSchemaId()) + .version(mdIncrementalRefreshBook32Encoder.sbeSchemaVersion()); + bufferOffset += messageHeaderEncoder.encodedLength(); + MDIncrementalRefreshBook32Encoder.NoMDEntriesEncoder noMDEntriesEncoder = mdIncrementalRefreshBook32Encoder.wrap(mutableDirectBuffer, bufferOffset) + .transactTime(System.currentTimeMillis()).noMDEntriesCount(12); + MatchEventIndicatorEncoder matchEventIndicatorEncoder = mdIncrementalRefreshBook32Encoder.matchEventIndicator(); + matchEventIndicatorEncoder.lastTradeMsg(true); + noMDEntriesEncoder.next().mDEntrySize(4 ).mDEntryType(MDEntryTypeBook.Bid ).mDPriceLevel((short) 1).rptSeq(1254).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryPx().mantissa(98745000000L); + noMDEntriesEncoder.next().mDEntrySize(1 ).mDEntryType(MDEntryTypeBook.Offer).mDPriceLevel((short) 1).rptSeq(1255).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryPx().mantissa(987075000000L); + noMDEntriesEncoder.next().mDEntrySize(45).mDEntryType(MDEntryTypeBook.Bid ).mDPriceLevel((short) 2).rptSeq(1256).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryPx().mantissa(987125000000L); + noMDEntriesEncoder.next().mDEntrySize(22).mDEntryType(MDEntryTypeBook.Offer).mDPriceLevel((short) 2).rptSeq(1257).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryPx().mantissa(98745000000L); + noMDEntriesEncoder.next().mDEntrySize(98).mDEntryType(MDEntryTypeBook.Bid ).mDPriceLevel((short) 3).rptSeq(1258).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryPx().mantissa(98720000000L); + noMDEntriesEncoder.next().mDEntrySize(43).mDEntryType(MDEntryTypeBook.Offer).mDPriceLevel((short) 3).rptSeq(1259).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryPx().mantissa(98725000000L); + noMDEntriesEncoder.next().mDEntrySize(12).mDEntryType(MDEntryTypeBook.Bid ).mDPriceLevel((short) 4).rptSeq(1260).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryPx().mantissa(98715000000L); + noMDEntriesEncoder.next().mDEntrySize(83).mDEntryType(MDEntryTypeBook.Offer).mDPriceLevel((short) 4).rptSeq(1261).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryPx().mantissa(98670000000L); + noMDEntriesEncoder.next().mDEntrySize(38).mDEntryType(MDEntryTypeBook.Bid ).mDPriceLevel((short) 5).rptSeq(1262).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryPx().mantissa(98695000000L); + noMDEntriesEncoder.next().mDEntrySize(99).mDEntryType(MDEntryTypeBook.Offer).mDPriceLevel((short) 5).rptSeq(1263).securityID(securityId).mDUpdateAction(MDUpdateAction.New).mDEntryPx().mantissa(98690000000L); + noMDEntriesEncoder.next().mDEntrySize(1 ).mDEntryType(MDEntryTypeBook.Bid ).mDPriceLevel((short) 3).rptSeq(1264).securityID(securityId).mDUpdateAction(MDUpdateAction.Delete).mDEntryPx().mantissa(987025000000L); + noMDEntriesEncoder.next().mDEntrySize(99).mDEntryType(MDEntryTypeBook.Offer).mDPriceLevel((short) 3).rptSeq(1265).securityID(securityId).mDUpdateAction(MDUpdateAction.Delete).mDEntryPx().mantissa(98677500000L); + bufferOffset += mdIncrementalRefreshBook32Encoder.encodedLength(); + return packMessage(sequence, mutableDirectBuffer.byteArray(), bufferOffset); + } + + public static ByteBuffer getMBPWithMBOIncrementTestMessage(long sequence, int[] securityIds, short[] referenceIDs){ + short bufferOffset = 0; + final MutableDirectBuffer mutableDirectBuffer = new ExpandableArrayBuffer(); + MessageHeaderEncoder messageHeaderEncoder = new MessageHeaderEncoder(); + MDIncrementalRefreshBook32Encoder mdIncrementalRefreshBook32Encoder = new MDIncrementalRefreshBook32Encoder(); + messageHeaderEncoder.wrap(mutableDirectBuffer, bufferOffset) + .blockLength(mdIncrementalRefreshBook32Encoder.sbeBlockLength()) + .templateId(mdIncrementalRefreshBook32Encoder.sbeTemplateId()) + .schemaId(mdIncrementalRefreshBook32Encoder.sbeSchemaId()) + .version(mdIncrementalRefreshBook32Encoder.sbeSchemaVersion()); + bufferOffset += messageHeaderEncoder.encodedLength(); + MDIncrementalRefreshBook32Encoder.NoMDEntriesEncoder noMDEntriesEncoder = mdIncrementalRefreshBook32Encoder.wrap(mutableDirectBuffer, bufferOffset) + .transactTime(System.currentTimeMillis()) + .noMDEntriesCount(securityIds.length); + MatchEventIndicatorEncoder matchEventIndicatorEncoder = mdIncrementalRefreshBook32Encoder.matchEventIndicator(); + matchEventIndicatorEncoder.lastTradeMsg(true); + for (int i = 0; i < securityIds.length; i++) { + noMDEntriesEncoder.next() + .mDEntrySize(2) + .mDEntryType(MDEntryTypeBook.Bid) + .mDPriceLevel((short) 3) + .rptSeq(4) + .securityID(securityIds[i]); + PRICENULLEncoder pricenullEncoder = noMDEntriesEncoder.mDEntryPx(); + pricenullEncoder.mantissa(5); + } + if(referenceIDs != null){ + MDIncrementalRefreshBook32Encoder.NoOrderIDEntriesEncoder noOrderIDEntriesEncoder = mdIncrementalRefreshBook32Encoder.noOrderIDEntriesCount(referenceIDs.length); + for (int i = 0; i < referenceIDs.length; i++) { + noOrderIDEntriesEncoder.next() + .orderUpdateAction(OrderUpdateAction.New) + .mDDisplayQty(213) + .mDOrderPriority(324324) + .orderID(3243324) + .referenceID(referenceIDs[i]); + } + } + bufferOffset += mdIncrementalRefreshBook32Encoder.encodedLength(); + return packMessage(sequence, mutableDirectBuffer.byteArray(), bufferOffset); + } + + public static ByteBuffer getMBOSnapshotTestMessage(long sequence, int securityId, long lastMsgSeqNumProcessed, long noChunks, long currentChunk, long totNumReports){ + short bufferOffset = 0; + final MutableDirectBuffer mutableDirectBuffer = new ExpandableArrayBuffer(); + MessageHeaderEncoder messageHeaderEncoder = new MessageHeaderEncoder(); + SnapshotFullRefreshOrderBook44Encoder snapshotFullRefreshOrderBook44Encoder = new SnapshotFullRefreshOrderBook44Encoder(); + messageHeaderEncoder.wrap(mutableDirectBuffer, bufferOffset) + .blockLength(snapshotFullRefreshOrderBook44Encoder.sbeBlockLength()) + .templateId(snapshotFullRefreshOrderBook44Encoder.sbeTemplateId()) + .schemaId(snapshotFullRefreshOrderBook44Encoder.sbeSchemaId()) + .version(snapshotFullRefreshOrderBook44Encoder.sbeSchemaVersion()); + bufferOffset += messageHeaderEncoder.encodedLength(); + + snapshotFullRefreshOrderBook44Encoder.wrap(mutableDirectBuffer, bufferOffset) + .totNumReports(totNumReports) + .lastMsgSeqNumProcessed(lastMsgSeqNumProcessed) + .noChunks(noChunks) + .currentChunk(currentChunk) + .securityID(securityId); + SnapshotFullRefreshOrderBook44Encoder.NoMDEntriesEncoder noMDEntriesEncoder = snapshotFullRefreshOrderBook44Encoder.noMDEntriesCount(1) + .next() + .mDDisplayQty(1) + .mDOrderPriority(10) + .orderID(123); + PRICEEncoder priceEncoder = noMDEntriesEncoder.mDEntryPx(); + priceEncoder.mantissa(5); + bufferOffset += snapshotFullRefreshOrderBook44Encoder.encodedLength(); + return packMessage(sequence, mutableDirectBuffer.byteArray(), bufferOffset); + } + + public static ByteBuffer getMBPSnapshotTestMessage(long sequence, int securityId, long lastMsgSeqNumProcessed, long totNumReports){ + short bufferOffset = 0; + final MutableDirectBuffer mutableDirectBuffer = new ExpandableArrayBuffer(); + MessageHeaderEncoder messageHeaderEncoder = new MessageHeaderEncoder(); + SnapshotFullRefresh38Encoder snapshotFullRefresh38Encoder = new SnapshotFullRefresh38Encoder(); + messageHeaderEncoder.wrap(mutableDirectBuffer, bufferOffset) + .blockLength(snapshotFullRefresh38Encoder.sbeBlockLength()) + .templateId(snapshotFullRefresh38Encoder.sbeTemplateId()) + .schemaId(snapshotFullRefresh38Encoder.sbeSchemaId()) + .version(snapshotFullRefresh38Encoder.sbeSchemaVersion()); + bufferOffset += messageHeaderEncoder.encodedLength(); + + snapshotFullRefresh38Encoder.wrap(mutableDirectBuffer, bufferOffset) + .totNumReports(totNumReports) + .lastMsgSeqNumProcessed(lastMsgSeqNumProcessed) + .securityID(securityId); + SnapshotFullRefresh38Encoder.NoMDEntriesEncoder noMDEntriesEncoder = snapshotFullRefresh38Encoder.noMDEntriesCount(1) + .next() + .mDEntrySize(10) + .mDPriceLevel((byte)1); + PRICENULLEncoder pricenullEncoder = noMDEntriesEncoder.mDEntryPx(); + pricenullEncoder.mantissa(5); + bufferOffset += snapshotFullRefresh38Encoder.encodedLength(); + return packMessage(sequence, mutableDirectBuffer.byteArray(), bufferOffset); + } + + public static ByteBuffer getMBOIncrementTestMessage(long sequence){ + return getMBOIncrementTestMessage(sequence, 1, 1, 1, (short)1, (byte)48, 1 ,1 ); + } + + public static ByteBuffer getMBOIncrementTestMessage(long sequence, int securityId, long orderID, long mDOrderPriority, + short mDUpdateAction, byte mDEntryType, int mDDisplayQty, int mDEntryPx){ + short bufferOffset = 0; + final MutableDirectBuffer mutableDirectBuffer = new ExpandableArrayBuffer(); + MessageHeaderEncoder messageHeaderEncoder = new MessageHeaderEncoder(); + MDIncrementalRefreshOrderBook43Encoder incrementalRefreshOrderBook43Encoder = new MDIncrementalRefreshOrderBook43Encoder(); + messageHeaderEncoder.wrap(mutableDirectBuffer, bufferOffset) + .blockLength(incrementalRefreshOrderBook43Encoder.sbeBlockLength()) + .templateId(incrementalRefreshOrderBook43Encoder.sbeTemplateId()) + .schemaId(incrementalRefreshOrderBook43Encoder.sbeSchemaId()) + .version(incrementalRefreshOrderBook43Encoder.sbeSchemaVersion()); + bufferOffset += messageHeaderEncoder.encodedLength(); + incrementalRefreshOrderBook43Encoder.wrap(mutableDirectBuffer, bufferOffset) + .transactTime(System.currentTimeMillis()); + MatchEventIndicatorEncoder matchEventIndicatorEncoder = incrementalRefreshOrderBook43Encoder.matchEventIndicator(); + matchEventIndicatorEncoder.lastTradeMsg(true); + incrementalRefreshOrderBook43Encoder.noMDEntriesCount(1) + .next() + .orderID(orderID) + .mDOrderPriority(mDOrderPriority) + .securityID(securityId) + .mDUpdateAction(MDUpdateAction.get(mDUpdateAction)) + .mDEntryType(MDEntryTypeBook.get(mDEntryType)) + .mDDisplayQty(mDDisplayQty).mDEntryPx().mantissa(mDEntryPx); + bufferOffset += incrementalRefreshOrderBook43Encoder.encodedLength(); + return packMessage(sequence, mutableDirectBuffer.byteArray(), bufferOffset); + } + + public static ByteBuffer getMDInstrumentDefinitionFuture27(long sequence, int securityId){ + short bufferOffset = 0; + final MutableDirectBuffer mutableDirectBuffer = new ExpandableArrayBuffer(); + MessageHeaderEncoder messageHeaderEncoder = new MessageHeaderEncoder(); + MDInstrumentDefinitionFuture27Encoder definitionFuture27Encoder = new MDInstrumentDefinitionFuture27Encoder(); + messageHeaderEncoder.wrap(mutableDirectBuffer, bufferOffset) + .blockLength(definitionFuture27Encoder.sbeBlockLength()) + .templateId(definitionFuture27Encoder.sbeTemplateId()) + .schemaId(definitionFuture27Encoder.sbeSchemaId()) + .version(definitionFuture27Encoder.sbeSchemaVersion()); + bufferOffset += messageHeaderEncoder.encodedLength(); + definitionFuture27Encoder.wrap(mutableDirectBuffer, bufferOffset) + .securityID(securityId) + .symbol("testSymbol"); + definitionFuture27Encoder.noEventsCount(1) + .next() + .eventTime(System.currentTimeMillis()) + .eventType(EventType.Activation); + definitionFuture27Encoder.noMDFeedTypesCount(1) + .next() + .marketDepth((byte)10) + .mDFeedType("GBX"); + bufferOffset += definitionFuture27Encoder.encodedLength(); + return packMessage(sequence, mutableDirectBuffer.byteArray(), bufferOffset); + } + + public static ByteBuffer getLogin(long sequence){ + short bufferOffset = 0; + final MutableDirectBuffer mutableDirectBuffer = new ExpandableArrayBuffer(); + MessageHeaderEncoder messageHeaderEncoder = new MessageHeaderEncoder(); + AdminLogin15Encoder loginEncoder = new AdminLogin15Encoder(); + messageHeaderEncoder.wrap(mutableDirectBuffer, bufferOffset) + .blockLength(loginEncoder.sbeBlockLength()) + .templateId(loginEncoder.sbeTemplateId()) + .schemaId(loginEncoder.sbeSchemaId()) + .version(loginEncoder.sbeSchemaVersion()); + bufferOffset += messageHeaderEncoder.encodedLength(); + loginEncoder.wrap(mutableDirectBuffer, bufferOffset); + loginEncoder.heartBtInt((byte)2); + bufferOffset += loginEncoder.encodedLength(); + return packMessage(sequence, mutableDirectBuffer.byteArray(), bufferOffset); + } + + private static byte[] getMDPHeader(long sequence, long sendingTime){ + final NativeBytesStore mdpHeader = NativeBytesStore.nativeStoreWithFixedCapacity(MDP_HEADER_SIZE); + mdpHeader.writeUnsignedInt(MESSAGE_SEQ_NUM_OFFSET, sequence); + mdpHeader.writeLong(MESSAGE_SENDING_TIME_OFFSET, sendingTime); + return mdpHeader.toByteArray(); + } + + private static ByteBuffer packMessage(long sequence, byte[] encodedMessage, short actualLength){ + final int fieldLengthSize = 2; + byte[] mdpHeader = getMDPHeader(sequence, System.currentTimeMillis()); + ByteBuffer result = ByteBuffer.allocateDirect(mdpHeader.length + fieldLengthSize + actualLength); + result.put(mdpHeader); + result.putShort(actualLength); + result.put(encodedMessage, 0, actualLength); + result.flip(); + return result; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/TestChannelListener.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/TestChannelListener.java new file mode 100644 index 0000000..a8f718a --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/TestChannelListener.java @@ -0,0 +1,169 @@ +package com.epam.cme.mdp3.test; + +import com.epam.cme.mdp3.*; +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.apache.commons.lang3.tuple.Pair; + +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; + +public class TestChannelListener implements ChannelListener { + private ChannelState prevSate; + private ChannelState currentSate; + private BlockingQueue incrementMBOQueue = new LinkedBlockingQueue<>(); + private BlockingQueue incrementMBPQueue = new LinkedBlockingQueue<>(); + private BlockingQueue> mboSnapshotQueue = new LinkedBlockingQueue<>(); + private BlockingQueue> mbpSnapshotQueue = new LinkedBlockingQueue<>(); + private BlockingQueue> securitiesQueue = new LinkedBlockingQueue<>(); + + @Override + public void onFeedStarted(String channelId, FeedType feedType, Feed feed) { + + } + + @Override + public void onFeedStopped(String channelId, FeedType feedType, Feed feed) { + + } + + @Override + public void onPacket(String channelId, FeedType feedType, Feed feed, MdpPacket mdpPacket) { + + } + + @Override + public void onBeforeChannelReset(String channelId, MdpMessage resetMessage) { + + } + + @Override + public void onFinishedChannelReset(String channelId, MdpMessage resetMessage) { + + } + + @Override + public void onChannelStateChanged(String channelId, ChannelState prevState, ChannelState newState) { + this.prevSate = prevState; + this.currentSate = newState; + } + + @Override + public int onSecurityDefinition(String channelId, MdpMessage secDefMessage) { + securitiesQueue.add(new ImmutablePair<>(channelId, secDefMessage)); + return 0; + } + + @Override + public void onIncrementalMBORefresh(final String channelId, final short matchEventIndicator, final int securityId, + final String secDesc, final long msgSeqNum, final FieldSet orderIDEntry, final FieldSet mdEntry){ + incrementMBOQueue.add(new IncrementalRefreshEntity(channelId, matchEventIndicator, securityId, secDesc, msgSeqNum, orderIDEntry != null ? orderIDEntry.copy() : null, mdEntry != null ? mdEntry.copy() : null)); + } + + @Override + public void onIncrementalMBPRefresh(final String channelId, final short matchEventIndicator, final int securityId, + final String secDesc, final long msgSeqNum, final FieldSet mdEntry){ + incrementMBPQueue.add(new IncrementalRefreshEntity(channelId, matchEventIndicator, securityId, secDesc, msgSeqNum, (mdEntry != null) ? mdEntry.copy() : null)); + } + + @Override + public void onSnapshotMBOFullRefresh(final String channelId, final String secDesc, final MdpMessage snptMessage){ + mboSnapshotQueue.add(new ImmutablePair<>(channelId, snptMessage.copy())); + } + + @Override + public void onSnapshotMBPFullRefresh(String channelId, String secDesc, MdpMessage snptMessage) { + mbpSnapshotQueue.add(new ImmutablePair<>(channelId, snptMessage.copy())); + } + + @Override + public void onRequestForQuote(String channelId, MdpMessage rfqMessage) { + + } + + @Override + public void onSecurityStatus(String channelId, int securityId, MdpMessage secStatusMessage) { + + } + + public Pair nextMBOSnapshotMessage() throws InterruptedException { + return mboSnapshotQueue.poll(Constants.WAITING_TIME_IN_MILLIS, TimeUnit.MILLISECONDS); + } + + public Pair nextMBPSnapshotMessage() throws InterruptedException { + return mbpSnapshotQueue.poll(Constants.WAITING_TIME_IN_MILLIS, TimeUnit.MILLISECONDS); + } + + public Pair nextSecurityMessage() throws InterruptedException { + return securitiesQueue.poll(Constants.WAITING_TIME_IN_MILLIS, TimeUnit.MILLISECONDS); + } + + public IncrementalRefreshEntity nextMBOIncrementMessage() throws InterruptedException { + return incrementMBOQueue.poll(Constants.WAITING_TIME_IN_MILLIS, TimeUnit.MILLISECONDS); + } + + public IncrementalRefreshEntity nextMBPIncrementMessage() throws InterruptedException { + return incrementMBPQueue.poll(Constants.WAITING_TIME_IN_MILLIS, TimeUnit.MILLISECONDS); + } + + public ChannelState getCurrentSate() { + return currentSate; + } + + public ChannelState getPrevSate() { + return prevSate; + } + + public class IncrementalRefreshEntity { + private String channelId; + private short matchEventIndicator; + private int securityId; + private String secDesc; + private long msgSeqNum; + private FieldSet orderIDEntry; + private FieldSet mdEntry; + + public IncrementalRefreshEntity(String channelId, short matchEventIndicator, int securityId, String secDesc, long msgSeqNum, FieldSet mdEntry) { + this(channelId, matchEventIndicator, securityId, secDesc, msgSeqNum, null, mdEntry); + } + + public IncrementalRefreshEntity(String channelId, short matchEventIndicator, int securityId, String secDesc, long msgSeqNum, FieldSet orderIDEntry, FieldSet mdEntry) { + this.channelId = channelId; + this.matchEventIndicator = matchEventIndicator; + this.securityId = securityId; + this.secDesc = secDesc; + this.msgSeqNum = msgSeqNum; + this.orderIDEntry = orderIDEntry; + this.mdEntry = mdEntry; + } + + public String getChannelId() { + return channelId; + } + + public short getMatchEventIndicator() { + return matchEventIndicator; + } + + public int getSecurityId() { + return securityId; + } + + public String getSecDesc() { + return secDesc; + } + + public long getMsgSeqNum() { + return msgSeqNum; + } + + public FieldSet getOrderIDEntry() { + return orderIDEntry; + } + + public FieldSet getMdEntry() { + return mdEntry; + } + } + +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/control/BufferTest.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/control/BufferTest.java new file mode 100644 index 0000000..7fa94e0 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/control/BufferTest.java @@ -0,0 +1,81 @@ +package com.epam.cme.mdp3.test.control; + +import com.epam.cme.mdp3.MdpPacket; +import com.epam.cme.mdp3.control.MDPOffHeapBuffer; +import com.epam.cme.mdp3.test.ModelUtils; +import org.junit.Test; + + +import static org.junit.Assert.*; + + +public class BufferTest { + + @Test + public void elementsMustBeInSequenceOrder(){ + MDPOffHeapBuffer buffer = new MDPOffHeapBuffer(5); + MdpPacket n1 = MdpPacket.instance(); n1.wrapFromBuffer(ModelUtils.getMBOIncrementTestMessage(1)); + MdpPacket n2 = MdpPacket.instance(); n2.wrapFromBuffer(ModelUtils.getMBOIncrementTestMessage(2)); + MdpPacket n3 = MdpPacket.instance(); n3.wrapFromBuffer(ModelUtils.getMBOIncrementTestMessage(3)); + MdpPacket n4 = MdpPacket.instance(); n4.wrapFromBuffer(ModelUtils.getMBOIncrementTestMessage(4)); + MdpPacket n5 = MdpPacket.instance(); n5.wrapFromBuffer(ModelUtils.getMBOIncrementTestMessage(5)); + buffer.add(n4); + buffer.add(n1); + buffer.add(n5); + buffer.add(n2); + buffer.add(n3); + for (int i = 1; i <= 5; i++) { + MdpPacket nextPacket = buffer.remove(); + assertEquals(i, nextPacket.getMsgSeqNum()); + } + } + + @Test + public void bufferMustCopyDataFromObject(){ + MDPOffHeapBuffer buffer = new MDPOffHeapBuffer(3); + MdpPacket packet = MdpPacket.instance(); + packet.wrapFromBuffer(ModelUtils.getMBOIncrementTestMessage(1)); + buffer.add(packet); + packet.wrapFromBuffer(ModelUtils.getMBOIncrementTestMessage(2)); + buffer.add(packet); + packet.wrapFromBuffer(ModelUtils.getMBOIncrementTestMessage(3)); + buffer.add(packet); + for (int i = 1; i <= 3; i++) { + MdpPacket nextPacket = buffer.remove(); + assertEquals(i, nextPacket.getMsgSeqNum()); + } + } + + @Test + public void lowElementsMustBeRemovedIfBufferIsFull(){ + MDPOffHeapBuffer buffer = new MDPOffHeapBuffer(3); + MdpPacket n1 = MdpPacket.instance(); n1.wrapFromBuffer(ModelUtils.getMBOIncrementTestMessage(1)); + MdpPacket n2 = MdpPacket.instance(); n2.wrapFromBuffer(ModelUtils.getMBOIncrementTestMessage(2)); + MdpPacket n3 = MdpPacket.instance(); n3.wrapFromBuffer(ModelUtils.getMBOIncrementTestMessage(3)); + MdpPacket n4 = MdpPacket.instance(); n4.wrapFromBuffer(ModelUtils.getMBOIncrementTestMessage(4)); + MdpPacket n5 = MdpPacket.instance(); n5.wrapFromBuffer(ModelUtils.getMBOIncrementTestMessage(5)); + buffer.add(n1); + buffer.add(n2); + buffer.add(n3); + buffer.add(n5); + buffer.add(n4); + for (int i = 3; i <= 5; i++) { + assertFalse(buffer.isEmpty()); + MdpPacket nextPacket = buffer.remove(); + assertEquals(i, nextPacket.getMsgSeqNum()); + } + assertTrue(buffer.isEmpty()); + } + + @Test + public void methodRemoveShouldReturnNullIfBufferIsEmpty(){ + MDPOffHeapBuffer buffer = new MDPOffHeapBuffer(3); + MdpPacket n1 = MdpPacket.instance(); n1.wrapFromBuffer(ModelUtils.getMBOIncrementTestMessage(1)); + buffer.add(n1); + MdpPacket nextPacket = buffer.remove(); + assertEquals(1, nextPacket.getMsgSeqNum()); + assertNull(buffer.remove()); + } + + +} \ No newline at end of file diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/control/GapChannelControllerTest.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/control/GapChannelControllerTest.java new file mode 100644 index 0000000..4c5dbc0 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/control/GapChannelControllerTest.java @@ -0,0 +1,355 @@ +package com.epam.cme.mdp3.test.control; + +import com.epam.cme.mdp3.*; +import com.epam.cme.mdp3.control.*; +import com.epam.cme.mdp3.core.channel.MdpFeedContext; +import com.epam.cme.mdp3.core.channel.tcp.TCPMessageRequester; +import com.epam.cme.mdp3.core.channel.tcp.TCPPacketListener; +import com.epam.cme.mdp3.sbe.schema.MdpMessageTypes; +import com.epam.cme.mdp3.test.Constants; +import com.epam.cme.mdp3.test.ModelUtils; +import com.epam.cme.mdp3.test.TestChannelListener; +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.apache.commons.lang3.tuple.Pair; +import org.junit.Before; +import org.junit.Test; +import java.nio.ByteBuffer; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.*; + +import static org.junit.Assert.*; + +public class GapChannelControllerTest { + private GapChannelController gapChannelController; + private TestChannelController testChannelController; + private final int bufferCapacity = 10; + private final String testChannelId = "1"; + private TestSnapshotRecoveryManager testRecoveryManager; + private boolean snapshotRecoveryStarted; + private TestChannelListener testChannelListener; + private InstrumentManager instrumentManager; + + @Before + public void init() throws Exception { + snapshotRecoveryStarted = false; + ClassLoader classLoader = getClass().getClassLoader(); + MdpMessageTypes mdpMessageTypes = new MdpMessageTypes(classLoader.getResource(Constants.TEMPLATE_NAME).toURI()); + testChannelController = new TestChannelController(); + Buffer buffer = new MDPOffHeapBuffer(bufferCapacity); + testRecoveryManager = new TestSnapshotRecoveryManager(); + SnapshotCycleHandler mboSnapshotCycleHandler = new OffHeapSnapshotCycleHandler(); + testChannelListener = new TestChannelListener(); + List mboChannelListeners = Collections.singletonList(testChannelListener); + instrumentManager = new MdpInstrumentManager("TEST", mboChannelListeners); + ChannelController targetForBuffered = new BufferedMessageRouter(testChannelId, instrumentManager, mdpMessageTypes, + mboChannelListeners, mboSnapshotCycleHandler, new TestInstrumentObserver(testChannelId), Collections.emptyList()); + gapChannelController = new GapChannelController(mboChannelListeners, testChannelController, targetForBuffered, + testRecoveryManager, buffer, 0, testChannelId, mdpMessageTypes, mboSnapshotCycleHandler, mboSnapshotCycleHandler,null, null); + + } + + @Test + public void itMustChangeItsStateAndBeReadyToWorkAfterSnapshot() throws InterruptedException { + assertNull(testChannelListener.getPrevSate()); + assertNull(testChannelListener.getCurrentSate()); + int lastMsgSeqNumProcessed = 1000; + Pair mdpFeedContextMdpPacketPair = sendInitialMBOSnapshot(lastMsgSeqNumProcessed); + assertNotNull(mdpFeedContextMdpPacketPair); + + assertEquals(ChannelState.INITIAL, testChannelListener.getPrevSate()); + assertEquals(ChannelState.SYNC, testChannelListener.getCurrentSate()); + } + + @Test + public void duplicateMessagesWhichWereTakenFromBufferAndHaveSeqNumGreaterThanHighSnapshotSeqShouldBeIgnored() throws Exception { + int instrument = 1, instrumentLastMsgSeqNumProcessed = 1, incrementSequence = 2; + instrumentManager.registerSecurity(instrument, ""); + + final MdpFeedContext incrementContext = new MdpFeedContext(Feed.A, FeedType.I); + gapChannelController.handleIncrementalPacket(incrementContext, createPacketWithIncrement(incrementSequence, new int[]{instrument}, new short[]{1})); + gapChannelController.handleIncrementalPacket(incrementContext, createPacketWithIncrement(incrementSequence, new int[]{instrument}, new short[]{1}));//duplicate + + sendSnapshotMessage(1, instrument, instrumentLastMsgSeqNumProcessed, 1, 1, 1); + sendSnapshotMessage(1, instrument, instrumentLastMsgSeqNumProcessed, 1, 1, 1);//next cycle + + Pair pair = testChannelController.nextIncrementalMessage(); + assertNotNull(pair); + assertEquals(incrementSequence, pair.getRight().getMsgSeqNum()); + + assertNull(testChannelListener.nextMBOIncrementMessage()); + assertNull(testChannelListener.nextMBPIncrementMessage()); + assertNull(testChannelController.nextIncrementalMessage()); + } + + @Test + public void duplicateMessagesWhichWereTakenFromBufferAndHaveSeqNumLessThanHighSnapshotSeqShouldBeIgnored() throws Exception { + int instrument = 1, instrumentLastMsgSeqNumProcessed = 1, incrementSequence = 2; + instrumentManager.registerSecurity(instrument, ""); + + final MdpFeedContext incrementContext = new MdpFeedContext(Feed.A, FeedType.I); + gapChannelController.handleIncrementalPacket(incrementContext, createPacketWithIncrement(incrementSequence, new int[]{instrument}, new short[]{1})); + gapChannelController.handleIncrementalPacket(incrementContext, createPacketWithIncrement(incrementSequence, new int[]{instrument}, new short[]{1}));//duplicate + + sendSnapshotMessage(1, instrument, instrumentLastMsgSeqNumProcessed, 1, 1, 2); + sendSnapshotMessage(2, 2, 2, 1, 1, 2); + sendSnapshotMessage(1, instrument, instrumentLastMsgSeqNumProcessed, 1, 1, 1);//next cycle + + TestChannelListener.IncrementalRefreshEntity incrementMessage = testChannelListener.nextMBOIncrementMessage(); + assertNotNull(incrementMessage); + assertEquals(instrument, incrementMessage.getSecurityId()); + assertEquals(incrementSequence, incrementMessage.getMsgSeqNum()); + incrementMessage = testChannelListener.nextMBPIncrementMessage(); + assertNotNull(incrementMessage); + assertEquals(instrument, incrementMessage.getSecurityId()); + assertEquals(incrementSequence, incrementMessage.getMsgSeqNum()); + + assertNull(testChannelListener.nextMBOIncrementMessage()); + assertNull(testChannelListener.nextMBPIncrementMessage()); + + assertNull(testChannelController.nextIncrementalMessage()); + } + + @Test + public void entriesFromIncrementShouldBeSentAccordingToSnapshotSequence() throws Exception { + int instrument1 = 1, instrument1lastMsgSeqNumProcessed = 1, instrument1Sequence = 2; + int instrument2 = 2, instrument2lastMsgSeqNumProcessed = 3, instrument2Sequence = 4; + + byte ignored = 0; + instrumentManager.registerSecurity(instrument1, ""); + + final MdpFeedContext incrementContext = new MdpFeedContext(Feed.A, FeedType.I); + gapChannelController.handleIncrementalPacket(incrementContext, createPacketWithIncrement(instrument1Sequence, new int[]{instrument1}, new short[]{1})); + gapChannelController.handleIncrementalPacket(incrementContext, createPacketWithIncrement(instrument2Sequence, new int[]{instrument2}, new short[]{1})); + + sendSnapshotMessage(1, instrument1, instrument1lastMsgSeqNumProcessed, 1, 1, 3); + sendSnapshotMessage(2, 3, 2, 1, 1, 3); + sendSnapshotMessage(3, instrument2, instrument2lastMsgSeqNumProcessed, 1, 1, 3); + sendSnapshotMessage(1, instrument1, instrument1lastMsgSeqNumProcessed, 1, 1, 3);//next cycle + + TestChannelListener.IncrementalRefreshEntity incrementMessage = testChannelListener.nextMBOIncrementMessage(); + assertNotNull(incrementMessage); + assertEquals(instrument1, incrementMessage.getSecurityId()); + assertEquals(instrument1Sequence, incrementMessage.getMsgSeqNum()); + + Pair pair = testChannelController.nextIncrementalMessage(); + assertNotNull(pair); + assertEquals(instrument2Sequence, pair.getRight().getMsgSeqNum()); + } + + @Test + public void incrementalMessagesMustBeSentToClientsIfThereAreNoGaps() throws Exception { + int lastMsgSeqNumProcessed = 1000; + sendInitialMBOSnapshot(lastMsgSeqNumProcessed); + final MdpFeedContext incrementContext = new MdpFeedContext(Feed.A, FeedType.I); + final MdpPacket mdpPacketWithIncrement = MdpPacket.instance(); + for(int i = lastMsgSeqNumProcessed +1; i < lastMsgSeqNumProcessed + 10; i++) { + ByteBuffer mboSnapshotTestMessage = ModelUtils.getMBOIncrementTestMessage(i); + mdpPacketWithIncrement.wrapFromBuffer(mboSnapshotTestMessage); + gapChannelController.handleIncrementalPacket(incrementContext, mdpPacketWithIncrement); + Pair incrementPair = testChannelController.nextIncrementalMessage(); + assertNotNull(incrementPair); + MdpPacket mdpPacket = incrementPair.getRight(); + assertEquals(i, mdpPacket.getMsgSeqNum()); + } + } + + @Test + public void itMustHandleMessagesInSequenceOrder() throws Exception { + ClassLoader classLoader = getClass().getClassLoader(); + MdpMessageTypes mdpMessageTypes = new MdpMessageTypes(classLoader.getResource(Constants.TEMPLATE_NAME).toURI()); + testChannelController = new TestChannelController(); + Buffer buffer = new MDPOffHeapBuffer(bufferCapacity); + testRecoveryManager = new TestSnapshotRecoveryManager(); + int gapThreshold = 3; + OffHeapSnapshotCycleHandler cycleHandler = new OffHeapSnapshotCycleHandler(); + gapChannelController = new GapChannelController(Collections.singletonList(testChannelListener), testChannelController, testChannelController, testRecoveryManager, buffer, gapThreshold, testChannelId, mdpMessageTypes, cycleHandler, cycleHandler, null, null); + + + int lastMsgSeqNumProcessed = 0; + sendInitialMBOSnapshot(lastMsgSeqNumProcessed); + final MdpFeedContext incrementContext = new MdpFeedContext(Feed.A, FeedType.I); + gapChannelController.handleIncrementalPacket(incrementContext, createPacketWithIncrement(1)); + gapChannelController.handleIncrementalPacket(incrementContext, createPacketWithIncrement(1)); + gapChannelController.handleIncrementalPacket(incrementContext, createPacketWithIncrement(2)); + gapChannelController.handleIncrementalPacket(incrementContext, createPacketWithIncrement(4)); + gapChannelController.handleIncrementalPacket(incrementContext, createPacketWithIncrement(4)); + gapChannelController.handleIncrementalPacket(incrementContext, createPacketWithIncrement(5)); + gapChannelController.handleIncrementalPacket(incrementContext, createPacketWithIncrement(3)); + gapChannelController.handleIncrementalPacket(incrementContext, createPacketWithIncrement(6)); + + for(int i = 1; i <= 6; i++){ + Pair nextIncrementalMessagePair = testChannelController.nextIncrementalMessage(); + assertNotNull(nextIncrementalMessagePair); + assertEquals(i, nextIncrementalMessagePair.getRight().getMsgSeqNum()); + } + + } + + @Test + public void itMustRecoverFromTCPChannelCorrectly() throws Exception { + ClassLoader classLoader = getClass().getClassLoader(); + MdpMessageTypes mdpMessageTypes = new MdpMessageTypes(classLoader.getResource(Constants.TEMPLATE_NAME).toURI()); + testChannelController = new TestChannelController(); + Buffer buffer = new MDPOffHeapBuffer(bufferCapacity); + testRecoveryManager = new TestSnapshotRecoveryManager(); + int gapThreshold = 3; + OffHeapSnapshotCycleHandler cycleHandler = new OffHeapSnapshotCycleHandler(); + ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor(); + gapChannelController = new GapChannelController(Collections.singletonList(testChannelListener), + testChannelController, testChannelController, testRecoveryManager, buffer, gapThreshold, testChannelId, + mdpMessageTypes, cycleHandler, cycleHandler, executorService, new TestTCPMessageRequester()); + + + int lastMsgSeqNumProcessed = 0; + sendInitialMBOSnapshot(lastMsgSeqNumProcessed); + final MdpFeedContext incrementContext = new MdpFeedContext(Feed.A, FeedType.I); + gapChannelController.handleIncrementalPacket(incrementContext, createPacketWithIncrement(1)); + gapChannelController.handleIncrementalPacket(incrementContext, createPacketWithIncrement(6)); + assertFalse(snapshotRecoveryStarted); + gapChannelController.handleIncrementalPacket(incrementContext, createPacketWithIncrement(3)); + gapChannelController.handleIncrementalPacket(incrementContext, createPacketWithIncrement(7)); + + for(int i = 1; i <= 7; i++){ + Pair nextIncrementalMessagePair = testChannelController.nextIncrementalMessage(); + assertNotNull("messages with sequence " + i + " has not been received", nextIncrementalMessagePair); + assertEquals(i, nextIncrementalMessagePair.getRight().getMsgSeqNum()); + } + + executorService.shutdownNow(); + } + + @Test + public void itMustStartRecoveryIfThereIsGapAndResendMessagesAfter() throws Exception { + int lastMsgSeqNumProcessed = 0; + sendInitialMBOSnapshot(lastMsgSeqNumProcessed); + final MdpFeedContext incrementContext = new MdpFeedContext(Feed.A, FeedType.I); + gapChannelController.handleIncrementalPacket(incrementContext, createPacketWithIncrement(1)); + gapChannelController.handleIncrementalPacket(incrementContext, createPacketWithIncrement(2)); + gapChannelController.handleIncrementalPacket(incrementContext, createPacketWithIncrement(4)); + gapChannelController.handleIncrementalPacket(incrementContext, createPacketWithIncrement(5)); + + assertTrue(snapshotRecoveryStarted); + + Pair nextIncrementalMessagePair = testChannelController.nextIncrementalMessage(); + + assertNotNull(nextIncrementalMessagePair); + assertEquals(1, nextIncrementalMessagePair.getRight().getMsgSeqNum()); + + nextIncrementalMessagePair = testChannelController.nextIncrementalMessage(); + assertNotNull(nextIncrementalMessagePair); + assertEquals(2, nextIncrementalMessagePair.getRight().getMsgSeqNum()); + + nextIncrementalMessagePair = testChannelController.nextIncrementalMessage(); + assertNull(nextIncrementalMessagePair); + + lastMsgSeqNumProcessed = 3; + + final MdpPacket mdpPacketWithSnapshot = MdpPacket.instance(); + mdpPacketWithSnapshot.wrapFromBuffer(ModelUtils.getMBOSnapshotTestMessage(1, 100, lastMsgSeqNumProcessed, 1, 1, 1)); + final MdpFeedContext smboContext = new MdpFeedContext(Feed.A, FeedType.SMBO); + + gapChannelController.handleSnapshotPacket(smboContext, mdpPacketWithSnapshot); + gapChannelController.handleSnapshotPacket(smboContext, mdpPacketWithSnapshot);//next cycle + assertNotNull(testChannelController.nextSnapshotMessage()); + + assertFalse(snapshotRecoveryStarted); + + nextIncrementalMessagePair = testChannelController.nextIncrementalMessage(); + assertNotNull(nextIncrementalMessagePair); + assertEquals(4, nextIncrementalMessagePair.getRight().getMsgSeqNum()); + + nextIncrementalMessagePair = testChannelController.nextIncrementalMessage(); + assertNotNull(nextIncrementalMessagePair); + assertEquals(5, nextIncrementalMessagePair.getRight().getMsgSeqNum()); + + nextIncrementalMessagePair = testChannelController.nextIncrementalMessage(); + assertNull(nextIncrementalMessagePair); + } + + private Pair sendInitialMBOSnapshot(int lastMsgSeqNumProcessed) throws InterruptedException { + int securityId = 100; + sendSnapshotMessage(1, securityId, lastMsgSeqNumProcessed, 1, 1, 1); + sendSnapshotMessage(1, securityId, lastMsgSeqNumProcessed, 1, 1, 1);//next cycle + return testChannelController.nextSnapshotMessage(); + } + + private void sendSnapshotMessage(long sequence, int securityId, long lastMsgSeqNumProcessed, long noChunks, long currentChunk, long totNumReports) { + final MdpPacket mdpPacketWithSnapshot = MdpPacket.instance(); + mdpPacketWithSnapshot.wrapFromBuffer(ModelUtils.getMBOSnapshotTestMessage(sequence, securityId, lastMsgSeqNumProcessed, noChunks, currentChunk, totNumReports)); + final MdpFeedContext smboContext = new MdpFeedContext(Feed.A, FeedType.SMBO); + gapChannelController.handleSnapshotPacket(smboContext, mdpPacketWithSnapshot); + } + + private MdpPacket createPacketWithIncrement(long sequence){ + final MdpPacket mdpPacket = MdpPacket.instance(); + ByteBuffer mboSnapshotTestMessage = ModelUtils.getMBOIncrementTestMessage(sequence); + mdpPacket.wrapFromBuffer(mboSnapshotTestMessage); + return mdpPacket; + } + + private MdpPacket createPacketWithIncrement(long sequence, int[] securityIds, short[] referenceIDs){ + final MdpPacket mdpPacket = MdpPacket.instance(); + ByteBuffer mboSnapshotTestMessage = ModelUtils.getMBPWithMBOIncrementTestMessage(sequence, securityIds, referenceIDs); + mdpPacket.wrapFromBuffer(mboSnapshotTestMessage); + return mdpPacket; + } + + private class TestChannelController implements ChannelController { + private BlockingQueue> snapshotQueue = new LinkedBlockingQueue<>(); + private BlockingQueue> incrementalQueue = new LinkedBlockingQueue<>(); + + @Override + public void handleSnapshotPacket(MdpFeedContext feedContext, MdpPacket mdpPacket) { + snapshotQueue.add(new ImmutablePair<>(feedContext, mdpPacket)); + } + + @Override + public void handleIncrementalPacket(MdpFeedContext feedContext, MdpPacket mdpPacket) { + incrementalQueue.add(new ImmutablePair<>(feedContext, mdpPacket.copy())); + } + + @Override + public void preClose() { + + } + + @Override + public void close() { + + } + + public Pair nextSnapshotMessage() throws InterruptedException { + return snapshotQueue.poll(Constants.WAITING_TIME_IN_MILLIS, TimeUnit.MILLISECONDS); + } + + public Pair nextIncrementalMessage() throws InterruptedException { + return incrementalQueue.poll(Constants.WAITING_TIME_IN_MILLIS, TimeUnit.MILLISECONDS); + } + } + + private class TestSnapshotRecoveryManager implements GapChannelController.SnapshotRecoveryManager { + + @Override + public void startRecovery() { + snapshotRecoveryStarted = true; + } + + @Override + public void stopRecovery() { + snapshotRecoveryStarted = false; + } + } + + private class TestTCPMessageRequester implements TCPMessageRequester { + private MdpFeedContext mdpFeedContext = new MdpFeedContext(Feed.A, FeedType.H); + + @Override + public boolean askForLostMessages(long beginSeqNo, long endSeqNo, TCPPacketListener tcpPacketListener) { + for (long i = beginSeqNo; i <= endSeqNo; i++) { + tcpPacketListener.onPacket(mdpFeedContext, createPacketWithIncrement(i)); + } + return true; + } + } +} \ No newline at end of file diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/control/MBOChannelControllerRouterTest.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/control/MBOChannelControllerRouterTest.java new file mode 100644 index 0000000..55298ef --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/control/MBOChannelControllerRouterTest.java @@ -0,0 +1,196 @@ +package com.epam.cme.mdp3.test.control; + +import com.epam.cme.mdp3.*; +import com.epam.cme.mdp3.control.*; +import com.epam.cme.mdp3.core.channel.MdpFeedContext; +import com.epam.cme.mdp3.sbe.schema.MdpMessageTypes; +import com.epam.cme.mdp3.test.Constants; +import com.epam.cme.mdp3.test.ModelUtils; +import com.epam.cme.mdp3.test.TestChannelListener; +import org.apache.commons.lang3.tuple.Pair; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.nio.ByteBuffer; +import java.util.Collections; +import java.util.List; + +import static com.epam.cme.mdp3.MdConstants.REFERENCE_ID; +import static com.epam.cme.mdp3.MdConstants.SECURITY_ID; +import static org.junit.Assert.*; + + +public class MBOChannelControllerRouterTest { + private TestChannelListener testListener = new TestChannelListener(); + private String channelId = "648"; + private int testSecurityId = 99; + private ChannelController channelController; + private String secDesc = "for test"; + private InstrumentManager instrumentManager; + private TestInstrumentObserver instrumentObserver = new TestInstrumentObserver(channelId); + + @Before + public void init() throws Exception { + ClassLoader classLoader = getClass().getClassLoader(); + MdpMessageTypes mdpMessageTypes = new MdpMessageTypes(classLoader.getResource(Constants.TEMPLATE_NAME).toURI()); + List listeners = Collections.singletonList(testListener); + instrumentManager = new MdpInstrumentManager(channelId, listeners); + instrumentManager.registerSecurity(testSecurityId, secDesc); + channelController = new ChannelControllerRouter(channelId, instrumentManager, mdpMessageTypes, + Collections.singletonList(testListener), instrumentObserver, Collections.emptyList()); + } + + @Test + public void controllerMustProcessMBOSnapshotMessageAndSendToClient() throws InterruptedException { + final MdpPacket mdpPacketWithSnapshot = MdpPacket.instance(); + final MdpFeedContext smboContext = new MdpFeedContext(Feed.A, FeedType.SMBO); + ByteBuffer mboSnapshotTestMessage = ModelUtils.getMBOSnapshotTestMessage(1, testSecurityId); + mdpPacketWithSnapshot.wrapFromBuffer(mboSnapshotTestMessage); + channelController.handleSnapshotPacket(smboContext, mdpPacketWithSnapshot); + assertNotNull(testListener.nextMBOSnapshotMessage()); + } + + @Test + public void controllerMustProcessMBPSnapshotMessageAndSendToClient() throws InterruptedException { + final MdpPacket mdpPacketWithSnapshot = MdpPacket.instance(); + final MdpFeedContext smboContext = new MdpFeedContext(Feed.A, FeedType.SMBO); + ByteBuffer mboSnapshotTestMessage = ModelUtils.getMBPSnapshotTestMessage(1, testSecurityId); + mdpPacketWithSnapshot.wrapFromBuffer(mboSnapshotTestMessage); + channelController.handleSnapshotPacket(smboContext, mdpPacketWithSnapshot); + assertNotNull(testListener.nextMBPSnapshotMessage()); + } + + @Test + public void controllerMustProcessMBOIncrementAndSendToClient() throws InterruptedException { + final MdpPacket mdpPacketWithIncrement = MdpPacket.instance(); + final MdpFeedContext incrementContext = new MdpFeedContext(Feed.A, FeedType.I); + long orderID = 1; + long mDOrderPriority = 2; + short mDUpdateAction = 0; + byte mDEntryType = (byte)48; + int mDDisplayQty = 5; + int mDEntryPx = 10; + ByteBuffer mboIncrementTestMessage = ModelUtils.getMBOIncrementTestMessage(1, testSecurityId, orderID, mDOrderPriority, mDUpdateAction, mDEntryType, mDDisplayQty, mDEntryPx); + mdpPacketWithIncrement.wrapFromBuffer(mboIncrementTestMessage); + channelController.handleIncrementalPacket(incrementContext, mdpPacketWithIncrement); + TestChannelListener.IncrementalRefreshEntity incrementalRefreshEntity = testListener.nextMBOIncrementMessage(); + assertNotNull(incrementalRefreshEntity); + Assert.assertEquals(channelId, incrementalRefreshEntity.getChannelId()); + Assert.assertEquals(secDesc, incrementalRefreshEntity.getSecDesc()); + Assert.assertEquals(1, incrementalRefreshEntity.getMatchEventIndicator()); + Assert.assertEquals(1, incrementalRefreshEntity.getMsgSeqNum()); + FieldSet orderIDEntry = incrementalRefreshEntity.getOrderIDEntry(); + assertNotNull(orderIDEntry); + assertEquals(orderID, orderIDEntry.getUInt64(37)); + assertEquals(mDOrderPriority, orderIDEntry.getUInt64(37707)); + assertEquals(mDUpdateAction, orderIDEntry.getInt8(279)); + assertEquals(mDEntryType, orderIDEntry.getUInt8(269)); + assertEquals(mDDisplayQty, orderIDEntry.getInt32(37706)); + assertEquals(mDEntryPx, orderIDEntry.getInt64(270)); + } + + @Test + public void controllerMustProcessSecurityDefinitionAndSendToClient() throws InterruptedException { + final MdpPacket mdpPacketWithInstrumentDefinition = MdpPacket.instance(); + final MdpFeedContext incrementContext = new MdpFeedContext(Feed.A, FeedType.I); + ByteBuffer instrumentDefinitionTestMessage = ModelUtils.getMDInstrumentDefinitionFuture27(1, testSecurityId); + mdpPacketWithInstrumentDefinition.wrapFromBuffer(instrumentDefinitionTestMessage); + channelController.handleIncrementalPacket(incrementContext, mdpPacketWithInstrumentDefinition); + Pair securityMessagePair = instrumentObserver.nextSecurityMessage(); + assertNotNull(securityMessagePair); + assertEquals(channelId, securityMessagePair.getLeft()); + assertEquals(SemanticMsgType.SecurityDefinition, securityMessagePair.getRight().getSemanticMsgType()); + } + + @Test + public void controllerMustProcessMBO2and3IncrementInMBPTemplate() throws Exception { + int secId1 = 1, secId2 = 4, secId3 = 8; + short ref1 = 2, ref2 = 3; + instrumentManager.registerSecurity(secId1, secDesc); + instrumentManager.registerSecurity(secId2, secDesc); + instrumentManager.registerSecurity(secId3, secDesc); + ByteBuffer mboIncrementTestMessage = ModelUtils.getMBPWithMBOIncrementTestMessage(1, new int[]{secId1, secId2, secId3}, new short[]{ref1, ref2}); + final MdpPacket mdpPacketWithIncrement = MdpPacket.instance(); + final MdpFeedContext incrementContext = new MdpFeedContext(Feed.A, FeedType.I); + mdpPacketWithIncrement.wrapFromBuffer(mboIncrementTestMessage); + + channelController.handleIncrementalPacket(incrementContext, mdpPacketWithIncrement); + + checkMBPIncrementalRefreshEntity(testListener.nextMBPIncrementMessage(), secId1); + + checkMBOIncrementalRefreshEntity(testListener.nextMBOIncrementMessage(), ref1); + checkMBPIncrementalRefreshEntity(testListener.nextMBPIncrementMessage(), secId2); + + checkMBOIncrementalRefreshEntity(testListener.nextMBOIncrementMessage(), ref2); + checkMBPIncrementalRefreshEntity(testListener.nextMBPIncrementMessage(), secId3); + + assertNull(testListener.nextMBOIncrementMessage()); + assertNull(testListener.nextMBPIncrementMessage()); + } + + @Test + public void controllerMustProcessMBO1and3IncrementInMBPTemplate() throws Exception { + int secId1 = 1, secId2 = 4, secId3 = 8; + short ref1 = 1, ref2 = 3; + instrumentManager.registerSecurity(secId1, secDesc); + instrumentManager.registerSecurity(secId2, secDesc); + instrumentManager.registerSecurity(secId3, secDesc); + ByteBuffer mboIncrementTestMessage = ModelUtils.getMBPWithMBOIncrementTestMessage(1, new int[]{secId1, secId2, secId3}, new short[]{ref1, ref2}); + final MdpPacket mdpPacketWithIncrement = MdpPacket.instance(); + final MdpFeedContext incrementContext = new MdpFeedContext(Feed.A, FeedType.I); + mdpPacketWithIncrement.wrapFromBuffer(mboIncrementTestMessage); + + channelController.handleIncrementalPacket(incrementContext, mdpPacketWithIncrement); + + checkMBOIncrementalRefreshEntity(testListener.nextMBOIncrementMessage(), ref1); + checkMBPIncrementalRefreshEntity(testListener.nextMBPIncrementMessage(), secId1); + + checkMBPIncrementalRefreshEntity(testListener.nextMBPIncrementMessage(), secId2); + + checkMBOIncrementalRefreshEntity(testListener.nextMBOIncrementMessage(), ref2); + checkMBPIncrementalRefreshEntity(testListener.nextMBPIncrementMessage(), secId3); + + assertNull(testListener.nextMBOIncrementMessage()); + assertNull(testListener.nextMBPIncrementMessage()); + } + + @Test + public void controllerMustProcessMBPWhenMBOEntitiesAreLess() throws Exception { + int secId1 = 1, secId2 = 4, secId3 = 8; + short ref1 = 1; + instrumentManager.registerSecurity(secId1, secDesc); + instrumentManager.registerSecurity(secId2, secDesc); + instrumentManager.registerSecurity(secId3, secDesc); + ByteBuffer mboIncrementTestMessage = ModelUtils.getMBPWithMBOIncrementTestMessage(1, new int[]{secId1, secId2, secId3}, new short[]{ref1}); + final MdpPacket mdpPacketWithIncrement = MdpPacket.instance(); + final MdpFeedContext incrementContext = new MdpFeedContext(Feed.A, FeedType.I); + mdpPacketWithIncrement.wrapFromBuffer(mboIncrementTestMessage); + + channelController.handleIncrementalPacket(incrementContext, mdpPacketWithIncrement); + + checkMBOIncrementalRefreshEntity(testListener.nextMBOIncrementMessage(), ref1); + checkMBPIncrementalRefreshEntity(testListener.nextMBPIncrementMessage(), secId1); + + checkMBPIncrementalRefreshEntity(testListener.nextMBPIncrementMessage(), secId2); + + checkMBPIncrementalRefreshEntity(testListener.nextMBPIncrementMessage(), secId3); + + assertNull(testListener.nextMBOIncrementMessage()); + assertNull(testListener.nextMBPIncrementMessage()); + } + + private void checkMBOIncrementalRefreshEntity(TestChannelListener.IncrementalRefreshEntity incrementalMBORefreshEntity, short ref){ + assertNotNull(incrementalMBORefreshEntity); + FieldSet orderIDEntry = incrementalMBORefreshEntity.getOrderIDEntry(); + assertNotNull(orderIDEntry); + assertEquals(ref, orderIDEntry.getUInt8(REFERENCE_ID)); + } + + private void checkMBPIncrementalRefreshEntity(TestChannelListener.IncrementalRefreshEntity incrementalMBPRefreshEntity, int secId){ + assertNotNull(incrementalMBPRefreshEntity); + FieldSet mdEntry = incrementalMBPRefreshEntity.getMdEntry(); + assertNotNull(mdEntry); + assertEquals(secId, mdEntry.getInt32(SECURITY_ID)); + } +} \ No newline at end of file diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/control/MessageProcessing.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/control/MessageProcessing.java new file mode 100644 index 0000000..f411eef --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/control/MessageProcessing.java @@ -0,0 +1,45 @@ +package com.epam.cme.mdp3.test.control; + + +import java.nio.ByteBuffer; + +import static com.epam.cme.mdp3.test.Constants.*; +import static org.junit.Assert.assertNotNull; + +public class MessageProcessing { +// private TestMBOChannelListener testListener = new TestMBOChannelListener(); +// private MdpChannel mdpChannel; +// private MdpMessageTypes mdpMessageTypes; +// +// @Before +// public void init() throws Exception { +// ClassLoader classLoader = getClass().getClassLoader(); +// mdpMessageTypes = new MdpMessageTypes(classLoader.getResource(Constants.TEMPLATE_NAME).toURI()); +// MdpChannelBuilder mdpHandlerBuilder = new MdpChannelBuilder(String.valueOf(648), +// classLoader.getResource(Constants.CONFIG_NAME).toURI(), +// classLoader.getResource(Constants.TEMPLATE_NAME).toURI()) +// .usingListener(testListener); +// mdpChannel = mdpHandlerBuilder.build(); +// } +// +// @Ignore +// @Test +// public void handlerMustProcessAndResendMBOSnapshotMessageToClient() throws InterruptedException { +// final MdpFeedContext smboContext = new MdpFeedContext(Feed.A, FeedType.SMBO); +// final MdpFeedContext instrumentContext = new MdpFeedContext(Feed.A, FeedType.N); +// final int security = 99; +// ByteBuffer securityDefinition = ModelUtils.getMDInstrumentDefinitionFuture27(1, security); +// ByteBuffer mboSnapshotTestMessage = ModelUtils.getMBOSnapshotTestMessage(2, security); +// mdpChannel.subscribe(security, "Test security"); +// final MdpPacket mdpPacketWithSecurityDefinition = MdpPacket.instance(); +// mdpPacketWithSecurityDefinition.wrapFromBuffer(securityDefinition); +// mdpChannel.handlePacket(instrumentContext, mdpPacketWithSecurityDefinition); +// assertNotNull(testListener.nextSecurityMessage()); +// +// final MdpPacket mdpPacketWithSnapshot = MdpPacket.instance(); +// mdpPacketWithSnapshot.wrapFromBuffer(mboSnapshotTestMessage); +// mdpChannel.handlePacket(smboContext, mdpPacketWithSnapshot); +// assertNotNull(testListener.nextMBOSnapshotMessage()); +// } + +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/control/SnapshotCycleHandlerTest.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/control/SnapshotCycleHandlerTest.java new file mode 100644 index 0000000..f382d06 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/control/SnapshotCycleHandlerTest.java @@ -0,0 +1,179 @@ +package com.epam.cme.mdp3.test.control; + +import com.epam.cme.mdp3.control.OffHeapSnapshotCycleHandler; +import com.epam.cme.mdp3.control.SnapshotCycleHandler; +import org.junit.Before; +import org.junit.Ignore; +import org.junit.Test; + +import static org.junit.Assert.*; + + +public class SnapshotCycleHandlerTest { + private SnapshotCycleHandler cycleHandler; + + @Before + public void init(){ + cycleHandler = new OffHeapSnapshotCycleHandler(); + } + + + @Test + public void snapshotSequenceMustBeUndefinedIfThereWereNoMessages(){ + assertEquals(SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED, cycleHandler.getSnapshotSequence(1)); + } + + @Test + public void itMustUpdateMetadataAndGiveCorrectResultWhenWholeSnapshotIsReceived(){ + long totNumReports = 2; + int securityId1 = 10; + int securityId2 = 20; + long securityId1NoChunks = 2; + long securityId2NoChunks = 1; + long lastMsgSeqNumProcessed = 1001; + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId1, securityId1NoChunks, 1); + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId1, securityId1NoChunks, 2); + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId2, securityId2NoChunks, 1); + assertEquals(lastMsgSeqNumProcessed, cycleHandler.getSmallestSnapshotSequence()); + } + + @Test + public void itMustUpdateMetadataAndGiveCorrectResultWhenWholeSnapshotIsReceivedInOneMessage(){ + long totNumReports = 1; + int securityId1 = 10; + long securityId1NoChunks = 1; + long lastMsgSeqNumProcessed = 1001; + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId1, securityId1NoChunks, 1); + assertEquals(lastMsgSeqNumProcessed, cycleHandler.getSmallestSnapshotSequence()); + } + + @Test + public void itMustUpdateMetadataAndGiveCorrectResultWhenSnapshotContainsNuChunkHigherThanMaxValue(){ + long totNumReports = 1; + int securityId1 = 10; + long securityId1NoChunks = SnapshotCycleHandler.MAX_NO_CHUNK_VALUE + 10; + long lastMsgSeqNumProcessed = 1001; + for(int i=1; i <= securityId1NoChunks; i++) { + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId1, securityId1NoChunks, i); + } + assertEquals(lastMsgSeqNumProcessed, cycleHandler.getSmallestSnapshotSequence()); + } + + @Test + public void itMustUpdateMetadataAndGiveCorrectResultWhenWholeSnapshotIsReceivedWithZeroSequence(){ + long totNumReports = 1; + int securityId1 = 10; + long securityId1NoChunks = 1; + long lastMsgSeqNumProcessed = 0; + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId1, securityId1NoChunks, 1); + assertEquals(lastMsgSeqNumProcessed, cycleHandler.getSmallestSnapshotSequence()); + } + + @Ignore("We don't need to do it") + @Test + public void metaDataMustBeRebuiltIfItContainsDifferentSequences(){ + long totNumReports = 2; + int securityId1 = 10; + int securityId2 = 20; + long securityId1NoChunks = 2; + long securityId2NoChunks = 1; + long lastMsgSeqNumProcessed1 = 1001; + long lastMsgSeqNumProcessed2 = 1002; + long lastMsgSeqNumProcessed3 = 1003; + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed1, securityId1, securityId1NoChunks, 1); + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed1, securityId1, securityId1NoChunks, 2); + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed2, securityId2, securityId2NoChunks, 1); + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed3, securityId1, securityId1NoChunks, 1); + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed3, securityId1, securityId1NoChunks, 2); + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed3, securityId2, securityId2NoChunks, 1); + assertEquals(lastMsgSeqNumProcessed3, cycleHandler.getSmallestSnapshotSequence()); + } + + @Test + public void itMustUpdateMetadataCorrectlyIfThereChangedNumberOfChunks(){ + long totNumReports = 2; + int securityId1 = 10; + int securityId2 = 20; + long lastMsgSeqNumProcessed = 1001; + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId1, 1, 1); + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId1, 2, 1); + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId1, 2, 2); + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId2, 1, 1); + assertEquals(lastMsgSeqNumProcessed, cycleHandler.getSmallestSnapshotSequence()); + } + + @Ignore("We don't need to do it") + @Test + public void itMustResetMetadataAndWorkCorrectlyInCaseWhenTotalChunkWasDecreased(){ + long totNumReports = 2; + int securityId1 = 10; + int securityId2 = 20; + long securityId1NoChunks = 2; + long securityId2NoChunks = 1; + long lastMsgSeqNumProcessed = 1001; + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId1, securityId1NoChunks, 1); + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId1, securityId1NoChunks, 2); + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId2, securityId2NoChunks, 1); + assertTrue(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + + cycleHandler.reset(); + totNumReports = 1; + lastMsgSeqNumProcessed = 2000; + + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId1, securityId1NoChunks, 1); + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId1, securityId1NoChunks, 2); + assertEquals(lastMsgSeqNumProcessed, cycleHandler.getSmallestSnapshotSequence()); + } + + @Ignore("We don't need to do it") + @Test + public void itMustResetMetadataAndWorkCorrectlyInCaseWhenTotalChunkWasIncreased(){ + int securityId1 = 10; + long totNumReports = 1; + long securityId1NoChunks = 2; + long lastMsgSeqNumProcessed = 1001; + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId1, securityId1NoChunks, 1); + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId1, securityId1NoChunks, 2); + assertEquals(lastMsgSeqNumProcessed, cycleHandler.getSmallestSnapshotSequence()); + + cycleHandler.reset(); + totNumReports = 2; + + int securityId2 = 20; + long securityId2NoChunks = 1; + lastMsgSeqNumProcessed = 2000; + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId1, securityId1NoChunks, 1); + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId1, securityId1NoChunks, 2); + assertFalse(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + cycleHandler.update(totNumReports, lastMsgSeqNumProcessed, securityId2, securityId2NoChunks, 1); + assertTrue(cycleHandler.getSmallestSnapshotSequence() != SnapshotCycleHandler.SNAPSHOT_SEQUENCE_UNDEFINED); + } + +} \ No newline at end of file diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/control/TestInstrumentObserver.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/control/TestInstrumentObserver.java new file mode 100644 index 0000000..e5e4f77 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/control/TestInstrumentObserver.java @@ -0,0 +1,48 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.test.control; + +import com.epam.cme.mdp3.MdpMessage; +import com.epam.cme.mdp3.MdpPacket; +import com.epam.cme.mdp3.control.InstrumentObserver; +import com.epam.cme.mdp3.core.channel.MdpFeedContext; +import com.epam.cme.mdp3.test.Constants; +import org.apache.commons.lang3.tuple.ImmutablePair; +import org.apache.commons.lang3.tuple.Pair; + +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; + +public class TestInstrumentObserver implements InstrumentObserver { + private BlockingQueue> securitiesQueue = new LinkedBlockingQueue<>(); + private String channelId; + + public TestInstrumentObserver(String channelId) { + this.channelId = channelId; + } + + @Override + public void onPacket(MdpFeedContext feedContext, MdpPacket instrumentPacket) { + + } + + @Override + public void onMessage(MdpFeedContext feedContext, MdpMessage secDefMsg) { + securitiesQueue.add(new ImmutablePair<>(channelId, secDefMsg)); + } + + public Pair nextSecurityMessage() throws InterruptedException { + return securitiesQueue.poll(Constants.WAITING_TIME_IN_MILLIS, TimeUnit.MILLISECONDS); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/AdminHeartbeat12Decoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/AdminHeartbeat12Decoder.java new file mode 100644 index 0000000..8b45f71 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/AdminHeartbeat12Decoder.java @@ -0,0 +1,119 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.AdminHeartbeat12Decoder"}) +@SuppressWarnings("all") +public class AdminHeartbeat12Decoder +{ + public static final int BLOCK_LENGTH = 0; + public static final int TEMPLATE_ID = 12; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final AdminHeartbeat12Decoder parentMessage = this; + private DirectBuffer buffer; + protected int offset; + protected int limit; + protected int actingBlockLength; + protected int actingVersion; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "0"; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public AdminHeartbeat12Decoder wrap( + final DirectBuffer buffer, final int offset, final int actingBlockLength, final int actingVersion) + { + this.buffer = buffer; + this.offset = offset; + this.actingBlockLength = actingBlockLength; + this.actingVersion = actingVersion; + limit(offset + actingBlockLength); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + final int originalLimit = limit(); + limit(offset + actingBlockLength); + builder.append("[AdminHeartbeat12](sbeTemplateId="); + builder.append(TEMPLATE_ID); + builder.append("|sbeSchemaId="); + builder.append(SCHEMA_ID); + builder.append("|sbeSchemaVersion="); + if (parentMessage.actingVersion != SCHEMA_VERSION) + { + builder.append(parentMessage.actingVersion); + builder.append('/'); + } + builder.append(SCHEMA_VERSION); + builder.append("|sbeBlockLength="); + if (actingBlockLength != BLOCK_LENGTH) + { + builder.append(actingBlockLength); + builder.append('/'); + } + builder.append(BLOCK_LENGTH); + builder.append("):"); + + limit(originalLimit); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/AdminHeartbeat12Encoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/AdminHeartbeat12Encoder.java new file mode 100644 index 0000000..9b07be4 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/AdminHeartbeat12Encoder.java @@ -0,0 +1,93 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.AdminHeartbeat12Encoder"}) +@SuppressWarnings("all") +public class AdminHeartbeat12Encoder +{ + public static final int BLOCK_LENGTH = 0; + public static final int TEMPLATE_ID = 12; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final AdminHeartbeat12Encoder parentMessage = this; + private MutableDirectBuffer buffer; + protected int offset; + protected int limit; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "0"; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public AdminHeartbeat12Encoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + limit(offset + BLOCK_LENGTH); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + AdminHeartbeat12Decoder writer = new AdminHeartbeat12Decoder(); + writer.wrap(buffer, offset, BLOCK_LENGTH, SCHEMA_VERSION); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/AdminLogin15Decoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/AdminLogin15Decoder.java new file mode 100644 index 0000000..614c03a --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/AdminLogin15Decoder.java @@ -0,0 +1,176 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.AdminLogin15Decoder"}) +@SuppressWarnings("all") +public class AdminLogin15Decoder +{ + public static final int BLOCK_LENGTH = 1; + public static final int TEMPLATE_ID = 15; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final AdminLogin15Decoder parentMessage = this; + private DirectBuffer buffer; + protected int offset; + protected int limit; + protected int actingBlockLength; + protected int actingVersion; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "A"; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public AdminLogin15Decoder wrap( + final DirectBuffer buffer, final int offset, final int actingBlockLength, final int actingVersion) + { + this.buffer = buffer; + this.offset = offset; + this.actingBlockLength = actingBlockLength; + this.actingVersion = actingVersion; + limit(offset + actingBlockLength); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int heartBtIntId() + { + return 108; + } + + public static int heartBtIntSinceVersion() + { + return 0; + } + + public static int heartBtIntEncodingOffset() + { + return 0; + } + + public static int heartBtIntEncodingLength() + { + return 1; + } + + public static String heartBtIntMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static byte heartBtIntNullValue() + { + return (byte)-128; + } + + public static byte heartBtIntMinValue() + { + return (byte)-127; + } + + public static byte heartBtIntMaxValue() + { + return (byte)127; + } + + public byte heartBtInt() + { + return buffer.getByte(offset + 0); + } + + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + final int originalLimit = limit(); + limit(offset + actingBlockLength); + builder.append("[AdminLogin15](sbeTemplateId="); + builder.append(TEMPLATE_ID); + builder.append("|sbeSchemaId="); + builder.append(SCHEMA_ID); + builder.append("|sbeSchemaVersion="); + if (parentMessage.actingVersion != SCHEMA_VERSION) + { + builder.append(parentMessage.actingVersion); + builder.append('/'); + } + builder.append(SCHEMA_VERSION); + builder.append("|sbeBlockLength="); + if (actingBlockLength != BLOCK_LENGTH) + { + builder.append(actingBlockLength); + builder.append('/'); + } + builder.append(BLOCK_LENGTH); + builder.append("):"); + //Token{signal=BEGIN_FIELD, name='HeartBtInt', referencedName='null', description='Heartbeat interval (seconds)', id=108, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int8', referencedName='null', description='Heartbeat interval (seconds)', id=-1, version=0, deprecated=0, encodedLength=1, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("heartBtInt="); + builder.append(heartBtInt()); + + limit(originalLimit); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/AdminLogin15Encoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/AdminLogin15Encoder.java new file mode 100644 index 0000000..71770ff --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/AdminLogin15Encoder.java @@ -0,0 +1,125 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.AdminLogin15Encoder"}) +@SuppressWarnings("all") +public class AdminLogin15Encoder +{ + public static final int BLOCK_LENGTH = 1; + public static final int TEMPLATE_ID = 15; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final AdminLogin15Encoder parentMessage = this; + private MutableDirectBuffer buffer; + protected int offset; + protected int limit; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "A"; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public AdminLogin15Encoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + limit(offset + BLOCK_LENGTH); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int heartBtIntEncodingOffset() + { + return 0; + } + + public static int heartBtIntEncodingLength() + { + return 1; + } + + public static byte heartBtIntNullValue() + { + return (byte)-128; + } + + public static byte heartBtIntMinValue() + { + return (byte)-127; + } + + public static byte heartBtIntMaxValue() + { + return (byte)127; + } + + public AdminLogin15Encoder heartBtInt(final byte value) + { + buffer.putByte(offset + 0, value); + return this; + } + + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + AdminLogin15Decoder writer = new AdminLogin15Decoder(); + writer.wrap(buffer, offset, BLOCK_LENGTH, SCHEMA_VERSION); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/AdminLogout16Decoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/AdminLogout16Decoder.java new file mode 100644 index 0000000..356ce1c --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/AdminLogout16Decoder.java @@ -0,0 +1,221 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.AdminLogout16Decoder"}) +@SuppressWarnings("all") +public class AdminLogout16Decoder +{ + public static final int BLOCK_LENGTH = 180; + public static final int TEMPLATE_ID = 16; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final AdminLogout16Decoder parentMessage = this; + private DirectBuffer buffer; + protected int offset; + protected int limit; + protected int actingBlockLength; + protected int actingVersion; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "5"; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public AdminLogout16Decoder wrap( + final DirectBuffer buffer, final int offset, final int actingBlockLength, final int actingVersion) + { + this.buffer = buffer; + this.offset = offset; + this.actingBlockLength = actingBlockLength; + this.actingVersion = actingVersion; + limit(offset + actingBlockLength); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int textId() + { + return 58; + } + + public static int textSinceVersion() + { + return 0; + } + + public static int textEncodingOffset() + { + return 0; + } + + public static int textEncodingLength() + { + return 180; + } + + public static String textMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte textNullValue() + { + return (byte)0; + } + + public static byte textMinValue() + { + return (byte)32; + } + + public static byte textMaxValue() + { + return (byte)126; + } + + public static int textLength() + { + return 180; + } + + public byte text(final int index) + { + if (index < 0 || index >= 180) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 0 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String textCharacterEncoding() + { + return "UTF-8"; + } + + public int getText(final byte[] dst, final int dstOffset) + { + final int length = 180; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 0, dst, dstOffset, length); + + return length; + } + + public String text() + { + final byte[] dst = new byte[180]; + buffer.getBytes(this.offset + 0, dst, 0, 180); + + int end = 0; + for (; end < 180 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + final int originalLimit = limit(); + limit(offset + actingBlockLength); + builder.append("[AdminLogout16](sbeTemplateId="); + builder.append(TEMPLATE_ID); + builder.append("|sbeSchemaId="); + builder.append(SCHEMA_ID); + builder.append("|sbeSchemaVersion="); + if (parentMessage.actingVersion != SCHEMA_VERSION) + { + builder.append(parentMessage.actingVersion); + builder.append('/'); + } + builder.append(SCHEMA_VERSION); + builder.append("|sbeBlockLength="); + if (actingBlockLength != BLOCK_LENGTH) + { + builder.append(actingBlockLength); + builder.append('/'); + } + builder.append(BLOCK_LENGTH); + builder.append("):"); + //Token{signal=BEGIN_FIELD, name='Text', referencedName='null', description='Free format text string. May include logout confirmation or reason for logout', id=58, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='Text', referencedName='null', description='Free format text string. May include logout confirmation or reason for logout', id=-1, version=0, deprecated=0, encodedLength=180, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("text="); + for (int i = 0; i < textLength() && text(i) > 0; i++) + { + builder.append((char)text(i)); + } + + limit(originalLimit); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/AdminLogout16Encoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/AdminLogout16Encoder.java new file mode 100644 index 0000000..484ecae --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/AdminLogout16Encoder.java @@ -0,0 +1,171 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.AdminLogout16Encoder"}) +@SuppressWarnings("all") +public class AdminLogout16Encoder +{ + public static final int BLOCK_LENGTH = 180; + public static final int TEMPLATE_ID = 16; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final AdminLogout16Encoder parentMessage = this; + private MutableDirectBuffer buffer; + protected int offset; + protected int limit; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "5"; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public AdminLogout16Encoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + limit(offset + BLOCK_LENGTH); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int textEncodingOffset() + { + return 0; + } + + public static int textEncodingLength() + { + return 180; + } + + public static byte textNullValue() + { + return (byte)0; + } + + public static byte textMinValue() + { + return (byte)32; + } + + public static byte textMaxValue() + { + return (byte)126; + } + + public static int textLength() + { + return 180; + } + + public void text(final int index, final byte value) + { + if (index < 0 || index >= 180) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 0 + (index * 1); + buffer.putByte(pos, value); + } + + public static String textCharacterEncoding() + { + return "UTF-8"; + } + + public AdminLogout16Encoder putText(final byte[] src, final int srcOffset) + { + final int length = 180; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 0, src, srcOffset, length); + + return this; + } + + public AdminLogout16Encoder text(final String src) + { + final int length = 180; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 0, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 0 + start, (byte)0); + } + + return this; + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + AdminLogout16Decoder writer = new AdminLogout16Decoder(); + writer.wrap(buffer, offset, BLOCK_LENGTH, SCHEMA_VERSION); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/AggressorSide.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/AggressorSide.java new file mode 100644 index 0000000..8969b3c --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/AggressorSide.java @@ -0,0 +1,40 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.AggressorSide"}) +public enum AggressorSide +{ + NoAggressor((short)0), + Buy((short)1), + Sell((short)2), + NULL_VAL((short)255); + + private final short value; + + AggressorSide(final short value) + { + this.value = value; + } + + public short value() + { + return value; + } + + public static AggressorSide get(final short value) + { + switch (value) + { + case 0: return NoAggressor; + case 1: return Buy; + case 2: return Sell; + } + + if ((short)255 == value) + { + return NULL_VAL; + } + + throw new IllegalArgumentException("Unknown value: " + value); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/ChannelReset4Decoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/ChannelReset4Decoder.java new file mode 100644 index 0000000..3d4ee78 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/ChannelReset4Decoder.java @@ -0,0 +1,525 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.ChannelReset4Decoder"}) +@SuppressWarnings("all") +public class ChannelReset4Decoder +{ + public static final int BLOCK_LENGTH = 9; + public static final int TEMPLATE_ID = 4; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final ChannelReset4Decoder parentMessage = this; + private DirectBuffer buffer; + protected int offset; + protected int limit; + protected int actingBlockLength; + protected int actingVersion; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "X"; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public ChannelReset4Decoder wrap( + final DirectBuffer buffer, final int offset, final int actingBlockLength, final int actingVersion) + { + this.buffer = buffer; + this.offset = offset; + this.actingBlockLength = actingBlockLength; + this.actingVersion = actingVersion; + limit(offset + actingBlockLength); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int transactTimeId() + { + return 60; + } + + public static int transactTimeSinceVersion() + { + return 0; + } + + public static int transactTimeEncodingOffset() + { + return 0; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static String transactTimeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "UTCTimestamp"; + } + + return ""; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long transactTime() + { + return buffer.getLong(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int matchEventIndicatorId() + { + return 5799; + } + + public static int matchEventIndicatorSinceVersion() + { + return 0; + } + + public static int matchEventIndicatorEncodingOffset() + { + return 8; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + public static String matchEventIndicatorMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MultipleCharValue"; + } + + return ""; + } + + private final MatchEventIndicatorDecoder matchEventIndicator = new MatchEventIndicatorDecoder(); + + public MatchEventIndicatorDecoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 8); + return matchEventIndicator; + } + + private final NoMDEntriesDecoder noMDEntries = new NoMDEntriesDecoder(); + + public static long noMDEntriesDecoderId() + { + return 268; + } + + public static int noMDEntriesDecoderSinceVersion() + { + return 0; + } + + public NoMDEntriesDecoder noMDEntries() + { + noMDEntries.wrap(parentMessage, buffer); + return noMDEntries; + } + + public static class NoMDEntriesDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private ChannelReset4Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final ChannelReset4Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 2; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoMDEntriesDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int mDUpdateActionId() + { + return 279; + } + + public static int mDUpdateActionSinceVersion() + { + return 2; + } + + public static int mDUpdateActionEncodingOffset() + { + return 0; + } + + public static int mDUpdateActionEncodingLength() + { + return 0; + } + + public static String mDUpdateActionMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static byte mDUpdateActionNullValue() + { + return (byte)-128; + } + + public static byte mDUpdateActionMinValue() + { + return (byte)-127; + } + + public static byte mDUpdateActionMaxValue() + { + return (byte)127; + } + + public byte mDUpdateAction() + { + return (byte)0; + } + + public static int mDEntryTypeId() + { + return 269; + } + + public static int mDEntryTypeSinceVersion() + { + return 0; + } + + public static int mDEntryTypeEncodingOffset() + { + return 0; + } + + public static int mDEntryTypeEncodingLength() + { + return 0; + } + + public static String mDEntryTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public static byte mDEntryTypeNullValue() + { + return (byte)0; + } + + public static byte mDEntryTypeMinValue() + { + return (byte)32; + } + + public static byte mDEntryTypeMaxValue() + { + return (byte)126; + } + + private static final byte[] MDENTRYTYPE_VALUE = {74}; + + public static int mDEntryTypeLength() + { + return 1; + } + + public byte mDEntryType(final int index) + { + return MDENTRYTYPE_VALUE[index]; + } + + public int getMDEntryType(final byte[] dst, final int offset, final int length) + { + final int bytesCopied = Math.min(length, 1); + System.arraycopy(MDENTRYTYPE_VALUE, 0, dst, offset, bytesCopied); + + return bytesCopied; + } + + public static int applIDId() + { + return 1180; + } + + public static int applIDSinceVersion() + { + return 3; + } + + public static int applIDEncodingOffset() + { + return 0; + } + + public static int applIDEncodingLength() + { + return 2; + } + + public static String applIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static short applIDNullValue() + { + return (short)-32768; + } + + public static short applIDMinValue() + { + return (short)-32767; + } + + public static short applIDMaxValue() + { + return (short)32767; + } + + public short applID() + { + if (parentMessage.actingVersion < 3) + { + return (short)-32768; + } + + return buffer.getShort(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='MDUpdateAction', referencedName='null', description='Market Data update action', id=279, version=2, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='MDUpdateTypeNew', referencedName='null', description='Market Data update action', id=-1, version=2, deprecated=0, encodedLength=0, offset=0, componentTokenCount=1, encoding=Encoding{presence=CONSTANT, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=0, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_FIELD, name='MDEntryType', referencedName='null', description='Market Data entry type ', id=269, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=ENCODING, name='MDEntryTypeChannelReset', referencedName='null', description='Market Data entry type ', id=-1, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=1, encoding=Encoding{presence=CONSTANT, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=74, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=BEGIN_FIELD, name='ApplID', referencedName='null', description='Indicates the channel ID as defined in the XML configuration file', id=1180, version=3, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int16', referencedName='null', description='Indicates the channel ID as defined in the XML configuration file', id=-1, version=3, deprecated=0, encodedLength=2, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT16, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("applID="); + builder.append(applID()); + builder.append(')'); + return builder; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + final int originalLimit = limit(); + limit(offset + actingBlockLength); + builder.append("[ChannelReset4](sbeTemplateId="); + builder.append(TEMPLATE_ID); + builder.append("|sbeSchemaId="); + builder.append(SCHEMA_ID); + builder.append("|sbeSchemaVersion="); + if (parentMessage.actingVersion != SCHEMA_VERSION) + { + builder.append(parentMessage.actingVersion); + builder.append('/'); + } + builder.append(SCHEMA_VERSION); + builder.append("|sbeBlockLength="); + if (actingBlockLength != BLOCK_LENGTH) + { + builder.append(actingBlockLength); + builder.append('/'); + } + builder.append(BLOCK_LENGTH); + builder.append("):"); + //Token{signal=BEGIN_FIELD, name='TransactTime', referencedName='null', description='Start of event processing time in number of nanoseconds since Unix epoch', id=60, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + //Token{signal=ENCODING, name='uInt64', referencedName='null', description='Start of event processing time in number of nanoseconds since Unix epoch', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + builder.append("transactTime="); + builder.append(transactTime()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=5799, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=12, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MultipleCharValue'}} + //Token{signal=BEGIN_SET, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=-1, version=0, deprecated=0, encodedLength=1, offset=8, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MultipleCharValue'}} + builder.append("matchEventIndicator="); + builder.append(matchEventIndicator()); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoMDEntries', referencedName='null', description='Number of entries in Market Data message', id=268, version=0, deprecated=0, encodedLength=2, offset=9, componentTokenCount=15, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noMDEntries=["); + NoMDEntriesDecoder noMDEntries = noMDEntries(); + if (noMDEntries.count() > 0) + { + while (noMDEntries.hasNext()) + { + noMDEntries.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + + limit(originalLimit); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/ChannelReset4Encoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/ChannelReset4Encoder.java new file mode 100644 index 0000000..073d3c6 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/ChannelReset4Encoder.java @@ -0,0 +1,316 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.ChannelReset4Encoder"}) +@SuppressWarnings("all") +public class ChannelReset4Encoder +{ + public static final int BLOCK_LENGTH = 9; + public static final int TEMPLATE_ID = 4; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final ChannelReset4Encoder parentMessage = this; + private MutableDirectBuffer buffer; + protected int offset; + protected int limit; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "X"; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public ChannelReset4Encoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + limit(offset + BLOCK_LENGTH); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int transactTimeEncodingOffset() + { + return 0; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public ChannelReset4Encoder transactTime(final long value) + { + buffer.putLong(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int matchEventIndicatorEncodingOffset() + { + return 8; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + private final MatchEventIndicatorEncoder matchEventIndicator = new MatchEventIndicatorEncoder(); + + public MatchEventIndicatorEncoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 8); + return matchEventIndicator; + } + + private final NoMDEntriesEncoder noMDEntries = new NoMDEntriesEncoder(); + + public static long noMDEntriesId() + { + return 268; + } + + public NoMDEntriesEncoder noMDEntriesCount(final int count) + { + noMDEntries.wrap(parentMessage, buffer, count); + return noMDEntries; + } + + public static class NoMDEntriesEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private ChannelReset4Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final ChannelReset4Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)2); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 2; + } + + public NoMDEntriesEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int mDUpdateActionEncodingOffset() + { + return 0; + } + + public static int mDUpdateActionEncodingLength() + { + return 0; + } + + public static byte mDUpdateActionNullValue() + { + return (byte)-128; + } + + public static byte mDUpdateActionMinValue() + { + return (byte)-127; + } + + public static byte mDUpdateActionMaxValue() + { + return (byte)127; + } + + public byte mDUpdateAction() + { + return (byte)0; + } + + public static int mDEntryTypeEncodingOffset() + { + return 0; + } + + public static int mDEntryTypeEncodingLength() + { + return 0; + } + + public static byte mDEntryTypeNullValue() + { + return (byte)0; + } + + public static byte mDEntryTypeMinValue() + { + return (byte)32; + } + + public static byte mDEntryTypeMaxValue() + { + return (byte)126; + } + + private static final byte[] MDENTRYTYPE_VALUE = {74}; + + public static int mDEntryTypeLength() + { + return 1; + } + + public byte mDEntryType(final int index) + { + return MDENTRYTYPE_VALUE[index]; + } + + public int getMDEntryType(final byte[] dst, final int offset, final int length) + { + final int bytesCopied = Math.min(length, 1); + System.arraycopy(MDENTRYTYPE_VALUE, 0, dst, offset, bytesCopied); + + return bytesCopied; + } + + public static int applIDEncodingOffset() + { + return 0; + } + + public static int applIDEncodingLength() + { + return 2; + } + + public static short applIDNullValue() + { + return (short)-32768; + } + + public static short applIDMinValue() + { + return (short)-32767; + } + + public static short applIDMaxValue() + { + return (short)32767; + } + + public NoMDEntriesEncoder applID(final short value) + { + buffer.putShort(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + ChannelReset4Decoder writer = new ChannelReset4Decoder(); + writer.wrap(buffer, offset, BLOCK_LENGTH, SCHEMA_VERSION); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/DecimalQtyDecoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/DecimalQtyDecoder.java new file mode 100644 index 0000000..e271888 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/DecimalQtyDecoder.java @@ -0,0 +1,115 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.DecimalQtyDecoder"}) +@SuppressWarnings("all") +public class DecimalQtyDecoder +{ + public static final int ENCODED_LENGTH = 4; + private int offset; + private DirectBuffer buffer; + + public DecimalQtyDecoder wrap(final DirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + + return this; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public int encodedLength() + { + return ENCODED_LENGTH; + } + + public static int mantissaEncodingOffset() + { + return 0; + } + + public static int mantissaEncodingLength() + { + return 4; + } + + public static int mantissaNullValue() + { + return 2147483647; + } + + public static int mantissaMinValue() + { + return -2147483647; + } + + public static int mantissaMaxValue() + { + return 2147483647; + } + + public int mantissa() + { + return buffer.getInt(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int exponentEncodingOffset() + { + return 4; + } + + public static int exponentEncodingLength() + { + return 0; + } + + public static byte exponentNullValue() + { + return (byte)-128; + } + + public static byte exponentMinValue() + { + return (byte)-127; + } + + public static byte exponentMaxValue() + { + return (byte)127; + } + + public byte exponent() + { + return (byte)-4; + } + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=ENCODING, name='mantissa', referencedName='null', description='mantissa ', id=-1, version=0, deprecated=0, encodedLength=4, offset=0, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=2147483647, constValue=null, characterEncoding='UTF-8', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("mantissa="); + builder.append(mantissa()); + builder.append('|'); + //Token{signal=ENCODING, name='exponent', referencedName='null', description='exponent', id=-1, version=0, deprecated=0, encodedLength=0, offset=4, componentTokenCount=1, encoding=Encoding{presence=CONSTANT, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=-4, characterEncoding='UTF-8', epoch='null', timeUnit=null, semanticType='null'}} + builder.append(')'); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/DecimalQtyEncoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/DecimalQtyEncoder.java new file mode 100644 index 0000000..920a955 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/DecimalQtyEncoder.java @@ -0,0 +1,111 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.DecimalQtyEncoder"}) +@SuppressWarnings("all") +public class DecimalQtyEncoder +{ + public static final int ENCODED_LENGTH = 4; + private int offset; + private MutableDirectBuffer buffer; + + public DecimalQtyEncoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + + return this; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public int encodedLength() + { + return ENCODED_LENGTH; + } + + public static int mantissaEncodingOffset() + { + return 0; + } + + public static int mantissaEncodingLength() + { + return 4; + } + + public static int mantissaNullValue() + { + return 2147483647; + } + + public static int mantissaMinValue() + { + return -2147483647; + } + + public static int mantissaMaxValue() + { + return 2147483647; + } + + public DecimalQtyEncoder mantissa(final int value) + { + buffer.putInt(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int exponentEncodingOffset() + { + return 4; + } + + public static int exponentEncodingLength() + { + return 0; + } + + public static byte exponentNullValue() + { + return (byte)-128; + } + + public static byte exponentMinValue() + { + return (byte)-127; + } + + public static byte exponentMaxValue() + { + return (byte)127; + } + + public byte exponent() + { + return (byte)-4; + } + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + DecimalQtyDecoder writer = new DecimalQtyDecoder(); + writer.wrap(buffer, offset); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/EventType.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/EventType.java new file mode 100644 index 0000000..ebd9c67 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/EventType.java @@ -0,0 +1,38 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.EventType"}) +public enum EventType +{ + Activation((short)5), + LastEligibleTradeDate((short)7), + NULL_VAL((short)255); + + private final short value; + + EventType(final short value) + { + this.value = value; + } + + public short value() + { + return value; + } + + public static EventType get(final short value) + { + switch (value) + { + case 5: return Activation; + case 7: return LastEligibleTradeDate; + } + + if ((short)255 == value) + { + return NULL_VAL; + } + + throw new IllegalArgumentException("Unknown value: " + value); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/FLOATDecoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/FLOATDecoder.java new file mode 100644 index 0000000..9b65109 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/FLOATDecoder.java @@ -0,0 +1,115 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.FLOATDecoder"}) +@SuppressWarnings("all") +public class FLOATDecoder +{ + public static final int ENCODED_LENGTH = 8; + private int offset; + private DirectBuffer buffer; + + public FLOATDecoder wrap(final DirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + + return this; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public int encodedLength() + { + return ENCODED_LENGTH; + } + + public static int mantissaEncodingOffset() + { + return 0; + } + + public static int mantissaEncodingLength() + { + return 8; + } + + public static long mantissaNullValue() + { + return -9223372036854775808L; + } + + public static long mantissaMinValue() + { + return -9223372036854775807L; + } + + public static long mantissaMaxValue() + { + return 9223372036854775807L; + } + + public long mantissa() + { + return buffer.getLong(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int exponentEncodingOffset() + { + return 8; + } + + public static int exponentEncodingLength() + { + return 0; + } + + public static byte exponentNullValue() + { + return (byte)-128; + } + + public static byte exponentMinValue() + { + return (byte)-127; + } + + public static byte exponentMaxValue() + { + return (byte)127; + } + + public byte exponent() + { + return (byte)-7; + } + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=ENCODING, name='mantissa', referencedName='null', description='mantissa', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("mantissa="); + builder.append(mantissa()); + builder.append('|'); + //Token{signal=ENCODING, name='exponent', referencedName='null', description='exponent', id=-1, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=1, encoding=Encoding{presence=CONSTANT, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=-7, characterEncoding='UTF-8', epoch='null', timeUnit=null, semanticType='null'}} + builder.append(')'); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/FLOATEncoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/FLOATEncoder.java new file mode 100644 index 0000000..e3a4dd2 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/FLOATEncoder.java @@ -0,0 +1,111 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.FLOATEncoder"}) +@SuppressWarnings("all") +public class FLOATEncoder +{ + public static final int ENCODED_LENGTH = 8; + private int offset; + private MutableDirectBuffer buffer; + + public FLOATEncoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + + return this; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public int encodedLength() + { + return ENCODED_LENGTH; + } + + public static int mantissaEncodingOffset() + { + return 0; + } + + public static int mantissaEncodingLength() + { + return 8; + } + + public static long mantissaNullValue() + { + return -9223372036854775808L; + } + + public static long mantissaMinValue() + { + return -9223372036854775807L; + } + + public static long mantissaMaxValue() + { + return 9223372036854775807L; + } + + public FLOATEncoder mantissa(final long value) + { + buffer.putLong(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int exponentEncodingOffset() + { + return 8; + } + + public static int exponentEncodingLength() + { + return 0; + } + + public static byte exponentNullValue() + { + return (byte)-128; + } + + public static byte exponentMinValue() + { + return (byte)-127; + } + + public static byte exponentMaxValue() + { + return (byte)127; + } + + public byte exponent() + { + return (byte)-7; + } + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + FLOATDecoder writer = new FLOATDecoder(); + writer.wrap(buffer, offset); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/GroupSize8ByteDecoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/GroupSize8ByteDecoder.java new file mode 100644 index 0000000..4953b1f --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/GroupSize8ByteDecoder.java @@ -0,0 +1,118 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.GroupSize8ByteDecoder"}) +@SuppressWarnings("all") +public class GroupSize8ByteDecoder +{ + public static final int ENCODED_LENGTH = 8; + private int offset; + private DirectBuffer buffer; + + public GroupSize8ByteDecoder wrap(final DirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + + return this; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public int encodedLength() + { + return ENCODED_LENGTH; + } + + public static int blockLengthEncodingOffset() + { + return 0; + } + + public static int blockLengthEncodingLength() + { + return 2; + } + + public static int blockLengthNullValue() + { + return 65535; + } + + public static int blockLengthMinValue() + { + return 0; + } + + public static int blockLengthMaxValue() + { + return 65534; + } + + public int blockLength() + { + return (buffer.getShort(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); + } + + + public static int numInGroupEncodingOffset() + { + return 7; + } + + public static int numInGroupEncodingLength() + { + return 1; + } + + public static short numInGroupNullValue() + { + return (short)255; + } + + public static short numInGroupMinValue() + { + return (short)0; + } + + public static short numInGroupMaxValue() + { + return (short)254; + } + + public short numInGroup() + { + return ((short)(buffer.getByte(offset + 7) & 0xFF)); + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=ENCODING, name='blockLength', referencedName='null', description='Length', id=-1, version=0, deprecated=0, encodedLength=2, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT16, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("blockLength="); + builder.append(blockLength()); + builder.append('|'); + //Token{signal=ENCODING, name='numInGroup', referencedName='null', description='NumInGroup', id=-1, version=0, deprecated=0, encodedLength=1, offset=7, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("numInGroup="); + builder.append(numInGroup()); + builder.append(')'); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/GroupSize8ByteEncoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/GroupSize8ByteEncoder.java new file mode 100644 index 0000000..2b8c09b --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/GroupSize8ByteEncoder.java @@ -0,0 +1,113 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.GroupSize8ByteEncoder"}) +@SuppressWarnings("all") +public class GroupSize8ByteEncoder +{ + public static final int ENCODED_LENGTH = 8; + private int offset; + private MutableDirectBuffer buffer; + + public GroupSize8ByteEncoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + + return this; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public int encodedLength() + { + return ENCODED_LENGTH; + } + + public static int blockLengthEncodingOffset() + { + return 0; + } + + public static int blockLengthEncodingLength() + { + return 2; + } + + public static int blockLengthNullValue() + { + return 65535; + } + + public static int blockLengthMinValue() + { + return 0; + } + + public static int blockLengthMaxValue() + { + return 65534; + } + + public GroupSize8ByteEncoder blockLength(final int value) + { + buffer.putShort(offset + 0, (short)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int numInGroupEncodingOffset() + { + return 7; + } + + public static int numInGroupEncodingLength() + { + return 1; + } + + public static short numInGroupNullValue() + { + return (short)255; + } + + public static short numInGroupMinValue() + { + return (short)0; + } + + public static short numInGroupMaxValue() + { + return (short)254; + } + + public GroupSize8ByteEncoder numInGroup(final short value) + { + buffer.putByte(offset + 7, (byte)value); + return this; + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + GroupSize8ByteDecoder writer = new GroupSize8ByteDecoder(); + writer.wrap(buffer, offset); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/GroupSizeDecoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/GroupSizeDecoder.java new file mode 100644 index 0000000..af27302 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/GroupSizeDecoder.java @@ -0,0 +1,118 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.GroupSizeDecoder"}) +@SuppressWarnings("all") +public class GroupSizeDecoder +{ + public static final int ENCODED_LENGTH = 3; + private int offset; + private DirectBuffer buffer; + + public GroupSizeDecoder wrap(final DirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + + return this; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public int encodedLength() + { + return ENCODED_LENGTH; + } + + public static int blockLengthEncodingOffset() + { + return 0; + } + + public static int blockLengthEncodingLength() + { + return 2; + } + + public static int blockLengthNullValue() + { + return 65535; + } + + public static int blockLengthMinValue() + { + return 0; + } + + public static int blockLengthMaxValue() + { + return 65534; + } + + public int blockLength() + { + return (buffer.getShort(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); + } + + + public static int numInGroupEncodingOffset() + { + return 2; + } + + public static int numInGroupEncodingLength() + { + return 1; + } + + public static short numInGroupNullValue() + { + return (short)255; + } + + public static short numInGroupMinValue() + { + return (short)0; + } + + public static short numInGroupMaxValue() + { + return (short)254; + } + + public short numInGroup() + { + return ((short)(buffer.getByte(offset + 2) & 0xFF)); + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=ENCODING, name='blockLength', referencedName='null', description='null', id=-1, version=0, deprecated=0, encodedLength=2, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT16, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("blockLength="); + builder.append(blockLength()); + builder.append('|'); + //Token{signal=ENCODING, name='numInGroup', referencedName='null', description='null', id=-1, version=0, deprecated=0, encodedLength=1, offset=2, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("numInGroup="); + builder.append(numInGroup()); + builder.append(')'); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/GroupSizeEncoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/GroupSizeEncoder.java new file mode 100644 index 0000000..23ff304 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/GroupSizeEncoder.java @@ -0,0 +1,113 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.GroupSizeEncoder"}) +@SuppressWarnings("all") +public class GroupSizeEncoder +{ + public static final int ENCODED_LENGTH = 3; + private int offset; + private MutableDirectBuffer buffer; + + public GroupSizeEncoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + + return this; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public int encodedLength() + { + return ENCODED_LENGTH; + } + + public static int blockLengthEncodingOffset() + { + return 0; + } + + public static int blockLengthEncodingLength() + { + return 2; + } + + public static int blockLengthNullValue() + { + return 65535; + } + + public static int blockLengthMinValue() + { + return 0; + } + + public static int blockLengthMaxValue() + { + return 65534; + } + + public GroupSizeEncoder blockLength(final int value) + { + buffer.putShort(offset + 0, (short)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int numInGroupEncodingOffset() + { + return 2; + } + + public static int numInGroupEncodingLength() + { + return 1; + } + + public static short numInGroupNullValue() + { + return (short)255; + } + + public static short numInGroupMinValue() + { + return (short)0; + } + + public static short numInGroupMaxValue() + { + return (short)254; + } + + public GroupSizeEncoder numInGroup(final short value) + { + buffer.putByte(offset + 2, (byte)value); + return this; + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + GroupSizeDecoder writer = new GroupSizeDecoder(); + writer.wrap(buffer, offset); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/HaltReason.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/HaltReason.java new file mode 100644 index 0000000..3e15963 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/HaltReason.java @@ -0,0 +1,48 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.HaltReason"}) +public enum HaltReason +{ + GroupSchedule((short)0), + SurveillanceIntervention((short)1), + MarketEvent((short)2), + InstrumentActivation((short)3), + InstrumentExpiration((short)4), + Unknown((short)5), + RecoveryInProcess((short)6), + NULL_VAL((short)255); + + private final short value; + + HaltReason(final short value) + { + this.value = value; + } + + public short value() + { + return value; + } + + public static HaltReason get(final short value) + { + switch (value) + { + case 0: return GroupSchedule; + case 1: return SurveillanceIntervention; + case 2: return MarketEvent; + case 3: return InstrumentActivation; + case 4: return InstrumentExpiration; + case 5: return Unknown; + case 6: return RecoveryInProcess; + } + + if ((short)255 == value) + { + return NULL_VAL; + } + + throw new IllegalArgumentException("Unknown value: " + value); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/InstAttribValueDecoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/InstAttribValueDecoder.java new file mode 100644 index 0000000..9310108 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/InstAttribValueDecoder.java @@ -0,0 +1,330 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.InstAttribValueDecoder"}) +@SuppressWarnings("all") +public class InstAttribValueDecoder +{ + public static final int ENCODED_LENGTH = 4; + private DirectBuffer buffer; + private int offset; + + public InstAttribValueDecoder wrap(final DirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + + return this; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public int encodedLength() + { + return ENCODED_LENGTH; + } + + public boolean electronicMatchEligible() + { + return 0 != (buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN) & (1 << 0)); + } + + public boolean orderCrossEligible() + { + return 0 != (buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN) & (1 << 1)); + } + + public boolean blockTradeEligible() + { + return 0 != (buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN) & (1 << 2)); + } + + public boolean eFPEligible() + { + return 0 != (buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN) & (1 << 3)); + } + + public boolean eBFEligible() + { + return 0 != (buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN) & (1 << 4)); + } + + public boolean eFSEligible() + { + return 0 != (buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN) & (1 << 5)); + } + + public boolean eFREligible() + { + return 0 != (buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN) & (1 << 6)); + } + + public boolean oTCEligible() + { + return 0 != (buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN) & (1 << 7)); + } + + public boolean iLinkIndicativeMassQuotingEligible() + { + return 0 != (buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN) & (1 << 8)); + } + + public boolean negativeStrikeEligible() + { + return 0 != (buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN) & (1 << 9)); + } + + public boolean negativePriceOutrightEligible() + { + return 0 != (buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN) & (1 << 10)); + } + + public boolean isFractional() + { + return 0 != (buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN) & (1 << 11)); + } + + public boolean volatilityQuotedOption() + { + return 0 != (buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN) & (1 << 12)); + } + + public boolean rFQCrossEligible() + { + return 0 != (buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN) & (1 << 13)); + } + + public boolean zeroPriceOutrightEligible() + { + return 0 != (buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN) & (1 << 14)); + } + + public boolean decayingProductEligibility() + { + return 0 != (buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN) & (1 << 15)); + } + + public boolean variableProductEligibility() + { + return 0 != (buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN) & (1 << 16)); + } + + public boolean dailyProductEligibility() + { + return 0 != (buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN) & (1 << 17)); + } + + public boolean gTOrdersEligibility() + { + return 0 != (buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN) & (1 << 18)); + } + + public boolean impliedMatchingEligibility() + { + return 0 != (buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN) & (1 << 19)); + } + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('{'); + boolean atLeastOne = false; + if (electronicMatchEligible()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("electronicMatchEligible"); + atLeastOne = true; + } + if (orderCrossEligible()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("orderCrossEligible"); + atLeastOne = true; + } + if (blockTradeEligible()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("blockTradeEligible"); + atLeastOne = true; + } + if (eFPEligible()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("eFPEligible"); + atLeastOne = true; + } + if (eBFEligible()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("eBFEligible"); + atLeastOne = true; + } + if (eFSEligible()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("eFSEligible"); + atLeastOne = true; + } + if (eFREligible()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("eFREligible"); + atLeastOne = true; + } + if (oTCEligible()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("oTCEligible"); + atLeastOne = true; + } + if (iLinkIndicativeMassQuotingEligible()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("iLinkIndicativeMassQuotingEligible"); + atLeastOne = true; + } + if (negativeStrikeEligible()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("negativeStrikeEligible"); + atLeastOne = true; + } + if (negativePriceOutrightEligible()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("negativePriceOutrightEligible"); + atLeastOne = true; + } + if (isFractional()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("isFractional"); + atLeastOne = true; + } + if (volatilityQuotedOption()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("volatilityQuotedOption"); + atLeastOne = true; + } + if (rFQCrossEligible()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("rFQCrossEligible"); + atLeastOne = true; + } + if (zeroPriceOutrightEligible()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("zeroPriceOutrightEligible"); + atLeastOne = true; + } + if (decayingProductEligibility()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("decayingProductEligibility"); + atLeastOne = true; + } + if (variableProductEligibility()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("variableProductEligibility"); + atLeastOne = true; + } + if (dailyProductEligibility()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("dailyProductEligibility"); + atLeastOne = true; + } + if (gTOrdersEligibility()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("gTOrdersEligibility"); + atLeastOne = true; + } + if (impliedMatchingEligibility()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("impliedMatchingEligibility"); + atLeastOne = true; + } + builder.append('}'); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/InstAttribValueEncoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/InstAttribValueEncoder.java new file mode 100644 index 0000000..4acd901 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/InstAttribValueEncoder.java @@ -0,0 +1,202 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.InstAttribValueEncoder"}) +@SuppressWarnings("all") +public class InstAttribValueEncoder +{ + public static final int ENCODED_LENGTH = 4; + private MutableDirectBuffer buffer; + private int offset; + + public InstAttribValueEncoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + + return this; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public int encodedLength() + { + return ENCODED_LENGTH; + } + + public InstAttribValueEncoder clear() + { + buffer.putInt(offset, (int)0L, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + public InstAttribValueEncoder electronicMatchEligible(final boolean value) + { + int bits = buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN); + bits = value ? bits | (1 << 0) : bits & ~(1 << 0); + buffer.putInt(offset, bits, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + public InstAttribValueEncoder orderCrossEligible(final boolean value) + { + int bits = buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN); + bits = value ? bits | (1 << 1) : bits & ~(1 << 1); + buffer.putInt(offset, bits, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + public InstAttribValueEncoder blockTradeEligible(final boolean value) + { + int bits = buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN); + bits = value ? bits | (1 << 2) : bits & ~(1 << 2); + buffer.putInt(offset, bits, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + public InstAttribValueEncoder eFPEligible(final boolean value) + { + int bits = buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN); + bits = value ? bits | (1 << 3) : bits & ~(1 << 3); + buffer.putInt(offset, bits, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + public InstAttribValueEncoder eBFEligible(final boolean value) + { + int bits = buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN); + bits = value ? bits | (1 << 4) : bits & ~(1 << 4); + buffer.putInt(offset, bits, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + public InstAttribValueEncoder eFSEligible(final boolean value) + { + int bits = buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN); + bits = value ? bits | (1 << 5) : bits & ~(1 << 5); + buffer.putInt(offset, bits, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + public InstAttribValueEncoder eFREligible(final boolean value) + { + int bits = buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN); + bits = value ? bits | (1 << 6) : bits & ~(1 << 6); + buffer.putInt(offset, bits, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + public InstAttribValueEncoder oTCEligible(final boolean value) + { + int bits = buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN); + bits = value ? bits | (1 << 7) : bits & ~(1 << 7); + buffer.putInt(offset, bits, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + public InstAttribValueEncoder iLinkIndicativeMassQuotingEligible(final boolean value) + { + int bits = buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN); + bits = value ? bits | (1 << 8) : bits & ~(1 << 8); + buffer.putInt(offset, bits, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + public InstAttribValueEncoder negativeStrikeEligible(final boolean value) + { + int bits = buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN); + bits = value ? bits | (1 << 9) : bits & ~(1 << 9); + buffer.putInt(offset, bits, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + public InstAttribValueEncoder negativePriceOutrightEligible(final boolean value) + { + int bits = buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN); + bits = value ? bits | (1 << 10) : bits & ~(1 << 10); + buffer.putInt(offset, bits, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + public InstAttribValueEncoder isFractional(final boolean value) + { + int bits = buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN); + bits = value ? bits | (1 << 11) : bits & ~(1 << 11); + buffer.putInt(offset, bits, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + public InstAttribValueEncoder volatilityQuotedOption(final boolean value) + { + int bits = buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN); + bits = value ? bits | (1 << 12) : bits & ~(1 << 12); + buffer.putInt(offset, bits, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + public InstAttribValueEncoder rFQCrossEligible(final boolean value) + { + int bits = buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN); + bits = value ? bits | (1 << 13) : bits & ~(1 << 13); + buffer.putInt(offset, bits, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + public InstAttribValueEncoder zeroPriceOutrightEligible(final boolean value) + { + int bits = buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN); + bits = value ? bits | (1 << 14) : bits & ~(1 << 14); + buffer.putInt(offset, bits, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + public InstAttribValueEncoder decayingProductEligibility(final boolean value) + { + int bits = buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN); + bits = value ? bits | (1 << 15) : bits & ~(1 << 15); + buffer.putInt(offset, bits, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + public InstAttribValueEncoder variableProductEligibility(final boolean value) + { + int bits = buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN); + bits = value ? bits | (1 << 16) : bits & ~(1 << 16); + buffer.putInt(offset, bits, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + public InstAttribValueEncoder dailyProductEligibility(final boolean value) + { + int bits = buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN); + bits = value ? bits | (1 << 17) : bits & ~(1 << 17); + buffer.putInt(offset, bits, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + public InstAttribValueEncoder gTOrdersEligibility(final boolean value) + { + int bits = buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN); + bits = value ? bits | (1 << 18) : bits & ~(1 << 18); + buffer.putInt(offset, bits, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + public InstAttribValueEncoder impliedMatchingEligibility(final boolean value) + { + int bits = buffer.getInt(offset, java.nio.ByteOrder.LITTLE_ENDIAN); + bits = value ? bits | (1 << 19) : bits & ~(1 << 19); + buffer.putInt(offset, bits, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/LegSide.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/LegSide.java new file mode 100644 index 0000000..dea41e4 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/LegSide.java @@ -0,0 +1,38 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.LegSide"}) +public enum LegSide +{ + BuySide((short)1), + SellSide((short)2), + NULL_VAL((short)255); + + private final short value; + + LegSide(final short value) + { + this.value = value; + } + + public short value() + { + return value; + } + + public static LegSide get(final short value) + { + switch (value) + { + case 1: return BuySide; + case 2: return SellSide; + } + + if ((short)255 == value) + { + return NULL_VAL; + } + + throw new IllegalArgumentException("Unknown value: " + value); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDEntryType.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDEntryType.java new file mode 100644 index 0000000..3649ce7 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDEntryType.java @@ -0,0 +1,68 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDEntryType"}) +public enum MDEntryType +{ + Bid((byte)48), + Offer((byte)49), + Trade((byte)50), + OpenPrice((byte)52), + SettlementPrice((byte)54), + TradingSessionHighPrice((byte)55), + TradingSessionLowPrice((byte)56), + ClearedVolume((byte)66), + OpenInterest((byte)67), + ImpliedBid((byte)69), + ImpliedOffer((byte)70), + BookReset((byte)74), + SessionHighBid((byte)78), + SessionLowOffer((byte)79), + FixingPrice((byte)87), + ElectronicVolume((byte)101), + ThresholdLimitsandPriceBandVariation((byte)103), + NULL_VAL((byte)0); + + private final byte value; + + MDEntryType(final byte value) + { + this.value = value; + } + + public byte value() + { + return value; + } + + public static MDEntryType get(final byte value) + { + switch (value) + { + case 48: return Bid; + case 49: return Offer; + case 50: return Trade; + case 52: return OpenPrice; + case 54: return SettlementPrice; + case 55: return TradingSessionHighPrice; + case 56: return TradingSessionLowPrice; + case 66: return ClearedVolume; + case 67: return OpenInterest; + case 69: return ImpliedBid; + case 70: return ImpliedOffer; + case 74: return BookReset; + case 78: return SessionHighBid; + case 79: return SessionLowOffer; + case 87: return FixingPrice; + case 101: return ElectronicVolume; + case 103: return ThresholdLimitsandPriceBandVariation; + } + + if ((byte)0 == value) + { + return NULL_VAL; + } + + throw new IllegalArgumentException("Unknown value: " + value); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDEntryTypeBook.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDEntryTypeBook.java new file mode 100644 index 0000000..d2700e6 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDEntryTypeBook.java @@ -0,0 +1,44 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDEntryTypeBook"}) +public enum MDEntryTypeBook +{ + Bid((byte)48), + Offer((byte)49), + ImpliedBid((byte)69), + ImpliedOffer((byte)70), + BookReset((byte)74), + NULL_VAL((byte)0); + + private final byte value; + + MDEntryTypeBook(final byte value) + { + this.value = value; + } + + public byte value() + { + return value; + } + + public static MDEntryTypeBook get(final byte value) + { + switch (value) + { + case 48: return Bid; + case 49: return Offer; + case 69: return ImpliedBid; + case 70: return ImpliedOffer; + case 74: return BookReset; + } + + if ((byte)0 == value) + { + return NULL_VAL; + } + + throw new IllegalArgumentException("Unknown value: " + value); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDEntryTypeDailyStatistics.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDEntryTypeDailyStatistics.java new file mode 100644 index 0000000..a1a0d27 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDEntryTypeDailyStatistics.java @@ -0,0 +1,42 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDEntryTypeDailyStatistics"}) +public enum MDEntryTypeDailyStatistics +{ + SettlementPrice((byte)54), + ClearedVolume((byte)66), + OpenInterest((byte)67), + FixingPrice((byte)87), + NULL_VAL((byte)0); + + private final byte value; + + MDEntryTypeDailyStatistics(final byte value) + { + this.value = value; + } + + public byte value() + { + return value; + } + + public static MDEntryTypeDailyStatistics get(final byte value) + { + switch (value) + { + case 54: return SettlementPrice; + case 66: return ClearedVolume; + case 67: return OpenInterest; + case 87: return FixingPrice; + } + + if ((byte)0 == value) + { + return NULL_VAL; + } + + throw new IllegalArgumentException("Unknown value: " + value); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDEntryTypeStatistics.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDEntryTypeStatistics.java new file mode 100644 index 0000000..1adb5f9 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDEntryTypeStatistics.java @@ -0,0 +1,44 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDEntryTypeStatistics"}) +public enum MDEntryTypeStatistics +{ + OpenPrice((byte)52), + HighTrade((byte)55), + LowTrade((byte)56), + HighestBid((byte)78), + LowestOffer((byte)79), + NULL_VAL((byte)0); + + private final byte value; + + MDEntryTypeStatistics(final byte value) + { + this.value = value; + } + + public byte value() + { + return value; + } + + public static MDEntryTypeStatistics get(final byte value) + { + switch (value) + { + case 52: return OpenPrice; + case 55: return HighTrade; + case 56: return LowTrade; + case 78: return HighestBid; + case 79: return LowestOffer; + } + + if ((byte)0 == value) + { + return NULL_VAL; + } + + throw new IllegalArgumentException("Unknown value: " + value); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshBook32Decoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshBook32Decoder.java new file mode 100644 index 0000000..03a37d4 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshBook32Decoder.java @@ -0,0 +1,1160 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDIncrementalRefreshBook32Decoder"}) +@SuppressWarnings("all") +public class MDIncrementalRefreshBook32Decoder +{ + public static final int BLOCK_LENGTH = 11; + public static final int TEMPLATE_ID = 32; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final MDIncrementalRefreshBook32Decoder parentMessage = this; + private DirectBuffer buffer; + protected int offset; + protected int limit; + protected int actingBlockLength; + protected int actingVersion; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "X"; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public MDIncrementalRefreshBook32Decoder wrap( + final DirectBuffer buffer, final int offset, final int actingBlockLength, final int actingVersion) + { + this.buffer = buffer; + this.offset = offset; + this.actingBlockLength = actingBlockLength; + this.actingVersion = actingVersion; + limit(offset + actingBlockLength); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int transactTimeId() + { + return 60; + } + + public static int transactTimeSinceVersion() + { + return 0; + } + + public static int transactTimeEncodingOffset() + { + return 0; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static String transactTimeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "UTCTimestamp"; + } + + return ""; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long transactTime() + { + return buffer.getLong(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int matchEventIndicatorId() + { + return 5799; + } + + public static int matchEventIndicatorSinceVersion() + { + return 0; + } + + public static int matchEventIndicatorEncodingOffset() + { + return 8; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + public static String matchEventIndicatorMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MultipleCharValue"; + } + + return ""; + } + + private final MatchEventIndicatorDecoder matchEventIndicator = new MatchEventIndicatorDecoder(); + + public MatchEventIndicatorDecoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 8); + return matchEventIndicator; + } + + private final NoMDEntriesDecoder noMDEntries = new NoMDEntriesDecoder(); + + public static long noMDEntriesDecoderId() + { + return 268; + } + + public static int noMDEntriesDecoderSinceVersion() + { + return 0; + } + + public NoMDEntriesDecoder noMDEntries() + { + noMDEntries.wrap(parentMessage, buffer); + return noMDEntries; + } + + public static class NoMDEntriesDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private MDIncrementalRefreshBook32Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDIncrementalRefreshBook32Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 32; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoMDEntriesDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int mDEntryPxId() + { + return 270; + } + + public static int mDEntryPxSinceVersion() + { + return 0; + } + + public static int mDEntryPxEncodingOffset() + { + return 0; + } + + public static int mDEntryPxEncodingLength() + { + return 8; + } + + public static String mDEntryPxMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder mDEntryPx = new PRICENULLDecoder(); + + public PRICENULLDecoder mDEntryPx() + { + mDEntryPx.wrap(buffer, offset + 0); + return mDEntryPx; + } + + public static int mDEntrySizeId() + { + return 271; + } + + public static int mDEntrySizeSinceVersion() + { + return 0; + } + + public static int mDEntrySizeEncodingOffset() + { + return 8; + } + + public static int mDEntrySizeEncodingLength() + { + return 4; + } + + public static String mDEntrySizeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static int mDEntrySizeNullValue() + { + return 2147483647; + } + + public static int mDEntrySizeMinValue() + { + return -2147483647; + } + + public static int mDEntrySizeMaxValue() + { + return 2147483647; + } + + public int mDEntrySize() + { + return buffer.getInt(offset + 8, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int securityIDId() + { + return 48; + } + + public static int securityIDSinceVersion() + { + return 0; + } + + public static int securityIDEncodingOffset() + { + return 12; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static String securityIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public int securityID() + { + return buffer.getInt(offset + 12, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int rptSeqId() + { + return 83; + } + + public static int rptSeqSinceVersion() + { + return 0; + } + + public static int rptSeqEncodingOffset() + { + return 16; + } + + public static int rptSeqEncodingLength() + { + return 4; + } + + public static String rptSeqMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static long rptSeqNullValue() + { + return 4294967294L; + } + + public static long rptSeqMinValue() + { + return 0L; + } + + public static long rptSeqMaxValue() + { + return 4294967293L; + } + + public long rptSeq() + { + return (buffer.getInt(offset + 16, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + public static int numberOfOrdersId() + { + return 346; + } + + public static int numberOfOrdersSinceVersion() + { + return 0; + } + + public static int numberOfOrdersEncodingOffset() + { + return 20; + } + + public static int numberOfOrdersEncodingLength() + { + return 4; + } + + public static String numberOfOrdersMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int numberOfOrdersNullValue() + { + return 2147483647; + } + + public static int numberOfOrdersMinValue() + { + return -2147483647; + } + + public static int numberOfOrdersMaxValue() + { + return 2147483647; + } + + public int numberOfOrders() + { + return buffer.getInt(offset + 20, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int mDPriceLevelId() + { + return 1023; + } + + public static int mDPriceLevelSinceVersion() + { + return 0; + } + + public static int mDPriceLevelEncodingOffset() + { + return 24; + } + + public static int mDPriceLevelEncodingLength() + { + return 1; + } + + public static String mDPriceLevelMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static short mDPriceLevelNullValue() + { + return (short)255; + } + + public static short mDPriceLevelMinValue() + { + return (short)0; + } + + public static short mDPriceLevelMaxValue() + { + return (short)254; + } + + public short mDPriceLevel() + { + return ((short)(buffer.getByte(offset + 24) & 0xFF)); + } + + + public static int mDUpdateActionId() + { + return 279; + } + + public static int mDUpdateActionSinceVersion() + { + return 0; + } + + public static int mDUpdateActionEncodingOffset() + { + return 25; + } + + public static int mDUpdateActionEncodingLength() + { + return 1; + } + + public static String mDUpdateActionMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public MDUpdateAction mDUpdateAction() + { + return MDUpdateAction.get(((short)(buffer.getByte(offset + 25) & 0xFF))); + } + + + public static int mDEntryTypeId() + { + return 269; + } + + public static int mDEntryTypeSinceVersion() + { + return 0; + } + + public static int mDEntryTypeEncodingOffset() + { + return 26; + } + + public static int mDEntryTypeEncodingLength() + { + return 1; + } + + public static String mDEntryTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public MDEntryTypeBook mDEntryType() + { + return MDEntryTypeBook.get(buffer.getByte(offset + 26)); + } + + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='MDEntryPx', referencedName='null', description='Market Data entry price', id=270, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Market Data entry price', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("mDEntryPx="); + mDEntryPx().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDEntrySize', referencedName='null', description='Market Data entry size', id=271, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='Int32NULL', referencedName='null', description='Market Data entry size', id=-1, version=0, deprecated=0, encodedLength=4, offset=8, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=2147483647, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("mDEntrySize="); + builder.append(mDEntrySize()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityID', referencedName='null', description='Security ID', id=48, version=0, deprecated=0, encodedLength=0, offset=12, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32', referencedName='null', description='Security ID', id=-1, version=0, deprecated=0, encodedLength=4, offset=12, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("securityID="); + builder.append(securityID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='RptSeq', referencedName='null', description='Market Data entry sequence number per instrument update', id=83, version=0, deprecated=0, encodedLength=0, offset=16, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt32', referencedName='null', description='Market Data entry sequence number per instrument update', id=-1, version=0, deprecated=0, encodedLength=4, offset=16, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("rptSeq="); + builder.append(rptSeq()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='NumberOfOrders', referencedName='null', description='In Book entry - aggregate number of orders at given price level', id=346, version=0, deprecated=0, encodedLength=0, offset=20, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32NULL', referencedName='null', description='In Book entry - aggregate number of orders at given price level', id=-1, version=0, deprecated=0, encodedLength=4, offset=20, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=2147483647, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("numberOfOrders="); + builder.append(numberOfOrders()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDPriceLevel', referencedName='null', description='Aggregate book level', id=1023, version=0, deprecated=0, encodedLength=0, offset=24, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt8', referencedName='null', description='Aggregate book level', id=-1, version=0, deprecated=0, encodedLength=1, offset=24, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("mDPriceLevel="); + builder.append(mDPriceLevel()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDUpdateAction', referencedName='null', description=' Market Data update action', id=279, version=0, deprecated=0, encodedLength=0, offset=25, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='MDUpdateAction', referencedName='null', description=' Market Data update action', id=-1, version=0, deprecated=0, encodedLength=1, offset=25, componentTokenCount=8, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("mDUpdateAction="); + builder.append(mDUpdateAction()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDEntryType', referencedName='null', description='Market Data entry type', id=269, version=0, deprecated=0, encodedLength=0, offset=26, componentTokenCount=9, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=BEGIN_ENUM, name='MDEntryTypeBook', referencedName='null', description='Market Data entry type', id=-1, version=0, deprecated=0, encodedLength=1, offset=26, componentTokenCount=7, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='char'}} + builder.append("mDEntryType="); + builder.append(mDEntryType()); + builder.append(')'); + return builder; + } + } + + private final NoOrderIDEntriesDecoder noOrderIDEntries = new NoOrderIDEntriesDecoder(); + + public static long noOrderIDEntriesDecoderId() + { + return 37705; + } + + public static int noOrderIDEntriesDecoderSinceVersion() + { + return 7; + } + + public NoOrderIDEntriesDecoder noOrderIDEntries() + { + if (parentMessage.actingVersion < 7) + { + noOrderIDEntries.count = 0; + noOrderIDEntries.index = -1; + return noOrderIDEntries; + } + + noOrderIDEntries.wrap(parentMessage, buffer); + return noOrderIDEntries; + } + + public static class NoOrderIDEntriesDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 8; + private final GroupSize8ByteDecoder dimensions = new GroupSize8ByteDecoder(); + private MDIncrementalRefreshBook32Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDIncrementalRefreshBook32Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 24; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoOrderIDEntriesDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int orderIDId() + { + return 37; + } + + public static int orderIDSinceVersion() + { + return 0; + } + + public static int orderIDEncodingOffset() + { + return 0; + } + + public static int orderIDEncodingLength() + { + return 8; + } + + public static String orderIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static long orderIDNullValue() + { + return 0xffffffffffffffffL; + } + + public static long orderIDMinValue() + { + return 0x0L; + } + + public static long orderIDMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long orderID() + { + return buffer.getLong(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int mDOrderPriorityId() + { + return 37707; + } + + public static int mDOrderPrioritySinceVersion() + { + return 0; + } + + public static int mDOrderPriorityEncodingOffset() + { + return 8; + } + + public static int mDOrderPriorityEncodingLength() + { + return 8; + } + + public static String mDOrderPriorityMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static long mDOrderPriorityNullValue() + { + return 0xffffffffffffffffL; + } + + public static long mDOrderPriorityMinValue() + { + return 0x0L; + } + + public static long mDOrderPriorityMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long mDOrderPriority() + { + return buffer.getLong(offset + 8, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int mDDisplayQtyId() + { + return 37706; + } + + public static int mDDisplayQtySinceVersion() + { + return 0; + } + + public static int mDDisplayQtyEncodingOffset() + { + return 16; + } + + public static int mDDisplayQtyEncodingLength() + { + return 4; + } + + public static String mDDisplayQtyMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int mDDisplayQtyNullValue() + { + return 2147483647; + } + + public static int mDDisplayQtyMinValue() + { + return -2147483647; + } + + public static int mDDisplayQtyMaxValue() + { + return 2147483647; + } + + public int mDDisplayQty() + { + return buffer.getInt(offset + 16, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int referenceIDId() + { + return 9633; + } + + public static int referenceIDSinceVersion() + { + return 0; + } + + public static int referenceIDEncodingOffset() + { + return 20; + } + + public static int referenceIDEncodingLength() + { + return 1; + } + + public static String referenceIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static short referenceIDNullValue() + { + return (short)255; + } + + public static short referenceIDMinValue() + { + return (short)0; + } + + public static short referenceIDMaxValue() + { + return (short)254; + } + + public short referenceID() + { + return ((short)(buffer.getByte(offset + 20) & 0xFF)); + } + + + public static int orderUpdateActionId() + { + return 37708; + } + + public static int orderUpdateActionSinceVersion() + { + return 0; + } + + public static int orderUpdateActionEncodingOffset() + { + return 21; + } + + public static int orderUpdateActionEncodingLength() + { + return 1; + } + + public static String orderUpdateActionMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public OrderUpdateAction orderUpdateAction() + { + return OrderUpdateAction.get(((short)(buffer.getByte(offset + 21) & 0xFF))); + } + + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='OrderID', referencedName='null', description='Unique Order ID', id=37, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt64', referencedName='null', description='Unique Order ID', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("orderID="); + builder.append(orderID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDOrderPriority', referencedName='null', description='Order priority for execution on the order book', id=37707, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt64NULL', referencedName='null', description='Order priority for execution on the order book', id=-1, version=0, deprecated=0, encodedLength=8, offset=8, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=-1, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("mDOrderPriority="); + builder.append(mDOrderPriority()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDDisplayQty', referencedName='null', description='Visible qty of order', id=37706, version=0, deprecated=0, encodedLength=0, offset=16, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32NULL', referencedName='null', description='Visible qty of order', id=-1, version=0, deprecated=0, encodedLength=4, offset=16, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=2147483647, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("mDDisplayQty="); + builder.append(mDDisplayQty()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='ReferenceID', referencedName='null', description='Reference to corresponding Price and Security ID, sequence of MD entry in the message', id=9633, version=0, deprecated=0, encodedLength=0, offset=20, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt8NULL', referencedName='null', description='Reference to corresponding Price and Security ID, sequence of MD entry in the message', id=-1, version=0, deprecated=0, encodedLength=1, offset=20, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=255, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("referenceID="); + builder.append(referenceID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='OrderUpdateAction', referencedName='null', description='Order book update action to be applied to the order referenced by OrderID', id=37708, version=0, deprecated=0, encodedLength=0, offset=21, componentTokenCount=7, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='OrderUpdateAction', referencedName='null', description='Order book update action to be applied to the order referenced by OrderID', id=-1, version=0, deprecated=0, encodedLength=1, offset=21, componentTokenCount=5, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("orderUpdateAction="); + builder.append(orderUpdateAction()); + builder.append(')'); + return builder; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + final int originalLimit = limit(); + limit(offset + actingBlockLength); + builder.append("[MDIncrementalRefreshBook32](sbeTemplateId="); + builder.append(TEMPLATE_ID); + builder.append("|sbeSchemaId="); + builder.append(SCHEMA_ID); + builder.append("|sbeSchemaVersion="); + if (parentMessage.actingVersion != SCHEMA_VERSION) + { + builder.append(parentMessage.actingVersion); + builder.append('/'); + } + builder.append(SCHEMA_VERSION); + builder.append("|sbeBlockLength="); + if (actingBlockLength != BLOCK_LENGTH) + { + builder.append(actingBlockLength); + builder.append('/'); + } + builder.append(BLOCK_LENGTH); + builder.append("):"); + //Token{signal=BEGIN_FIELD, name='TransactTime', referencedName='null', description='Start of event processing time in number of nanoseconds since Unix epoch', id=60, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + //Token{signal=ENCODING, name='uInt64', referencedName='null', description='Start of event processing time in number of nanoseconds since Unix epoch', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + builder.append("transactTime="); + builder.append(transactTime()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=5799, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=12, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MultipleCharValue'}} + //Token{signal=BEGIN_SET, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=-1, version=0, deprecated=0, encodedLength=1, offset=8, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MultipleCharValue'}} + builder.append("matchEventIndicator="); + builder.append(matchEventIndicator()); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoMDEntries', referencedName='null', description='Number of entries in Market Data message', id=268, version=0, deprecated=0, encodedLength=32, offset=11, componentTokenCount=46, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noMDEntries=["); + NoMDEntriesDecoder noMDEntries = noMDEntries(); + if (noMDEntries.count() > 0) + { + while (noMDEntries.hasNext()) + { + noMDEntries.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoOrderIDEntries', referencedName='null', description='Number of OrderID entries', id=37705, version=7, deprecated=0, encodedLength=24, offset=-1, componentTokenCount=25, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noOrderIDEntries=["); + NoOrderIDEntriesDecoder noOrderIDEntries = noOrderIDEntries(); + if (noOrderIDEntries.count() > 0) + { + while (noOrderIDEntries.hasNext()) + { + noOrderIDEntries.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + + limit(originalLimit); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshBook32Encoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshBook32Encoder.java new file mode 100644 index 0000000..98cba86 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshBook32Encoder.java @@ -0,0 +1,629 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDIncrementalRefreshBook32Encoder"}) +@SuppressWarnings("all") +public class MDIncrementalRefreshBook32Encoder +{ + public static final int BLOCK_LENGTH = 11; + public static final int TEMPLATE_ID = 32; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final MDIncrementalRefreshBook32Encoder parentMessage = this; + private MutableDirectBuffer buffer; + protected int offset; + protected int limit; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "X"; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public MDIncrementalRefreshBook32Encoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + limit(offset + BLOCK_LENGTH); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int transactTimeEncodingOffset() + { + return 0; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public MDIncrementalRefreshBook32Encoder transactTime(final long value) + { + buffer.putLong(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int matchEventIndicatorEncodingOffset() + { + return 8; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + private final MatchEventIndicatorEncoder matchEventIndicator = new MatchEventIndicatorEncoder(); + + public MatchEventIndicatorEncoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 8); + return matchEventIndicator; + } + + private final NoMDEntriesEncoder noMDEntries = new NoMDEntriesEncoder(); + + public static long noMDEntriesId() + { + return 268; + } + + public NoMDEntriesEncoder noMDEntriesCount(final int count) + { + noMDEntries.wrap(parentMessage, buffer, count); + return noMDEntries; + } + + public static class NoMDEntriesEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private MDIncrementalRefreshBook32Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDIncrementalRefreshBook32Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)32); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 32; + } + + public NoMDEntriesEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int mDEntryPxEncodingOffset() + { + return 0; + } + + public static int mDEntryPxEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder mDEntryPx = new PRICENULLEncoder(); + + public PRICENULLEncoder mDEntryPx() + { + mDEntryPx.wrap(buffer, offset + 0); + return mDEntryPx; + } + + public static int mDEntrySizeEncodingOffset() + { + return 8; + } + + public static int mDEntrySizeEncodingLength() + { + return 4; + } + + public static int mDEntrySizeNullValue() + { + return 2147483647; + } + + public static int mDEntrySizeMinValue() + { + return -2147483647; + } + + public static int mDEntrySizeMaxValue() + { + return 2147483647; + } + + public NoMDEntriesEncoder mDEntrySize(final int value) + { + buffer.putInt(offset + 8, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int securityIDEncodingOffset() + { + return 12; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public NoMDEntriesEncoder securityID(final int value) + { + buffer.putInt(offset + 12, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int rptSeqEncodingOffset() + { + return 16; + } + + public static int rptSeqEncodingLength() + { + return 4; + } + + public static long rptSeqNullValue() + { + return 4294967294L; + } + + public static long rptSeqMinValue() + { + return 0L; + } + + public static long rptSeqMaxValue() + { + return 4294967293L; + } + + public NoMDEntriesEncoder rptSeq(final long value) + { + buffer.putInt(offset + 16, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int numberOfOrdersEncodingOffset() + { + return 20; + } + + public static int numberOfOrdersEncodingLength() + { + return 4; + } + + public static int numberOfOrdersNullValue() + { + return 2147483647; + } + + public static int numberOfOrdersMinValue() + { + return -2147483647; + } + + public static int numberOfOrdersMaxValue() + { + return 2147483647; + } + + public NoMDEntriesEncoder numberOfOrders(final int value) + { + buffer.putInt(offset + 20, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int mDPriceLevelEncodingOffset() + { + return 24; + } + + public static int mDPriceLevelEncodingLength() + { + return 1; + } + + public static short mDPriceLevelNullValue() + { + return (short)255; + } + + public static short mDPriceLevelMinValue() + { + return (short)0; + } + + public static short mDPriceLevelMaxValue() + { + return (short)254; + } + + public NoMDEntriesEncoder mDPriceLevel(final short value) + { + buffer.putByte(offset + 24, (byte)value); + return this; + } + + + public static int mDUpdateActionEncodingOffset() + { + return 25; + } + + public static int mDUpdateActionEncodingLength() + { + return 1; + } + + public NoMDEntriesEncoder mDUpdateAction(final MDUpdateAction value) + { + buffer.putByte(offset + 25, (byte)value.value()); + return this; + } + + public static int mDEntryTypeEncodingOffset() + { + return 26; + } + + public static int mDEntryTypeEncodingLength() + { + return 1; + } + + public NoMDEntriesEncoder mDEntryType(final MDEntryTypeBook value) + { + buffer.putByte(offset + 26, value.value()); + return this; + } + } + + private final NoOrderIDEntriesEncoder noOrderIDEntries = new NoOrderIDEntriesEncoder(); + + public static long noOrderIDEntriesId() + { + return 37705; + } + + public NoOrderIDEntriesEncoder noOrderIDEntriesCount(final int count) + { + noOrderIDEntries.wrap(parentMessage, buffer, count); + return noOrderIDEntries; + } + + public static class NoOrderIDEntriesEncoder + { + private static final int HEADER_SIZE = 8; + private final GroupSize8ByteEncoder dimensions = new GroupSize8ByteEncoder(); + private MDIncrementalRefreshBook32Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDIncrementalRefreshBook32Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)24); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 24; + } + + public NoOrderIDEntriesEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int orderIDEncodingOffset() + { + return 0; + } + + public static int orderIDEncodingLength() + { + return 8; + } + + public static long orderIDNullValue() + { + return 0xffffffffffffffffL; + } + + public static long orderIDMinValue() + { + return 0x0L; + } + + public static long orderIDMaxValue() + { + return 0xfffffffffffffffeL; + } + + public NoOrderIDEntriesEncoder orderID(final long value) + { + buffer.putLong(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int mDOrderPriorityEncodingOffset() + { + return 8; + } + + public static int mDOrderPriorityEncodingLength() + { + return 8; + } + + public static long mDOrderPriorityNullValue() + { + return 0xffffffffffffffffL; + } + + public static long mDOrderPriorityMinValue() + { + return 0x0L; + } + + public static long mDOrderPriorityMaxValue() + { + return 0xfffffffffffffffeL; + } + + public NoOrderIDEntriesEncoder mDOrderPriority(final long value) + { + buffer.putLong(offset + 8, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int mDDisplayQtyEncodingOffset() + { + return 16; + } + + public static int mDDisplayQtyEncodingLength() + { + return 4; + } + + public static int mDDisplayQtyNullValue() + { + return 2147483647; + } + + public static int mDDisplayQtyMinValue() + { + return -2147483647; + } + + public static int mDDisplayQtyMaxValue() + { + return 2147483647; + } + + public NoOrderIDEntriesEncoder mDDisplayQty(final int value) + { + buffer.putInt(offset + 16, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int referenceIDEncodingOffset() + { + return 20; + } + + public static int referenceIDEncodingLength() + { + return 1; + } + + public static short referenceIDNullValue() + { + return (short)255; + } + + public static short referenceIDMinValue() + { + return (short)0; + } + + public static short referenceIDMaxValue() + { + return (short)254; + } + + public NoOrderIDEntriesEncoder referenceID(final short value) + { + buffer.putByte(offset + 20, (byte)value); + return this; + } + + + public static int orderUpdateActionEncodingOffset() + { + return 21; + } + + public static int orderUpdateActionEncodingLength() + { + return 1; + } + + public NoOrderIDEntriesEncoder orderUpdateAction(final OrderUpdateAction value) + { + buffer.putByte(offset + 21, (byte)value.value()); + return this; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + MDIncrementalRefreshBook32Decoder writer = new MDIncrementalRefreshBook32Decoder(); + writer.wrap(buffer, offset, BLOCK_LENGTH, SCHEMA_VERSION); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshDailyStatistics33Decoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshDailyStatistics33Decoder.java new file mode 100644 index 0000000..6957ffb --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshDailyStatistics33Decoder.java @@ -0,0 +1,747 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDIncrementalRefreshDailyStatistics33Decoder"}) +@SuppressWarnings("all") +public class MDIncrementalRefreshDailyStatistics33Decoder +{ + public static final int BLOCK_LENGTH = 11; + public static final int TEMPLATE_ID = 33; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final MDIncrementalRefreshDailyStatistics33Decoder parentMessage = this; + private DirectBuffer buffer; + protected int offset; + protected int limit; + protected int actingBlockLength; + protected int actingVersion; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "X"; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public MDIncrementalRefreshDailyStatistics33Decoder wrap( + final DirectBuffer buffer, final int offset, final int actingBlockLength, final int actingVersion) + { + this.buffer = buffer; + this.offset = offset; + this.actingBlockLength = actingBlockLength; + this.actingVersion = actingVersion; + limit(offset + actingBlockLength); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int transactTimeId() + { + return 60; + } + + public static int transactTimeSinceVersion() + { + return 0; + } + + public static int transactTimeEncodingOffset() + { + return 0; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static String transactTimeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "UTCTimestamp"; + } + + return ""; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long transactTime() + { + return buffer.getLong(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int matchEventIndicatorId() + { + return 5799; + } + + public static int matchEventIndicatorSinceVersion() + { + return 0; + } + + public static int matchEventIndicatorEncodingOffset() + { + return 8; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + public static String matchEventIndicatorMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MultipleCharValue"; + } + + return ""; + } + + private final MatchEventIndicatorDecoder matchEventIndicator = new MatchEventIndicatorDecoder(); + + public MatchEventIndicatorDecoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 8); + return matchEventIndicator; + } + + private final NoMDEntriesDecoder noMDEntries = new NoMDEntriesDecoder(); + + public static long noMDEntriesDecoderId() + { + return 268; + } + + public static int noMDEntriesDecoderSinceVersion() + { + return 0; + } + + public NoMDEntriesDecoder noMDEntries() + { + noMDEntries.wrap(parentMessage, buffer); + return noMDEntries; + } + + public static class NoMDEntriesDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private MDIncrementalRefreshDailyStatistics33Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDIncrementalRefreshDailyStatistics33Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 32; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoMDEntriesDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int mDEntryPxId() + { + return 270; + } + + public static int mDEntryPxSinceVersion() + { + return 0; + } + + public static int mDEntryPxEncodingOffset() + { + return 0; + } + + public static int mDEntryPxEncodingLength() + { + return 8; + } + + public static String mDEntryPxMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder mDEntryPx = new PRICENULLDecoder(); + + public PRICENULLDecoder mDEntryPx() + { + mDEntryPx.wrap(buffer, offset + 0); + return mDEntryPx; + } + + public static int mDEntrySizeId() + { + return 271; + } + + public static int mDEntrySizeSinceVersion() + { + return 0; + } + + public static int mDEntrySizeEncodingOffset() + { + return 8; + } + + public static int mDEntrySizeEncodingLength() + { + return 4; + } + + public static String mDEntrySizeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static int mDEntrySizeNullValue() + { + return 2147483647; + } + + public static int mDEntrySizeMinValue() + { + return -2147483647; + } + + public static int mDEntrySizeMaxValue() + { + return 2147483647; + } + + public int mDEntrySize() + { + return buffer.getInt(offset + 8, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int securityIDId() + { + return 48; + } + + public static int securityIDSinceVersion() + { + return 0; + } + + public static int securityIDEncodingOffset() + { + return 12; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static String securityIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public int securityID() + { + return buffer.getInt(offset + 12, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int rptSeqId() + { + return 83; + } + + public static int rptSeqSinceVersion() + { + return 0; + } + + public static int rptSeqEncodingOffset() + { + return 16; + } + + public static int rptSeqEncodingLength() + { + return 4; + } + + public static String rptSeqMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static long rptSeqNullValue() + { + return 4294967294L; + } + + public static long rptSeqMinValue() + { + return 0L; + } + + public static long rptSeqMaxValue() + { + return 4294967293L; + } + + public long rptSeq() + { + return (buffer.getInt(offset + 16, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + public static int tradingReferenceDateId() + { + return 5796; + } + + public static int tradingReferenceDateSinceVersion() + { + return 0; + } + + public static int tradingReferenceDateEncodingOffset() + { + return 20; + } + + public static int tradingReferenceDateEncodingLength() + { + return 2; + } + + public static String tradingReferenceDateMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "LocalMktDate"; + } + + return ""; + } + + public static int tradingReferenceDateNullValue() + { + return 65535; + } + + public static int tradingReferenceDateMinValue() + { + return 0; + } + + public static int tradingReferenceDateMaxValue() + { + return 65534; + } + + public int tradingReferenceDate() + { + return (buffer.getShort(offset + 20, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); + } + + + public static int settlPriceTypeId() + { + return 731; + } + + public static int settlPriceTypeSinceVersion() + { + return 0; + } + + public static int settlPriceTypeEncodingOffset() + { + return 22; + } + + public static int settlPriceTypeEncodingLength() + { + return 1; + } + + public static String settlPriceTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MultipleCharValue"; + } + + return ""; + } + + private final SettlPriceTypeDecoder settlPriceType = new SettlPriceTypeDecoder(); + + public SettlPriceTypeDecoder settlPriceType() + { + settlPriceType.wrap(buffer, offset + 22); + return settlPriceType; + } + + public static int mDUpdateActionId() + { + return 279; + } + + public static int mDUpdateActionSinceVersion() + { + return 0; + } + + public static int mDUpdateActionEncodingOffset() + { + return 23; + } + + public static int mDUpdateActionEncodingLength() + { + return 1; + } + + public static String mDUpdateActionMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public MDUpdateAction mDUpdateAction() + { + return MDUpdateAction.get(((short)(buffer.getByte(offset + 23) & 0xFF))); + } + + + public static int mDEntryTypeId() + { + return 269; + } + + public static int mDEntryTypeSinceVersion() + { + return 0; + } + + public static int mDEntryTypeEncodingOffset() + { + return 24; + } + + public static int mDEntryTypeEncodingLength() + { + return 1; + } + + public static String mDEntryTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public MDEntryTypeDailyStatistics mDEntryType() + { + return MDEntryTypeDailyStatistics.get(buffer.getByte(offset + 24)); + } + + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='MDEntryPx', referencedName='null', description='Market Data entry price', id=270, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Market Data entry price', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("mDEntryPx="); + mDEntryPx().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDEntrySize', referencedName='null', description='Market Data entry size', id=271, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='Int32NULL', referencedName='null', description='Market Data entry size', id=-1, version=0, deprecated=0, encodedLength=4, offset=8, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=2147483647, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("mDEntrySize="); + builder.append(mDEntrySize()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityID', referencedName='null', description='Security ID ', id=48, version=0, deprecated=0, encodedLength=0, offset=12, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32', referencedName='null', description='Security ID ', id=-1, version=0, deprecated=0, encodedLength=4, offset=12, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("securityID="); + builder.append(securityID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='RptSeq', referencedName='null', description='Market Data entry sequence number per instrument update', id=83, version=0, deprecated=0, encodedLength=0, offset=16, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt32', referencedName='null', description='Market Data entry sequence number per instrument update', id=-1, version=0, deprecated=0, encodedLength=4, offset=16, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("rptSeq="); + builder.append(rptSeq()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='TradingReferenceDate', referencedName='null', description='Indicates trade session date corresponding to a statistic entry', id=5796, version=0, deprecated=0, encodedLength=0, offset=20, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='LocalMktDate'}} + //Token{signal=ENCODING, name='LocalMktDate', referencedName='null', description='Indicates trade session date corresponding to a statistic entry', id=-1, version=0, deprecated=0, encodedLength=2, offset=20, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT16, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=65535, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='LocalMktDate'}} + builder.append("tradingReferenceDate="); + builder.append(tradingReferenceDate()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SettlPriceType', referencedName='null', description='Bitmap field of eight Boolean type indicators representing settlement price type', id=731, version=0, deprecated=0, encodedLength=0, offset=22, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MultipleCharValue'}} + //Token{signal=BEGIN_SET, name='SettlPriceType', referencedName='null', description='Bitmap field of eight Boolean type indicators representing settlement price type', id=-1, version=0, deprecated=0, encodedLength=1, offset=22, componentTokenCount=8, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MultipleCharValue'}} + builder.append("settlPriceType="); + builder.append(settlPriceType()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDUpdateAction', referencedName='null', description='Market Data update action', id=279, version=0, deprecated=0, encodedLength=0, offset=23, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='MDUpdateAction', referencedName='null', description='Market Data update action', id=-1, version=0, deprecated=0, encodedLength=1, offset=23, componentTokenCount=8, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("mDUpdateAction="); + builder.append(mDUpdateAction()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDEntryType', referencedName='null', description='Market Data entry type', id=269, version=0, deprecated=0, encodedLength=0, offset=24, componentTokenCount=8, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=BEGIN_ENUM, name='MDEntryTypeDailyStatistics', referencedName='null', description='Market Data entry type', id=-1, version=0, deprecated=0, encodedLength=1, offset=24, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='char'}} + builder.append("mDEntryType="); + builder.append(mDEntryType()); + builder.append(')'); + return builder; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + final int originalLimit = limit(); + limit(offset + actingBlockLength); + builder.append("[MDIncrementalRefreshDailyStatistics33](sbeTemplateId="); + builder.append(TEMPLATE_ID); + builder.append("|sbeSchemaId="); + builder.append(SCHEMA_ID); + builder.append("|sbeSchemaVersion="); + if (parentMessage.actingVersion != SCHEMA_VERSION) + { + builder.append(parentMessage.actingVersion); + builder.append('/'); + } + builder.append(SCHEMA_VERSION); + builder.append("|sbeBlockLength="); + if (actingBlockLength != BLOCK_LENGTH) + { + builder.append(actingBlockLength); + builder.append('/'); + } + builder.append(BLOCK_LENGTH); + builder.append("):"); + //Token{signal=BEGIN_FIELD, name='TransactTime', referencedName='null', description='Start of event processing time in number of nanoseconds since Unix epoch', id=60, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + //Token{signal=ENCODING, name='uInt64', referencedName='null', description='Start of event processing time in number of nanoseconds since Unix epoch', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + builder.append("transactTime="); + builder.append(transactTime()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=5799, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=12, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MultipleCharValue'}} + //Token{signal=BEGIN_SET, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=-1, version=0, deprecated=0, encodedLength=1, offset=8, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MultipleCharValue'}} + builder.append("matchEventIndicator="); + builder.append(matchEventIndicator()); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoMDEntries', referencedName='null', description='Number of entries in Market Data message', id=268, version=0, deprecated=0, encodedLength=32, offset=11, componentTokenCount=52, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noMDEntries=["); + NoMDEntriesDecoder noMDEntries = noMDEntries(); + if (noMDEntries.count() > 0) + { + while (noMDEntries.hasNext()) + { + noMDEntries.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + + limit(originalLimit); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshDailyStatistics33Encoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshDailyStatistics33Encoder.java new file mode 100644 index 0000000..c2de448 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshDailyStatistics33Encoder.java @@ -0,0 +1,405 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDIncrementalRefreshDailyStatistics33Encoder"}) +@SuppressWarnings("all") +public class MDIncrementalRefreshDailyStatistics33Encoder +{ + public static final int BLOCK_LENGTH = 11; + public static final int TEMPLATE_ID = 33; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final MDIncrementalRefreshDailyStatistics33Encoder parentMessage = this; + private MutableDirectBuffer buffer; + protected int offset; + protected int limit; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "X"; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public MDIncrementalRefreshDailyStatistics33Encoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + limit(offset + BLOCK_LENGTH); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int transactTimeEncodingOffset() + { + return 0; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public MDIncrementalRefreshDailyStatistics33Encoder transactTime(final long value) + { + buffer.putLong(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int matchEventIndicatorEncodingOffset() + { + return 8; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + private final MatchEventIndicatorEncoder matchEventIndicator = new MatchEventIndicatorEncoder(); + + public MatchEventIndicatorEncoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 8); + return matchEventIndicator; + } + + private final NoMDEntriesEncoder noMDEntries = new NoMDEntriesEncoder(); + + public static long noMDEntriesId() + { + return 268; + } + + public NoMDEntriesEncoder noMDEntriesCount(final int count) + { + noMDEntries.wrap(parentMessage, buffer, count); + return noMDEntries; + } + + public static class NoMDEntriesEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private MDIncrementalRefreshDailyStatistics33Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDIncrementalRefreshDailyStatistics33Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)32); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 32; + } + + public NoMDEntriesEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int mDEntryPxEncodingOffset() + { + return 0; + } + + public static int mDEntryPxEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder mDEntryPx = new PRICENULLEncoder(); + + public PRICENULLEncoder mDEntryPx() + { + mDEntryPx.wrap(buffer, offset + 0); + return mDEntryPx; + } + + public static int mDEntrySizeEncodingOffset() + { + return 8; + } + + public static int mDEntrySizeEncodingLength() + { + return 4; + } + + public static int mDEntrySizeNullValue() + { + return 2147483647; + } + + public static int mDEntrySizeMinValue() + { + return -2147483647; + } + + public static int mDEntrySizeMaxValue() + { + return 2147483647; + } + + public NoMDEntriesEncoder mDEntrySize(final int value) + { + buffer.putInt(offset + 8, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int securityIDEncodingOffset() + { + return 12; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public NoMDEntriesEncoder securityID(final int value) + { + buffer.putInt(offset + 12, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int rptSeqEncodingOffset() + { + return 16; + } + + public static int rptSeqEncodingLength() + { + return 4; + } + + public static long rptSeqNullValue() + { + return 4294967294L; + } + + public static long rptSeqMinValue() + { + return 0L; + } + + public static long rptSeqMaxValue() + { + return 4294967293L; + } + + public NoMDEntriesEncoder rptSeq(final long value) + { + buffer.putInt(offset + 16, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int tradingReferenceDateEncodingOffset() + { + return 20; + } + + public static int tradingReferenceDateEncodingLength() + { + return 2; + } + + public static int tradingReferenceDateNullValue() + { + return 65535; + } + + public static int tradingReferenceDateMinValue() + { + return 0; + } + + public static int tradingReferenceDateMaxValue() + { + return 65534; + } + + public NoMDEntriesEncoder tradingReferenceDate(final int value) + { + buffer.putShort(offset + 20, (short)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int settlPriceTypeEncodingOffset() + { + return 22; + } + + public static int settlPriceTypeEncodingLength() + { + return 1; + } + + private final SettlPriceTypeEncoder settlPriceType = new SettlPriceTypeEncoder(); + + public SettlPriceTypeEncoder settlPriceType() + { + settlPriceType.wrap(buffer, offset + 22); + return settlPriceType; + } + + public static int mDUpdateActionEncodingOffset() + { + return 23; + } + + public static int mDUpdateActionEncodingLength() + { + return 1; + } + + public NoMDEntriesEncoder mDUpdateAction(final MDUpdateAction value) + { + buffer.putByte(offset + 23, (byte)value.value()); + return this; + } + + public static int mDEntryTypeEncodingOffset() + { + return 24; + } + + public static int mDEntryTypeEncodingLength() + { + return 1; + } + + public NoMDEntriesEncoder mDEntryType(final MDEntryTypeDailyStatistics value) + { + buffer.putByte(offset + 24, value.value()); + return this; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + MDIncrementalRefreshDailyStatistics33Decoder writer = new MDIncrementalRefreshDailyStatistics33Decoder(); + writer.wrap(buffer, offset, BLOCK_LENGTH, SCHEMA_VERSION); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshLimitsBanding34Decoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshLimitsBanding34Decoder.java new file mode 100644 index 0000000..148c402 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshLimitsBanding34Decoder.java @@ -0,0 +1,714 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDIncrementalRefreshLimitsBanding34Decoder"}) +@SuppressWarnings("all") +public class MDIncrementalRefreshLimitsBanding34Decoder +{ + public static final int BLOCK_LENGTH = 11; + public static final int TEMPLATE_ID = 34; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final MDIncrementalRefreshLimitsBanding34Decoder parentMessage = this; + private DirectBuffer buffer; + protected int offset; + protected int limit; + protected int actingBlockLength; + protected int actingVersion; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "X"; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public MDIncrementalRefreshLimitsBanding34Decoder wrap( + final DirectBuffer buffer, final int offset, final int actingBlockLength, final int actingVersion) + { + this.buffer = buffer; + this.offset = offset; + this.actingBlockLength = actingBlockLength; + this.actingVersion = actingVersion; + limit(offset + actingBlockLength); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int transactTimeId() + { + return 60; + } + + public static int transactTimeSinceVersion() + { + return 0; + } + + public static int transactTimeEncodingOffset() + { + return 0; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static String transactTimeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "UTCTimestamp"; + } + + return ""; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long transactTime() + { + return buffer.getLong(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int matchEventIndicatorId() + { + return 5799; + } + + public static int matchEventIndicatorSinceVersion() + { + return 0; + } + + public static int matchEventIndicatorEncodingOffset() + { + return 8; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + public static String matchEventIndicatorMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MultipleCharValue"; + } + + return ""; + } + + private final MatchEventIndicatorDecoder matchEventIndicator = new MatchEventIndicatorDecoder(); + + public MatchEventIndicatorDecoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 8); + return matchEventIndicator; + } + + private final NoMDEntriesDecoder noMDEntries = new NoMDEntriesDecoder(); + + public static long noMDEntriesDecoderId() + { + return 268; + } + + public static int noMDEntriesDecoderSinceVersion() + { + return 0; + } + + public NoMDEntriesDecoder noMDEntries() + { + noMDEntries.wrap(parentMessage, buffer); + return noMDEntries; + } + + public static class NoMDEntriesDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private MDIncrementalRefreshLimitsBanding34Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDIncrementalRefreshLimitsBanding34Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 32; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoMDEntriesDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int highLimitPriceId() + { + return 1149; + } + + public static int highLimitPriceSinceVersion() + { + return 0; + } + + public static int highLimitPriceEncodingOffset() + { + return 0; + } + + public static int highLimitPriceEncodingLength() + { + return 8; + } + + public static String highLimitPriceMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder highLimitPrice = new PRICENULLDecoder(); + + public PRICENULLDecoder highLimitPrice() + { + highLimitPrice.wrap(buffer, offset + 0); + return highLimitPrice; + } + + public static int lowLimitPriceId() + { + return 1148; + } + + public static int lowLimitPriceSinceVersion() + { + return 0; + } + + public static int lowLimitPriceEncodingOffset() + { + return 8; + } + + public static int lowLimitPriceEncodingLength() + { + return 8; + } + + public static String lowLimitPriceMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder lowLimitPrice = new PRICENULLDecoder(); + + public PRICENULLDecoder lowLimitPrice() + { + lowLimitPrice.wrap(buffer, offset + 8); + return lowLimitPrice; + } + + public static int maxPriceVariationId() + { + return 1143; + } + + public static int maxPriceVariationSinceVersion() + { + return 0; + } + + public static int maxPriceVariationEncodingOffset() + { + return 16; + } + + public static int maxPriceVariationEncodingLength() + { + return 8; + } + + public static String maxPriceVariationMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder maxPriceVariation = new PRICENULLDecoder(); + + public PRICENULLDecoder maxPriceVariation() + { + maxPriceVariation.wrap(buffer, offset + 16); + return maxPriceVariation; + } + + public static int securityIDId() + { + return 48; + } + + public static int securityIDSinceVersion() + { + return 0; + } + + public static int securityIDEncodingOffset() + { + return 24; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static String securityIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public int securityID() + { + return buffer.getInt(offset + 24, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int rptSeqId() + { + return 83; + } + + public static int rptSeqSinceVersion() + { + return 0; + } + + public static int rptSeqEncodingOffset() + { + return 28; + } + + public static int rptSeqEncodingLength() + { + return 4; + } + + public static String rptSeqMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static long rptSeqNullValue() + { + return 4294967294L; + } + + public static long rptSeqMinValue() + { + return 0L; + } + + public static long rptSeqMaxValue() + { + return 4294967293L; + } + + public long rptSeq() + { + return (buffer.getInt(offset + 28, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + public static int mDUpdateActionId() + { + return 279; + } + + public static int mDUpdateActionSinceVersion() + { + return 0; + } + + public static int mDUpdateActionEncodingOffset() + { + return 32; + } + + public static int mDUpdateActionEncodingLength() + { + return 0; + } + + public static String mDUpdateActionMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static byte mDUpdateActionNullValue() + { + return (byte)-128; + } + + public static byte mDUpdateActionMinValue() + { + return (byte)-127; + } + + public static byte mDUpdateActionMaxValue() + { + return (byte)127; + } + + public byte mDUpdateAction() + { + return (byte)0; + } + + public static int mDEntryTypeId() + { + return 269; + } + + public static int mDEntryTypeSinceVersion() + { + return 0; + } + + public static int mDEntryTypeEncodingOffset() + { + return 32; + } + + public static int mDEntryTypeEncodingLength() + { + return 0; + } + + public static String mDEntryTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public static byte mDEntryTypeNullValue() + { + return (byte)0; + } + + public static byte mDEntryTypeMinValue() + { + return (byte)32; + } + + public static byte mDEntryTypeMaxValue() + { + return (byte)126; + } + + private static final byte[] MDENTRYTYPE_VALUE = {103}; + + public static int mDEntryTypeLength() + { + return 1; + } + + public byte mDEntryType(final int index) + { + return MDENTRYTYPE_VALUE[index]; + } + + public int getMDEntryType(final byte[] dst, final int offset, final int length) + { + final int bytesCopied = Math.min(length, 1); + System.arraycopy(MDENTRYTYPE_VALUE, 0, dst, offset, bytesCopied); + + return bytesCopied; + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='HighLimitPrice', referencedName='null', description='Upper price threshold for the instrument', id=1149, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Upper price threshold for the instrument', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("highLimitPrice="); + highLimitPrice().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='LowLimitPrice', referencedName='null', description='Lower price threshold for the instrument', id=1148, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Lower price threshold for the instrument', id=-1, version=0, deprecated=0, encodedLength=8, offset=8, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("lowLimitPrice="); + lowLimitPrice().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MaxPriceVariation', referencedName='null', description='Differential static value for price banding', id=1143, version=0, deprecated=0, encodedLength=0, offset=16, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Differential static value for price banding', id=-1, version=0, deprecated=0, encodedLength=8, offset=16, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("maxPriceVariation="); + maxPriceVariation().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityID', referencedName='null', description='Security ID ', id=48, version=0, deprecated=0, encodedLength=0, offset=24, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32', referencedName='null', description='Security ID ', id=-1, version=0, deprecated=0, encodedLength=4, offset=24, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("securityID="); + builder.append(securityID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='RptSeq', referencedName='null', description='MD Entry sequence number per instrument update', id=83, version=0, deprecated=0, encodedLength=0, offset=28, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt32', referencedName='null', description='MD Entry sequence number per instrument update', id=-1, version=0, deprecated=0, encodedLength=4, offset=28, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("rptSeq="); + builder.append(rptSeq()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDUpdateAction', referencedName='null', description='Market Data entry update action. In order to delete banding value, high or low limit, the deleted price field is populated with a NULL ', id=279, version=0, deprecated=0, encodedLength=0, offset=32, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='MDUpdateActionNew', referencedName='null', description='Market Data entry update action. In order to delete banding value, high or low limit, the deleted price field is populated with a NULL ', id=-1, version=0, deprecated=0, encodedLength=0, offset=32, componentTokenCount=1, encoding=Encoding{presence=CONSTANT, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=0, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_FIELD, name='MDEntryType', referencedName='null', description='Market Data entry type ', id=269, version=0, deprecated=0, encodedLength=0, offset=32, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=ENCODING, name='MDEntryTypeLimits', referencedName='null', description='Market Data entry type ', id=-1, version=0, deprecated=0, encodedLength=0, offset=32, componentTokenCount=1, encoding=Encoding{presence=CONSTANT, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=103, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + builder.append(')'); + return builder; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + final int originalLimit = limit(); + limit(offset + actingBlockLength); + builder.append("[MDIncrementalRefreshLimitsBanding34](sbeTemplateId="); + builder.append(TEMPLATE_ID); + builder.append("|sbeSchemaId="); + builder.append(SCHEMA_ID); + builder.append("|sbeSchemaVersion="); + if (parentMessage.actingVersion != SCHEMA_VERSION) + { + builder.append(parentMessage.actingVersion); + builder.append('/'); + } + builder.append(SCHEMA_VERSION); + builder.append("|sbeBlockLength="); + if (actingBlockLength != BLOCK_LENGTH) + { + builder.append(actingBlockLength); + builder.append('/'); + } + builder.append(BLOCK_LENGTH); + builder.append("):"); + //Token{signal=BEGIN_FIELD, name='TransactTime', referencedName='null', description='Start of event processing time in number of nanoseconds since Unix epoch', id=60, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + //Token{signal=ENCODING, name='uInt64', referencedName='null', description='Start of event processing time in number of nanoseconds since Unix epoch', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + builder.append("transactTime="); + builder.append(transactTime()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=5799, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=12, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MultipleCharValue'}} + //Token{signal=BEGIN_SET, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=-1, version=0, deprecated=0, encodedLength=1, offset=8, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MultipleCharValue'}} + builder.append("matchEventIndicator="); + builder.append(matchEventIndicator()); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoMDEntries', referencedName='null', description='Number of entries in Market Data message', id=268, version=0, deprecated=0, encodedLength=32, offset=11, componentTokenCount=36, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noMDEntries=["); + NoMDEntriesDecoder noMDEntries = noMDEntries(); + if (noMDEntries.count() > 0) + { + while (noMDEntries.hasNext()) + { + noMDEntries.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + + limit(originalLimit); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshLimitsBanding34Encoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshLimitsBanding34Encoder.java new file mode 100644 index 0000000..2d7aa5f --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshLimitsBanding34Encoder.java @@ -0,0 +1,402 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDIncrementalRefreshLimitsBanding34Encoder"}) +@SuppressWarnings("all") +public class MDIncrementalRefreshLimitsBanding34Encoder +{ + public static final int BLOCK_LENGTH = 11; + public static final int TEMPLATE_ID = 34; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final MDIncrementalRefreshLimitsBanding34Encoder parentMessage = this; + private MutableDirectBuffer buffer; + protected int offset; + protected int limit; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "X"; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public MDIncrementalRefreshLimitsBanding34Encoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + limit(offset + BLOCK_LENGTH); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int transactTimeEncodingOffset() + { + return 0; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public MDIncrementalRefreshLimitsBanding34Encoder transactTime(final long value) + { + buffer.putLong(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int matchEventIndicatorEncodingOffset() + { + return 8; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + private final MatchEventIndicatorEncoder matchEventIndicator = new MatchEventIndicatorEncoder(); + + public MatchEventIndicatorEncoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 8); + return matchEventIndicator; + } + + private final NoMDEntriesEncoder noMDEntries = new NoMDEntriesEncoder(); + + public static long noMDEntriesId() + { + return 268; + } + + public NoMDEntriesEncoder noMDEntriesCount(final int count) + { + noMDEntries.wrap(parentMessage, buffer, count); + return noMDEntries; + } + + public static class NoMDEntriesEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private MDIncrementalRefreshLimitsBanding34Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDIncrementalRefreshLimitsBanding34Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)32); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 32; + } + + public NoMDEntriesEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int highLimitPriceEncodingOffset() + { + return 0; + } + + public static int highLimitPriceEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder highLimitPrice = new PRICENULLEncoder(); + + public PRICENULLEncoder highLimitPrice() + { + highLimitPrice.wrap(buffer, offset + 0); + return highLimitPrice; + } + + public static int lowLimitPriceEncodingOffset() + { + return 8; + } + + public static int lowLimitPriceEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder lowLimitPrice = new PRICENULLEncoder(); + + public PRICENULLEncoder lowLimitPrice() + { + lowLimitPrice.wrap(buffer, offset + 8); + return lowLimitPrice; + } + + public static int maxPriceVariationEncodingOffset() + { + return 16; + } + + public static int maxPriceVariationEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder maxPriceVariation = new PRICENULLEncoder(); + + public PRICENULLEncoder maxPriceVariation() + { + maxPriceVariation.wrap(buffer, offset + 16); + return maxPriceVariation; + } + + public static int securityIDEncodingOffset() + { + return 24; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public NoMDEntriesEncoder securityID(final int value) + { + buffer.putInt(offset + 24, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int rptSeqEncodingOffset() + { + return 28; + } + + public static int rptSeqEncodingLength() + { + return 4; + } + + public static long rptSeqNullValue() + { + return 4294967294L; + } + + public static long rptSeqMinValue() + { + return 0L; + } + + public static long rptSeqMaxValue() + { + return 4294967293L; + } + + public NoMDEntriesEncoder rptSeq(final long value) + { + buffer.putInt(offset + 28, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int mDUpdateActionEncodingOffset() + { + return 32; + } + + public static int mDUpdateActionEncodingLength() + { + return 0; + } + + public static byte mDUpdateActionNullValue() + { + return (byte)-128; + } + + public static byte mDUpdateActionMinValue() + { + return (byte)-127; + } + + public static byte mDUpdateActionMaxValue() + { + return (byte)127; + } + + public byte mDUpdateAction() + { + return (byte)0; + } + + public static int mDEntryTypeEncodingOffset() + { + return 32; + } + + public static int mDEntryTypeEncodingLength() + { + return 0; + } + + public static byte mDEntryTypeNullValue() + { + return (byte)0; + } + + public static byte mDEntryTypeMinValue() + { + return (byte)32; + } + + public static byte mDEntryTypeMaxValue() + { + return (byte)126; + } + + private static final byte[] MDENTRYTYPE_VALUE = {103}; + + public static int mDEntryTypeLength() + { + return 1; + } + + public byte mDEntryType(final int index) + { + return MDENTRYTYPE_VALUE[index]; + } + + public int getMDEntryType(final byte[] dst, final int offset, final int length) + { + final int bytesCopied = Math.min(length, 1); + System.arraycopy(MDENTRYTYPE_VALUE, 0, dst, offset, bytesCopied); + + return bytesCopied; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + MDIncrementalRefreshLimitsBanding34Decoder writer = new MDIncrementalRefreshLimitsBanding34Decoder(); + writer.wrap(buffer, offset, BLOCK_LENGTH, SCHEMA_VERSION); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshOrderBook43Decoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshOrderBook43Decoder.java new file mode 100644 index 0000000..8c4ac67 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshOrderBook43Decoder.java @@ -0,0 +1,702 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDIncrementalRefreshOrderBook43Decoder"}) +@SuppressWarnings("all") +public class MDIncrementalRefreshOrderBook43Decoder +{ + public static final int BLOCK_LENGTH = 11; + public static final int TEMPLATE_ID = 43; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final MDIncrementalRefreshOrderBook43Decoder parentMessage = this; + private DirectBuffer buffer; + protected int offset; + protected int limit; + protected int actingBlockLength; + protected int actingVersion; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "X"; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public MDIncrementalRefreshOrderBook43Decoder wrap( + final DirectBuffer buffer, final int offset, final int actingBlockLength, final int actingVersion) + { + this.buffer = buffer; + this.offset = offset; + this.actingBlockLength = actingBlockLength; + this.actingVersion = actingVersion; + limit(offset + actingBlockLength); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int transactTimeId() + { + return 60; + } + + public static int transactTimeSinceVersion() + { + return 0; + } + + public static int transactTimeEncodingOffset() + { + return 0; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static String transactTimeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "UTCTimestamp"; + } + + return ""; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long transactTime() + { + return buffer.getLong(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int matchEventIndicatorId() + { + return 5799; + } + + public static int matchEventIndicatorSinceVersion() + { + return 0; + } + + public static int matchEventIndicatorEncodingOffset() + { + return 8; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + public static String matchEventIndicatorMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MultipleCharValue"; + } + + return ""; + } + + private final MatchEventIndicatorDecoder matchEventIndicator = new MatchEventIndicatorDecoder(); + + public MatchEventIndicatorDecoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 8); + return matchEventIndicator; + } + + private final NoMDEntriesDecoder noMDEntries = new NoMDEntriesDecoder(); + + public static long noMDEntriesDecoderId() + { + return 268; + } + + public static int noMDEntriesDecoderSinceVersion() + { + return 0; + } + + public NoMDEntriesDecoder noMDEntries() + { + noMDEntries.wrap(parentMessage, buffer); + return noMDEntries; + } + + public static class NoMDEntriesDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private MDIncrementalRefreshOrderBook43Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDIncrementalRefreshOrderBook43Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 40; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoMDEntriesDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int orderIDId() + { + return 37; + } + + public static int orderIDSinceVersion() + { + return 0; + } + + public static int orderIDEncodingOffset() + { + return 0; + } + + public static int orderIDEncodingLength() + { + return 8; + } + + public static String orderIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static long orderIDNullValue() + { + return 0xffffffffffffffffL; + } + + public static long orderIDMinValue() + { + return 0x0L; + } + + public static long orderIDMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long orderID() + { + return buffer.getLong(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int mDOrderPriorityId() + { + return 37707; + } + + public static int mDOrderPrioritySinceVersion() + { + return 0; + } + + public static int mDOrderPriorityEncodingOffset() + { + return 8; + } + + public static int mDOrderPriorityEncodingLength() + { + return 8; + } + + public static String mDOrderPriorityMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static long mDOrderPriorityNullValue() + { + return 0xffffffffffffffffL; + } + + public static long mDOrderPriorityMinValue() + { + return 0x0L; + } + + public static long mDOrderPriorityMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long mDOrderPriority() + { + return buffer.getLong(offset + 8, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int mDEntryPxId() + { + return 270; + } + + public static int mDEntryPxSinceVersion() + { + return 0; + } + + public static int mDEntryPxEncodingOffset() + { + return 16; + } + + public static int mDEntryPxEncodingLength() + { + return 8; + } + + public static String mDEntryPxMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder mDEntryPx = new PRICENULLDecoder(); + + public PRICENULLDecoder mDEntryPx() + { + mDEntryPx.wrap(buffer, offset + 16); + return mDEntryPx; + } + + public static int mDDisplayQtyId() + { + return 37706; + } + + public static int mDDisplayQtySinceVersion() + { + return 0; + } + + public static int mDDisplayQtyEncodingOffset() + { + return 24; + } + + public static int mDDisplayQtyEncodingLength() + { + return 4; + } + + public static String mDDisplayQtyMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static int mDDisplayQtyNullValue() + { + return 2147483647; + } + + public static int mDDisplayQtyMinValue() + { + return -2147483647; + } + + public static int mDDisplayQtyMaxValue() + { + return 2147483647; + } + + public int mDDisplayQty() + { + return buffer.getInt(offset + 24, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int securityIDId() + { + return 48; + } + + public static int securityIDSinceVersion() + { + return 0; + } + + public static int securityIDEncodingOffset() + { + return 28; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static String securityIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public int securityID() + { + return buffer.getInt(offset + 28, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int mDUpdateActionId() + { + return 279; + } + + public static int mDUpdateActionSinceVersion() + { + return 0; + } + + public static int mDUpdateActionEncodingOffset() + { + return 32; + } + + public static int mDUpdateActionEncodingLength() + { + return 1; + } + + public static String mDUpdateActionMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public MDUpdateAction mDUpdateAction() + { + return MDUpdateAction.get(((short)(buffer.getByte(offset + 32) & 0xFF))); + } + + + public static int mDEntryTypeId() + { + return 269; + } + + public static int mDEntryTypeSinceVersion() + { + return 0; + } + + public static int mDEntryTypeEncodingOffset() + { + return 33; + } + + public static int mDEntryTypeEncodingLength() + { + return 1; + } + + public static String mDEntryTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public MDEntryTypeBook mDEntryType() + { + return MDEntryTypeBook.get(buffer.getByte(offset + 33)); + } + + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='OrderID', referencedName='null', description='Order ID', id=37, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='uInt64NULL', referencedName='null', description='Order ID', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=-1, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("orderID="); + builder.append(orderID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDOrderPriority', referencedName='null', description='Order priority for execution on the order book', id=37707, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt64NULL', referencedName='null', description='Order priority for execution on the order book', id=-1, version=0, deprecated=0, encodedLength=8, offset=8, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=-1, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("mDOrderPriority="); + builder.append(mDOrderPriority()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDEntryPx', referencedName='null', description='Order price', id=270, version=0, deprecated=0, encodedLength=0, offset=16, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Order price', id=-1, version=0, deprecated=0, encodedLength=8, offset=16, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("mDEntryPx="); + mDEntryPx().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDDisplayQty', referencedName='null', description='Visible order qty', id=37706, version=0, deprecated=0, encodedLength=0, offset=24, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='Int32NULL', referencedName='null', description='Visible order qty', id=-1, version=0, deprecated=0, encodedLength=4, offset=24, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=2147483647, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("mDDisplayQty="); + builder.append(mDDisplayQty()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityID', referencedName='null', description='Security ID ', id=48, version=0, deprecated=0, encodedLength=0, offset=28, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32', referencedName='null', description='Security ID ', id=-1, version=0, deprecated=0, encodedLength=4, offset=28, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("securityID="); + builder.append(securityID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDUpdateAction', referencedName='null', description='Order book update action to be applied to the order referenced by OrderID', id=279, version=0, deprecated=0, encodedLength=0, offset=32, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='MDUpdateAction', referencedName='null', description='Order book update action to be applied to the order referenced by OrderID', id=-1, version=0, deprecated=0, encodedLength=1, offset=32, componentTokenCount=8, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("mDUpdateAction="); + builder.append(mDUpdateAction()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDEntryType', referencedName='null', description='Market Data entry type ', id=269, version=0, deprecated=0, encodedLength=0, offset=33, componentTokenCount=9, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=BEGIN_ENUM, name='MDEntryTypeBook', referencedName='null', description='Market Data entry type ', id=-1, version=0, deprecated=0, encodedLength=1, offset=33, componentTokenCount=7, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='char'}} + builder.append("mDEntryType="); + builder.append(mDEntryType()); + builder.append(')'); + return builder; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + final int originalLimit = limit(); + limit(offset + actingBlockLength); + builder.append("[MDIncrementalRefreshOrderBook43](sbeTemplateId="); + builder.append(TEMPLATE_ID); + builder.append("|sbeSchemaId="); + builder.append(SCHEMA_ID); + builder.append("|sbeSchemaVersion="); + if (parentMessage.actingVersion != SCHEMA_VERSION) + { + builder.append(parentMessage.actingVersion); + builder.append('/'); + } + builder.append(SCHEMA_VERSION); + builder.append("|sbeBlockLength="); + if (actingBlockLength != BLOCK_LENGTH) + { + builder.append(actingBlockLength); + builder.append('/'); + } + builder.append(BLOCK_LENGTH); + builder.append("):"); + //Token{signal=BEGIN_FIELD, name='TransactTime', referencedName='null', description='Start of event processing time in number of nanoseconds since Unix epoch', id=60, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + //Token{signal=ENCODING, name='uInt64', referencedName='null', description='Start of event processing time in number of nanoseconds since Unix epoch', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + builder.append("transactTime="); + builder.append(transactTime()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=5799, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=12, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MultipleCharValue'}} + //Token{signal=BEGIN_SET, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=-1, version=0, deprecated=0, encodedLength=1, offset=8, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MultipleCharValue'}} + builder.append("matchEventIndicator="); + builder.append(matchEventIndicator()); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoMDEntries', referencedName='null', description='Number of entries in Market Data message', id=268, version=0, deprecated=0, encodedLength=40, offset=11, componentTokenCount=43, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noMDEntries=["); + NoMDEntriesDecoder noMDEntries = noMDEntries(); + if (noMDEntries.count() > 0) + { + while (noMDEntries.hasNext()) + { + noMDEntries.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + + limit(originalLimit); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshOrderBook43Encoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshOrderBook43Encoder.java new file mode 100644 index 0000000..cfd1059 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshOrderBook43Encoder.java @@ -0,0 +1,387 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDIncrementalRefreshOrderBook43Encoder"}) +@SuppressWarnings("all") +public class MDIncrementalRefreshOrderBook43Encoder +{ + public static final int BLOCK_LENGTH = 11; + public static final int TEMPLATE_ID = 43; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final MDIncrementalRefreshOrderBook43Encoder parentMessage = this; + private MutableDirectBuffer buffer; + protected int offset; + protected int limit; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "X"; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public MDIncrementalRefreshOrderBook43Encoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + limit(offset + BLOCK_LENGTH); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int transactTimeEncodingOffset() + { + return 0; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public MDIncrementalRefreshOrderBook43Encoder transactTime(final long value) + { + buffer.putLong(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int matchEventIndicatorEncodingOffset() + { + return 8; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + private final MatchEventIndicatorEncoder matchEventIndicator = new MatchEventIndicatorEncoder(); + + public MatchEventIndicatorEncoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 8); + return matchEventIndicator; + } + + private final NoMDEntriesEncoder noMDEntries = new NoMDEntriesEncoder(); + + public static long noMDEntriesId() + { + return 268; + } + + public NoMDEntriesEncoder noMDEntriesCount(final int count) + { + noMDEntries.wrap(parentMessage, buffer, count); + return noMDEntries; + } + + public static class NoMDEntriesEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private MDIncrementalRefreshOrderBook43Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDIncrementalRefreshOrderBook43Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)40); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 40; + } + + public NoMDEntriesEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int orderIDEncodingOffset() + { + return 0; + } + + public static int orderIDEncodingLength() + { + return 8; + } + + public static long orderIDNullValue() + { + return 0xffffffffffffffffL; + } + + public static long orderIDMinValue() + { + return 0x0L; + } + + public static long orderIDMaxValue() + { + return 0xfffffffffffffffeL; + } + + public NoMDEntriesEncoder orderID(final long value) + { + buffer.putLong(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int mDOrderPriorityEncodingOffset() + { + return 8; + } + + public static int mDOrderPriorityEncodingLength() + { + return 8; + } + + public static long mDOrderPriorityNullValue() + { + return 0xffffffffffffffffL; + } + + public static long mDOrderPriorityMinValue() + { + return 0x0L; + } + + public static long mDOrderPriorityMaxValue() + { + return 0xfffffffffffffffeL; + } + + public NoMDEntriesEncoder mDOrderPriority(final long value) + { + buffer.putLong(offset + 8, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int mDEntryPxEncodingOffset() + { + return 16; + } + + public static int mDEntryPxEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder mDEntryPx = new PRICENULLEncoder(); + + public PRICENULLEncoder mDEntryPx() + { + mDEntryPx.wrap(buffer, offset + 16); + return mDEntryPx; + } + + public static int mDDisplayQtyEncodingOffset() + { + return 24; + } + + public static int mDDisplayQtyEncodingLength() + { + return 4; + } + + public static int mDDisplayQtyNullValue() + { + return 2147483647; + } + + public static int mDDisplayQtyMinValue() + { + return -2147483647; + } + + public static int mDDisplayQtyMaxValue() + { + return 2147483647; + } + + public NoMDEntriesEncoder mDDisplayQty(final int value) + { + buffer.putInt(offset + 24, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int securityIDEncodingOffset() + { + return 28; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public NoMDEntriesEncoder securityID(final int value) + { + buffer.putInt(offset + 28, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int mDUpdateActionEncodingOffset() + { + return 32; + } + + public static int mDUpdateActionEncodingLength() + { + return 1; + } + + public NoMDEntriesEncoder mDUpdateAction(final MDUpdateAction value) + { + buffer.putByte(offset + 32, (byte)value.value()); + return this; + } + + public static int mDEntryTypeEncodingOffset() + { + return 33; + } + + public static int mDEntryTypeEncodingLength() + { + return 1; + } + + public NoMDEntriesEncoder mDEntryType(final MDEntryTypeBook value) + { + buffer.putByte(offset + 33, value.value()); + return this; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + MDIncrementalRefreshOrderBook43Decoder writer = new MDIncrementalRefreshOrderBook43Decoder(); + writer.wrap(buffer, offset, BLOCK_LENGTH, SCHEMA_VERSION); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshSessionStatistics35Decoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshSessionStatistics35Decoder.java new file mode 100644 index 0000000..a8b2528 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshSessionStatistics35Decoder.java @@ -0,0 +1,692 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDIncrementalRefreshSessionStatistics35Decoder"}) +@SuppressWarnings("all") +public class MDIncrementalRefreshSessionStatistics35Decoder +{ + public static final int BLOCK_LENGTH = 11; + public static final int TEMPLATE_ID = 35; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final MDIncrementalRefreshSessionStatistics35Decoder parentMessage = this; + private DirectBuffer buffer; + protected int offset; + protected int limit; + protected int actingBlockLength; + protected int actingVersion; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "X"; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public MDIncrementalRefreshSessionStatistics35Decoder wrap( + final DirectBuffer buffer, final int offset, final int actingBlockLength, final int actingVersion) + { + this.buffer = buffer; + this.offset = offset; + this.actingBlockLength = actingBlockLength; + this.actingVersion = actingVersion; + limit(offset + actingBlockLength); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int transactTimeId() + { + return 60; + } + + public static int transactTimeSinceVersion() + { + return 0; + } + + public static int transactTimeEncodingOffset() + { + return 0; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static String transactTimeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "UTCTimestamp"; + } + + return ""; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long transactTime() + { + return buffer.getLong(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int matchEventIndicatorId() + { + return 5799; + } + + public static int matchEventIndicatorSinceVersion() + { + return 0; + } + + public static int matchEventIndicatorEncodingOffset() + { + return 8; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + public static String matchEventIndicatorMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MultipleCharValue"; + } + + return ""; + } + + private final MatchEventIndicatorDecoder matchEventIndicator = new MatchEventIndicatorDecoder(); + + public MatchEventIndicatorDecoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 8); + return matchEventIndicator; + } + + private final NoMDEntriesDecoder noMDEntries = new NoMDEntriesDecoder(); + + public static long noMDEntriesDecoderId() + { + return 268; + } + + public static int noMDEntriesDecoderSinceVersion() + { + return 0; + } + + public NoMDEntriesDecoder noMDEntries() + { + noMDEntries.wrap(parentMessage, buffer); + return noMDEntries; + } + + public static class NoMDEntriesDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private MDIncrementalRefreshSessionStatistics35Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDIncrementalRefreshSessionStatistics35Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 24; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoMDEntriesDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int mDEntryPxId() + { + return 270; + } + + public static int mDEntryPxSinceVersion() + { + return 0; + } + + public static int mDEntryPxEncodingOffset() + { + return 0; + } + + public static int mDEntryPxEncodingLength() + { + return 8; + } + + public static String mDEntryPxMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICEDecoder mDEntryPx = new PRICEDecoder(); + + public PRICEDecoder mDEntryPx() + { + mDEntryPx.wrap(buffer, offset + 0); + return mDEntryPx; + } + + public static int securityIDId() + { + return 48; + } + + public static int securityIDSinceVersion() + { + return 0; + } + + public static int securityIDEncodingOffset() + { + return 8; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static String securityIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public int securityID() + { + return buffer.getInt(offset + 8, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int rptSeqId() + { + return 83; + } + + public static int rptSeqSinceVersion() + { + return 0; + } + + public static int rptSeqEncodingOffset() + { + return 12; + } + + public static int rptSeqEncodingLength() + { + return 4; + } + + public static String rptSeqMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static long rptSeqNullValue() + { + return 4294967294L; + } + + public static long rptSeqMinValue() + { + return 0L; + } + + public static long rptSeqMaxValue() + { + return 4294967293L; + } + + public long rptSeq() + { + return (buffer.getInt(offset + 12, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + public static int openCloseSettlFlagId() + { + return 286; + } + + public static int openCloseSettlFlagSinceVersion() + { + return 0; + } + + public static int openCloseSettlFlagEncodingOffset() + { + return 16; + } + + public static int openCloseSettlFlagEncodingLength() + { + return 1; + } + + public static String openCloseSettlFlagMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public OpenCloseSettlFlag openCloseSettlFlag() + { + return OpenCloseSettlFlag.get(((short)(buffer.getByte(offset + 16) & 0xFF))); + } + + + public static int mDUpdateActionId() + { + return 279; + } + + public static int mDUpdateActionSinceVersion() + { + return 0; + } + + public static int mDUpdateActionEncodingOffset() + { + return 17; + } + + public static int mDUpdateActionEncodingLength() + { + return 1; + } + + public static String mDUpdateActionMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public MDUpdateAction mDUpdateAction() + { + return MDUpdateAction.get(((short)(buffer.getByte(offset + 17) & 0xFF))); + } + + + public static int mDEntryTypeId() + { + return 269; + } + + public static int mDEntryTypeSinceVersion() + { + return 0; + } + + public static int mDEntryTypeEncodingOffset() + { + return 18; + } + + public static int mDEntryTypeEncodingLength() + { + return 1; + } + + public static String mDEntryTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public MDEntryTypeStatistics mDEntryType() + { + return MDEntryTypeStatistics.get(buffer.getByte(offset + 18)); + } + + + public static int mDEntrySizeId() + { + return 271; + } + + public static int mDEntrySizeSinceVersion() + { + return 8; + } + + public static int mDEntrySizeEncodingOffset() + { + return 19; + } + + public static int mDEntrySizeEncodingLength() + { + return 4; + } + + public static String mDEntrySizeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static int mDEntrySizeNullValue() + { + return 2147483647; + } + + public static int mDEntrySizeMinValue() + { + return -2147483647; + } + + public static int mDEntrySizeMaxValue() + { + return 2147483647; + } + + public int mDEntrySize() + { + if (parentMessage.actingVersion < 8) + { + return 2147483647; + } + + return buffer.getInt(offset + 19, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='MDEntryPx', referencedName='null', description='Market Data entry price', id=270, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICE', referencedName='null', description='Market Data entry price', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("mDEntryPx="); + mDEntryPx().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityID', referencedName='null', description='Security ID ', id=48, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32', referencedName='null', description='Security ID ', id=-1, version=0, deprecated=0, encodedLength=4, offset=8, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("securityID="); + builder.append(securityID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='RptSeq', referencedName='null', description='MD Entry sequence number per instrument update', id=83, version=0, deprecated=0, encodedLength=0, offset=12, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt32', referencedName='null', description='MD Entry sequence number per instrument update', id=-1, version=0, deprecated=0, encodedLength=4, offset=12, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("rptSeq="); + builder.append(rptSeq()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='OpenCloseSettlFlag', referencedName='null', description='Flag describing IOP and Open Price entries', id=286, version=0, deprecated=0, encodedLength=0, offset=16, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='OpenCloseSettlFlag', referencedName='null', description='Flag describing IOP and Open Price entries', id=-1, version=0, deprecated=0, encodedLength=1, offset=16, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("openCloseSettlFlag="); + builder.append(openCloseSettlFlag()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDUpdateAction', referencedName='null', description='Market Data update action ', id=279, version=0, deprecated=0, encodedLength=0, offset=17, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='MDUpdateAction', referencedName='null', description='Market Data update action ', id=-1, version=0, deprecated=0, encodedLength=1, offset=17, componentTokenCount=8, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("mDUpdateAction="); + builder.append(mDUpdateAction()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDEntryType', referencedName='null', description='Market Data entry type ', id=269, version=0, deprecated=0, encodedLength=0, offset=18, componentTokenCount=9, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=BEGIN_ENUM, name='MDEntryTypeStatistics', referencedName='null', description='Market Data entry type ', id=-1, version=0, deprecated=0, encodedLength=1, offset=18, componentTokenCount=7, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='char'}} + builder.append("mDEntryType="); + builder.append(mDEntryType()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDEntrySize', referencedName='null', description='Indicative Opening Quantity ', id=271, version=8, deprecated=0, encodedLength=0, offset=19, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='Int32NULL', referencedName='null', description='Indicative Opening Quantity ', id=-1, version=8, deprecated=0, encodedLength=4, offset=19, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=2147483647, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("mDEntrySize="); + builder.append(mDEntrySize()); + builder.append(')'); + return builder; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + final int originalLimit = limit(); + limit(offset + actingBlockLength); + builder.append("[MDIncrementalRefreshSessionStatistics35](sbeTemplateId="); + builder.append(TEMPLATE_ID); + builder.append("|sbeSchemaId="); + builder.append(SCHEMA_ID); + builder.append("|sbeSchemaVersion="); + if (parentMessage.actingVersion != SCHEMA_VERSION) + { + builder.append(parentMessage.actingVersion); + builder.append('/'); + } + builder.append(SCHEMA_VERSION); + builder.append("|sbeBlockLength="); + if (actingBlockLength != BLOCK_LENGTH) + { + builder.append(actingBlockLength); + builder.append('/'); + } + builder.append(BLOCK_LENGTH); + builder.append("):"); + //Token{signal=BEGIN_FIELD, name='TransactTime', referencedName='null', description='Start of event processing time in number of nanoseconds since Unix epoch', id=60, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + //Token{signal=ENCODING, name='uInt64', referencedName='null', description='Start of event processing time in number of nanoseconds since Unix epoch', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + builder.append("transactTime="); + builder.append(transactTime()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=5799, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=12, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MultipleCharValue'}} + //Token{signal=BEGIN_SET, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=-1, version=0, deprecated=0, encodedLength=1, offset=8, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MultipleCharValue'}} + builder.append("matchEventIndicator="); + builder.append(matchEventIndicator()); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoMDEntries', referencedName='null', description='Number of entries in Market Data message', id=268, version=0, deprecated=0, encodedLength=24, offset=11, componentTokenCount=46, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noMDEntries=["); + NoMDEntriesDecoder noMDEntries = noMDEntries(); + if (noMDEntries.count() > 0) + { + while (noMDEntries.hasNext()) + { + noMDEntries.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + + limit(originalLimit); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshSessionStatistics35Encoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshSessionStatistics35Encoder.java new file mode 100644 index 0000000..790932d --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshSessionStatistics35Encoder.java @@ -0,0 +1,371 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDIncrementalRefreshSessionStatistics35Encoder"}) +@SuppressWarnings("all") +public class MDIncrementalRefreshSessionStatistics35Encoder +{ + public static final int BLOCK_LENGTH = 11; + public static final int TEMPLATE_ID = 35; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final MDIncrementalRefreshSessionStatistics35Encoder parentMessage = this; + private MutableDirectBuffer buffer; + protected int offset; + protected int limit; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "X"; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public MDIncrementalRefreshSessionStatistics35Encoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + limit(offset + BLOCK_LENGTH); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int transactTimeEncodingOffset() + { + return 0; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public MDIncrementalRefreshSessionStatistics35Encoder transactTime(final long value) + { + buffer.putLong(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int matchEventIndicatorEncodingOffset() + { + return 8; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + private final MatchEventIndicatorEncoder matchEventIndicator = new MatchEventIndicatorEncoder(); + + public MatchEventIndicatorEncoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 8); + return matchEventIndicator; + } + + private final NoMDEntriesEncoder noMDEntries = new NoMDEntriesEncoder(); + + public static long noMDEntriesId() + { + return 268; + } + + public NoMDEntriesEncoder noMDEntriesCount(final int count) + { + noMDEntries.wrap(parentMessage, buffer, count); + return noMDEntries; + } + + public static class NoMDEntriesEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private MDIncrementalRefreshSessionStatistics35Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDIncrementalRefreshSessionStatistics35Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)24); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 24; + } + + public NoMDEntriesEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int mDEntryPxEncodingOffset() + { + return 0; + } + + public static int mDEntryPxEncodingLength() + { + return 8; + } + + private final PRICEEncoder mDEntryPx = new PRICEEncoder(); + + public PRICEEncoder mDEntryPx() + { + mDEntryPx.wrap(buffer, offset + 0); + return mDEntryPx; + } + + public static int securityIDEncodingOffset() + { + return 8; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public NoMDEntriesEncoder securityID(final int value) + { + buffer.putInt(offset + 8, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int rptSeqEncodingOffset() + { + return 12; + } + + public static int rptSeqEncodingLength() + { + return 4; + } + + public static long rptSeqNullValue() + { + return 4294967294L; + } + + public static long rptSeqMinValue() + { + return 0L; + } + + public static long rptSeqMaxValue() + { + return 4294967293L; + } + + public NoMDEntriesEncoder rptSeq(final long value) + { + buffer.putInt(offset + 12, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int openCloseSettlFlagEncodingOffset() + { + return 16; + } + + public static int openCloseSettlFlagEncodingLength() + { + return 1; + } + + public NoMDEntriesEncoder openCloseSettlFlag(final OpenCloseSettlFlag value) + { + buffer.putByte(offset + 16, (byte)value.value()); + return this; + } + + public static int mDUpdateActionEncodingOffset() + { + return 17; + } + + public static int mDUpdateActionEncodingLength() + { + return 1; + } + + public NoMDEntriesEncoder mDUpdateAction(final MDUpdateAction value) + { + buffer.putByte(offset + 17, (byte)value.value()); + return this; + } + + public static int mDEntryTypeEncodingOffset() + { + return 18; + } + + public static int mDEntryTypeEncodingLength() + { + return 1; + } + + public NoMDEntriesEncoder mDEntryType(final MDEntryTypeStatistics value) + { + buffer.putByte(offset + 18, value.value()); + return this; + } + + public static int mDEntrySizeEncodingOffset() + { + return 19; + } + + public static int mDEntrySizeEncodingLength() + { + return 4; + } + + public static int mDEntrySizeNullValue() + { + return 2147483647; + } + + public static int mDEntrySizeMinValue() + { + return -2147483647; + } + + public static int mDEntrySizeMaxValue() + { + return 2147483647; + } + + public NoMDEntriesEncoder mDEntrySize(final int value) + { + buffer.putInt(offset + 19, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + MDIncrementalRefreshSessionStatistics35Decoder writer = new MDIncrementalRefreshSessionStatistics35Decoder(); + writer.wrap(buffer, offset, BLOCK_LENGTH, SCHEMA_VERSION); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshTrade36Decoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshTrade36Decoder.java new file mode 100644 index 0000000..3c8603f --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshTrade36Decoder.java @@ -0,0 +1,830 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDIncrementalRefreshTrade36Decoder"}) +@SuppressWarnings("all") +public class MDIncrementalRefreshTrade36Decoder +{ + public static final int BLOCK_LENGTH = 11; + public static final int TEMPLATE_ID = 36; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final MDIncrementalRefreshTrade36Decoder parentMessage = this; + private DirectBuffer buffer; + protected int offset; + protected int limit; + protected int actingBlockLength; + protected int actingVersion; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "X"; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public MDIncrementalRefreshTrade36Decoder wrap( + final DirectBuffer buffer, final int offset, final int actingBlockLength, final int actingVersion) + { + this.buffer = buffer; + this.offset = offset; + this.actingBlockLength = actingBlockLength; + this.actingVersion = actingVersion; + limit(offset + actingBlockLength); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int transactTimeId() + { + return 60; + } + + public static int transactTimeSinceVersion() + { + return 0; + } + + public static int transactTimeEncodingOffset() + { + return 0; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static String transactTimeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "UTCTimestamp"; + } + + return ""; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long transactTime() + { + return buffer.getLong(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int matchEventIndicatorId() + { + return 5799; + } + + public static int matchEventIndicatorSinceVersion() + { + return 0; + } + + public static int matchEventIndicatorEncodingOffset() + { + return 8; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + public static String matchEventIndicatorMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MultipleCharValue"; + } + + return ""; + } + + private final MatchEventIndicatorDecoder matchEventIndicator = new MatchEventIndicatorDecoder(); + + public MatchEventIndicatorDecoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 8); + return matchEventIndicator; + } + + private final NoMDEntriesDecoder noMDEntries = new NoMDEntriesDecoder(); + + public static long noMDEntriesDecoderId() + { + return 268; + } + + public static int noMDEntriesDecoderSinceVersion() + { + return 0; + } + + public NoMDEntriesDecoder noMDEntries() + { + noMDEntries.wrap(parentMessage, buffer); + return noMDEntries; + } + + public static class NoMDEntriesDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private MDIncrementalRefreshTrade36Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDIncrementalRefreshTrade36Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 32; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoMDEntriesDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int mDEntryPxId() + { + return 270; + } + + public static int mDEntryPxSinceVersion() + { + return 0; + } + + public static int mDEntryPxEncodingOffset() + { + return 0; + } + + public static int mDEntryPxEncodingLength() + { + return 8; + } + + public static String mDEntryPxMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICEDecoder mDEntryPx = new PRICEDecoder(); + + public PRICEDecoder mDEntryPx() + { + mDEntryPx.wrap(buffer, offset + 0); + return mDEntryPx; + } + + public static int mDEntrySizeId() + { + return 271; + } + + public static int mDEntrySizeSinceVersion() + { + return 0; + } + + public static int mDEntrySizeEncodingOffset() + { + return 8; + } + + public static int mDEntrySizeEncodingLength() + { + return 4; + } + + public static String mDEntrySizeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static int mDEntrySizeNullValue() + { + return -2147483648; + } + + public static int mDEntrySizeMinValue() + { + return -2147483647; + } + + public static int mDEntrySizeMaxValue() + { + return 2147483647; + } + + public int mDEntrySize() + { + return buffer.getInt(offset + 8, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int securityIDId() + { + return 48; + } + + public static int securityIDSinceVersion() + { + return 0; + } + + public static int securityIDEncodingOffset() + { + return 12; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static String securityIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public int securityID() + { + return buffer.getInt(offset + 12, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int rptSeqId() + { + return 83; + } + + public static int rptSeqSinceVersion() + { + return 0; + } + + public static int rptSeqEncodingOffset() + { + return 16; + } + + public static int rptSeqEncodingLength() + { + return 4; + } + + public static String rptSeqMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static long rptSeqNullValue() + { + return 4294967294L; + } + + public static long rptSeqMinValue() + { + return 0L; + } + + public static long rptSeqMaxValue() + { + return 4294967293L; + } + + public long rptSeq() + { + return (buffer.getInt(offset + 16, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + public static int numberOfOrdersId() + { + return 346; + } + + public static int numberOfOrdersSinceVersion() + { + return 0; + } + + public static int numberOfOrdersEncodingOffset() + { + return 20; + } + + public static int numberOfOrdersEncodingLength() + { + return 4; + } + + public static String numberOfOrdersMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int numberOfOrdersNullValue() + { + return 2147483647; + } + + public static int numberOfOrdersMinValue() + { + return -2147483647; + } + + public static int numberOfOrdersMaxValue() + { + return 2147483647; + } + + public int numberOfOrders() + { + return buffer.getInt(offset + 20, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int tradeIDId() + { + return 1003; + } + + public static int tradeIDSinceVersion() + { + return 0; + } + + public static int tradeIDEncodingOffset() + { + return 24; + } + + public static int tradeIDEncodingLength() + { + return 4; + } + + public static String tradeIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int tradeIDNullValue() + { + return -2147483648; + } + + public static int tradeIDMinValue() + { + return -2147483647; + } + + public static int tradeIDMaxValue() + { + return 2147483647; + } + + public int tradeID() + { + return buffer.getInt(offset + 24, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int aggressorSideId() + { + return 5797; + } + + public static int aggressorSideSinceVersion() + { + return 0; + } + + public static int aggressorSideEncodingOffset() + { + return 28; + } + + public static int aggressorSideEncodingLength() + { + return 1; + } + + public static String aggressorSideMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public AggressorSide aggressorSide() + { + return AggressorSide.get(((short)(buffer.getByte(offset + 28) & 0xFF))); + } + + + public static int mDUpdateActionId() + { + return 279; + } + + public static int mDUpdateActionSinceVersion() + { + return 0; + } + + public static int mDUpdateActionEncodingOffset() + { + return 29; + } + + public static int mDUpdateActionEncodingLength() + { + return 1; + } + + public static String mDUpdateActionMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public MDUpdateAction mDUpdateAction() + { + return MDUpdateAction.get(((short)(buffer.getByte(offset + 29) & 0xFF))); + } + + + public static int mDEntryTypeId() + { + return 269; + } + + public static int mDEntryTypeSinceVersion() + { + return 0; + } + + public static int mDEntryTypeEncodingOffset() + { + return 30; + } + + public static int mDEntryTypeEncodingLength() + { + return 0; + } + + public static String mDEntryTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public static byte mDEntryTypeNullValue() + { + return (byte)0; + } + + public static byte mDEntryTypeMinValue() + { + return (byte)32; + } + + public static byte mDEntryTypeMaxValue() + { + return (byte)126; + } + + private static final byte[] MDENTRYTYPE_VALUE = {50}; + + public static int mDEntryTypeLength() + { + return 1; + } + + public byte mDEntryType(final int index) + { + return MDENTRYTYPE_VALUE[index]; + } + + public int getMDEntryType(final byte[] dst, final int offset, final int length) + { + final int bytesCopied = Math.min(length, 1); + System.arraycopy(MDENTRYTYPE_VALUE, 0, dst, offset, bytesCopied); + + return bytesCopied; + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='MDEntryPx', referencedName='null', description='Trade price', id=270, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICE', referencedName='null', description='Trade price', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("mDEntryPx="); + mDEntryPx().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDEntrySize', referencedName='null', description='Trade quantity', id=271, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='Int32', referencedName='null', description='Trade quantity', id=-1, version=0, deprecated=0, encodedLength=4, offset=8, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("mDEntrySize="); + builder.append(mDEntrySize()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityID', referencedName='null', description='Security ID', id=48, version=0, deprecated=0, encodedLength=0, offset=12, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32', referencedName='null', description='Security ID', id=-1, version=0, deprecated=0, encodedLength=4, offset=12, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("securityID="); + builder.append(securityID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='RptSeq', referencedName='null', description='Market Data entry sequence number per instrument update', id=83, version=0, deprecated=0, encodedLength=0, offset=16, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt32', referencedName='null', description='Market Data entry sequence number per instrument update', id=-1, version=0, deprecated=0, encodedLength=4, offset=16, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("rptSeq="); + builder.append(rptSeq()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='NumberOfOrders', referencedName='null', description='Total number of real orders per instrument that participated in the trade', id=346, version=0, deprecated=0, encodedLength=0, offset=20, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32NULL', referencedName='null', description='Total number of real orders per instrument that participated in the trade', id=-1, version=0, deprecated=0, encodedLength=4, offset=20, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=2147483647, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("numberOfOrders="); + builder.append(numberOfOrders()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='TradeID', referencedName='null', description='Unique Trade ID per instrument and Trading Date', id=1003, version=0, deprecated=0, encodedLength=0, offset=24, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32', referencedName='null', description='Unique Trade ID per instrument and Trading Date', id=-1, version=0, deprecated=0, encodedLength=4, offset=24, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("tradeID="); + builder.append(tradeID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='AggressorSide', referencedName='null', description='Indicates aggressor side in the trade, if value is 0 then there is no aggressor', id=5797, version=0, deprecated=0, encodedLength=0, offset=28, componentTokenCount=7, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='AggressorSide', referencedName='null', description='Indicates aggressor side in the trade, if value is 0 then there is no aggressor', id=-1, version=0, deprecated=0, encodedLength=1, offset=28, componentTokenCount=5, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("aggressorSide="); + builder.append(aggressorSide()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDUpdateAction', referencedName='null', description='Market Data update action', id=279, version=0, deprecated=0, encodedLength=0, offset=29, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='MDUpdateAction', referencedName='null', description='Market Data update action', id=-1, version=0, deprecated=0, encodedLength=1, offset=29, componentTokenCount=8, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("mDUpdateAction="); + builder.append(mDUpdateAction()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDEntryType', referencedName='null', description='Market Data entry type', id=269, version=0, deprecated=0, encodedLength=0, offset=30, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=ENCODING, name='MDEntryTypeTrade', referencedName='null', description='Market Data entry type', id=-1, version=0, deprecated=0, encodedLength=0, offset=30, componentTokenCount=1, encoding=Encoding{presence=CONSTANT, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=50, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + builder.append(')'); + return builder; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + final int originalLimit = limit(); + limit(offset + actingBlockLength); + builder.append("[MDIncrementalRefreshTrade36](sbeTemplateId="); + builder.append(TEMPLATE_ID); + builder.append("|sbeSchemaId="); + builder.append(SCHEMA_ID); + builder.append("|sbeSchemaVersion="); + if (parentMessage.actingVersion != SCHEMA_VERSION) + { + builder.append(parentMessage.actingVersion); + builder.append('/'); + } + builder.append(SCHEMA_VERSION); + builder.append("|sbeBlockLength="); + if (actingBlockLength != BLOCK_LENGTH) + { + builder.append(actingBlockLength); + builder.append('/'); + } + builder.append(BLOCK_LENGTH); + builder.append("):"); + //Token{signal=BEGIN_FIELD, name='TransactTime', referencedName='null', description='Start of event processing time in number of nanoseconds since Unix epoch', id=60, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + //Token{signal=ENCODING, name='uInt64', referencedName='null', description='Start of event processing time in number of nanoseconds since Unix epoch', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + builder.append("transactTime="); + builder.append(transactTime()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=5799, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=12, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MultipleCharValue'}} + //Token{signal=BEGIN_SET, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=-1, version=0, deprecated=0, encodedLength=1, offset=8, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MultipleCharValue'}} + builder.append("matchEventIndicator="); + builder.append(matchEventIndicator()); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoMDEntries', referencedName='null', description='Number of entries in Market Data message', id=268, version=0, deprecated=0, encodedLength=32, offset=11, componentTokenCount=47, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noMDEntries=["); + NoMDEntriesDecoder noMDEntries = noMDEntries(); + if (noMDEntries.count() > 0) + { + while (noMDEntries.hasNext()) + { + noMDEntries.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + + limit(originalLimit); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshTrade36Encoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshTrade36Encoder.java new file mode 100644 index 0000000..17295d2 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshTrade36Encoder.java @@ -0,0 +1,464 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDIncrementalRefreshTrade36Encoder"}) +@SuppressWarnings("all") +public class MDIncrementalRefreshTrade36Encoder +{ + public static final int BLOCK_LENGTH = 11; + public static final int TEMPLATE_ID = 36; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final MDIncrementalRefreshTrade36Encoder parentMessage = this; + private MutableDirectBuffer buffer; + protected int offset; + protected int limit; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "X"; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public MDIncrementalRefreshTrade36Encoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + limit(offset + BLOCK_LENGTH); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int transactTimeEncodingOffset() + { + return 0; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public MDIncrementalRefreshTrade36Encoder transactTime(final long value) + { + buffer.putLong(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int matchEventIndicatorEncodingOffset() + { + return 8; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + private final MatchEventIndicatorEncoder matchEventIndicator = new MatchEventIndicatorEncoder(); + + public MatchEventIndicatorEncoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 8); + return matchEventIndicator; + } + + private final NoMDEntriesEncoder noMDEntries = new NoMDEntriesEncoder(); + + public static long noMDEntriesId() + { + return 268; + } + + public NoMDEntriesEncoder noMDEntriesCount(final int count) + { + noMDEntries.wrap(parentMessage, buffer, count); + return noMDEntries; + } + + public static class NoMDEntriesEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private MDIncrementalRefreshTrade36Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDIncrementalRefreshTrade36Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)32); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 32; + } + + public NoMDEntriesEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int mDEntryPxEncodingOffset() + { + return 0; + } + + public static int mDEntryPxEncodingLength() + { + return 8; + } + + private final PRICEEncoder mDEntryPx = new PRICEEncoder(); + + public PRICEEncoder mDEntryPx() + { + mDEntryPx.wrap(buffer, offset + 0); + return mDEntryPx; + } + + public static int mDEntrySizeEncodingOffset() + { + return 8; + } + + public static int mDEntrySizeEncodingLength() + { + return 4; + } + + public static int mDEntrySizeNullValue() + { + return -2147483648; + } + + public static int mDEntrySizeMinValue() + { + return -2147483647; + } + + public static int mDEntrySizeMaxValue() + { + return 2147483647; + } + + public NoMDEntriesEncoder mDEntrySize(final int value) + { + buffer.putInt(offset + 8, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int securityIDEncodingOffset() + { + return 12; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public NoMDEntriesEncoder securityID(final int value) + { + buffer.putInt(offset + 12, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int rptSeqEncodingOffset() + { + return 16; + } + + public static int rptSeqEncodingLength() + { + return 4; + } + + public static long rptSeqNullValue() + { + return 4294967294L; + } + + public static long rptSeqMinValue() + { + return 0L; + } + + public static long rptSeqMaxValue() + { + return 4294967293L; + } + + public NoMDEntriesEncoder rptSeq(final long value) + { + buffer.putInt(offset + 16, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int numberOfOrdersEncodingOffset() + { + return 20; + } + + public static int numberOfOrdersEncodingLength() + { + return 4; + } + + public static int numberOfOrdersNullValue() + { + return 2147483647; + } + + public static int numberOfOrdersMinValue() + { + return -2147483647; + } + + public static int numberOfOrdersMaxValue() + { + return 2147483647; + } + + public NoMDEntriesEncoder numberOfOrders(final int value) + { + buffer.putInt(offset + 20, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int tradeIDEncodingOffset() + { + return 24; + } + + public static int tradeIDEncodingLength() + { + return 4; + } + + public static int tradeIDNullValue() + { + return -2147483648; + } + + public static int tradeIDMinValue() + { + return -2147483647; + } + + public static int tradeIDMaxValue() + { + return 2147483647; + } + + public NoMDEntriesEncoder tradeID(final int value) + { + buffer.putInt(offset + 24, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int aggressorSideEncodingOffset() + { + return 28; + } + + public static int aggressorSideEncodingLength() + { + return 1; + } + + public NoMDEntriesEncoder aggressorSide(final AggressorSide value) + { + buffer.putByte(offset + 28, (byte)value.value()); + return this; + } + + public static int mDUpdateActionEncodingOffset() + { + return 29; + } + + public static int mDUpdateActionEncodingLength() + { + return 1; + } + + public NoMDEntriesEncoder mDUpdateAction(final MDUpdateAction value) + { + buffer.putByte(offset + 29, (byte)value.value()); + return this; + } + + public static int mDEntryTypeEncodingOffset() + { + return 30; + } + + public static int mDEntryTypeEncodingLength() + { + return 0; + } + + public static byte mDEntryTypeNullValue() + { + return (byte)0; + } + + public static byte mDEntryTypeMinValue() + { + return (byte)32; + } + + public static byte mDEntryTypeMaxValue() + { + return (byte)126; + } + + private static final byte[] MDENTRYTYPE_VALUE = {50}; + + public static int mDEntryTypeLength() + { + return 1; + } + + public byte mDEntryType(final int index) + { + return MDENTRYTYPE_VALUE[index]; + } + + public int getMDEntryType(final byte[] dst, final int offset, final int length) + { + final int bytesCopied = Math.min(length, 1); + System.arraycopy(MDENTRYTYPE_VALUE, 0, dst, offset, bytesCopied); + + return bytesCopied; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + MDIncrementalRefreshTrade36Decoder writer = new MDIncrementalRefreshTrade36Decoder(); + writer.wrap(buffer, offset, BLOCK_LENGTH, SCHEMA_VERSION); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshTradeSummary42Decoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshTradeSummary42Decoder.java new file mode 100644 index 0000000..b029cbb --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshTradeSummary42Decoder.java @@ -0,0 +1,1068 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDIncrementalRefreshTradeSummary42Decoder"}) +@SuppressWarnings("all") +public class MDIncrementalRefreshTradeSummary42Decoder +{ + public static final int BLOCK_LENGTH = 11; + public static final int TEMPLATE_ID = 42; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final MDIncrementalRefreshTradeSummary42Decoder parentMessage = this; + private DirectBuffer buffer; + protected int offset; + protected int limit; + protected int actingBlockLength; + protected int actingVersion; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "X"; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public MDIncrementalRefreshTradeSummary42Decoder wrap( + final DirectBuffer buffer, final int offset, final int actingBlockLength, final int actingVersion) + { + this.buffer = buffer; + this.offset = offset; + this.actingBlockLength = actingBlockLength; + this.actingVersion = actingVersion; + limit(offset + actingBlockLength); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int transactTimeId() + { + return 60; + } + + public static int transactTimeSinceVersion() + { + return 0; + } + + public static int transactTimeEncodingOffset() + { + return 0; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static String transactTimeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "UTCTimestamp"; + } + + return ""; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long transactTime() + { + return buffer.getLong(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int matchEventIndicatorId() + { + return 5799; + } + + public static int matchEventIndicatorSinceVersion() + { + return 0; + } + + public static int matchEventIndicatorEncodingOffset() + { + return 8; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + public static String matchEventIndicatorMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MultipleCharValue"; + } + + return ""; + } + + private final MatchEventIndicatorDecoder matchEventIndicator = new MatchEventIndicatorDecoder(); + + public MatchEventIndicatorDecoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 8); + return matchEventIndicator; + } + + private final NoMDEntriesDecoder noMDEntries = new NoMDEntriesDecoder(); + + public static long noMDEntriesDecoderId() + { + return 268; + } + + public static int noMDEntriesDecoderSinceVersion() + { + return 0; + } + + public NoMDEntriesDecoder noMDEntries() + { + noMDEntries.wrap(parentMessage, buffer); + return noMDEntries; + } + + public static class NoMDEntriesDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private MDIncrementalRefreshTradeSummary42Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDIncrementalRefreshTradeSummary42Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 32; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoMDEntriesDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int mDEntryPxId() + { + return 270; + } + + public static int mDEntryPxSinceVersion() + { + return 0; + } + + public static int mDEntryPxEncodingOffset() + { + return 0; + } + + public static int mDEntryPxEncodingLength() + { + return 8; + } + + public static String mDEntryPxMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICEDecoder mDEntryPx = new PRICEDecoder(); + + public PRICEDecoder mDEntryPx() + { + mDEntryPx.wrap(buffer, offset + 0); + return mDEntryPx; + } + + public static int mDEntrySizeId() + { + return 271; + } + + public static int mDEntrySizeSinceVersion() + { + return 0; + } + + public static int mDEntrySizeEncodingOffset() + { + return 8; + } + + public static int mDEntrySizeEncodingLength() + { + return 4; + } + + public static String mDEntrySizeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static int mDEntrySizeNullValue() + { + return -2147483648; + } + + public static int mDEntrySizeMinValue() + { + return -2147483647; + } + + public static int mDEntrySizeMaxValue() + { + return 2147483647; + } + + public int mDEntrySize() + { + return buffer.getInt(offset + 8, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int securityIDId() + { + return 48; + } + + public static int securityIDSinceVersion() + { + return 0; + } + + public static int securityIDEncodingOffset() + { + return 12; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static String securityIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public int securityID() + { + return buffer.getInt(offset + 12, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int rptSeqId() + { + return 83; + } + + public static int rptSeqSinceVersion() + { + return 0; + } + + public static int rptSeqEncodingOffset() + { + return 16; + } + + public static int rptSeqEncodingLength() + { + return 4; + } + + public static String rptSeqMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static long rptSeqNullValue() + { + return 4294967294L; + } + + public static long rptSeqMinValue() + { + return 0L; + } + + public static long rptSeqMaxValue() + { + return 4294967293L; + } + + public long rptSeq() + { + return (buffer.getInt(offset + 16, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + public static int numberOfOrdersId() + { + return 346; + } + + public static int numberOfOrdersSinceVersion() + { + return 0; + } + + public static int numberOfOrdersEncodingOffset() + { + return 20; + } + + public static int numberOfOrdersEncodingLength() + { + return 4; + } + + public static String numberOfOrdersMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int numberOfOrdersNullValue() + { + return 2147483647; + } + + public static int numberOfOrdersMinValue() + { + return -2147483647; + } + + public static int numberOfOrdersMaxValue() + { + return 2147483647; + } + + public int numberOfOrders() + { + return buffer.getInt(offset + 20, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int aggressorSideId() + { + return 5797; + } + + public static int aggressorSideSinceVersion() + { + return 0; + } + + public static int aggressorSideEncodingOffset() + { + return 24; + } + + public static int aggressorSideEncodingLength() + { + return 1; + } + + public static String aggressorSideMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public AggressorSide aggressorSide() + { + return AggressorSide.get(((short)(buffer.getByte(offset + 24) & 0xFF))); + } + + + public static int mDUpdateActionId() + { + return 279; + } + + public static int mDUpdateActionSinceVersion() + { + return 0; + } + + public static int mDUpdateActionEncodingOffset() + { + return 25; + } + + public static int mDUpdateActionEncodingLength() + { + return 1; + } + + public static String mDUpdateActionMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public MDUpdateAction mDUpdateAction() + { + return MDUpdateAction.get(((short)(buffer.getByte(offset + 25) & 0xFF))); + } + + + public static int mDEntryTypeId() + { + return 269; + } + + public static int mDEntryTypeSinceVersion() + { + return 0; + } + + public static int mDEntryTypeEncodingOffset() + { + return 26; + } + + public static int mDEntryTypeEncodingLength() + { + return 0; + } + + public static String mDEntryTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public static byte mDEntryTypeNullValue() + { + return (byte)0; + } + + public static byte mDEntryTypeMinValue() + { + return (byte)32; + } + + public static byte mDEntryTypeMaxValue() + { + return (byte)126; + } + + private static final byte[] MDENTRYTYPE_VALUE = {50}; + + public static int mDEntryTypeLength() + { + return 1; + } + + public byte mDEntryType(final int index) + { + return MDENTRYTYPE_VALUE[index]; + } + + public int getMDEntryType(final byte[] dst, final int offset, final int length) + { + final int bytesCopied = Math.min(length, 1); + System.arraycopy(MDENTRYTYPE_VALUE, 0, dst, offset, bytesCopied); + + return bytesCopied; + } + + public static int mDTradeEntryIDId() + { + return 37711; + } + + public static int mDTradeEntryIDSinceVersion() + { + return 7; + } + + public static int mDTradeEntryIDEncodingOffset() + { + return 26; + } + + public static int mDTradeEntryIDEncodingLength() + { + return 4; + } + + public static String mDTradeEntryIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static long mDTradeEntryIDNullValue() + { + return 4294967295L; + } + + public static long mDTradeEntryIDMinValue() + { + return 0L; + } + + public static long mDTradeEntryIDMaxValue() + { + return 4294967293L; + } + + public long mDTradeEntryID() + { + if (parentMessage.actingVersion < 7) + { + return 4294967295L; + } + + return (buffer.getInt(offset + 26, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='MDEntryPx', referencedName='null', description='Trade price', id=270, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICE', referencedName='null', description='Trade price', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("mDEntryPx="); + mDEntryPx().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDEntrySize', referencedName='null', description='Consolidated trade quantity', id=271, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='Int32', referencedName='null', description='Consolidated trade quantity', id=-1, version=0, deprecated=0, encodedLength=4, offset=8, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("mDEntrySize="); + builder.append(mDEntrySize()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityID', referencedName='null', description='Security ID as defined by CME', id=48, version=0, deprecated=0, encodedLength=0, offset=12, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32', referencedName='null', description='Security ID as defined by CME', id=-1, version=0, deprecated=0, encodedLength=4, offset=12, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("securityID="); + builder.append(securityID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='RptSeq', referencedName='null', description='Sequence number per instrument update', id=83, version=0, deprecated=0, encodedLength=0, offset=16, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt32', referencedName='null', description='Sequence number per instrument update', id=-1, version=0, deprecated=0, encodedLength=4, offset=16, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("rptSeq="); + builder.append(rptSeq()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='NumberOfOrders', referencedName='null', description='The total number of real orders per instrument that participated in a match step within a match event', id=346, version=0, deprecated=0, encodedLength=0, offset=20, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32NULL', referencedName='null', description='The total number of real orders per instrument that participated in a match step within a match event', id=-1, version=0, deprecated=0, encodedLength=4, offset=20, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=2147483647, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("numberOfOrders="); + builder.append(numberOfOrders()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='AggressorSide', referencedName='null', description='Indicates which side is the aggressor or if there is no aggressor', id=5797, version=0, deprecated=0, encodedLength=0, offset=24, componentTokenCount=7, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='AggressorSide', referencedName='null', description='Indicates which side is the aggressor or if there is no aggressor', id=-1, version=0, deprecated=0, encodedLength=1, offset=24, componentTokenCount=5, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("aggressorSide="); + builder.append(aggressorSide()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDUpdateAction', referencedName='null', description='Market Data update action', id=279, version=0, deprecated=0, encodedLength=0, offset=25, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='MDUpdateAction', referencedName='null', description='Market Data update action', id=-1, version=0, deprecated=0, encodedLength=1, offset=25, componentTokenCount=8, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("mDUpdateAction="); + builder.append(mDUpdateAction()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDEntryType', referencedName='null', description='Market Data entry type', id=269, version=0, deprecated=0, encodedLength=0, offset=26, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=ENCODING, name='MDEntryTypeTrade', referencedName='null', description='Market Data entry type', id=-1, version=0, deprecated=0, encodedLength=0, offset=26, componentTokenCount=1, encoding=Encoding{presence=CONSTANT, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=50, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=BEGIN_FIELD, name='MDTradeEntryID', referencedName='null', description='Market Data Trade entry ID', id=37711, version=7, deprecated=0, encodedLength=0, offset=26, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt32NULL', referencedName='null', description='Market Data Trade entry ID', id=-1, version=7, deprecated=0, encodedLength=4, offset=26, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=4294967295, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("mDTradeEntryID="); + builder.append(mDTradeEntryID()); + builder.append(')'); + return builder; + } + } + + private final NoOrderIDEntriesDecoder noOrderIDEntries = new NoOrderIDEntriesDecoder(); + + public static long noOrderIDEntriesDecoderId() + { + return 37705; + } + + public static int noOrderIDEntriesDecoderSinceVersion() + { + return 0; + } + + public NoOrderIDEntriesDecoder noOrderIDEntries() + { + noOrderIDEntries.wrap(parentMessage, buffer); + return noOrderIDEntries; + } + + public static class NoOrderIDEntriesDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 8; + private final GroupSize8ByteDecoder dimensions = new GroupSize8ByteDecoder(); + private MDIncrementalRefreshTradeSummary42Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDIncrementalRefreshTradeSummary42Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 16; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoOrderIDEntriesDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int orderIDId() + { + return 37; + } + + public static int orderIDSinceVersion() + { + return 0; + } + + public static int orderIDEncodingOffset() + { + return 0; + } + + public static int orderIDEncodingLength() + { + return 8; + } + + public static String orderIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static long orderIDNullValue() + { + return 0xffffffffffffffffL; + } + + public static long orderIDMinValue() + { + return 0x0L; + } + + public static long orderIDMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long orderID() + { + return buffer.getLong(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int lastQtyId() + { + return 32; + } + + public static int lastQtySinceVersion() + { + return 0; + } + + public static int lastQtyEncodingOffset() + { + return 8; + } + + public static int lastQtyEncodingLength() + { + return 4; + } + + public static String lastQtyMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static int lastQtyNullValue() + { + return -2147483648; + } + + public static int lastQtyMinValue() + { + return -2147483647; + } + + public static int lastQtyMaxValue() + { + return 2147483647; + } + + public int lastQty() + { + return buffer.getInt(offset + 8, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='OrderID', referencedName='null', description='Unique order identifier as assigned by the exchange', id=37, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt64', referencedName='null', description='Unique order identifier as assigned by the exchange', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("orderID="); + builder.append(orderID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='LastQty', referencedName='null', description='Quantity bought or sold on this last fill', id=32, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='Int32', referencedName='null', description='Quantity bought or sold on this last fill', id=-1, version=0, deprecated=0, encodedLength=4, offset=8, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("lastQty="); + builder.append(lastQty()); + builder.append(')'); + return builder; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + final int originalLimit = limit(); + limit(offset + actingBlockLength); + builder.append("[MDIncrementalRefreshTradeSummary42](sbeTemplateId="); + builder.append(TEMPLATE_ID); + builder.append("|sbeSchemaId="); + builder.append(SCHEMA_ID); + builder.append("|sbeSchemaVersion="); + if (parentMessage.actingVersion != SCHEMA_VERSION) + { + builder.append(parentMessage.actingVersion); + builder.append('/'); + } + builder.append(SCHEMA_VERSION); + builder.append("|sbeBlockLength="); + if (actingBlockLength != BLOCK_LENGTH) + { + builder.append(actingBlockLength); + builder.append('/'); + } + builder.append(BLOCK_LENGTH); + builder.append("):"); + //Token{signal=BEGIN_FIELD, name='TransactTime', referencedName='null', description='Start of event processing time in number of nanoseconds since Unix epoch', id=60, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + //Token{signal=ENCODING, name='uInt64', referencedName='null', description='Start of event processing time in number of nanoseconds since Unix epoch', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + builder.append("transactTime="); + builder.append(transactTime()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=5799, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=12, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MultipleCharValue'}} + //Token{signal=BEGIN_SET, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=-1, version=0, deprecated=0, encodedLength=1, offset=8, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MultipleCharValue'}} + builder.append("matchEventIndicator="); + builder.append(matchEventIndicator()); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoMDEntries', referencedName='null', description='Number of Trade Summary entries', id=268, version=0, deprecated=0, encodedLength=32, offset=11, componentTokenCount=47, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noMDEntries=["); + NoMDEntriesDecoder noMDEntries = noMDEntries(); + if (noMDEntries.count() > 0) + { + while (noMDEntries.hasNext()) + { + noMDEntries.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoOrderIDEntries', referencedName='null', description='Number of OrderID entries', id=37705, version=0, deprecated=0, encodedLength=16, offset=-1, componentTokenCount=12, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noOrderIDEntries=["); + NoOrderIDEntriesDecoder noOrderIDEntries = noOrderIDEntries(); + if (noOrderIDEntries.count() > 0) + { + while (noOrderIDEntries.hasNext()) + { + noOrderIDEntries.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + + limit(originalLimit); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshTradeSummary42Encoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshTradeSummary42Encoder.java new file mode 100644 index 0000000..97b13f8 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshTradeSummary42Encoder.java @@ -0,0 +1,594 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDIncrementalRefreshTradeSummary42Encoder"}) +@SuppressWarnings("all") +public class MDIncrementalRefreshTradeSummary42Encoder +{ + public static final int BLOCK_LENGTH = 11; + public static final int TEMPLATE_ID = 42; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final MDIncrementalRefreshTradeSummary42Encoder parentMessage = this; + private MutableDirectBuffer buffer; + protected int offset; + protected int limit; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "X"; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public MDIncrementalRefreshTradeSummary42Encoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + limit(offset + BLOCK_LENGTH); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int transactTimeEncodingOffset() + { + return 0; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public MDIncrementalRefreshTradeSummary42Encoder transactTime(final long value) + { + buffer.putLong(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int matchEventIndicatorEncodingOffset() + { + return 8; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + private final MatchEventIndicatorEncoder matchEventIndicator = new MatchEventIndicatorEncoder(); + + public MatchEventIndicatorEncoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 8); + return matchEventIndicator; + } + + private final NoMDEntriesEncoder noMDEntries = new NoMDEntriesEncoder(); + + public static long noMDEntriesId() + { + return 268; + } + + public NoMDEntriesEncoder noMDEntriesCount(final int count) + { + noMDEntries.wrap(parentMessage, buffer, count); + return noMDEntries; + } + + public static class NoMDEntriesEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private MDIncrementalRefreshTradeSummary42Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDIncrementalRefreshTradeSummary42Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)32); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 32; + } + + public NoMDEntriesEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int mDEntryPxEncodingOffset() + { + return 0; + } + + public static int mDEntryPxEncodingLength() + { + return 8; + } + + private final PRICEEncoder mDEntryPx = new PRICEEncoder(); + + public PRICEEncoder mDEntryPx() + { + mDEntryPx.wrap(buffer, offset + 0); + return mDEntryPx; + } + + public static int mDEntrySizeEncodingOffset() + { + return 8; + } + + public static int mDEntrySizeEncodingLength() + { + return 4; + } + + public static int mDEntrySizeNullValue() + { + return -2147483648; + } + + public static int mDEntrySizeMinValue() + { + return -2147483647; + } + + public static int mDEntrySizeMaxValue() + { + return 2147483647; + } + + public NoMDEntriesEncoder mDEntrySize(final int value) + { + buffer.putInt(offset + 8, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int securityIDEncodingOffset() + { + return 12; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public NoMDEntriesEncoder securityID(final int value) + { + buffer.putInt(offset + 12, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int rptSeqEncodingOffset() + { + return 16; + } + + public static int rptSeqEncodingLength() + { + return 4; + } + + public static long rptSeqNullValue() + { + return 4294967294L; + } + + public static long rptSeqMinValue() + { + return 0L; + } + + public static long rptSeqMaxValue() + { + return 4294967293L; + } + + public NoMDEntriesEncoder rptSeq(final long value) + { + buffer.putInt(offset + 16, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int numberOfOrdersEncodingOffset() + { + return 20; + } + + public static int numberOfOrdersEncodingLength() + { + return 4; + } + + public static int numberOfOrdersNullValue() + { + return 2147483647; + } + + public static int numberOfOrdersMinValue() + { + return -2147483647; + } + + public static int numberOfOrdersMaxValue() + { + return 2147483647; + } + + public NoMDEntriesEncoder numberOfOrders(final int value) + { + buffer.putInt(offset + 20, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int aggressorSideEncodingOffset() + { + return 24; + } + + public static int aggressorSideEncodingLength() + { + return 1; + } + + public NoMDEntriesEncoder aggressorSide(final AggressorSide value) + { + buffer.putByte(offset + 24, (byte)value.value()); + return this; + } + + public static int mDUpdateActionEncodingOffset() + { + return 25; + } + + public static int mDUpdateActionEncodingLength() + { + return 1; + } + + public NoMDEntriesEncoder mDUpdateAction(final MDUpdateAction value) + { + buffer.putByte(offset + 25, (byte)value.value()); + return this; + } + + public static int mDEntryTypeEncodingOffset() + { + return 26; + } + + public static int mDEntryTypeEncodingLength() + { + return 0; + } + + public static byte mDEntryTypeNullValue() + { + return (byte)0; + } + + public static byte mDEntryTypeMinValue() + { + return (byte)32; + } + + public static byte mDEntryTypeMaxValue() + { + return (byte)126; + } + + private static final byte[] MDENTRYTYPE_VALUE = {50}; + + public static int mDEntryTypeLength() + { + return 1; + } + + public byte mDEntryType(final int index) + { + return MDENTRYTYPE_VALUE[index]; + } + + public int getMDEntryType(final byte[] dst, final int offset, final int length) + { + final int bytesCopied = Math.min(length, 1); + System.arraycopy(MDENTRYTYPE_VALUE, 0, dst, offset, bytesCopied); + + return bytesCopied; + } + + public static int mDTradeEntryIDEncodingOffset() + { + return 26; + } + + public static int mDTradeEntryIDEncodingLength() + { + return 4; + } + + public static long mDTradeEntryIDNullValue() + { + return 4294967295L; + } + + public static long mDTradeEntryIDMinValue() + { + return 0L; + } + + public static long mDTradeEntryIDMaxValue() + { + return 4294967293L; + } + + public NoMDEntriesEncoder mDTradeEntryID(final long value) + { + buffer.putInt(offset + 26, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + } + + private final NoOrderIDEntriesEncoder noOrderIDEntries = new NoOrderIDEntriesEncoder(); + + public static long noOrderIDEntriesId() + { + return 37705; + } + + public NoOrderIDEntriesEncoder noOrderIDEntriesCount(final int count) + { + noOrderIDEntries.wrap(parentMessage, buffer, count); + return noOrderIDEntries; + } + + public static class NoOrderIDEntriesEncoder + { + private static final int HEADER_SIZE = 8; + private final GroupSize8ByteEncoder dimensions = new GroupSize8ByteEncoder(); + private MDIncrementalRefreshTradeSummary42Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDIncrementalRefreshTradeSummary42Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)16); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 16; + } + + public NoOrderIDEntriesEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int orderIDEncodingOffset() + { + return 0; + } + + public static int orderIDEncodingLength() + { + return 8; + } + + public static long orderIDNullValue() + { + return 0xffffffffffffffffL; + } + + public static long orderIDMinValue() + { + return 0x0L; + } + + public static long orderIDMaxValue() + { + return 0xfffffffffffffffeL; + } + + public NoOrderIDEntriesEncoder orderID(final long value) + { + buffer.putLong(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int lastQtyEncodingOffset() + { + return 8; + } + + public static int lastQtyEncodingLength() + { + return 4; + } + + public static int lastQtyNullValue() + { + return -2147483648; + } + + public static int lastQtyMinValue() + { + return -2147483647; + } + + public static int lastQtyMaxValue() + { + return 2147483647; + } + + public NoOrderIDEntriesEncoder lastQty(final int value) + { + buffer.putInt(offset + 8, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + MDIncrementalRefreshTradeSummary42Decoder writer = new MDIncrementalRefreshTradeSummary42Decoder(); + writer.wrap(buffer, offset, BLOCK_LENGTH, SCHEMA_VERSION); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshVolume37Decoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshVolume37Decoder.java new file mode 100644 index 0000000..790aea0 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshVolume37Decoder.java @@ -0,0 +1,626 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDIncrementalRefreshVolume37Decoder"}) +@SuppressWarnings("all") +public class MDIncrementalRefreshVolume37Decoder +{ + public static final int BLOCK_LENGTH = 11; + public static final int TEMPLATE_ID = 37; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final MDIncrementalRefreshVolume37Decoder parentMessage = this; + private DirectBuffer buffer; + protected int offset; + protected int limit; + protected int actingBlockLength; + protected int actingVersion; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "X"; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public MDIncrementalRefreshVolume37Decoder wrap( + final DirectBuffer buffer, final int offset, final int actingBlockLength, final int actingVersion) + { + this.buffer = buffer; + this.offset = offset; + this.actingBlockLength = actingBlockLength; + this.actingVersion = actingVersion; + limit(offset + actingBlockLength); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int transactTimeId() + { + return 60; + } + + public static int transactTimeSinceVersion() + { + return 0; + } + + public static int transactTimeEncodingOffset() + { + return 0; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static String transactTimeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "UTCTimestamp"; + } + + return ""; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long transactTime() + { + return buffer.getLong(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int matchEventIndicatorId() + { + return 5799; + } + + public static int matchEventIndicatorSinceVersion() + { + return 0; + } + + public static int matchEventIndicatorEncodingOffset() + { + return 8; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + public static String matchEventIndicatorMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MultipleCharValue"; + } + + return ""; + } + + private final MatchEventIndicatorDecoder matchEventIndicator = new MatchEventIndicatorDecoder(); + + public MatchEventIndicatorDecoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 8); + return matchEventIndicator; + } + + private final NoMDEntriesDecoder noMDEntries = new NoMDEntriesDecoder(); + + public static long noMDEntriesDecoderId() + { + return 268; + } + + public static int noMDEntriesDecoderSinceVersion() + { + return 0; + } + + public NoMDEntriesDecoder noMDEntries() + { + noMDEntries.wrap(parentMessage, buffer); + return noMDEntries; + } + + public static class NoMDEntriesDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private MDIncrementalRefreshVolume37Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDIncrementalRefreshVolume37Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 16; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoMDEntriesDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int mDEntrySizeId() + { + return 271; + } + + public static int mDEntrySizeSinceVersion() + { + return 0; + } + + public static int mDEntrySizeEncodingOffset() + { + return 0; + } + + public static int mDEntrySizeEncodingLength() + { + return 4; + } + + public static String mDEntrySizeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static int mDEntrySizeNullValue() + { + return -2147483648; + } + + public static int mDEntrySizeMinValue() + { + return -2147483647; + } + + public static int mDEntrySizeMaxValue() + { + return 2147483647; + } + + public int mDEntrySize() + { + return buffer.getInt(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int securityIDId() + { + return 48; + } + + public static int securityIDSinceVersion() + { + return 0; + } + + public static int securityIDEncodingOffset() + { + return 4; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static String securityIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public int securityID() + { + return buffer.getInt(offset + 4, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int rptSeqId() + { + return 83; + } + + public static int rptSeqSinceVersion() + { + return 0; + } + + public static int rptSeqEncodingOffset() + { + return 8; + } + + public static int rptSeqEncodingLength() + { + return 4; + } + + public static String rptSeqMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static long rptSeqNullValue() + { + return 4294967294L; + } + + public static long rptSeqMinValue() + { + return 0L; + } + + public static long rptSeqMaxValue() + { + return 4294967293L; + } + + public long rptSeq() + { + return (buffer.getInt(offset + 8, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + public static int mDUpdateActionId() + { + return 279; + } + + public static int mDUpdateActionSinceVersion() + { + return 0; + } + + public static int mDUpdateActionEncodingOffset() + { + return 12; + } + + public static int mDUpdateActionEncodingLength() + { + return 1; + } + + public static String mDUpdateActionMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public MDUpdateAction mDUpdateAction() + { + return MDUpdateAction.get(((short)(buffer.getByte(offset + 12) & 0xFF))); + } + + + public static int mDEntryTypeId() + { + return 269; + } + + public static int mDEntryTypeSinceVersion() + { + return 0; + } + + public static int mDEntryTypeEncodingOffset() + { + return 13; + } + + public static int mDEntryTypeEncodingLength() + { + return 0; + } + + public static String mDEntryTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public static byte mDEntryTypeNullValue() + { + return (byte)0; + } + + public static byte mDEntryTypeMinValue() + { + return (byte)32; + } + + public static byte mDEntryTypeMaxValue() + { + return (byte)126; + } + + private static final byte[] MDENTRYTYPE_VALUE = {101}; + + public static int mDEntryTypeLength() + { + return 1; + } + + public byte mDEntryType(final int index) + { + return MDENTRYTYPE_VALUE[index]; + } + + public int getMDEntryType(final byte[] dst, final int offset, final int length) + { + final int bytesCopied = Math.min(length, 1); + System.arraycopy(MDENTRYTYPE_VALUE, 0, dst, offset, bytesCopied); + + return bytesCopied; + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='MDEntrySize', referencedName='null', description='Cumulative traded volume', id=271, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='Int32', referencedName='null', description='Cumulative traded volume', id=-1, version=0, deprecated=0, encodedLength=4, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("mDEntrySize="); + builder.append(mDEntrySize()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityID', referencedName='null', description='Security ID', id=48, version=0, deprecated=0, encodedLength=0, offset=4, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32', referencedName='null', description='Security ID', id=-1, version=0, deprecated=0, encodedLength=4, offset=4, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("securityID="); + builder.append(securityID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='RptSeq', referencedName='null', description='Market Data entry sequence number per instrument update', id=83, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt32', referencedName='null', description='Market Data entry sequence number per instrument update', id=-1, version=0, deprecated=0, encodedLength=4, offset=8, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("rptSeq="); + builder.append(rptSeq()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDUpdateAction', referencedName='null', description='Market Data update action', id=279, version=0, deprecated=0, encodedLength=0, offset=12, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='MDUpdateAction', referencedName='null', description='Market Data update action', id=-1, version=0, deprecated=0, encodedLength=1, offset=12, componentTokenCount=8, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("mDUpdateAction="); + builder.append(mDUpdateAction()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDEntryType', referencedName='null', description='Electronic Volume entry provides cumulative session trade volume updated with the event', id=269, version=0, deprecated=0, encodedLength=0, offset=13, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=ENCODING, name='MDEntryTypeVol', referencedName='null', description='Electronic Volume entry provides cumulative session trade volume updated with the event', id=-1, version=0, deprecated=0, encodedLength=0, offset=13, componentTokenCount=1, encoding=Encoding{presence=CONSTANT, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=101, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + builder.append(')'); + return builder; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + final int originalLimit = limit(); + limit(offset + actingBlockLength); + builder.append("[MDIncrementalRefreshVolume37](sbeTemplateId="); + builder.append(TEMPLATE_ID); + builder.append("|sbeSchemaId="); + builder.append(SCHEMA_ID); + builder.append("|sbeSchemaVersion="); + if (parentMessage.actingVersion != SCHEMA_VERSION) + { + builder.append(parentMessage.actingVersion); + builder.append('/'); + } + builder.append(SCHEMA_VERSION); + builder.append("|sbeBlockLength="); + if (actingBlockLength != BLOCK_LENGTH) + { + builder.append(actingBlockLength); + builder.append('/'); + } + builder.append(BLOCK_LENGTH); + builder.append("):"); + //Token{signal=BEGIN_FIELD, name='TransactTime', referencedName='null', description='Start of event processing time in number of nanoseconds since Unix epoch', id=60, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + //Token{signal=ENCODING, name='uInt64', referencedName='null', description='Start of event processing time in number of nanoseconds since Unix epoch', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + builder.append("transactTime="); + builder.append(transactTime()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=5799, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=12, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MultipleCharValue'}} + //Token{signal=BEGIN_SET, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=-1, version=0, deprecated=0, encodedLength=1, offset=8, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MultipleCharValue'}} + builder.append("matchEventIndicator="); + builder.append(matchEventIndicator()); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoMDEntries', referencedName='null', description='Number of entries in Market Data message', id=268, version=0, deprecated=0, encodedLength=16, offset=11, componentTokenCount=28, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noMDEntries=["); + NoMDEntriesDecoder noMDEntries = noMDEntries(); + if (noMDEntries.count() > 0) + { + while (noMDEntries.hasNext()) + { + noMDEntries.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + + limit(originalLimit); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshVolume37Encoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshVolume37Encoder.java new file mode 100644 index 0000000..f48947e --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDIncrementalRefreshVolume37Encoder.java @@ -0,0 +1,366 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDIncrementalRefreshVolume37Encoder"}) +@SuppressWarnings("all") +public class MDIncrementalRefreshVolume37Encoder +{ + public static final int BLOCK_LENGTH = 11; + public static final int TEMPLATE_ID = 37; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final MDIncrementalRefreshVolume37Encoder parentMessage = this; + private MutableDirectBuffer buffer; + protected int offset; + protected int limit; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "X"; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public MDIncrementalRefreshVolume37Encoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + limit(offset + BLOCK_LENGTH); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int transactTimeEncodingOffset() + { + return 0; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public MDIncrementalRefreshVolume37Encoder transactTime(final long value) + { + buffer.putLong(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int matchEventIndicatorEncodingOffset() + { + return 8; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + private final MatchEventIndicatorEncoder matchEventIndicator = new MatchEventIndicatorEncoder(); + + public MatchEventIndicatorEncoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 8); + return matchEventIndicator; + } + + private final NoMDEntriesEncoder noMDEntries = new NoMDEntriesEncoder(); + + public static long noMDEntriesId() + { + return 268; + } + + public NoMDEntriesEncoder noMDEntriesCount(final int count) + { + noMDEntries.wrap(parentMessage, buffer, count); + return noMDEntries; + } + + public static class NoMDEntriesEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private MDIncrementalRefreshVolume37Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDIncrementalRefreshVolume37Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)16); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 16; + } + + public NoMDEntriesEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int mDEntrySizeEncodingOffset() + { + return 0; + } + + public static int mDEntrySizeEncodingLength() + { + return 4; + } + + public static int mDEntrySizeNullValue() + { + return -2147483648; + } + + public static int mDEntrySizeMinValue() + { + return -2147483647; + } + + public static int mDEntrySizeMaxValue() + { + return 2147483647; + } + + public NoMDEntriesEncoder mDEntrySize(final int value) + { + buffer.putInt(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int securityIDEncodingOffset() + { + return 4; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public NoMDEntriesEncoder securityID(final int value) + { + buffer.putInt(offset + 4, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int rptSeqEncodingOffset() + { + return 8; + } + + public static int rptSeqEncodingLength() + { + return 4; + } + + public static long rptSeqNullValue() + { + return 4294967294L; + } + + public static long rptSeqMinValue() + { + return 0L; + } + + public static long rptSeqMaxValue() + { + return 4294967293L; + } + + public NoMDEntriesEncoder rptSeq(final long value) + { + buffer.putInt(offset + 8, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int mDUpdateActionEncodingOffset() + { + return 12; + } + + public static int mDUpdateActionEncodingLength() + { + return 1; + } + + public NoMDEntriesEncoder mDUpdateAction(final MDUpdateAction value) + { + buffer.putByte(offset + 12, (byte)value.value()); + return this; + } + + public static int mDEntryTypeEncodingOffset() + { + return 13; + } + + public static int mDEntryTypeEncodingLength() + { + return 0; + } + + public static byte mDEntryTypeNullValue() + { + return (byte)0; + } + + public static byte mDEntryTypeMinValue() + { + return (byte)32; + } + + public static byte mDEntryTypeMaxValue() + { + return (byte)126; + } + + private static final byte[] MDENTRYTYPE_VALUE = {101}; + + public static int mDEntryTypeLength() + { + return 1; + } + + public byte mDEntryType(final int index) + { + return MDENTRYTYPE_VALUE[index]; + } + + public int getMDEntryType(final byte[] dst, final int offset, final int length) + { + final int bytesCopied = Math.min(length, 1); + System.arraycopy(MDENTRYTYPE_VALUE, 0, dst, offset, bytesCopied); + + return bytesCopied; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + MDIncrementalRefreshVolume37Decoder writer = new MDIncrementalRefreshVolume37Decoder(); + writer.wrap(buffer, offset, BLOCK_LENGTH, SCHEMA_VERSION); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDInstrumentDefinitionFuture27Decoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDInstrumentDefinitionFuture27Decoder.java new file mode 100644 index 0000000..7f677a2 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDInstrumentDefinitionFuture27Decoder.java @@ -0,0 +1,3917 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDInstrumentDefinitionFuture27Decoder"}) +@SuppressWarnings("all") +public class MDInstrumentDefinitionFuture27Decoder +{ + public static final int BLOCK_LENGTH = 216; + public static final int TEMPLATE_ID = 27; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final MDInstrumentDefinitionFuture27Decoder parentMessage = this; + private DirectBuffer buffer; + protected int offset; + protected int limit; + protected int actingBlockLength; + protected int actingVersion; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "d"; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public MDInstrumentDefinitionFuture27Decoder wrap( + final DirectBuffer buffer, final int offset, final int actingBlockLength, final int actingVersion) + { + this.buffer = buffer; + this.offset = offset; + this.actingBlockLength = actingBlockLength; + this.actingVersion = actingVersion; + limit(offset + actingBlockLength); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int matchEventIndicatorId() + { + return 5799; + } + + public static int matchEventIndicatorSinceVersion() + { + return 0; + } + + public static int matchEventIndicatorEncodingOffset() + { + return 0; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + public static String matchEventIndicatorMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MultipleCharValue"; + } + + return ""; + } + + private final MatchEventIndicatorDecoder matchEventIndicator = new MatchEventIndicatorDecoder(); + + public MatchEventIndicatorDecoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 0); + return matchEventIndicator; + } + + public static int totNumReportsId() + { + return 911; + } + + public static int totNumReportsSinceVersion() + { + return 0; + } + + public static int totNumReportsEncodingOffset() + { + return 1; + } + + public static int totNumReportsEncodingLength() + { + return 4; + } + + public static String totNumReportsMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static long totNumReportsNullValue() + { + return 4294967295L; + } + + public static long totNumReportsMinValue() + { + return 0L; + } + + public static long totNumReportsMaxValue() + { + return 4294967293L; + } + + public long totNumReports() + { + return (buffer.getInt(offset + 1, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + public static int securityUpdateActionId() + { + return 980; + } + + public static int securityUpdateActionSinceVersion() + { + return 0; + } + + public static int securityUpdateActionEncodingOffset() + { + return 5; + } + + public static int securityUpdateActionEncodingLength() + { + return 1; + } + + public static String securityUpdateActionMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public SecurityUpdateAction securityUpdateAction() + { + return SecurityUpdateAction.get(buffer.getByte(offset + 5)); + } + + + public static int lastUpdateTimeId() + { + return 779; + } + + public static int lastUpdateTimeSinceVersion() + { + return 0; + } + + public static int lastUpdateTimeEncodingOffset() + { + return 6; + } + + public static int lastUpdateTimeEncodingLength() + { + return 8; + } + + public static String lastUpdateTimeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "UTCTimestamp"; + } + + return ""; + } + + public static long lastUpdateTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long lastUpdateTimeMinValue() + { + return 0x0L; + } + + public static long lastUpdateTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long lastUpdateTime() + { + return buffer.getLong(offset + 6, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int mDSecurityTradingStatusId() + { + return 1682; + } + + public static int mDSecurityTradingStatusSinceVersion() + { + return 0; + } + + public static int mDSecurityTradingStatusEncodingOffset() + { + return 14; + } + + public static int mDSecurityTradingStatusEncodingLength() + { + return 1; + } + + public static String mDSecurityTradingStatusMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public SecurityTradingStatus mDSecurityTradingStatus() + { + return SecurityTradingStatus.get(((short)(buffer.getByte(offset + 14) & 0xFF))); + } + + + public static int applIDId() + { + return 1180; + } + + public static int applIDSinceVersion() + { + return 0; + } + + public static int applIDEncodingOffset() + { + return 15; + } + + public static int applIDEncodingLength() + { + return 2; + } + + public static String applIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static short applIDNullValue() + { + return (short)-32768; + } + + public static short applIDMinValue() + { + return (short)-32767; + } + + public static short applIDMaxValue() + { + return (short)32767; + } + + public short applID() + { + return buffer.getShort(offset + 15, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int marketSegmentIDId() + { + return 1300; + } + + public static int marketSegmentIDSinceVersion() + { + return 0; + } + + public static int marketSegmentIDEncodingOffset() + { + return 17; + } + + public static int marketSegmentIDEncodingLength() + { + return 1; + } + + public static String marketSegmentIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static short marketSegmentIDNullValue() + { + return (short)255; + } + + public static short marketSegmentIDMinValue() + { + return (short)0; + } + + public static short marketSegmentIDMaxValue() + { + return (short)254; + } + + public short marketSegmentID() + { + return ((short)(buffer.getByte(offset + 17) & 0xFF)); + } + + + public static int underlyingProductId() + { + return 462; + } + + public static int underlyingProductSinceVersion() + { + return 0; + } + + public static int underlyingProductEncodingOffset() + { + return 18; + } + + public static int underlyingProductEncodingLength() + { + return 1; + } + + public static String underlyingProductMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static short underlyingProductNullValue() + { + return (short)255; + } + + public static short underlyingProductMinValue() + { + return (short)0; + } + + public static short underlyingProductMaxValue() + { + return (short)254; + } + + public short underlyingProduct() + { + return ((short)(buffer.getByte(offset + 18) & 0xFF)); + } + + + public static int securityExchangeId() + { + return 207; + } + + public static int securityExchangeSinceVersion() + { + return 0; + } + + public static int securityExchangeEncodingOffset() + { + return 19; + } + + public static int securityExchangeEncodingLength() + { + return 4; + } + + public static String securityExchangeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Exchange"; + } + + return ""; + } + + public static byte securityExchangeNullValue() + { + return (byte)0; + } + + public static byte securityExchangeMinValue() + { + return (byte)32; + } + + public static byte securityExchangeMaxValue() + { + return (byte)126; + } + + public static int securityExchangeLength() + { + return 4; + } + + public byte securityExchange(final int index) + { + if (index < 0 || index >= 4) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 19 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String securityExchangeCharacterEncoding() + { + return "UTF-8"; + } + + public int getSecurityExchange(final byte[] dst, final int dstOffset) + { + final int length = 4; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 19, dst, dstOffset, length); + + return length; + } + + public String securityExchange() + { + final byte[] dst = new byte[4]; + buffer.getBytes(this.offset + 19, dst, 0, 4); + + int end = 0; + for (; end < 4 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int securityGroupId() + { + return 1151; + } + + public static int securityGroupSinceVersion() + { + return 0; + } + + public static int securityGroupEncodingOffset() + { + return 23; + } + + public static int securityGroupEncodingLength() + { + return 6; + } + + public static String securityGroupMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte securityGroupNullValue() + { + return (byte)0; + } + + public static byte securityGroupMinValue() + { + return (byte)32; + } + + public static byte securityGroupMaxValue() + { + return (byte)126; + } + + public static int securityGroupLength() + { + return 6; + } + + public byte securityGroup(final int index) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 23 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String securityGroupCharacterEncoding() + { + return "UTF-8"; + } + + public int getSecurityGroup(final byte[] dst, final int dstOffset) + { + final int length = 6; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 23, dst, dstOffset, length); + + return length; + } + + public String securityGroup() + { + final byte[] dst = new byte[6]; + buffer.getBytes(this.offset + 23, dst, 0, 6); + + int end = 0; + for (; end < 6 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int assetId() + { + return 6937; + } + + public static int assetSinceVersion() + { + return 0; + } + + public static int assetEncodingOffset() + { + return 29; + } + + public static int assetEncodingLength() + { + return 6; + } + + public static String assetMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte assetNullValue() + { + return (byte)0; + } + + public static byte assetMinValue() + { + return (byte)32; + } + + public static byte assetMaxValue() + { + return (byte)126; + } + + public static int assetLength() + { + return 6; + } + + public byte asset(final int index) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 29 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String assetCharacterEncoding() + { + return "UTF-8"; + } + + public int getAsset(final byte[] dst, final int dstOffset) + { + final int length = 6; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 29, dst, dstOffset, length); + + return length; + } + + public String asset() + { + final byte[] dst = new byte[6]; + buffer.getBytes(this.offset + 29, dst, 0, 6); + + int end = 0; + for (; end < 6 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int symbolId() + { + return 55; + } + + public static int symbolSinceVersion() + { + return 0; + } + + public static int symbolEncodingOffset() + { + return 35; + } + + public static int symbolEncodingLength() + { + return 20; + } + + public static String symbolMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte symbolNullValue() + { + return (byte)0; + } + + public static byte symbolMinValue() + { + return (byte)32; + } + + public static byte symbolMaxValue() + { + return (byte)126; + } + + public static int symbolLength() + { + return 20; + } + + public byte symbol(final int index) + { + if (index < 0 || index >= 20) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 35 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String symbolCharacterEncoding() + { + return "UTF-8"; + } + + public int getSymbol(final byte[] dst, final int dstOffset) + { + final int length = 20; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 35, dst, dstOffset, length); + + return length; + } + + public String symbol() + { + final byte[] dst = new byte[20]; + buffer.getBytes(this.offset + 35, dst, 0, 20); + + int end = 0; + for (; end < 20 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int securityIDId() + { + return 48; + } + + public static int securityIDSinceVersion() + { + return 0; + } + + public static int securityIDEncodingOffset() + { + return 55; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static String securityIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public int securityID() + { + return buffer.getInt(offset + 55, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int securityIDSourceId() + { + return 22; + } + + public static int securityIDSourceSinceVersion() + { + return 0; + } + + public static int securityIDSourceEncodingOffset() + { + return 59; + } + + public static int securityIDSourceEncodingLength() + { + return 0; + } + + public static String securityIDSourceMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public static byte securityIDSourceNullValue() + { + return (byte)0; + } + + public static byte securityIDSourceMinValue() + { + return (byte)32; + } + + public static byte securityIDSourceMaxValue() + { + return (byte)126; + } + + private static final byte[] SECURITYIDSOURCE_VALUE = {56}; + + public static int securityIDSourceLength() + { + return 1; + } + + public byte securityIDSource(final int index) + { + return SECURITYIDSOURCE_VALUE[index]; + } + + public int getSecurityIDSource(final byte[] dst, final int offset, final int length) + { + final int bytesCopied = Math.min(length, 1); + System.arraycopy(SECURITYIDSOURCE_VALUE, 0, dst, offset, bytesCopied); + + return bytesCopied; + } + + public static int securityTypeId() + { + return 167; + } + + public static int securityTypeSinceVersion() + { + return 0; + } + + public static int securityTypeEncodingOffset() + { + return 59; + } + + public static int securityTypeEncodingLength() + { + return 6; + } + + public static String securityTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte securityTypeNullValue() + { + return (byte)0; + } + + public static byte securityTypeMinValue() + { + return (byte)32; + } + + public static byte securityTypeMaxValue() + { + return (byte)126; + } + + public static int securityTypeLength() + { + return 6; + } + + public byte securityType(final int index) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 59 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String securityTypeCharacterEncoding() + { + return "UTF-8"; + } + + public int getSecurityType(final byte[] dst, final int dstOffset) + { + final int length = 6; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 59, dst, dstOffset, length); + + return length; + } + + public String securityType() + { + final byte[] dst = new byte[6]; + buffer.getBytes(this.offset + 59, dst, 0, 6); + + int end = 0; + for (; end < 6 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int cFICodeId() + { + return 461; + } + + public static int cFICodeSinceVersion() + { + return 0; + } + + public static int cFICodeEncodingOffset() + { + return 65; + } + + public static int cFICodeEncodingLength() + { + return 6; + } + + public static String cFICodeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte cFICodeNullValue() + { + return (byte)0; + } + + public static byte cFICodeMinValue() + { + return (byte)32; + } + + public static byte cFICodeMaxValue() + { + return (byte)126; + } + + public static int cFICodeLength() + { + return 6; + } + + public byte cFICode(final int index) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 65 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String cFICodeCharacterEncoding() + { + return "UTF-8"; + } + + public int getCFICode(final byte[] dst, final int dstOffset) + { + final int length = 6; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 65, dst, dstOffset, length); + + return length; + } + + public String cFICode() + { + final byte[] dst = new byte[6]; + buffer.getBytes(this.offset + 65, dst, 0, 6); + + int end = 0; + for (; end < 6 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int maturityMonthYearId() + { + return 200; + } + + public static int maturityMonthYearSinceVersion() + { + return 0; + } + + public static int maturityMonthYearEncodingOffset() + { + return 71; + } + + public static int maturityMonthYearEncodingLength() + { + return 5; + } + + public static String maturityMonthYearMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MonthYear"; + } + + return ""; + } + + private final MaturityMonthYearDecoder maturityMonthYear = new MaturityMonthYearDecoder(); + + public MaturityMonthYearDecoder maturityMonthYear() + { + maturityMonthYear.wrap(buffer, offset + 71); + return maturityMonthYear; + } + + public static int currencyId() + { + return 15; + } + + public static int currencySinceVersion() + { + return 0; + } + + public static int currencyEncodingOffset() + { + return 76; + } + + public static int currencyEncodingLength() + { + return 3; + } + + public static String currencyMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Currency"; + } + + return ""; + } + + public static byte currencyNullValue() + { + return (byte)0; + } + + public static byte currencyMinValue() + { + return (byte)32; + } + + public static byte currencyMaxValue() + { + return (byte)126; + } + + public static int currencyLength() + { + return 3; + } + + public byte currency(final int index) + { + if (index < 0 || index >= 3) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 76 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String currencyCharacterEncoding() + { + return "UTF-8"; + } + + public int getCurrency(final byte[] dst, final int dstOffset) + { + final int length = 3; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 76, dst, dstOffset, length); + + return length; + } + + public String currency() + { + final byte[] dst = new byte[3]; + buffer.getBytes(this.offset + 76, dst, 0, 3); + + int end = 0; + for (; end < 3 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int settlCurrencyId() + { + return 120; + } + + public static int settlCurrencySinceVersion() + { + return 0; + } + + public static int settlCurrencyEncodingOffset() + { + return 79; + } + + public static int settlCurrencyEncodingLength() + { + return 3; + } + + public static String settlCurrencyMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Currency"; + } + + return ""; + } + + public static byte settlCurrencyNullValue() + { + return (byte)0; + } + + public static byte settlCurrencyMinValue() + { + return (byte)32; + } + + public static byte settlCurrencyMaxValue() + { + return (byte)126; + } + + public static int settlCurrencyLength() + { + return 3; + } + + public byte settlCurrency(final int index) + { + if (index < 0 || index >= 3) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 79 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String settlCurrencyCharacterEncoding() + { + return "UTF-8"; + } + + public int getSettlCurrency(final byte[] dst, final int dstOffset) + { + final int length = 3; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 79, dst, dstOffset, length); + + return length; + } + + public String settlCurrency() + { + final byte[] dst = new byte[3]; + buffer.getBytes(this.offset + 79, dst, 0, 3); + + int end = 0; + for (; end < 3 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int matchAlgorithmId() + { + return 1142; + } + + public static int matchAlgorithmSinceVersion() + { + return 0; + } + + public static int matchAlgorithmEncodingOffset() + { + return 82; + } + + public static int matchAlgorithmEncodingLength() + { + return 1; + } + + public static String matchAlgorithmMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public static byte matchAlgorithmNullValue() + { + return (byte)0; + } + + public static byte matchAlgorithmMinValue() + { + return (byte)32; + } + + public static byte matchAlgorithmMaxValue() + { + return (byte)126; + } + + public byte matchAlgorithm() + { + return buffer.getByte(offset + 82); + } + + + public static int minTradeVolId() + { + return 562; + } + + public static int minTradeVolSinceVersion() + { + return 0; + } + + public static int minTradeVolEncodingOffset() + { + return 83; + } + + public static int minTradeVolEncodingLength() + { + return 4; + } + + public static String minTradeVolMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static long minTradeVolNullValue() + { + return 4294967294L; + } + + public static long minTradeVolMinValue() + { + return 0L; + } + + public static long minTradeVolMaxValue() + { + return 4294967293L; + } + + public long minTradeVol() + { + return (buffer.getInt(offset + 83, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + public static int maxTradeVolId() + { + return 1140; + } + + public static int maxTradeVolSinceVersion() + { + return 0; + } + + public static int maxTradeVolEncodingOffset() + { + return 87; + } + + public static int maxTradeVolEncodingLength() + { + return 4; + } + + public static String maxTradeVolMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static long maxTradeVolNullValue() + { + return 4294967294L; + } + + public static long maxTradeVolMinValue() + { + return 0L; + } + + public static long maxTradeVolMaxValue() + { + return 4294967293L; + } + + public long maxTradeVol() + { + return (buffer.getInt(offset + 87, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + public static int minPriceIncrementId() + { + return 969; + } + + public static int minPriceIncrementSinceVersion() + { + return 0; + } + + public static int minPriceIncrementEncodingOffset() + { + return 91; + } + + public static int minPriceIncrementEncodingLength() + { + return 8; + } + + public static String minPriceIncrementMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICEDecoder minPriceIncrement = new PRICEDecoder(); + + public PRICEDecoder minPriceIncrement() + { + minPriceIncrement.wrap(buffer, offset + 91); + return minPriceIncrement; + } + + public static int displayFactorId() + { + return 9787; + } + + public static int displayFactorSinceVersion() + { + return 0; + } + + public static int displayFactorEncodingOffset() + { + return 99; + } + + public static int displayFactorEncodingLength() + { + return 8; + } + + public static String displayFactorMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "float"; + } + + return ""; + } + + private final FLOATDecoder displayFactor = new FLOATDecoder(); + + public FLOATDecoder displayFactor() + { + displayFactor.wrap(buffer, offset + 99); + return displayFactor; + } + + public static int mainFractionId() + { + return 37702; + } + + public static int mainFractionSinceVersion() + { + return 0; + } + + public static int mainFractionEncodingOffset() + { + return 107; + } + + public static int mainFractionEncodingLength() + { + return 1; + } + + public static String mainFractionMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static short mainFractionNullValue() + { + return (short)255; + } + + public static short mainFractionMinValue() + { + return (short)0; + } + + public static short mainFractionMaxValue() + { + return (short)254; + } + + public short mainFraction() + { + return ((short)(buffer.getByte(offset + 107) & 0xFF)); + } + + + public static int subFractionId() + { + return 37703; + } + + public static int subFractionSinceVersion() + { + return 0; + } + + public static int subFractionEncodingOffset() + { + return 108; + } + + public static int subFractionEncodingLength() + { + return 1; + } + + public static String subFractionMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static short subFractionNullValue() + { + return (short)255; + } + + public static short subFractionMinValue() + { + return (short)0; + } + + public static short subFractionMaxValue() + { + return (short)254; + } + + public short subFraction() + { + return ((short)(buffer.getByte(offset + 108) & 0xFF)); + } + + + public static int priceDisplayFormatId() + { + return 9800; + } + + public static int priceDisplayFormatSinceVersion() + { + return 0; + } + + public static int priceDisplayFormatEncodingOffset() + { + return 109; + } + + public static int priceDisplayFormatEncodingLength() + { + return 1; + } + + public static String priceDisplayFormatMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static short priceDisplayFormatNullValue() + { + return (short)255; + } + + public static short priceDisplayFormatMinValue() + { + return (short)0; + } + + public static short priceDisplayFormatMaxValue() + { + return (short)254; + } + + public short priceDisplayFormat() + { + return ((short)(buffer.getByte(offset + 109) & 0xFF)); + } + + + public static int unitOfMeasureId() + { + return 996; + } + + public static int unitOfMeasureSinceVersion() + { + return 0; + } + + public static int unitOfMeasureEncodingOffset() + { + return 110; + } + + public static int unitOfMeasureEncodingLength() + { + return 30; + } + + public static String unitOfMeasureMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte unitOfMeasureNullValue() + { + return (byte)0; + } + + public static byte unitOfMeasureMinValue() + { + return (byte)32; + } + + public static byte unitOfMeasureMaxValue() + { + return (byte)126; + } + + public static int unitOfMeasureLength() + { + return 30; + } + + public byte unitOfMeasure(final int index) + { + if (index < 0 || index >= 30) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 110 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String unitOfMeasureCharacterEncoding() + { + return "UTF-8"; + } + + public int getUnitOfMeasure(final byte[] dst, final int dstOffset) + { + final int length = 30; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 110, dst, dstOffset, length); + + return length; + } + + public String unitOfMeasure() + { + final byte[] dst = new byte[30]; + buffer.getBytes(this.offset + 110, dst, 0, 30); + + int end = 0; + for (; end < 30 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int unitOfMeasureQtyId() + { + return 1147; + } + + public static int unitOfMeasureQtySinceVersion() + { + return 0; + } + + public static int unitOfMeasureQtyEncodingOffset() + { + return 140; + } + + public static int unitOfMeasureQtyEncodingLength() + { + return 8; + } + + public static String unitOfMeasureQtyMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + private final PRICENULLDecoder unitOfMeasureQty = new PRICENULLDecoder(); + + public PRICENULLDecoder unitOfMeasureQty() + { + unitOfMeasureQty.wrap(buffer, offset + 140); + return unitOfMeasureQty; + } + + public static int tradingReferencePriceId() + { + return 1150; + } + + public static int tradingReferencePriceSinceVersion() + { + return 0; + } + + public static int tradingReferencePriceEncodingOffset() + { + return 148; + } + + public static int tradingReferencePriceEncodingLength() + { + return 8; + } + + public static String tradingReferencePriceMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder tradingReferencePrice = new PRICENULLDecoder(); + + public PRICENULLDecoder tradingReferencePrice() + { + tradingReferencePrice.wrap(buffer, offset + 148); + return tradingReferencePrice; + } + + public static int settlPriceTypeId() + { + return 731; + } + + public static int settlPriceTypeSinceVersion() + { + return 0; + } + + public static int settlPriceTypeEncodingOffset() + { + return 156; + } + + public static int settlPriceTypeEncodingLength() + { + return 1; + } + + public static String settlPriceTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MultipleCharValue"; + } + + return ""; + } + + private final SettlPriceTypeDecoder settlPriceType = new SettlPriceTypeDecoder(); + + public SettlPriceTypeDecoder settlPriceType() + { + settlPriceType.wrap(buffer, offset + 156); + return settlPriceType; + } + + public static int openInterestQtyId() + { + return 5792; + } + + public static int openInterestQtySinceVersion() + { + return 0; + } + + public static int openInterestQtyEncodingOffset() + { + return 157; + } + + public static int openInterestQtyEncodingLength() + { + return 4; + } + + public static String openInterestQtyMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int openInterestQtyNullValue() + { + return 2147483647; + } + + public static int openInterestQtyMinValue() + { + return -2147483647; + } + + public static int openInterestQtyMaxValue() + { + return 2147483647; + } + + public int openInterestQty() + { + return buffer.getInt(offset + 157, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int clearedVolumeId() + { + return 5791; + } + + public static int clearedVolumeSinceVersion() + { + return 0; + } + + public static int clearedVolumeEncodingOffset() + { + return 161; + } + + public static int clearedVolumeEncodingLength() + { + return 4; + } + + public static String clearedVolumeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int clearedVolumeNullValue() + { + return 2147483647; + } + + public static int clearedVolumeMinValue() + { + return -2147483647; + } + + public static int clearedVolumeMaxValue() + { + return 2147483647; + } + + public int clearedVolume() + { + return buffer.getInt(offset + 161, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int highLimitPriceId() + { + return 1149; + } + + public static int highLimitPriceSinceVersion() + { + return 0; + } + + public static int highLimitPriceEncodingOffset() + { + return 165; + } + + public static int highLimitPriceEncodingLength() + { + return 8; + } + + public static String highLimitPriceMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder highLimitPrice = new PRICENULLDecoder(); + + public PRICENULLDecoder highLimitPrice() + { + highLimitPrice.wrap(buffer, offset + 165); + return highLimitPrice; + } + + public static int lowLimitPriceId() + { + return 1148; + } + + public static int lowLimitPriceSinceVersion() + { + return 0; + } + + public static int lowLimitPriceEncodingOffset() + { + return 173; + } + + public static int lowLimitPriceEncodingLength() + { + return 8; + } + + public static String lowLimitPriceMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder lowLimitPrice = new PRICENULLDecoder(); + + public PRICENULLDecoder lowLimitPrice() + { + lowLimitPrice.wrap(buffer, offset + 173); + return lowLimitPrice; + } + + public static int maxPriceVariationId() + { + return 1143; + } + + public static int maxPriceVariationSinceVersion() + { + return 0; + } + + public static int maxPriceVariationEncodingOffset() + { + return 181; + } + + public static int maxPriceVariationEncodingLength() + { + return 8; + } + + public static String maxPriceVariationMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder maxPriceVariation = new PRICENULLDecoder(); + + public PRICENULLDecoder maxPriceVariation() + { + maxPriceVariation.wrap(buffer, offset + 181); + return maxPriceVariation; + } + + public static int decayQuantityId() + { + return 5818; + } + + public static int decayQuantitySinceVersion() + { + return 0; + } + + public static int decayQuantityEncodingOffset() + { + return 189; + } + + public static int decayQuantityEncodingLength() + { + return 4; + } + + public static String decayQuantityMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static int decayQuantityNullValue() + { + return 2147483647; + } + + public static int decayQuantityMinValue() + { + return -2147483647; + } + + public static int decayQuantityMaxValue() + { + return 2147483647; + } + + public int decayQuantity() + { + return buffer.getInt(offset + 189, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int decayStartDateId() + { + return 5819; + } + + public static int decayStartDateSinceVersion() + { + return 0; + } + + public static int decayStartDateEncodingOffset() + { + return 193; + } + + public static int decayStartDateEncodingLength() + { + return 2; + } + + public static String decayStartDateMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "LocalMktDate"; + } + + return ""; + } + + public static int decayStartDateNullValue() + { + return 65535; + } + + public static int decayStartDateMinValue() + { + return 0; + } + + public static int decayStartDateMaxValue() + { + return 65534; + } + + public int decayStartDate() + { + return (buffer.getShort(offset + 193, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); + } + + + public static int originalContractSizeId() + { + return 5849; + } + + public static int originalContractSizeSinceVersion() + { + return 0; + } + + public static int originalContractSizeEncodingOffset() + { + return 195; + } + + public static int originalContractSizeEncodingLength() + { + return 4; + } + + public static String originalContractSizeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static int originalContractSizeNullValue() + { + return 2147483647; + } + + public static int originalContractSizeMinValue() + { + return -2147483647; + } + + public static int originalContractSizeMaxValue() + { + return 2147483647; + } + + public int originalContractSize() + { + return buffer.getInt(offset + 195, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int contractMultiplierId() + { + return 231; + } + + public static int contractMultiplierSinceVersion() + { + return 0; + } + + public static int contractMultiplierEncodingOffset() + { + return 199; + } + + public static int contractMultiplierEncodingLength() + { + return 4; + } + + public static String contractMultiplierMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int contractMultiplierNullValue() + { + return 2147483647; + } + + public static int contractMultiplierMinValue() + { + return -2147483647; + } + + public static int contractMultiplierMaxValue() + { + return 2147483647; + } + + public int contractMultiplier() + { + return buffer.getInt(offset + 199, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int contractMultiplierUnitId() + { + return 1435; + } + + public static int contractMultiplierUnitSinceVersion() + { + return 0; + } + + public static int contractMultiplierUnitEncodingOffset() + { + return 203; + } + + public static int contractMultiplierUnitEncodingLength() + { + return 1; + } + + public static String contractMultiplierUnitMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static byte contractMultiplierUnitNullValue() + { + return (byte)127; + } + + public static byte contractMultiplierUnitMinValue() + { + return (byte)-127; + } + + public static byte contractMultiplierUnitMaxValue() + { + return (byte)127; + } + + public byte contractMultiplierUnit() + { + return buffer.getByte(offset + 203); + } + + + public static int flowScheduleTypeId() + { + return 1439; + } + + public static int flowScheduleTypeSinceVersion() + { + return 0; + } + + public static int flowScheduleTypeEncodingOffset() + { + return 204; + } + + public static int flowScheduleTypeEncodingLength() + { + return 1; + } + + public static String flowScheduleTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static byte flowScheduleTypeNullValue() + { + return (byte)127; + } + + public static byte flowScheduleTypeMinValue() + { + return (byte)-127; + } + + public static byte flowScheduleTypeMaxValue() + { + return (byte)127; + } + + public byte flowScheduleType() + { + return buffer.getByte(offset + 204); + } + + + public static int minPriceIncrementAmountId() + { + return 1146; + } + + public static int minPriceIncrementAmountSinceVersion() + { + return 0; + } + + public static int minPriceIncrementAmountEncodingOffset() + { + return 205; + } + + public static int minPriceIncrementAmountEncodingLength() + { + return 8; + } + + public static String minPriceIncrementAmountMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder minPriceIncrementAmount = new PRICENULLDecoder(); + + public PRICENULLDecoder minPriceIncrementAmount() + { + minPriceIncrementAmount.wrap(buffer, offset + 205); + return minPriceIncrementAmount; + } + + public static int userDefinedInstrumentId() + { + return 9779; + } + + public static int userDefinedInstrumentSinceVersion() + { + return 3; + } + + public static int userDefinedInstrumentEncodingOffset() + { + return 213; + } + + public static int userDefinedInstrumentEncodingLength() + { + return 1; + } + + public static String userDefinedInstrumentMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public static byte userDefinedInstrumentNullValue() + { + return (byte)0; + } + + public static byte userDefinedInstrumentMinValue() + { + return (byte)32; + } + + public static byte userDefinedInstrumentMaxValue() + { + return (byte)126; + } + + public byte userDefinedInstrument() + { + if (parentMessage.actingVersion < 3) + { + return (byte)0; + } + + return buffer.getByte(offset + 213); + } + + + public static int tradingReferenceDateId() + { + return 5796; + } + + public static int tradingReferenceDateSinceVersion() + { + return 6; + } + + public static int tradingReferenceDateEncodingOffset() + { + return 214; + } + + public static int tradingReferenceDateEncodingLength() + { + return 2; + } + + public static String tradingReferenceDateMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "LocalMktDate"; + } + + return ""; + } + + public static int tradingReferenceDateNullValue() + { + return 65535; + } + + public static int tradingReferenceDateMinValue() + { + return 0; + } + + public static int tradingReferenceDateMaxValue() + { + return 65534; + } + + public int tradingReferenceDate() + { + if (parentMessage.actingVersion < 6) + { + return 65535; + } + + return (buffer.getShort(offset + 214, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); + } + + + private final NoEventsDecoder noEvents = new NoEventsDecoder(); + + public static long noEventsDecoderId() + { + return 864; + } + + public static int noEventsDecoderSinceVersion() + { + return 0; + } + + public NoEventsDecoder noEvents() + { + noEvents.wrap(parentMessage, buffer); + return noEvents; + } + + public static class NoEventsDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private MDInstrumentDefinitionFuture27Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDInstrumentDefinitionFuture27Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 9; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoEventsDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int eventTypeId() + { + return 865; + } + + public static int eventTypeSinceVersion() + { + return 0; + } + + public static int eventTypeEncodingOffset() + { + return 0; + } + + public static int eventTypeEncodingLength() + { + return 1; + } + + public static String eventTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public EventType eventType() + { + return EventType.get(((short)(buffer.getByte(offset + 0) & 0xFF))); + } + + + public static int eventTimeId() + { + return 1145; + } + + public static int eventTimeSinceVersion() + { + return 0; + } + + public static int eventTimeEncodingOffset() + { + return 1; + } + + public static int eventTimeEncodingLength() + { + return 8; + } + + public static String eventTimeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "UTCTimestamp"; + } + + return ""; + } + + public static long eventTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long eventTimeMinValue() + { + return 0x0L; + } + + public static long eventTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long eventTime() + { + return buffer.getLong(offset + 1, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='EventType', referencedName='null', description='Code to represent the type of event', id=865, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='EventType', referencedName='null', description='Code to represent the type of event', id=-1, version=0, deprecated=0, encodedLength=1, offset=0, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("eventType="); + builder.append(eventType()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='EventTime', referencedName='null', description='Date and Time of instument Activation or Expiration event sent as number of nanoseconds since Unix epoch', id=1145, version=0, deprecated=0, encodedLength=0, offset=1, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + //Token{signal=ENCODING, name='uInt64', referencedName='null', description='Date and Time of instument Activation or Expiration event sent as number of nanoseconds since Unix epoch', id=-1, version=0, deprecated=0, encodedLength=8, offset=1, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + builder.append("eventTime="); + builder.append(eventTime()); + builder.append(')'); + return builder; + } + } + + private final NoMDFeedTypesDecoder noMDFeedTypes = new NoMDFeedTypesDecoder(); + + public static long noMDFeedTypesDecoderId() + { + return 1141; + } + + public static int noMDFeedTypesDecoderSinceVersion() + { + return 0; + } + + public NoMDFeedTypesDecoder noMDFeedTypes() + { + noMDFeedTypes.wrap(parentMessage, buffer); + return noMDFeedTypes; + } + + public static class NoMDFeedTypesDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private MDInstrumentDefinitionFuture27Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDInstrumentDefinitionFuture27Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 4; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoMDFeedTypesDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int mDFeedTypeId() + { + return 1022; + } + + public static int mDFeedTypeSinceVersion() + { + return 0; + } + + public static int mDFeedTypeEncodingOffset() + { + return 0; + } + + public static int mDFeedTypeEncodingLength() + { + return 3; + } + + public static String mDFeedTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte mDFeedTypeNullValue() + { + return (byte)0; + } + + public static byte mDFeedTypeMinValue() + { + return (byte)32; + } + + public static byte mDFeedTypeMaxValue() + { + return (byte)126; + } + + public static int mDFeedTypeLength() + { + return 3; + } + + public byte mDFeedType(final int index) + { + if (index < 0 || index >= 3) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 0 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String mDFeedTypeCharacterEncoding() + { + return "UTF-8"; + } + + public int getMDFeedType(final byte[] dst, final int dstOffset) + { + final int length = 3; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 0, dst, dstOffset, length); + + return length; + } + + public String mDFeedType() + { + final byte[] dst = new byte[3]; + buffer.getBytes(this.offset + 0, dst, 0, 3); + + int end = 0; + for (; end < 3 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int marketDepthId() + { + return 264; + } + + public static int marketDepthSinceVersion() + { + return 0; + } + + public static int marketDepthEncodingOffset() + { + return 3; + } + + public static int marketDepthEncodingLength() + { + return 1; + } + + public static String marketDepthMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static byte marketDepthNullValue() + { + return (byte)-128; + } + + public static byte marketDepthMinValue() + { + return (byte)-127; + } + + public static byte marketDepthMaxValue() + { + return (byte)127; + } + + public byte marketDepth() + { + return buffer.getByte(offset + 3); + } + + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='MDFeedType', referencedName='null', description='Describes a class of service for a given data feed. GBX- Real Book, GBI-Implied Book', id=1022, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='MDFeedType', referencedName='null', description='Describes a class of service for a given data feed. GBX- Real Book, GBI-Implied Book', id=-1, version=0, deprecated=0, encodedLength=3, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("mDFeedType="); + for (int i = 0; i < mDFeedTypeLength() && mDFeedType(i) > 0; i++) + { + builder.append((char)mDFeedType(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MarketDepth', referencedName='null', description='Book depth', id=264, version=0, deprecated=0, encodedLength=0, offset=3, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int8', referencedName='null', description='Book depth', id=-1, version=0, deprecated=0, encodedLength=1, offset=3, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("marketDepth="); + builder.append(marketDepth()); + builder.append(')'); + return builder; + } + } + + private final NoInstAttribDecoder noInstAttrib = new NoInstAttribDecoder(); + + public static long noInstAttribDecoderId() + { + return 870; + } + + public static int noInstAttribDecoderSinceVersion() + { + return 0; + } + + public NoInstAttribDecoder noInstAttrib() + { + noInstAttrib.wrap(parentMessage, buffer); + return noInstAttrib; + } + + public static class NoInstAttribDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private MDInstrumentDefinitionFuture27Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDInstrumentDefinitionFuture27Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 4; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoInstAttribDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int instAttribTypeId() + { + return 871; + } + + public static int instAttribTypeSinceVersion() + { + return 0; + } + + public static int instAttribTypeEncodingOffset() + { + return 0; + } + + public static int instAttribTypeEncodingLength() + { + return 0; + } + + public static String instAttribTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static byte instAttribTypeNullValue() + { + return (byte)-128; + } + + public static byte instAttribTypeMinValue() + { + return (byte)-127; + } + + public static byte instAttribTypeMaxValue() + { + return (byte)127; + } + + public byte instAttribType() + { + return (byte)24; + } + + public static int instAttribValueId() + { + return 872; + } + + public static int instAttribValueSinceVersion() + { + return 0; + } + + public static int instAttribValueEncodingOffset() + { + return 0; + } + + public static int instAttribValueEncodingLength() + { + return 4; + } + + public static String instAttribValueMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MultipleCharValue"; + } + + return ""; + } + + private final InstAttribValueDecoder instAttribValue = new InstAttribValueDecoder(); + + public InstAttribValueDecoder instAttribValue() + { + instAttribValue.wrap(buffer, offset + 0); + return instAttribValue; + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='InstAttribType', referencedName='null', description='Instrument eligibility attributes', id=871, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='InstAttribType', referencedName='null', description='Instrument eligibility attributes', id=-1, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=1, encoding=Encoding{presence=CONSTANT, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=24, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_FIELD, name='InstAttribValue', referencedName='null', description='Bitmap field of 32 Boolean type instrument eligibility flags', id=872, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=24, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MultipleCharValue'}} + //Token{signal=BEGIN_SET, name='InstAttribValue', referencedName='null', description='Bitmap field of 32 Boolean type instrument eligibility flags', id=-1, version=0, deprecated=0, encodedLength=4, offset=0, componentTokenCount=22, encoding=Encoding{presence=REQUIRED, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MultipleCharValue'}} + builder.append("instAttribValue="); + builder.append(instAttribValue()); + builder.append(')'); + return builder; + } + } + + private final NoLotTypeRulesDecoder noLotTypeRules = new NoLotTypeRulesDecoder(); + + public static long noLotTypeRulesDecoderId() + { + return 1234; + } + + public static int noLotTypeRulesDecoderSinceVersion() + { + return 0; + } + + public NoLotTypeRulesDecoder noLotTypeRules() + { + noLotTypeRules.wrap(parentMessage, buffer); + return noLotTypeRules; + } + + public static class NoLotTypeRulesDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private MDInstrumentDefinitionFuture27Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDInstrumentDefinitionFuture27Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 5; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoLotTypeRulesDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int lotTypeId() + { + return 1093; + } + + public static int lotTypeSinceVersion() + { + return 0; + } + + public static int lotTypeEncodingOffset() + { + return 0; + } + + public static int lotTypeEncodingLength() + { + return 1; + } + + public static String lotTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static byte lotTypeNullValue() + { + return (byte)-128; + } + + public static byte lotTypeMinValue() + { + return (byte)-127; + } + + public static byte lotTypeMaxValue() + { + return (byte)127; + } + + public byte lotType() + { + return buffer.getByte(offset + 0); + } + + + public static int minLotSizeId() + { + return 1231; + } + + public static int minLotSizeSinceVersion() + { + return 0; + } + + public static int minLotSizeEncodingOffset() + { + return 1; + } + + public static int minLotSizeEncodingLength() + { + return 4; + } + + public static String minLotSizeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + private final DecimalQtyDecoder minLotSize = new DecimalQtyDecoder(); + + public DecimalQtyDecoder minLotSize() + { + minLotSize.wrap(buffer, offset + 1); + return minLotSize; + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='LotType', referencedName='null', description='This tag is required to interpret the value in tag 1231-MinLotSize', id=1093, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int8', referencedName='null', description='This tag is required to interpret the value in tag 1231-MinLotSize', id=-1, version=0, deprecated=0, encodedLength=1, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("lotType="); + builder.append(lotType()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MinLotSize', referencedName='null', description='Minimum quantity accepted for order entry. If tag 1093-LotType=4, this value is the minimum quantity for order entry expressed in the applicable units, specified in tag 996-UnitOfMeasure, e.g. megawatts', id=1231, version=0, deprecated=0, encodedLength=0, offset=1, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=BEGIN_COMPOSITE, name='DecimalQty', referencedName='null', description='Minimum quantity accepted for order entry. If tag 1093-LotType=4, this value is the minimum quantity for order entry expressed in the applicable units, specified in tag 996-UnitOfMeasure, e.g. megawatts', id=-1, version=0, deprecated=0, encodedLength=4, offset=1, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Qty'}} + builder.append("minLotSize="); + minLotSize().appendTo(builder); + builder.append(')'); + return builder; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + final int originalLimit = limit(); + limit(offset + actingBlockLength); + builder.append("[MDInstrumentDefinitionFuture27](sbeTemplateId="); + builder.append(TEMPLATE_ID); + builder.append("|sbeSchemaId="); + builder.append(SCHEMA_ID); + builder.append("|sbeSchemaVersion="); + if (parentMessage.actingVersion != SCHEMA_VERSION) + { + builder.append(parentMessage.actingVersion); + builder.append('/'); + } + builder.append(SCHEMA_VERSION); + builder.append("|sbeBlockLength="); + if (actingBlockLength != BLOCK_LENGTH) + { + builder.append(actingBlockLength); + builder.append('/'); + } + builder.append(BLOCK_LENGTH); + builder.append("):"); + //Token{signal=BEGIN_FIELD, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=5799, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=12, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MultipleCharValue'}} + //Token{signal=BEGIN_SET, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=-1, version=0, deprecated=0, encodedLength=1, offset=0, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MultipleCharValue'}} + builder.append("matchEventIndicator="); + builder.append(matchEventIndicator()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='TotNumReports', referencedName='null', description='Total number of instruments in the Replay loop. Used on Replay Feed only ', id=911, version=0, deprecated=0, encodedLength=0, offset=1, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt32NULL', referencedName='null', description='Total number of instruments in the Replay loop. Used on Replay Feed only ', id=-1, version=0, deprecated=0, encodedLength=4, offset=1, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=4294967295, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("totNumReports="); + builder.append(totNumReports()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityUpdateAction', referencedName='null', description='Last Security update action on Incremental feed, 'D' or 'M' is used when a mid-week deletion or modification (i.e. extension) occurs', id=980, version=0, deprecated=0, encodedLength=0, offset=5, componentTokenCount=7, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=BEGIN_ENUM, name='SecurityUpdateAction', referencedName='null', description='Last Security update action on Incremental feed, 'D' or 'M' is used when a mid-week deletion or modification (i.e. extension) occurs', id=-1, version=0, deprecated=0, encodedLength=1, offset=5, componentTokenCount=5, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='char'}} + builder.append("securityUpdateAction="); + builder.append(securityUpdateAction()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='LastUpdateTime', referencedName='null', description='Timestamp of when the instrument was last added, modified or deleted', id=779, version=0, deprecated=0, encodedLength=0, offset=6, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + //Token{signal=ENCODING, name='uInt64', referencedName='null', description='Timestamp of when the instrument was last added, modified or deleted', id=-1, version=0, deprecated=0, encodedLength=8, offset=6, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + builder.append("lastUpdateTime="); + builder.append(lastUpdateTime()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDSecurityTradingStatus', referencedName='null', description='Identifies the current state of the instrument. In Security Definition message this tag is available in the Instrument Replay feed only ', id=1682, version=0, deprecated=0, encodedLength=0, offset=14, componentTokenCount=15, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='SecurityTradingStatus', referencedName='null', description='Identifies the current state of the instrument. In Security Definition message this tag is available in the Instrument Replay feed only ', id=-1, version=0, deprecated=0, encodedLength=1, offset=14, componentTokenCount=13, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("mDSecurityTradingStatus="); + builder.append(mDSecurityTradingStatus()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='ApplID', referencedName='null', description='The channel ID as defined in the XML Configuration file', id=1180, version=0, deprecated=0, encodedLength=0, offset=15, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int16', referencedName='null', description='The channel ID as defined in the XML Configuration file', id=-1, version=0, deprecated=0, encodedLength=2, offset=15, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT16, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("applID="); + builder.append(applID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MarketSegmentID', referencedName='null', description='Identifies the market segment, populated for all CME Globex instruments', id=1300, version=0, deprecated=0, encodedLength=0, offset=17, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt8', referencedName='null', description='Identifies the market segment, populated for all CME Globex instruments', id=-1, version=0, deprecated=0, encodedLength=1, offset=17, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("marketSegmentID="); + builder.append(marketSegmentID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='UnderlyingProduct', referencedName='null', description='Product complex', id=462, version=0, deprecated=0, encodedLength=0, offset=18, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt8', referencedName='null', description='Product complex', id=-1, version=0, deprecated=0, encodedLength=1, offset=18, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("underlyingProduct="); + builder.append(underlyingProduct()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityExchange', referencedName='null', description='Exchange used to identify a security', id=207, version=0, deprecated=0, encodedLength=0, offset=19, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Exchange'}} + //Token{signal=ENCODING, name='SecurityExchange', referencedName='null', description='Exchange used to identify a security', id=-1, version=0, deprecated=0, encodedLength=4, offset=19, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Exchange'}} + builder.append("securityExchange="); + for (int i = 0; i < securityExchangeLength() && securityExchange(i) > 0; i++) + { + builder.append((char)securityExchange(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityGroup', referencedName='null', description='Security Group Code.', id=1151, version=0, deprecated=0, encodedLength=0, offset=23, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='SecurityGroup', referencedName='null', description='Security Group Code.', id=-1, version=0, deprecated=0, encodedLength=6, offset=23, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("securityGroup="); + for (int i = 0; i < securityGroupLength() && securityGroup(i) > 0; i++) + { + builder.append((char)securityGroup(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='Asset', referencedName='null', description='The underlying asset code also known as Product Code', id=6937, version=0, deprecated=0, encodedLength=0, offset=29, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='Asset', referencedName='null', description='The underlying asset code also known as Product Code', id=-1, version=0, deprecated=0, encodedLength=6, offset=29, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("asset="); + for (int i = 0; i < assetLength() && asset(i) > 0; i++) + { + builder.append((char)asset(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='Symbol', referencedName='null', description='Instrument Name or Symbol ', id=55, version=0, deprecated=0, encodedLength=0, offset=35, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='Symbol', referencedName='null', description='Instrument Name or Symbol ', id=-1, version=0, deprecated=0, encodedLength=20, offset=35, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("symbol="); + for (int i = 0; i < symbolLength() && symbol(i) > 0; i++) + { + builder.append((char)symbol(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityID', referencedName='null', description='Unique instrument ID', id=48, version=0, deprecated=0, encodedLength=0, offset=55, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32', referencedName='null', description='Unique instrument ID', id=-1, version=0, deprecated=0, encodedLength=4, offset=55, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("securityID="); + builder.append(securityID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityIDSource', referencedName='null', description='Identifies class or source of tag 48-SecurityID value', id=22, version=0, deprecated=0, encodedLength=0, offset=59, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=ENCODING, name='SecurityIDSource', referencedName='null', description='Identifies class or source of tag 48-SecurityID value', id=-1, version=0, deprecated=0, encodedLength=0, offset=59, componentTokenCount=1, encoding=Encoding{presence=CONSTANT, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=56, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=BEGIN_FIELD, name='SecurityType', referencedName='null', description='Security Type', id=167, version=0, deprecated=0, encodedLength=0, offset=59, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='SecurityType', referencedName='null', description='Security Type', id=-1, version=0, deprecated=0, encodedLength=6, offset=59, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("securityType="); + for (int i = 0; i < securityTypeLength() && securityType(i) > 0; i++) + { + builder.append((char)securityType(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='CFICode', referencedName='null', description='ISO standard instrument categorization code', id=461, version=0, deprecated=0, encodedLength=0, offset=65, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='CFICode', referencedName='null', description='ISO standard instrument categorization code', id=-1, version=0, deprecated=0, encodedLength=6, offset=65, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("cFICode="); + for (int i = 0; i < cFICodeLength() && cFICode(i) > 0; i++) + { + builder.append((char)cFICode(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MaturityMonthYear', referencedName='null', description='This field provides the actual calendar date for contract maturity', id=200, version=0, deprecated=0, encodedLength=0, offset=71, componentTokenCount=8, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MonthYear'}} + //Token{signal=BEGIN_COMPOSITE, name='MaturityMonthYear', referencedName='null', description='This field provides the actual calendar date for contract maturity', id=-1, version=0, deprecated=0, encodedLength=5, offset=71, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MonthYear'}} + builder.append("maturityMonthYear="); + maturityMonthYear().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='Currency', referencedName='null', description='Identifies currency used for price', id=15, version=0, deprecated=0, encodedLength=0, offset=76, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Currency'}} + //Token{signal=ENCODING, name='Currency', referencedName='null', description='Identifies currency used for price', id=-1, version=0, deprecated=0, encodedLength=3, offset=76, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Currency'}} + builder.append("currency="); + for (int i = 0; i < currencyLength() && currency(i) > 0; i++) + { + builder.append((char)currency(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SettlCurrency', referencedName='null', description='Identifies currency used for settlement, if different from trading currency', id=120, version=0, deprecated=0, encodedLength=0, offset=79, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Currency'}} + //Token{signal=ENCODING, name='Currency', referencedName='null', description='Identifies currency used for settlement, if different from trading currency', id=-1, version=0, deprecated=0, encodedLength=3, offset=79, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Currency'}} + builder.append("settlCurrency="); + for (int i = 0; i < settlCurrencyLength() && settlCurrency(i) > 0; i++) + { + builder.append((char)settlCurrency(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MatchAlgorithm', referencedName='null', description='Matching algorithm ', id=1142, version=0, deprecated=0, encodedLength=0, offset=82, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=ENCODING, name='CHAR', referencedName='null', description='Matching algorithm ', id=-1, version=0, deprecated=0, encodedLength=1, offset=82, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + builder.append("matchAlgorithm="); + builder.append(matchAlgorithm()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MinTradeVol', referencedName='null', description='The minimum trading volume for a security', id=562, version=0, deprecated=0, encodedLength=0, offset=83, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='uInt32', referencedName='null', description='The minimum trading volume for a security', id=-1, version=0, deprecated=0, encodedLength=4, offset=83, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("minTradeVol="); + builder.append(minTradeVol()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MaxTradeVol', referencedName='null', description='The maximum trading volume for a security', id=1140, version=0, deprecated=0, encodedLength=0, offset=87, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='uInt32', referencedName='null', description='The maximum trading volume for a security', id=-1, version=0, deprecated=0, encodedLength=4, offset=87, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("maxTradeVol="); + builder.append(maxTradeVol()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MinPriceIncrement', referencedName='null', description='Minimum constant tick for the instrument, sent only if instrument is non-VTT (Variable Tick table) eligible', id=969, version=0, deprecated=0, encodedLength=0, offset=91, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICE', referencedName='null', description='Minimum constant tick for the instrument, sent only if instrument is non-VTT (Variable Tick table) eligible', id=-1, version=0, deprecated=0, encodedLength=8, offset=91, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("minPriceIncrement="); + minPriceIncrement().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='DisplayFactor', referencedName='null', description='Contains the multiplier to convert the CME Globex display price to the conventional price', id=9787, version=0, deprecated=0, encodedLength=0, offset=99, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='float'}} + //Token{signal=BEGIN_COMPOSITE, name='FLOAT', referencedName='null', description='Contains the multiplier to convert the CME Globex display price to the conventional price', id=-1, version=0, deprecated=0, encodedLength=8, offset=99, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='float'}} + builder.append("displayFactor="); + displayFactor().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MainFraction', referencedName='null', description='Price Denominator of Main Fraction', id=37702, version=0, deprecated=0, encodedLength=0, offset=107, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt8NULL', referencedName='null', description='Price Denominator of Main Fraction', id=-1, version=0, deprecated=0, encodedLength=1, offset=107, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=255, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("mainFraction="); + builder.append(mainFraction()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SubFraction', referencedName='null', description='Price Denominator of Sub Fraction', id=37703, version=0, deprecated=0, encodedLength=0, offset=108, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt8NULL', referencedName='null', description='Price Denominator of Sub Fraction', id=-1, version=0, deprecated=0, encodedLength=1, offset=108, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=255, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("subFraction="); + builder.append(subFraction()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='PriceDisplayFormat', referencedName='null', description='Number of decimals in fractional display price', id=9800, version=0, deprecated=0, encodedLength=0, offset=109, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt8NULL', referencedName='null', description='Number of decimals in fractional display price', id=-1, version=0, deprecated=0, encodedLength=1, offset=109, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=255, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("priceDisplayFormat="); + builder.append(priceDisplayFormat()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='UnitOfMeasure', referencedName='null', description='Unit of measure for the products' original contract size. This will be populated for all products listed on CME Globex', id=996, version=0, deprecated=0, encodedLength=0, offset=110, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='UnitOfMeasure', referencedName='null', description='Unit of measure for the products' original contract size. This will be populated for all products listed on CME Globex', id=-1, version=0, deprecated=0, encodedLength=30, offset=110, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("unitOfMeasure="); + for (int i = 0; i < unitOfMeasureLength() && unitOfMeasure(i) > 0; i++) + { + builder.append((char)unitOfMeasure(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='UnitOfMeasureQty', referencedName='null', description='This field contains the contract size for each instrument. Used in combination with tag 996-UnitofMeasure', id=1147, version=0, deprecated=0, encodedLength=0, offset=140, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='This field contains the contract size for each instrument. Used in combination with tag 996-UnitofMeasure', id=-1, version=0, deprecated=0, encodedLength=8, offset=140, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Qty'}} + builder.append("unitOfMeasureQty="); + unitOfMeasureQty().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='TradingReferencePrice', referencedName='null', description='Reference price for prelisted instruments or the last calculated Settlement whether it be Theoretical, Preliminary or a Final Settle of the session.', id=1150, version=0, deprecated=0, encodedLength=0, offset=148, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Reference price for prelisted instruments or the last calculated Settlement whether it be Theoretical, Preliminary or a Final Settle of the session.', id=-1, version=0, deprecated=0, encodedLength=8, offset=148, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("tradingReferencePrice="); + tradingReferencePrice().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SettlPriceType', referencedName='null', description='Bitmap field of eight Boolean type indicators representing settlement price type', id=731, version=0, deprecated=0, encodedLength=0, offset=156, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MultipleCharValue'}} + //Token{signal=BEGIN_SET, name='SettlPriceType', referencedName='null', description='Bitmap field of eight Boolean type indicators representing settlement price type', id=-1, version=0, deprecated=0, encodedLength=1, offset=156, componentTokenCount=8, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MultipleCharValue'}} + builder.append("settlPriceType="); + builder.append(settlPriceType()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='OpenInterestQty', referencedName='null', description='The total open interest for the market at the close of the prior trading session.', id=5792, version=0, deprecated=0, encodedLength=0, offset=157, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32NULL', referencedName='null', description='The total open interest for the market at the close of the prior trading session.', id=-1, version=0, deprecated=0, encodedLength=4, offset=157, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=2147483647, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("openInterestQty="); + builder.append(openInterestQty()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='ClearedVolume', referencedName='null', description='The total cleared volume of instrument traded during the prior trading session.', id=5791, version=0, deprecated=0, encodedLength=0, offset=161, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32NULL', referencedName='null', description='The total cleared volume of instrument traded during the prior trading session.', id=-1, version=0, deprecated=0, encodedLength=4, offset=161, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=2147483647, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("clearedVolume="); + builder.append(clearedVolume()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='HighLimitPrice', referencedName='null', description='Allowable high limit price for the trading day', id=1149, version=0, deprecated=0, encodedLength=0, offset=165, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Allowable high limit price for the trading day', id=-1, version=0, deprecated=0, encodedLength=8, offset=165, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("highLimitPrice="); + highLimitPrice().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='LowLimitPrice', referencedName='null', description='Allowable low limit price for the trading day', id=1148, version=0, deprecated=0, encodedLength=0, offset=173, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Allowable low limit price for the trading day', id=-1, version=0, deprecated=0, encodedLength=8, offset=173, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("lowLimitPrice="); + lowLimitPrice().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MaxPriceVariation', referencedName='null', description='Differential value for price banding.', id=1143, version=0, deprecated=0, encodedLength=0, offset=181, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Differential value for price banding.', id=-1, version=0, deprecated=0, encodedLength=8, offset=181, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("maxPriceVariation="); + maxPriceVariation().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='DecayQuantity', referencedName='null', description='Indicates the quantity that a contract will decay daily by once the decay start date is reached', id=5818, version=0, deprecated=0, encodedLength=0, offset=189, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='Int32NULL', referencedName='null', description='Indicates the quantity that a contract will decay daily by once the decay start date is reached', id=-1, version=0, deprecated=0, encodedLength=4, offset=189, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=2147483647, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("decayQuantity="); + builder.append(decayQuantity()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='DecayStartDate', referencedName='null', description='Indicates the date at which a decaying contract will begin to decay', id=5819, version=0, deprecated=0, encodedLength=0, offset=193, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='LocalMktDate'}} + //Token{signal=ENCODING, name='LocalMktDate', referencedName='null', description='Indicates the date at which a decaying contract will begin to decay', id=-1, version=0, deprecated=0, encodedLength=2, offset=193, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT16, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=65535, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='LocalMktDate'}} + builder.append("decayStartDate="); + builder.append(decayStartDate()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='OriginalContractSize', referencedName='null', description='Fixed contract value assigned to each product', id=5849, version=0, deprecated=0, encodedLength=0, offset=195, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='Int32NULL', referencedName='null', description='Fixed contract value assigned to each product', id=-1, version=0, deprecated=0, encodedLength=4, offset=195, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=2147483647, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("originalContractSize="); + builder.append(originalContractSize()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='ContractMultiplier', referencedName='null', description='Number of deliverable units per instrument, e.g., peak days in maturity month or number of calendar days in maturity month', id=231, version=0, deprecated=0, encodedLength=0, offset=199, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32NULL', referencedName='null', description='Number of deliverable units per instrument, e.g., peak days in maturity month or number of calendar days in maturity month', id=-1, version=0, deprecated=0, encodedLength=4, offset=199, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=2147483647, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("contractMultiplier="); + builder.append(contractMultiplier()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='ContractMultiplierUnit', referencedName='null', description='Indicates the type of multiplier being applied to the product. Optionally used in combination with tag 231-ContractMultiplier', id=1435, version=0, deprecated=0, encodedLength=0, offset=203, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int8NULL', referencedName='null', description='Indicates the type of multiplier being applied to the product. Optionally used in combination with tag 231-ContractMultiplier', id=-1, version=0, deprecated=0, encodedLength=1, offset=203, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=127, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("contractMultiplierUnit="); + builder.append(contractMultiplierUnit()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='FlowScheduleType', referencedName='null', description='The schedule according to which the electricity is delivered in a physical contract, or priced in a financial contract. Specifies whether the contract is defined according to the Easter Peak, Eastern Off-Peak, Western Peak or Western Off-Peak.', id=1439, version=0, deprecated=0, encodedLength=0, offset=204, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int8NULL', referencedName='null', description='The schedule according to which the electricity is delivered in a physical contract, or priced in a financial contract. Specifies whether the contract is defined according to the Easter Peak, Eastern Off-Peak, Western Peak or Western Off-Peak.', id=-1, version=0, deprecated=0, encodedLength=1, offset=204, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=127, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("flowScheduleType="); + builder.append(flowScheduleType()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MinPriceIncrementAmount', referencedName='null', description='Monetary value equivalent to the minimum price fluctuation', id=1146, version=0, deprecated=0, encodedLength=0, offset=205, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Monetary value equivalent to the minimum price fluctuation', id=-1, version=0, deprecated=0, encodedLength=8, offset=205, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("minPriceIncrementAmount="); + minPriceIncrementAmount().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='UserDefinedInstrument', referencedName='null', description='User-defined instruments flag', id=9779, version=3, deprecated=0, encodedLength=0, offset=213, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=ENCODING, name='UserDefinedInstrument', referencedName='null', description='User-defined instruments flag', id=-1, version=3, deprecated=0, encodedLength=1, offset=213, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + builder.append("userDefinedInstrument="); + builder.append(userDefinedInstrument()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='TradingReferenceDate', referencedName='null', description='Indicates session date corresponding to the settlement price in tag 1150-TradingReferencePrice', id=5796, version=6, deprecated=0, encodedLength=0, offset=214, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='LocalMktDate'}} + //Token{signal=ENCODING, name='LocalMktDate', referencedName='null', description='Indicates session date corresponding to the settlement price in tag 1150-TradingReferencePrice', id=-1, version=6, deprecated=0, encodedLength=2, offset=214, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT16, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=65535, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='LocalMktDate'}} + builder.append("tradingReferenceDate="); + builder.append(tradingReferenceDate()); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoEvents', referencedName='null', description='Number of repeating EventType entries', id=864, version=0, deprecated=0, encodedLength=9, offset=216, componentTokenCount=15, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noEvents=["); + NoEventsDecoder noEvents = noEvents(); + if (noEvents.count() > 0) + { + while (noEvents.hasNext()) + { + noEvents.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoMDFeedTypes', referencedName='null', description='Number of repeating FeedType entries', id=1141, version=0, deprecated=0, encodedLength=4, offset=-1, componentTokenCount=12, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noMDFeedTypes=["); + NoMDFeedTypesDecoder noMDFeedTypes = noMDFeedTypes(); + if (noMDFeedTypes.count() > 0) + { + while (noMDFeedTypes.hasNext()) + { + noMDFeedTypes.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoInstAttrib', referencedName='null', description='Number of repeating InstrAttribType entries', id=870, version=0, deprecated=0, encodedLength=4, offset=-1, componentTokenCount=33, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noInstAttrib=["); + NoInstAttribDecoder noInstAttrib = noInstAttrib(); + if (noInstAttrib.count() > 0) + { + while (noInstAttrib.hasNext()) + { + noInstAttrib.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoLotTypeRules', referencedName='null', description='Number of entries', id=1234, version=0, deprecated=0, encodedLength=5, offset=-1, componentTokenCount=15, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noLotTypeRules=["); + NoLotTypeRulesDecoder noLotTypeRules = noLotTypeRules(); + if (noLotTypeRules.count() > 0) + { + while (noLotTypeRules.hasNext()) + { + noLotTypeRules.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + + limit(originalLimit); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDInstrumentDefinitionFuture27Encoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDInstrumentDefinitionFuture27Encoder.java new file mode 100644 index 0000000..b43f81d --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDInstrumentDefinitionFuture27Encoder.java @@ -0,0 +1,2294 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDInstrumentDefinitionFuture27Encoder"}) +@SuppressWarnings("all") +public class MDInstrumentDefinitionFuture27Encoder +{ + public static final int BLOCK_LENGTH = 216; + public static final int TEMPLATE_ID = 27; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final MDInstrumentDefinitionFuture27Encoder parentMessage = this; + private MutableDirectBuffer buffer; + protected int offset; + protected int limit; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "d"; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public MDInstrumentDefinitionFuture27Encoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + limit(offset + BLOCK_LENGTH); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int matchEventIndicatorEncodingOffset() + { + return 0; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + private final MatchEventIndicatorEncoder matchEventIndicator = new MatchEventIndicatorEncoder(); + + public MatchEventIndicatorEncoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 0); + return matchEventIndicator; + } + + public static int totNumReportsEncodingOffset() + { + return 1; + } + + public static int totNumReportsEncodingLength() + { + return 4; + } + + public static long totNumReportsNullValue() + { + return 4294967295L; + } + + public static long totNumReportsMinValue() + { + return 0L; + } + + public static long totNumReportsMaxValue() + { + return 4294967293L; + } + + public MDInstrumentDefinitionFuture27Encoder totNumReports(final long value) + { + buffer.putInt(offset + 1, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int securityUpdateActionEncodingOffset() + { + return 5; + } + + public static int securityUpdateActionEncodingLength() + { + return 1; + } + + public MDInstrumentDefinitionFuture27Encoder securityUpdateAction(final SecurityUpdateAction value) + { + buffer.putByte(offset + 5, value.value()); + return this; + } + + public static int lastUpdateTimeEncodingOffset() + { + return 6; + } + + public static int lastUpdateTimeEncodingLength() + { + return 8; + } + + public static long lastUpdateTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long lastUpdateTimeMinValue() + { + return 0x0L; + } + + public static long lastUpdateTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public MDInstrumentDefinitionFuture27Encoder lastUpdateTime(final long value) + { + buffer.putLong(offset + 6, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int mDSecurityTradingStatusEncodingOffset() + { + return 14; + } + + public static int mDSecurityTradingStatusEncodingLength() + { + return 1; + } + + public MDInstrumentDefinitionFuture27Encoder mDSecurityTradingStatus(final SecurityTradingStatus value) + { + buffer.putByte(offset + 14, (byte)value.value()); + return this; + } + + public static int applIDEncodingOffset() + { + return 15; + } + + public static int applIDEncodingLength() + { + return 2; + } + + public static short applIDNullValue() + { + return (short)-32768; + } + + public static short applIDMinValue() + { + return (short)-32767; + } + + public static short applIDMaxValue() + { + return (short)32767; + } + + public MDInstrumentDefinitionFuture27Encoder applID(final short value) + { + buffer.putShort(offset + 15, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int marketSegmentIDEncodingOffset() + { + return 17; + } + + public static int marketSegmentIDEncodingLength() + { + return 1; + } + + public static short marketSegmentIDNullValue() + { + return (short)255; + } + + public static short marketSegmentIDMinValue() + { + return (short)0; + } + + public static short marketSegmentIDMaxValue() + { + return (short)254; + } + + public MDInstrumentDefinitionFuture27Encoder marketSegmentID(final short value) + { + buffer.putByte(offset + 17, (byte)value); + return this; + } + + + public static int underlyingProductEncodingOffset() + { + return 18; + } + + public static int underlyingProductEncodingLength() + { + return 1; + } + + public static short underlyingProductNullValue() + { + return (short)255; + } + + public static short underlyingProductMinValue() + { + return (short)0; + } + + public static short underlyingProductMaxValue() + { + return (short)254; + } + + public MDInstrumentDefinitionFuture27Encoder underlyingProduct(final short value) + { + buffer.putByte(offset + 18, (byte)value); + return this; + } + + + public static int securityExchangeEncodingOffset() + { + return 19; + } + + public static int securityExchangeEncodingLength() + { + return 4; + } + + public static byte securityExchangeNullValue() + { + return (byte)0; + } + + public static byte securityExchangeMinValue() + { + return (byte)32; + } + + public static byte securityExchangeMaxValue() + { + return (byte)126; + } + + public static int securityExchangeLength() + { + return 4; + } + + public void securityExchange(final int index, final byte value) + { + if (index < 0 || index >= 4) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 19 + (index * 1); + buffer.putByte(pos, value); + } + + public static String securityExchangeCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionFuture27Encoder putSecurityExchange(final byte[] src, final int srcOffset) + { + final int length = 4; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 19, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionFuture27Encoder securityExchange(final String src) + { + final int length = 4; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 19, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 19 + start, (byte)0); + } + + return this; + } + + public static int securityGroupEncodingOffset() + { + return 23; + } + + public static int securityGroupEncodingLength() + { + return 6; + } + + public static byte securityGroupNullValue() + { + return (byte)0; + } + + public static byte securityGroupMinValue() + { + return (byte)32; + } + + public static byte securityGroupMaxValue() + { + return (byte)126; + } + + public static int securityGroupLength() + { + return 6; + } + + public void securityGroup(final int index, final byte value) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 23 + (index * 1); + buffer.putByte(pos, value); + } + + public static String securityGroupCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionFuture27Encoder putSecurityGroup(final byte[] src, final int srcOffset) + { + final int length = 6; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 23, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionFuture27Encoder securityGroup(final String src) + { + final int length = 6; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 23, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 23 + start, (byte)0); + } + + return this; + } + + public static int assetEncodingOffset() + { + return 29; + } + + public static int assetEncodingLength() + { + return 6; + } + + public static byte assetNullValue() + { + return (byte)0; + } + + public static byte assetMinValue() + { + return (byte)32; + } + + public static byte assetMaxValue() + { + return (byte)126; + } + + public static int assetLength() + { + return 6; + } + + public void asset(final int index, final byte value) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 29 + (index * 1); + buffer.putByte(pos, value); + } + + public static String assetCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionFuture27Encoder putAsset(final byte[] src, final int srcOffset) + { + final int length = 6; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 29, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionFuture27Encoder asset(final String src) + { + final int length = 6; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 29, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 29 + start, (byte)0); + } + + return this; + } + + public static int symbolEncodingOffset() + { + return 35; + } + + public static int symbolEncodingLength() + { + return 20; + } + + public static byte symbolNullValue() + { + return (byte)0; + } + + public static byte symbolMinValue() + { + return (byte)32; + } + + public static byte symbolMaxValue() + { + return (byte)126; + } + + public static int symbolLength() + { + return 20; + } + + public void symbol(final int index, final byte value) + { + if (index < 0 || index >= 20) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 35 + (index * 1); + buffer.putByte(pos, value); + } + + public static String symbolCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionFuture27Encoder putSymbol(final byte[] src, final int srcOffset) + { + final int length = 20; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 35, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionFuture27Encoder symbol(final String src) + { + final int length = 20; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 35, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 35 + start, (byte)0); + } + + return this; + } + + public static int securityIDEncodingOffset() + { + return 55; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public MDInstrumentDefinitionFuture27Encoder securityID(final int value) + { + buffer.putInt(offset + 55, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int securityIDSourceEncodingOffset() + { + return 59; + } + + public static int securityIDSourceEncodingLength() + { + return 0; + } + + public static byte securityIDSourceNullValue() + { + return (byte)0; + } + + public static byte securityIDSourceMinValue() + { + return (byte)32; + } + + public static byte securityIDSourceMaxValue() + { + return (byte)126; + } + + private static final byte[] SECURITYIDSOURCE_VALUE = {56}; + + public static int securityIDSourceLength() + { + return 1; + } + + public byte securityIDSource(final int index) + { + return SECURITYIDSOURCE_VALUE[index]; + } + + public int getSecurityIDSource(final byte[] dst, final int offset, final int length) + { + final int bytesCopied = Math.min(length, 1); + System.arraycopy(SECURITYIDSOURCE_VALUE, 0, dst, offset, bytesCopied); + + return bytesCopied; + } + + public static int securityTypeEncodingOffset() + { + return 59; + } + + public static int securityTypeEncodingLength() + { + return 6; + } + + public static byte securityTypeNullValue() + { + return (byte)0; + } + + public static byte securityTypeMinValue() + { + return (byte)32; + } + + public static byte securityTypeMaxValue() + { + return (byte)126; + } + + public static int securityTypeLength() + { + return 6; + } + + public void securityType(final int index, final byte value) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 59 + (index * 1); + buffer.putByte(pos, value); + } + + public static String securityTypeCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionFuture27Encoder putSecurityType(final byte[] src, final int srcOffset) + { + final int length = 6; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 59, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionFuture27Encoder securityType(final String src) + { + final int length = 6; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 59, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 59 + start, (byte)0); + } + + return this; + } + + public static int cFICodeEncodingOffset() + { + return 65; + } + + public static int cFICodeEncodingLength() + { + return 6; + } + + public static byte cFICodeNullValue() + { + return (byte)0; + } + + public static byte cFICodeMinValue() + { + return (byte)32; + } + + public static byte cFICodeMaxValue() + { + return (byte)126; + } + + public static int cFICodeLength() + { + return 6; + } + + public void cFICode(final int index, final byte value) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 65 + (index * 1); + buffer.putByte(pos, value); + } + + public static String cFICodeCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionFuture27Encoder putCFICode(final byte[] src, final int srcOffset) + { + final int length = 6; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 65, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionFuture27Encoder cFICode(final String src) + { + final int length = 6; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 65, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 65 + start, (byte)0); + } + + return this; + } + + public static int maturityMonthYearEncodingOffset() + { + return 71; + } + + public static int maturityMonthYearEncodingLength() + { + return 5; + } + + private final MaturityMonthYearEncoder maturityMonthYear = new MaturityMonthYearEncoder(); + + public MaturityMonthYearEncoder maturityMonthYear() + { + maturityMonthYear.wrap(buffer, offset + 71); + return maturityMonthYear; + } + + public static int currencyEncodingOffset() + { + return 76; + } + + public static int currencyEncodingLength() + { + return 3; + } + + public static byte currencyNullValue() + { + return (byte)0; + } + + public static byte currencyMinValue() + { + return (byte)32; + } + + public static byte currencyMaxValue() + { + return (byte)126; + } + + public static int currencyLength() + { + return 3; + } + + public void currency(final int index, final byte value) + { + if (index < 0 || index >= 3) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 76 + (index * 1); + buffer.putByte(pos, value); + } + + public static String currencyCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionFuture27Encoder putCurrency(final byte[] src, final int srcOffset) + { + final int length = 3; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 76, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionFuture27Encoder currency(final String src) + { + final int length = 3; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 76, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 76 + start, (byte)0); + } + + return this; + } + + public static int settlCurrencyEncodingOffset() + { + return 79; + } + + public static int settlCurrencyEncodingLength() + { + return 3; + } + + public static byte settlCurrencyNullValue() + { + return (byte)0; + } + + public static byte settlCurrencyMinValue() + { + return (byte)32; + } + + public static byte settlCurrencyMaxValue() + { + return (byte)126; + } + + public static int settlCurrencyLength() + { + return 3; + } + + public void settlCurrency(final int index, final byte value) + { + if (index < 0 || index >= 3) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 79 + (index * 1); + buffer.putByte(pos, value); + } + + public static String settlCurrencyCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionFuture27Encoder putSettlCurrency(final byte[] src, final int srcOffset) + { + final int length = 3; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 79, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionFuture27Encoder settlCurrency(final String src) + { + final int length = 3; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 79, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 79 + start, (byte)0); + } + + return this; + } + + public static int matchAlgorithmEncodingOffset() + { + return 82; + } + + public static int matchAlgorithmEncodingLength() + { + return 1; + } + + public static byte matchAlgorithmNullValue() + { + return (byte)0; + } + + public static byte matchAlgorithmMinValue() + { + return (byte)32; + } + + public static byte matchAlgorithmMaxValue() + { + return (byte)126; + } + + public MDInstrumentDefinitionFuture27Encoder matchAlgorithm(final byte value) + { + buffer.putByte(offset + 82, value); + return this; + } + + + public static int minTradeVolEncodingOffset() + { + return 83; + } + + public static int minTradeVolEncodingLength() + { + return 4; + } + + public static long minTradeVolNullValue() + { + return 4294967294L; + } + + public static long minTradeVolMinValue() + { + return 0L; + } + + public static long minTradeVolMaxValue() + { + return 4294967293L; + } + + public MDInstrumentDefinitionFuture27Encoder minTradeVol(final long value) + { + buffer.putInt(offset + 83, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int maxTradeVolEncodingOffset() + { + return 87; + } + + public static int maxTradeVolEncodingLength() + { + return 4; + } + + public static long maxTradeVolNullValue() + { + return 4294967294L; + } + + public static long maxTradeVolMinValue() + { + return 0L; + } + + public static long maxTradeVolMaxValue() + { + return 4294967293L; + } + + public MDInstrumentDefinitionFuture27Encoder maxTradeVol(final long value) + { + buffer.putInt(offset + 87, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int minPriceIncrementEncodingOffset() + { + return 91; + } + + public static int minPriceIncrementEncodingLength() + { + return 8; + } + + private final PRICEEncoder minPriceIncrement = new PRICEEncoder(); + + public PRICEEncoder minPriceIncrement() + { + minPriceIncrement.wrap(buffer, offset + 91); + return minPriceIncrement; + } + + public static int displayFactorEncodingOffset() + { + return 99; + } + + public static int displayFactorEncodingLength() + { + return 8; + } + + private final FLOATEncoder displayFactor = new FLOATEncoder(); + + public FLOATEncoder displayFactor() + { + displayFactor.wrap(buffer, offset + 99); + return displayFactor; + } + + public static int mainFractionEncodingOffset() + { + return 107; + } + + public static int mainFractionEncodingLength() + { + return 1; + } + + public static short mainFractionNullValue() + { + return (short)255; + } + + public static short mainFractionMinValue() + { + return (short)0; + } + + public static short mainFractionMaxValue() + { + return (short)254; + } + + public MDInstrumentDefinitionFuture27Encoder mainFraction(final short value) + { + buffer.putByte(offset + 107, (byte)value); + return this; + } + + + public static int subFractionEncodingOffset() + { + return 108; + } + + public static int subFractionEncodingLength() + { + return 1; + } + + public static short subFractionNullValue() + { + return (short)255; + } + + public static short subFractionMinValue() + { + return (short)0; + } + + public static short subFractionMaxValue() + { + return (short)254; + } + + public MDInstrumentDefinitionFuture27Encoder subFraction(final short value) + { + buffer.putByte(offset + 108, (byte)value); + return this; + } + + + public static int priceDisplayFormatEncodingOffset() + { + return 109; + } + + public static int priceDisplayFormatEncodingLength() + { + return 1; + } + + public static short priceDisplayFormatNullValue() + { + return (short)255; + } + + public static short priceDisplayFormatMinValue() + { + return (short)0; + } + + public static short priceDisplayFormatMaxValue() + { + return (short)254; + } + + public MDInstrumentDefinitionFuture27Encoder priceDisplayFormat(final short value) + { + buffer.putByte(offset + 109, (byte)value); + return this; + } + + + public static int unitOfMeasureEncodingOffset() + { + return 110; + } + + public static int unitOfMeasureEncodingLength() + { + return 30; + } + + public static byte unitOfMeasureNullValue() + { + return (byte)0; + } + + public static byte unitOfMeasureMinValue() + { + return (byte)32; + } + + public static byte unitOfMeasureMaxValue() + { + return (byte)126; + } + + public static int unitOfMeasureLength() + { + return 30; + } + + public void unitOfMeasure(final int index, final byte value) + { + if (index < 0 || index >= 30) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 110 + (index * 1); + buffer.putByte(pos, value); + } + + public static String unitOfMeasureCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionFuture27Encoder putUnitOfMeasure(final byte[] src, final int srcOffset) + { + final int length = 30; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 110, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionFuture27Encoder unitOfMeasure(final String src) + { + final int length = 30; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 110, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 110 + start, (byte)0); + } + + return this; + } + + public static int unitOfMeasureQtyEncodingOffset() + { + return 140; + } + + public static int unitOfMeasureQtyEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder unitOfMeasureQty = new PRICENULLEncoder(); + + public PRICENULLEncoder unitOfMeasureQty() + { + unitOfMeasureQty.wrap(buffer, offset + 140); + return unitOfMeasureQty; + } + + public static int tradingReferencePriceEncodingOffset() + { + return 148; + } + + public static int tradingReferencePriceEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder tradingReferencePrice = new PRICENULLEncoder(); + + public PRICENULLEncoder tradingReferencePrice() + { + tradingReferencePrice.wrap(buffer, offset + 148); + return tradingReferencePrice; + } + + public static int settlPriceTypeEncodingOffset() + { + return 156; + } + + public static int settlPriceTypeEncodingLength() + { + return 1; + } + + private final SettlPriceTypeEncoder settlPriceType = new SettlPriceTypeEncoder(); + + public SettlPriceTypeEncoder settlPriceType() + { + settlPriceType.wrap(buffer, offset + 156); + return settlPriceType; + } + + public static int openInterestQtyEncodingOffset() + { + return 157; + } + + public static int openInterestQtyEncodingLength() + { + return 4; + } + + public static int openInterestQtyNullValue() + { + return 2147483647; + } + + public static int openInterestQtyMinValue() + { + return -2147483647; + } + + public static int openInterestQtyMaxValue() + { + return 2147483647; + } + + public MDInstrumentDefinitionFuture27Encoder openInterestQty(final int value) + { + buffer.putInt(offset + 157, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int clearedVolumeEncodingOffset() + { + return 161; + } + + public static int clearedVolumeEncodingLength() + { + return 4; + } + + public static int clearedVolumeNullValue() + { + return 2147483647; + } + + public static int clearedVolumeMinValue() + { + return -2147483647; + } + + public static int clearedVolumeMaxValue() + { + return 2147483647; + } + + public MDInstrumentDefinitionFuture27Encoder clearedVolume(final int value) + { + buffer.putInt(offset + 161, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int highLimitPriceEncodingOffset() + { + return 165; + } + + public static int highLimitPriceEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder highLimitPrice = new PRICENULLEncoder(); + + public PRICENULLEncoder highLimitPrice() + { + highLimitPrice.wrap(buffer, offset + 165); + return highLimitPrice; + } + + public static int lowLimitPriceEncodingOffset() + { + return 173; + } + + public static int lowLimitPriceEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder lowLimitPrice = new PRICENULLEncoder(); + + public PRICENULLEncoder lowLimitPrice() + { + lowLimitPrice.wrap(buffer, offset + 173); + return lowLimitPrice; + } + + public static int maxPriceVariationEncodingOffset() + { + return 181; + } + + public static int maxPriceVariationEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder maxPriceVariation = new PRICENULLEncoder(); + + public PRICENULLEncoder maxPriceVariation() + { + maxPriceVariation.wrap(buffer, offset + 181); + return maxPriceVariation; + } + + public static int decayQuantityEncodingOffset() + { + return 189; + } + + public static int decayQuantityEncodingLength() + { + return 4; + } + + public static int decayQuantityNullValue() + { + return 2147483647; + } + + public static int decayQuantityMinValue() + { + return -2147483647; + } + + public static int decayQuantityMaxValue() + { + return 2147483647; + } + + public MDInstrumentDefinitionFuture27Encoder decayQuantity(final int value) + { + buffer.putInt(offset + 189, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int decayStartDateEncodingOffset() + { + return 193; + } + + public static int decayStartDateEncodingLength() + { + return 2; + } + + public static int decayStartDateNullValue() + { + return 65535; + } + + public static int decayStartDateMinValue() + { + return 0; + } + + public static int decayStartDateMaxValue() + { + return 65534; + } + + public MDInstrumentDefinitionFuture27Encoder decayStartDate(final int value) + { + buffer.putShort(offset + 193, (short)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int originalContractSizeEncodingOffset() + { + return 195; + } + + public static int originalContractSizeEncodingLength() + { + return 4; + } + + public static int originalContractSizeNullValue() + { + return 2147483647; + } + + public static int originalContractSizeMinValue() + { + return -2147483647; + } + + public static int originalContractSizeMaxValue() + { + return 2147483647; + } + + public MDInstrumentDefinitionFuture27Encoder originalContractSize(final int value) + { + buffer.putInt(offset + 195, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int contractMultiplierEncodingOffset() + { + return 199; + } + + public static int contractMultiplierEncodingLength() + { + return 4; + } + + public static int contractMultiplierNullValue() + { + return 2147483647; + } + + public static int contractMultiplierMinValue() + { + return -2147483647; + } + + public static int contractMultiplierMaxValue() + { + return 2147483647; + } + + public MDInstrumentDefinitionFuture27Encoder contractMultiplier(final int value) + { + buffer.putInt(offset + 199, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int contractMultiplierUnitEncodingOffset() + { + return 203; + } + + public static int contractMultiplierUnitEncodingLength() + { + return 1; + } + + public static byte contractMultiplierUnitNullValue() + { + return (byte)127; + } + + public static byte contractMultiplierUnitMinValue() + { + return (byte)-127; + } + + public static byte contractMultiplierUnitMaxValue() + { + return (byte)127; + } + + public MDInstrumentDefinitionFuture27Encoder contractMultiplierUnit(final byte value) + { + buffer.putByte(offset + 203, value); + return this; + } + + + public static int flowScheduleTypeEncodingOffset() + { + return 204; + } + + public static int flowScheduleTypeEncodingLength() + { + return 1; + } + + public static byte flowScheduleTypeNullValue() + { + return (byte)127; + } + + public static byte flowScheduleTypeMinValue() + { + return (byte)-127; + } + + public static byte flowScheduleTypeMaxValue() + { + return (byte)127; + } + + public MDInstrumentDefinitionFuture27Encoder flowScheduleType(final byte value) + { + buffer.putByte(offset + 204, value); + return this; + } + + + public static int minPriceIncrementAmountEncodingOffset() + { + return 205; + } + + public static int minPriceIncrementAmountEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder minPriceIncrementAmount = new PRICENULLEncoder(); + + public PRICENULLEncoder minPriceIncrementAmount() + { + minPriceIncrementAmount.wrap(buffer, offset + 205); + return minPriceIncrementAmount; + } + + public static int userDefinedInstrumentEncodingOffset() + { + return 213; + } + + public static int userDefinedInstrumentEncodingLength() + { + return 1; + } + + public static byte userDefinedInstrumentNullValue() + { + return (byte)0; + } + + public static byte userDefinedInstrumentMinValue() + { + return (byte)32; + } + + public static byte userDefinedInstrumentMaxValue() + { + return (byte)126; + } + + public MDInstrumentDefinitionFuture27Encoder userDefinedInstrument(final byte value) + { + buffer.putByte(offset + 213, value); + return this; + } + + + public static int tradingReferenceDateEncodingOffset() + { + return 214; + } + + public static int tradingReferenceDateEncodingLength() + { + return 2; + } + + public static int tradingReferenceDateNullValue() + { + return 65535; + } + + public static int tradingReferenceDateMinValue() + { + return 0; + } + + public static int tradingReferenceDateMaxValue() + { + return 65534; + } + + public MDInstrumentDefinitionFuture27Encoder tradingReferenceDate(final int value) + { + buffer.putShort(offset + 214, (short)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + private final NoEventsEncoder noEvents = new NoEventsEncoder(); + + public static long noEventsId() + { + return 864; + } + + public NoEventsEncoder noEventsCount(final int count) + { + noEvents.wrap(parentMessage, buffer, count); + return noEvents; + } + + public static class NoEventsEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private MDInstrumentDefinitionFuture27Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDInstrumentDefinitionFuture27Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)9); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 9; + } + + public NoEventsEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int eventTypeEncodingOffset() + { + return 0; + } + + public static int eventTypeEncodingLength() + { + return 1; + } + + public NoEventsEncoder eventType(final EventType value) + { + buffer.putByte(offset + 0, (byte)value.value()); + return this; + } + + public static int eventTimeEncodingOffset() + { + return 1; + } + + public static int eventTimeEncodingLength() + { + return 8; + } + + public static long eventTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long eventTimeMinValue() + { + return 0x0L; + } + + public static long eventTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public NoEventsEncoder eventTime(final long value) + { + buffer.putLong(offset + 1, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + } + + private final NoMDFeedTypesEncoder noMDFeedTypes = new NoMDFeedTypesEncoder(); + + public static long noMDFeedTypesId() + { + return 1141; + } + + public NoMDFeedTypesEncoder noMDFeedTypesCount(final int count) + { + noMDFeedTypes.wrap(parentMessage, buffer, count); + return noMDFeedTypes; + } + + public static class NoMDFeedTypesEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private MDInstrumentDefinitionFuture27Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDInstrumentDefinitionFuture27Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)4); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 4; + } + + public NoMDFeedTypesEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int mDFeedTypeEncodingOffset() + { + return 0; + } + + public static int mDFeedTypeEncodingLength() + { + return 3; + } + + public static byte mDFeedTypeNullValue() + { + return (byte)0; + } + + public static byte mDFeedTypeMinValue() + { + return (byte)32; + } + + public static byte mDFeedTypeMaxValue() + { + return (byte)126; + } + + public static int mDFeedTypeLength() + { + return 3; + } + + public void mDFeedType(final int index, final byte value) + { + if (index < 0 || index >= 3) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 0 + (index * 1); + buffer.putByte(pos, value); + } + + public static String mDFeedTypeCharacterEncoding() + { + return "UTF-8"; + } + + public NoMDFeedTypesEncoder putMDFeedType(final byte[] src, final int srcOffset) + { + final int length = 3; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 0, src, srcOffset, length); + + return this; + } + + public NoMDFeedTypesEncoder mDFeedType(final String src) + { + final int length = 3; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 0, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 0 + start, (byte)0); + } + + return this; + } + + public static int marketDepthEncodingOffset() + { + return 3; + } + + public static int marketDepthEncodingLength() + { + return 1; + } + + public static byte marketDepthNullValue() + { + return (byte)-128; + } + + public static byte marketDepthMinValue() + { + return (byte)-127; + } + + public static byte marketDepthMaxValue() + { + return (byte)127; + } + + public NoMDFeedTypesEncoder marketDepth(final byte value) + { + buffer.putByte(offset + 3, value); + return this; + } + + } + + private final NoInstAttribEncoder noInstAttrib = new NoInstAttribEncoder(); + + public static long noInstAttribId() + { + return 870; + } + + public NoInstAttribEncoder noInstAttribCount(final int count) + { + noInstAttrib.wrap(parentMessage, buffer, count); + return noInstAttrib; + } + + public static class NoInstAttribEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private MDInstrumentDefinitionFuture27Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDInstrumentDefinitionFuture27Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)4); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 4; + } + + public NoInstAttribEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int instAttribTypeEncodingOffset() + { + return 0; + } + + public static int instAttribTypeEncodingLength() + { + return 0; + } + + public static byte instAttribTypeNullValue() + { + return (byte)-128; + } + + public static byte instAttribTypeMinValue() + { + return (byte)-127; + } + + public static byte instAttribTypeMaxValue() + { + return (byte)127; + } + + public byte instAttribType() + { + return (byte)24; + } + + public static int instAttribValueEncodingOffset() + { + return 0; + } + + public static int instAttribValueEncodingLength() + { + return 4; + } + + private final InstAttribValueEncoder instAttribValue = new InstAttribValueEncoder(); + + public InstAttribValueEncoder instAttribValue() + { + instAttribValue.wrap(buffer, offset + 0); + return instAttribValue; + } + } + + private final NoLotTypeRulesEncoder noLotTypeRules = new NoLotTypeRulesEncoder(); + + public static long noLotTypeRulesId() + { + return 1234; + } + + public NoLotTypeRulesEncoder noLotTypeRulesCount(final int count) + { + noLotTypeRules.wrap(parentMessage, buffer, count); + return noLotTypeRules; + } + + public static class NoLotTypeRulesEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private MDInstrumentDefinitionFuture27Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDInstrumentDefinitionFuture27Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)5); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 5; + } + + public NoLotTypeRulesEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int lotTypeEncodingOffset() + { + return 0; + } + + public static int lotTypeEncodingLength() + { + return 1; + } + + public static byte lotTypeNullValue() + { + return (byte)-128; + } + + public static byte lotTypeMinValue() + { + return (byte)-127; + } + + public static byte lotTypeMaxValue() + { + return (byte)127; + } + + public NoLotTypeRulesEncoder lotType(final byte value) + { + buffer.putByte(offset + 0, value); + return this; + } + + + public static int minLotSizeEncodingOffset() + { + return 1; + } + + public static int minLotSizeEncodingLength() + { + return 4; + } + + private final DecimalQtyEncoder minLotSize = new DecimalQtyEncoder(); + + public DecimalQtyEncoder minLotSize() + { + minLotSize.wrap(buffer, offset + 1); + return minLotSize; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + MDInstrumentDefinitionFuture27Decoder writer = new MDInstrumentDefinitionFuture27Decoder(); + writer.wrap(buffer, offset, BLOCK_LENGTH, SCHEMA_VERSION); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDInstrumentDefinitionOption41Decoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDInstrumentDefinitionOption41Decoder.java new file mode 100644 index 0000000..b9aed88 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDInstrumentDefinitionOption41Decoder.java @@ -0,0 +1,4516 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDInstrumentDefinitionOption41Decoder"}) +@SuppressWarnings("all") +public class MDInstrumentDefinitionOption41Decoder +{ + public static final int BLOCK_LENGTH = 213; + public static final int TEMPLATE_ID = 41; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final MDInstrumentDefinitionOption41Decoder parentMessage = this; + private DirectBuffer buffer; + protected int offset; + protected int limit; + protected int actingBlockLength; + protected int actingVersion; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "d"; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public MDInstrumentDefinitionOption41Decoder wrap( + final DirectBuffer buffer, final int offset, final int actingBlockLength, final int actingVersion) + { + this.buffer = buffer; + this.offset = offset; + this.actingBlockLength = actingBlockLength; + this.actingVersion = actingVersion; + limit(offset + actingBlockLength); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int matchEventIndicatorId() + { + return 5799; + } + + public static int matchEventIndicatorSinceVersion() + { + return 0; + } + + public static int matchEventIndicatorEncodingOffset() + { + return 0; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + public static String matchEventIndicatorMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MultipleCharValue"; + } + + return ""; + } + + private final MatchEventIndicatorDecoder matchEventIndicator = new MatchEventIndicatorDecoder(); + + public MatchEventIndicatorDecoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 0); + return matchEventIndicator; + } + + public static int totNumReportsId() + { + return 911; + } + + public static int totNumReportsSinceVersion() + { + return 0; + } + + public static int totNumReportsEncodingOffset() + { + return 1; + } + + public static int totNumReportsEncodingLength() + { + return 4; + } + + public static String totNumReportsMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static long totNumReportsNullValue() + { + return 4294967295L; + } + + public static long totNumReportsMinValue() + { + return 0L; + } + + public static long totNumReportsMaxValue() + { + return 4294967293L; + } + + public long totNumReports() + { + return (buffer.getInt(offset + 1, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + public static int securityUpdateActionId() + { + return 980; + } + + public static int securityUpdateActionSinceVersion() + { + return 0; + } + + public static int securityUpdateActionEncodingOffset() + { + return 5; + } + + public static int securityUpdateActionEncodingLength() + { + return 1; + } + + public static String securityUpdateActionMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public SecurityUpdateAction securityUpdateAction() + { + return SecurityUpdateAction.get(buffer.getByte(offset + 5)); + } + + + public static int lastUpdateTimeId() + { + return 779; + } + + public static int lastUpdateTimeSinceVersion() + { + return 0; + } + + public static int lastUpdateTimeEncodingOffset() + { + return 6; + } + + public static int lastUpdateTimeEncodingLength() + { + return 8; + } + + public static String lastUpdateTimeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "UTCTimestamp"; + } + + return ""; + } + + public static long lastUpdateTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long lastUpdateTimeMinValue() + { + return 0x0L; + } + + public static long lastUpdateTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long lastUpdateTime() + { + return buffer.getLong(offset + 6, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int mDSecurityTradingStatusId() + { + return 1682; + } + + public static int mDSecurityTradingStatusSinceVersion() + { + return 0; + } + + public static int mDSecurityTradingStatusEncodingOffset() + { + return 14; + } + + public static int mDSecurityTradingStatusEncodingLength() + { + return 1; + } + + public static String mDSecurityTradingStatusMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public SecurityTradingStatus mDSecurityTradingStatus() + { + return SecurityTradingStatus.get(((short)(buffer.getByte(offset + 14) & 0xFF))); + } + + + public static int applIDId() + { + return 1180; + } + + public static int applIDSinceVersion() + { + return 0; + } + + public static int applIDEncodingOffset() + { + return 15; + } + + public static int applIDEncodingLength() + { + return 2; + } + + public static String applIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static short applIDNullValue() + { + return (short)-32768; + } + + public static short applIDMinValue() + { + return (short)-32767; + } + + public static short applIDMaxValue() + { + return (short)32767; + } + + public short applID() + { + return buffer.getShort(offset + 15, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int marketSegmentIDId() + { + return 1300; + } + + public static int marketSegmentIDSinceVersion() + { + return 0; + } + + public static int marketSegmentIDEncodingOffset() + { + return 17; + } + + public static int marketSegmentIDEncodingLength() + { + return 1; + } + + public static String marketSegmentIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static short marketSegmentIDNullValue() + { + return (short)255; + } + + public static short marketSegmentIDMinValue() + { + return (short)0; + } + + public static short marketSegmentIDMaxValue() + { + return (short)254; + } + + public short marketSegmentID() + { + return ((short)(buffer.getByte(offset + 17) & 0xFF)); + } + + + public static int underlyingProductId() + { + return 462; + } + + public static int underlyingProductSinceVersion() + { + return 0; + } + + public static int underlyingProductEncodingOffset() + { + return 18; + } + + public static int underlyingProductEncodingLength() + { + return 1; + } + + public static String underlyingProductMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static short underlyingProductNullValue() + { + return (short)255; + } + + public static short underlyingProductMinValue() + { + return (short)0; + } + + public static short underlyingProductMaxValue() + { + return (short)254; + } + + public short underlyingProduct() + { + return ((short)(buffer.getByte(offset + 18) & 0xFF)); + } + + + public static int securityExchangeId() + { + return 207; + } + + public static int securityExchangeSinceVersion() + { + return 0; + } + + public static int securityExchangeEncodingOffset() + { + return 19; + } + + public static int securityExchangeEncodingLength() + { + return 4; + } + + public static String securityExchangeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Exchange"; + } + + return ""; + } + + public static byte securityExchangeNullValue() + { + return (byte)0; + } + + public static byte securityExchangeMinValue() + { + return (byte)32; + } + + public static byte securityExchangeMaxValue() + { + return (byte)126; + } + + public static int securityExchangeLength() + { + return 4; + } + + public byte securityExchange(final int index) + { + if (index < 0 || index >= 4) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 19 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String securityExchangeCharacterEncoding() + { + return "UTF-8"; + } + + public int getSecurityExchange(final byte[] dst, final int dstOffset) + { + final int length = 4; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 19, dst, dstOffset, length); + + return length; + } + + public String securityExchange() + { + final byte[] dst = new byte[4]; + buffer.getBytes(this.offset + 19, dst, 0, 4); + + int end = 0; + for (; end < 4 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int securityGroupId() + { + return 1151; + } + + public static int securityGroupSinceVersion() + { + return 0; + } + + public static int securityGroupEncodingOffset() + { + return 23; + } + + public static int securityGroupEncodingLength() + { + return 6; + } + + public static String securityGroupMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte securityGroupNullValue() + { + return (byte)0; + } + + public static byte securityGroupMinValue() + { + return (byte)32; + } + + public static byte securityGroupMaxValue() + { + return (byte)126; + } + + public static int securityGroupLength() + { + return 6; + } + + public byte securityGroup(final int index) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 23 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String securityGroupCharacterEncoding() + { + return "UTF-8"; + } + + public int getSecurityGroup(final byte[] dst, final int dstOffset) + { + final int length = 6; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 23, dst, dstOffset, length); + + return length; + } + + public String securityGroup() + { + final byte[] dst = new byte[6]; + buffer.getBytes(this.offset + 23, dst, 0, 6); + + int end = 0; + for (; end < 6 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int assetId() + { + return 6937; + } + + public static int assetSinceVersion() + { + return 0; + } + + public static int assetEncodingOffset() + { + return 29; + } + + public static int assetEncodingLength() + { + return 6; + } + + public static String assetMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte assetNullValue() + { + return (byte)0; + } + + public static byte assetMinValue() + { + return (byte)32; + } + + public static byte assetMaxValue() + { + return (byte)126; + } + + public static int assetLength() + { + return 6; + } + + public byte asset(final int index) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 29 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String assetCharacterEncoding() + { + return "UTF-8"; + } + + public int getAsset(final byte[] dst, final int dstOffset) + { + final int length = 6; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 29, dst, dstOffset, length); + + return length; + } + + public String asset() + { + final byte[] dst = new byte[6]; + buffer.getBytes(this.offset + 29, dst, 0, 6); + + int end = 0; + for (; end < 6 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int symbolId() + { + return 55; + } + + public static int symbolSinceVersion() + { + return 0; + } + + public static int symbolEncodingOffset() + { + return 35; + } + + public static int symbolEncodingLength() + { + return 20; + } + + public static String symbolMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte symbolNullValue() + { + return (byte)0; + } + + public static byte symbolMinValue() + { + return (byte)32; + } + + public static byte symbolMaxValue() + { + return (byte)126; + } + + public static int symbolLength() + { + return 20; + } + + public byte symbol(final int index) + { + if (index < 0 || index >= 20) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 35 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String symbolCharacterEncoding() + { + return "UTF-8"; + } + + public int getSymbol(final byte[] dst, final int dstOffset) + { + final int length = 20; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 35, dst, dstOffset, length); + + return length; + } + + public String symbol() + { + final byte[] dst = new byte[20]; + buffer.getBytes(this.offset + 35, dst, 0, 20); + + int end = 0; + for (; end < 20 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int securityIDId() + { + return 48; + } + + public static int securityIDSinceVersion() + { + return 0; + } + + public static int securityIDEncodingOffset() + { + return 55; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static String securityIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public int securityID() + { + return buffer.getInt(offset + 55, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int securityIDSourceId() + { + return 22; + } + + public static int securityIDSourceSinceVersion() + { + return 0; + } + + public static int securityIDSourceEncodingOffset() + { + return 59; + } + + public static int securityIDSourceEncodingLength() + { + return 0; + } + + public static String securityIDSourceMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public static byte securityIDSourceNullValue() + { + return (byte)0; + } + + public static byte securityIDSourceMinValue() + { + return (byte)32; + } + + public static byte securityIDSourceMaxValue() + { + return (byte)126; + } + + private static final byte[] SECURITYIDSOURCE_VALUE = {56}; + + public static int securityIDSourceLength() + { + return 1; + } + + public byte securityIDSource(final int index) + { + return SECURITYIDSOURCE_VALUE[index]; + } + + public int getSecurityIDSource(final byte[] dst, final int offset, final int length) + { + final int bytesCopied = Math.min(length, 1); + System.arraycopy(SECURITYIDSOURCE_VALUE, 0, dst, offset, bytesCopied); + + return bytesCopied; + } + + public static int securityTypeId() + { + return 167; + } + + public static int securityTypeSinceVersion() + { + return 0; + } + + public static int securityTypeEncodingOffset() + { + return 59; + } + + public static int securityTypeEncodingLength() + { + return 6; + } + + public static String securityTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte securityTypeNullValue() + { + return (byte)0; + } + + public static byte securityTypeMinValue() + { + return (byte)32; + } + + public static byte securityTypeMaxValue() + { + return (byte)126; + } + + public static int securityTypeLength() + { + return 6; + } + + public byte securityType(final int index) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 59 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String securityTypeCharacterEncoding() + { + return "UTF-8"; + } + + public int getSecurityType(final byte[] dst, final int dstOffset) + { + final int length = 6; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 59, dst, dstOffset, length); + + return length; + } + + public String securityType() + { + final byte[] dst = new byte[6]; + buffer.getBytes(this.offset + 59, dst, 0, 6); + + int end = 0; + for (; end < 6 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int cFICodeId() + { + return 461; + } + + public static int cFICodeSinceVersion() + { + return 0; + } + + public static int cFICodeEncodingOffset() + { + return 65; + } + + public static int cFICodeEncodingLength() + { + return 6; + } + + public static String cFICodeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte cFICodeNullValue() + { + return (byte)0; + } + + public static byte cFICodeMinValue() + { + return (byte)32; + } + + public static byte cFICodeMaxValue() + { + return (byte)126; + } + + public static int cFICodeLength() + { + return 6; + } + + public byte cFICode(final int index) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 65 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String cFICodeCharacterEncoding() + { + return "UTF-8"; + } + + public int getCFICode(final byte[] dst, final int dstOffset) + { + final int length = 6; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 65, dst, dstOffset, length); + + return length; + } + + public String cFICode() + { + final byte[] dst = new byte[6]; + buffer.getBytes(this.offset + 65, dst, 0, 6); + + int end = 0; + for (; end < 6 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int putOrCallId() + { + return 201; + } + + public static int putOrCallSinceVersion() + { + return 0; + } + + public static int putOrCallEncodingOffset() + { + return 71; + } + + public static int putOrCallEncodingLength() + { + return 1; + } + + public static String putOrCallMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public PutOrCall putOrCall() + { + return PutOrCall.get(((short)(buffer.getByte(offset + 71) & 0xFF))); + } + + + public static int maturityMonthYearId() + { + return 200; + } + + public static int maturityMonthYearSinceVersion() + { + return 0; + } + + public static int maturityMonthYearEncodingOffset() + { + return 72; + } + + public static int maturityMonthYearEncodingLength() + { + return 5; + } + + public static String maturityMonthYearMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MonthYear"; + } + + return ""; + } + + private final MaturityMonthYearDecoder maturityMonthYear = new MaturityMonthYearDecoder(); + + public MaturityMonthYearDecoder maturityMonthYear() + { + maturityMonthYear.wrap(buffer, offset + 72); + return maturityMonthYear; + } + + public static int currencyId() + { + return 15; + } + + public static int currencySinceVersion() + { + return 0; + } + + public static int currencyEncodingOffset() + { + return 77; + } + + public static int currencyEncodingLength() + { + return 3; + } + + public static String currencyMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Currency"; + } + + return ""; + } + + public static byte currencyNullValue() + { + return (byte)0; + } + + public static byte currencyMinValue() + { + return (byte)32; + } + + public static byte currencyMaxValue() + { + return (byte)126; + } + + public static int currencyLength() + { + return 3; + } + + public byte currency(final int index) + { + if (index < 0 || index >= 3) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 77 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String currencyCharacterEncoding() + { + return "UTF-8"; + } + + public int getCurrency(final byte[] dst, final int dstOffset) + { + final int length = 3; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 77, dst, dstOffset, length); + + return length; + } + + public String currency() + { + final byte[] dst = new byte[3]; + buffer.getBytes(this.offset + 77, dst, 0, 3); + + int end = 0; + for (; end < 3 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int strikePriceId() + { + return 202; + } + + public static int strikePriceSinceVersion() + { + return 0; + } + + public static int strikePriceEncodingOffset() + { + return 80; + } + + public static int strikePriceEncodingLength() + { + return 8; + } + + public static String strikePriceMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder strikePrice = new PRICENULLDecoder(); + + public PRICENULLDecoder strikePrice() + { + strikePrice.wrap(buffer, offset + 80); + return strikePrice; + } + + public static int strikeCurrencyId() + { + return 947; + } + + public static int strikeCurrencySinceVersion() + { + return 0; + } + + public static int strikeCurrencyEncodingOffset() + { + return 88; + } + + public static int strikeCurrencyEncodingLength() + { + return 3; + } + + public static String strikeCurrencyMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Currency"; + } + + return ""; + } + + public static byte strikeCurrencyNullValue() + { + return (byte)0; + } + + public static byte strikeCurrencyMinValue() + { + return (byte)32; + } + + public static byte strikeCurrencyMaxValue() + { + return (byte)126; + } + + public static int strikeCurrencyLength() + { + return 3; + } + + public byte strikeCurrency(final int index) + { + if (index < 0 || index >= 3) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 88 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String strikeCurrencyCharacterEncoding() + { + return "UTF-8"; + } + + public int getStrikeCurrency(final byte[] dst, final int dstOffset) + { + final int length = 3; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 88, dst, dstOffset, length); + + return length; + } + + public String strikeCurrency() + { + final byte[] dst = new byte[3]; + buffer.getBytes(this.offset + 88, dst, 0, 3); + + int end = 0; + for (; end < 3 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int settlCurrencyId() + { + return 120; + } + + public static int settlCurrencySinceVersion() + { + return 0; + } + + public static int settlCurrencyEncodingOffset() + { + return 91; + } + + public static int settlCurrencyEncodingLength() + { + return 3; + } + + public static String settlCurrencyMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Currency"; + } + + return ""; + } + + public static byte settlCurrencyNullValue() + { + return (byte)0; + } + + public static byte settlCurrencyMinValue() + { + return (byte)32; + } + + public static byte settlCurrencyMaxValue() + { + return (byte)126; + } + + public static int settlCurrencyLength() + { + return 3; + } + + public byte settlCurrency(final int index) + { + if (index < 0 || index >= 3) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 91 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String settlCurrencyCharacterEncoding() + { + return "UTF-8"; + } + + public int getSettlCurrency(final byte[] dst, final int dstOffset) + { + final int length = 3; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 91, dst, dstOffset, length); + + return length; + } + + public String settlCurrency() + { + final byte[] dst = new byte[3]; + buffer.getBytes(this.offset + 91, dst, 0, 3); + + int end = 0; + for (; end < 3 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int minCabPriceId() + { + return 9850; + } + + public static int minCabPriceSinceVersion() + { + return 0; + } + + public static int minCabPriceEncodingOffset() + { + return 94; + } + + public static int minCabPriceEncodingLength() + { + return 8; + } + + public static String minCabPriceMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder minCabPrice = new PRICENULLDecoder(); + + public PRICENULLDecoder minCabPrice() + { + minCabPrice.wrap(buffer, offset + 94); + return minCabPrice; + } + + public static int matchAlgorithmId() + { + return 1142; + } + + public static int matchAlgorithmSinceVersion() + { + return 0; + } + + public static int matchAlgorithmEncodingOffset() + { + return 102; + } + + public static int matchAlgorithmEncodingLength() + { + return 1; + } + + public static String matchAlgorithmMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public static byte matchAlgorithmNullValue() + { + return (byte)0; + } + + public static byte matchAlgorithmMinValue() + { + return (byte)32; + } + + public static byte matchAlgorithmMaxValue() + { + return (byte)126; + } + + public byte matchAlgorithm() + { + return buffer.getByte(offset + 102); + } + + + public static int minTradeVolId() + { + return 562; + } + + public static int minTradeVolSinceVersion() + { + return 0; + } + + public static int minTradeVolEncodingOffset() + { + return 103; + } + + public static int minTradeVolEncodingLength() + { + return 4; + } + + public static String minTradeVolMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static long minTradeVolNullValue() + { + return 4294967294L; + } + + public static long minTradeVolMinValue() + { + return 0L; + } + + public static long minTradeVolMaxValue() + { + return 4294967293L; + } + + public long minTradeVol() + { + return (buffer.getInt(offset + 103, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + public static int maxTradeVolId() + { + return 1140; + } + + public static int maxTradeVolSinceVersion() + { + return 0; + } + + public static int maxTradeVolEncodingOffset() + { + return 107; + } + + public static int maxTradeVolEncodingLength() + { + return 4; + } + + public static String maxTradeVolMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static long maxTradeVolNullValue() + { + return 4294967294L; + } + + public static long maxTradeVolMinValue() + { + return 0L; + } + + public static long maxTradeVolMaxValue() + { + return 4294967293L; + } + + public long maxTradeVol() + { + return (buffer.getInt(offset + 107, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + public static int minPriceIncrementId() + { + return 969; + } + + public static int minPriceIncrementSinceVersion() + { + return 0; + } + + public static int minPriceIncrementEncodingOffset() + { + return 111; + } + + public static int minPriceIncrementEncodingLength() + { + return 8; + } + + public static String minPriceIncrementMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder minPriceIncrement = new PRICENULLDecoder(); + + public PRICENULLDecoder minPriceIncrement() + { + minPriceIncrement.wrap(buffer, offset + 111); + return minPriceIncrement; + } + + public static int minPriceIncrementAmountId() + { + return 1146; + } + + public static int minPriceIncrementAmountSinceVersion() + { + return 0; + } + + public static int minPriceIncrementAmountEncodingOffset() + { + return 119; + } + + public static int minPriceIncrementAmountEncodingLength() + { + return 8; + } + + public static String minPriceIncrementAmountMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder minPriceIncrementAmount = new PRICENULLDecoder(); + + public PRICENULLDecoder minPriceIncrementAmount() + { + minPriceIncrementAmount.wrap(buffer, offset + 119); + return minPriceIncrementAmount; + } + + public static int displayFactorId() + { + return 9787; + } + + public static int displayFactorSinceVersion() + { + return 0; + } + + public static int displayFactorEncodingOffset() + { + return 127; + } + + public static int displayFactorEncodingLength() + { + return 8; + } + + public static String displayFactorMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "float"; + } + + return ""; + } + + private final FLOATDecoder displayFactor = new FLOATDecoder(); + + public FLOATDecoder displayFactor() + { + displayFactor.wrap(buffer, offset + 127); + return displayFactor; + } + + public static int tickRuleId() + { + return 6350; + } + + public static int tickRuleSinceVersion() + { + return 0; + } + + public static int tickRuleEncodingOffset() + { + return 135; + } + + public static int tickRuleEncodingLength() + { + return 1; + } + + public static String tickRuleMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static byte tickRuleNullValue() + { + return (byte)127; + } + + public static byte tickRuleMinValue() + { + return (byte)-127; + } + + public static byte tickRuleMaxValue() + { + return (byte)127; + } + + public byte tickRule() + { + return buffer.getByte(offset + 135); + } + + + public static int mainFractionId() + { + return 37702; + } + + public static int mainFractionSinceVersion() + { + return 0; + } + + public static int mainFractionEncodingOffset() + { + return 136; + } + + public static int mainFractionEncodingLength() + { + return 1; + } + + public static String mainFractionMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static short mainFractionNullValue() + { + return (short)255; + } + + public static short mainFractionMinValue() + { + return (short)0; + } + + public static short mainFractionMaxValue() + { + return (short)254; + } + + public short mainFraction() + { + return ((short)(buffer.getByte(offset + 136) & 0xFF)); + } + + + public static int subFractionId() + { + return 37703; + } + + public static int subFractionSinceVersion() + { + return 0; + } + + public static int subFractionEncodingOffset() + { + return 137; + } + + public static int subFractionEncodingLength() + { + return 1; + } + + public static String subFractionMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static short subFractionNullValue() + { + return (short)255; + } + + public static short subFractionMinValue() + { + return (short)0; + } + + public static short subFractionMaxValue() + { + return (short)254; + } + + public short subFraction() + { + return ((short)(buffer.getByte(offset + 137) & 0xFF)); + } + + + public static int priceDisplayFormatId() + { + return 9800; + } + + public static int priceDisplayFormatSinceVersion() + { + return 0; + } + + public static int priceDisplayFormatEncodingOffset() + { + return 138; + } + + public static int priceDisplayFormatEncodingLength() + { + return 1; + } + + public static String priceDisplayFormatMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static short priceDisplayFormatNullValue() + { + return (short)255; + } + + public static short priceDisplayFormatMinValue() + { + return (short)0; + } + + public static short priceDisplayFormatMaxValue() + { + return (short)254; + } + + public short priceDisplayFormat() + { + return ((short)(buffer.getByte(offset + 138) & 0xFF)); + } + + + public static int unitOfMeasureId() + { + return 996; + } + + public static int unitOfMeasureSinceVersion() + { + return 0; + } + + public static int unitOfMeasureEncodingOffset() + { + return 139; + } + + public static int unitOfMeasureEncodingLength() + { + return 30; + } + + public static String unitOfMeasureMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte unitOfMeasureNullValue() + { + return (byte)0; + } + + public static byte unitOfMeasureMinValue() + { + return (byte)32; + } + + public static byte unitOfMeasureMaxValue() + { + return (byte)126; + } + + public static int unitOfMeasureLength() + { + return 30; + } + + public byte unitOfMeasure(final int index) + { + if (index < 0 || index >= 30) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 139 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String unitOfMeasureCharacterEncoding() + { + return "UTF-8"; + } + + public int getUnitOfMeasure(final byte[] dst, final int dstOffset) + { + final int length = 30; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 139, dst, dstOffset, length); + + return length; + } + + public String unitOfMeasure() + { + final byte[] dst = new byte[30]; + buffer.getBytes(this.offset + 139, dst, 0, 30); + + int end = 0; + for (; end < 30 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int unitOfMeasureQtyId() + { + return 1147; + } + + public static int unitOfMeasureQtySinceVersion() + { + return 0; + } + + public static int unitOfMeasureQtyEncodingOffset() + { + return 169; + } + + public static int unitOfMeasureQtyEncodingLength() + { + return 8; + } + + public static String unitOfMeasureQtyMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + private final PRICENULLDecoder unitOfMeasureQty = new PRICENULLDecoder(); + + public PRICENULLDecoder unitOfMeasureQty() + { + unitOfMeasureQty.wrap(buffer, offset + 169); + return unitOfMeasureQty; + } + + public static int tradingReferencePriceId() + { + return 1150; + } + + public static int tradingReferencePriceSinceVersion() + { + return 0; + } + + public static int tradingReferencePriceEncodingOffset() + { + return 177; + } + + public static int tradingReferencePriceEncodingLength() + { + return 8; + } + + public static String tradingReferencePriceMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder tradingReferencePrice = new PRICENULLDecoder(); + + public PRICENULLDecoder tradingReferencePrice() + { + tradingReferencePrice.wrap(buffer, offset + 177); + return tradingReferencePrice; + } + + public static int settlPriceTypeId() + { + return 731; + } + + public static int settlPriceTypeSinceVersion() + { + return 0; + } + + public static int settlPriceTypeEncodingOffset() + { + return 185; + } + + public static int settlPriceTypeEncodingLength() + { + return 1; + } + + public static String settlPriceTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MultipleCharValue"; + } + + return ""; + } + + private final SettlPriceTypeDecoder settlPriceType = new SettlPriceTypeDecoder(); + + public SettlPriceTypeDecoder settlPriceType() + { + settlPriceType.wrap(buffer, offset + 185); + return settlPriceType; + } + + public static int clearedVolumeId() + { + return 5791; + } + + public static int clearedVolumeSinceVersion() + { + return 0; + } + + public static int clearedVolumeEncodingOffset() + { + return 186; + } + + public static int clearedVolumeEncodingLength() + { + return 4; + } + + public static String clearedVolumeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static int clearedVolumeNullValue() + { + return 2147483647; + } + + public static int clearedVolumeMinValue() + { + return -2147483647; + } + + public static int clearedVolumeMaxValue() + { + return 2147483647; + } + + public int clearedVolume() + { + return buffer.getInt(offset + 186, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int openInterestQtyId() + { + return 5792; + } + + public static int openInterestQtySinceVersion() + { + return 0; + } + + public static int openInterestQtyEncodingOffset() + { + return 190; + } + + public static int openInterestQtyEncodingLength() + { + return 4; + } + + public static String openInterestQtyMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static int openInterestQtyNullValue() + { + return 2147483647; + } + + public static int openInterestQtyMinValue() + { + return -2147483647; + } + + public static int openInterestQtyMaxValue() + { + return 2147483647; + } + + public int openInterestQty() + { + return buffer.getInt(offset + 190, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int lowLimitPriceId() + { + return 1148; + } + + public static int lowLimitPriceSinceVersion() + { + return 0; + } + + public static int lowLimitPriceEncodingOffset() + { + return 194; + } + + public static int lowLimitPriceEncodingLength() + { + return 8; + } + + public static String lowLimitPriceMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder lowLimitPrice = new PRICENULLDecoder(); + + public PRICENULLDecoder lowLimitPrice() + { + lowLimitPrice.wrap(buffer, offset + 194); + return lowLimitPrice; + } + + public static int highLimitPriceId() + { + return 1149; + } + + public static int highLimitPriceSinceVersion() + { + return 0; + } + + public static int highLimitPriceEncodingOffset() + { + return 202; + } + + public static int highLimitPriceEncodingLength() + { + return 8; + } + + public static String highLimitPriceMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder highLimitPrice = new PRICENULLDecoder(); + + public PRICENULLDecoder highLimitPrice() + { + highLimitPrice.wrap(buffer, offset + 202); + return highLimitPrice; + } + + public static int userDefinedInstrumentId() + { + return 9779; + } + + public static int userDefinedInstrumentSinceVersion() + { + return 0; + } + + public static int userDefinedInstrumentEncodingOffset() + { + return 210; + } + + public static int userDefinedInstrumentEncodingLength() + { + return 1; + } + + public static String userDefinedInstrumentMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public static byte userDefinedInstrumentNullValue() + { + return (byte)0; + } + + public static byte userDefinedInstrumentMinValue() + { + return (byte)32; + } + + public static byte userDefinedInstrumentMaxValue() + { + return (byte)126; + } + + public byte userDefinedInstrument() + { + return buffer.getByte(offset + 210); + } + + + public static int tradingReferenceDateId() + { + return 5796; + } + + public static int tradingReferenceDateSinceVersion() + { + return 6; + } + + public static int tradingReferenceDateEncodingOffset() + { + return 211; + } + + public static int tradingReferenceDateEncodingLength() + { + return 2; + } + + public static String tradingReferenceDateMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "LocalMktDate"; + } + + return ""; + } + + public static int tradingReferenceDateNullValue() + { + return 65535; + } + + public static int tradingReferenceDateMinValue() + { + return 0; + } + + public static int tradingReferenceDateMaxValue() + { + return 65534; + } + + public int tradingReferenceDate() + { + if (parentMessage.actingVersion < 6) + { + return 65535; + } + + return (buffer.getShort(offset + 211, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); + } + + + private final NoEventsDecoder noEvents = new NoEventsDecoder(); + + public static long noEventsDecoderId() + { + return 864; + } + + public static int noEventsDecoderSinceVersion() + { + return 0; + } + + public NoEventsDecoder noEvents() + { + noEvents.wrap(parentMessage, buffer); + return noEvents; + } + + public static class NoEventsDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private MDInstrumentDefinitionOption41Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDInstrumentDefinitionOption41Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 9; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoEventsDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int eventTypeId() + { + return 865; + } + + public static int eventTypeSinceVersion() + { + return 0; + } + + public static int eventTypeEncodingOffset() + { + return 0; + } + + public static int eventTypeEncodingLength() + { + return 1; + } + + public static String eventTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public EventType eventType() + { + return EventType.get(((short)(buffer.getByte(offset + 0) & 0xFF))); + } + + + public static int eventTimeId() + { + return 1145; + } + + public static int eventTimeSinceVersion() + { + return 0; + } + + public static int eventTimeEncodingOffset() + { + return 1; + } + + public static int eventTimeEncodingLength() + { + return 8; + } + + public static String eventTimeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "UTCTimestamp"; + } + + return ""; + } + + public static long eventTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long eventTimeMinValue() + { + return 0x0L; + } + + public static long eventTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long eventTime() + { + return buffer.getLong(offset + 1, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='EventType', referencedName='null', description='Code to represent the type of event', id=865, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='EventType', referencedName='null', description='Code to represent the type of event', id=-1, version=0, deprecated=0, encodedLength=1, offset=0, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("eventType="); + builder.append(eventType()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='EventTime', referencedName='null', description='Date and Time of instument Activation or Expiration event sent as number of nanoseconds since Unix epoch', id=1145, version=0, deprecated=0, encodedLength=0, offset=1, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + //Token{signal=ENCODING, name='uInt64', referencedName='null', description='Date and Time of instument Activation or Expiration event sent as number of nanoseconds since Unix epoch', id=-1, version=0, deprecated=0, encodedLength=8, offset=1, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + builder.append("eventTime="); + builder.append(eventTime()); + builder.append(')'); + return builder; + } + } + + private final NoMDFeedTypesDecoder noMDFeedTypes = new NoMDFeedTypesDecoder(); + + public static long noMDFeedTypesDecoderId() + { + return 1141; + } + + public static int noMDFeedTypesDecoderSinceVersion() + { + return 0; + } + + public NoMDFeedTypesDecoder noMDFeedTypes() + { + noMDFeedTypes.wrap(parentMessage, buffer); + return noMDFeedTypes; + } + + public static class NoMDFeedTypesDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private MDInstrumentDefinitionOption41Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDInstrumentDefinitionOption41Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 4; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoMDFeedTypesDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int mDFeedTypeId() + { + return 1022; + } + + public static int mDFeedTypeSinceVersion() + { + return 0; + } + + public static int mDFeedTypeEncodingOffset() + { + return 0; + } + + public static int mDFeedTypeEncodingLength() + { + return 3; + } + + public static String mDFeedTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte mDFeedTypeNullValue() + { + return (byte)0; + } + + public static byte mDFeedTypeMinValue() + { + return (byte)32; + } + + public static byte mDFeedTypeMaxValue() + { + return (byte)126; + } + + public static int mDFeedTypeLength() + { + return 3; + } + + public byte mDFeedType(final int index) + { + if (index < 0 || index >= 3) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 0 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String mDFeedTypeCharacterEncoding() + { + return "UTF-8"; + } + + public int getMDFeedType(final byte[] dst, final int dstOffset) + { + final int length = 3; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 0, dst, dstOffset, length); + + return length; + } + + public String mDFeedType() + { + final byte[] dst = new byte[3]; + buffer.getBytes(this.offset + 0, dst, 0, 3); + + int end = 0; + for (; end < 3 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int marketDepthId() + { + return 264; + } + + public static int marketDepthSinceVersion() + { + return 0; + } + + public static int marketDepthEncodingOffset() + { + return 3; + } + + public static int marketDepthEncodingLength() + { + return 1; + } + + public static String marketDepthMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static byte marketDepthNullValue() + { + return (byte)-128; + } + + public static byte marketDepthMinValue() + { + return (byte)-127; + } + + public static byte marketDepthMaxValue() + { + return (byte)127; + } + + public byte marketDepth() + { + return buffer.getByte(offset + 3); + } + + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='MDFeedType', referencedName='null', description='Describes a class of service for a given data feed. GBX- Real Book, GBI-Implied Book', id=1022, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='MDFeedType', referencedName='null', description='Describes a class of service for a given data feed. GBX- Real Book, GBI-Implied Book', id=-1, version=0, deprecated=0, encodedLength=3, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("mDFeedType="); + for (int i = 0; i < mDFeedTypeLength() && mDFeedType(i) > 0; i++) + { + builder.append((char)mDFeedType(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MarketDepth', referencedName='null', description='Book depth', id=264, version=0, deprecated=0, encodedLength=0, offset=3, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int8', referencedName='null', description='Book depth', id=-1, version=0, deprecated=0, encodedLength=1, offset=3, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("marketDepth="); + builder.append(marketDepth()); + builder.append(')'); + return builder; + } + } + + private final NoInstAttribDecoder noInstAttrib = new NoInstAttribDecoder(); + + public static long noInstAttribDecoderId() + { + return 870; + } + + public static int noInstAttribDecoderSinceVersion() + { + return 0; + } + + public NoInstAttribDecoder noInstAttrib() + { + noInstAttrib.wrap(parentMessage, buffer); + return noInstAttrib; + } + + public static class NoInstAttribDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private MDInstrumentDefinitionOption41Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDInstrumentDefinitionOption41Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 4; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoInstAttribDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int instAttribTypeId() + { + return 871; + } + + public static int instAttribTypeSinceVersion() + { + return 0; + } + + public static int instAttribTypeEncodingOffset() + { + return 0; + } + + public static int instAttribTypeEncodingLength() + { + return 0; + } + + public static String instAttribTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static byte instAttribTypeNullValue() + { + return (byte)-128; + } + + public static byte instAttribTypeMinValue() + { + return (byte)-127; + } + + public static byte instAttribTypeMaxValue() + { + return (byte)127; + } + + public byte instAttribType() + { + return (byte)24; + } + + public static int instAttribValueId() + { + return 872; + } + + public static int instAttribValueSinceVersion() + { + return 0; + } + + public static int instAttribValueEncodingOffset() + { + return 0; + } + + public static int instAttribValueEncodingLength() + { + return 4; + } + + public static String instAttribValueMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MultipleCharValue"; + } + + return ""; + } + + private final InstAttribValueDecoder instAttribValue = new InstAttribValueDecoder(); + + public InstAttribValueDecoder instAttribValue() + { + instAttribValue.wrap(buffer, offset + 0); + return instAttribValue; + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='InstAttribType', referencedName='null', description='Instrument Eligibility Attributes', id=871, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='InstAttribType', referencedName='null', description='Instrument Eligibility Attributes', id=-1, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=1, encoding=Encoding{presence=CONSTANT, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=24, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_FIELD, name='InstAttribValue', referencedName='null', description='Bitmap field of 32 Boolean type Instrument eligibility flags', id=872, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=24, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MultipleCharValue'}} + //Token{signal=BEGIN_SET, name='InstAttribValue', referencedName='null', description='Bitmap field of 32 Boolean type Instrument eligibility flags', id=-1, version=0, deprecated=0, encodedLength=4, offset=0, componentTokenCount=22, encoding=Encoding{presence=REQUIRED, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MultipleCharValue'}} + builder.append("instAttribValue="); + builder.append(instAttribValue()); + builder.append(')'); + return builder; + } + } + + private final NoLotTypeRulesDecoder noLotTypeRules = new NoLotTypeRulesDecoder(); + + public static long noLotTypeRulesDecoderId() + { + return 1234; + } + + public static int noLotTypeRulesDecoderSinceVersion() + { + return 0; + } + + public NoLotTypeRulesDecoder noLotTypeRules() + { + noLotTypeRules.wrap(parentMessage, buffer); + return noLotTypeRules; + } + + public static class NoLotTypeRulesDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private MDInstrumentDefinitionOption41Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDInstrumentDefinitionOption41Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 5; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoLotTypeRulesDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int lotTypeId() + { + return 1093; + } + + public static int lotTypeSinceVersion() + { + return 0; + } + + public static int lotTypeEncodingOffset() + { + return 0; + } + + public static int lotTypeEncodingLength() + { + return 1; + } + + public static String lotTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static byte lotTypeNullValue() + { + return (byte)-128; + } + + public static byte lotTypeMinValue() + { + return (byte)-127; + } + + public static byte lotTypeMaxValue() + { + return (byte)127; + } + + public byte lotType() + { + return buffer.getByte(offset + 0); + } + + + public static int minLotSizeId() + { + return 1231; + } + + public static int minLotSizeSinceVersion() + { + return 0; + } + + public static int minLotSizeEncodingOffset() + { + return 1; + } + + public static int minLotSizeEncodingLength() + { + return 4; + } + + public static String minLotSizeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + private final DecimalQtyDecoder minLotSize = new DecimalQtyDecoder(); + + public DecimalQtyDecoder minLotSize() + { + minLotSize.wrap(buffer, offset + 1); + return minLotSize; + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='LotType', referencedName='null', description='This tag is required to interpret the value in tag 1231-MinLotSize', id=1093, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int8', referencedName='null', description='This tag is required to interpret the value in tag 1231-MinLotSize', id=-1, version=0, deprecated=0, encodedLength=1, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("lotType="); + builder.append(lotType()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MinLotSize', referencedName='null', description='Minimum quantity accepted for order entry. If tag 1093-LotType=4, this value is the minimum quantity for order entry expressed in the applicable units, specified in tag 996-UnitOfMeasure, e.g. megawatts', id=1231, version=0, deprecated=0, encodedLength=0, offset=1, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=BEGIN_COMPOSITE, name='DecimalQty', referencedName='null', description='Minimum quantity accepted for order entry. If tag 1093-LotType=4, this value is the minimum quantity for order entry expressed in the applicable units, specified in tag 996-UnitOfMeasure, e.g. megawatts', id=-1, version=0, deprecated=0, encodedLength=4, offset=1, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Qty'}} + builder.append("minLotSize="); + minLotSize().appendTo(builder); + builder.append(')'); + return builder; + } + } + + private final NoUnderlyingsDecoder noUnderlyings = new NoUnderlyingsDecoder(); + + public static long noUnderlyingsDecoderId() + { + return 711; + } + + public static int noUnderlyingsDecoderSinceVersion() + { + return 0; + } + + public NoUnderlyingsDecoder noUnderlyings() + { + noUnderlyings.wrap(parentMessage, buffer); + return noUnderlyings; + } + + public static class NoUnderlyingsDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private MDInstrumentDefinitionOption41Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDInstrumentDefinitionOption41Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 24; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoUnderlyingsDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int underlyingSecurityIDId() + { + return 309; + } + + public static int underlyingSecurityIDSinceVersion() + { + return 0; + } + + public static int underlyingSecurityIDEncodingOffset() + { + return 0; + } + + public static int underlyingSecurityIDEncodingLength() + { + return 4; + } + + public static String underlyingSecurityIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int underlyingSecurityIDNullValue() + { + return -2147483648; + } + + public static int underlyingSecurityIDMinValue() + { + return -2147483647; + } + + public static int underlyingSecurityIDMaxValue() + { + return 2147483647; + } + + public int underlyingSecurityID() + { + return buffer.getInt(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int underlyingSecurityIDSourceId() + { + return 305; + } + + public static int underlyingSecurityIDSourceSinceVersion() + { + return 0; + } + + public static int underlyingSecurityIDSourceEncodingOffset() + { + return 4; + } + + public static int underlyingSecurityIDSourceEncodingLength() + { + return 0; + } + + public static String underlyingSecurityIDSourceMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public static byte underlyingSecurityIDSourceNullValue() + { + return (byte)0; + } + + public static byte underlyingSecurityIDSourceMinValue() + { + return (byte)32; + } + + public static byte underlyingSecurityIDSourceMaxValue() + { + return (byte)126; + } + + private static final byte[] UNDERLYINGSECURITYIDSOURCE_VALUE = {56}; + + public static int underlyingSecurityIDSourceLength() + { + return 1; + } + + public byte underlyingSecurityIDSource(final int index) + { + return UNDERLYINGSECURITYIDSOURCE_VALUE[index]; + } + + public int getUnderlyingSecurityIDSource(final byte[] dst, final int offset, final int length) + { + final int bytesCopied = Math.min(length, 1); + System.arraycopy(UNDERLYINGSECURITYIDSOURCE_VALUE, 0, dst, offset, bytesCopied); + + return bytesCopied; + } + + public static int underlyingSymbolId() + { + return 311; + } + + public static int underlyingSymbolSinceVersion() + { + return 0; + } + + public static int underlyingSymbolEncodingOffset() + { + return 4; + } + + public static int underlyingSymbolEncodingLength() + { + return 20; + } + + public static String underlyingSymbolMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte underlyingSymbolNullValue() + { + return (byte)0; + } + + public static byte underlyingSymbolMinValue() + { + return (byte)32; + } + + public static byte underlyingSymbolMaxValue() + { + return (byte)126; + } + + public static int underlyingSymbolLength() + { + return 20; + } + + public byte underlyingSymbol(final int index) + { + if (index < 0 || index >= 20) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 4 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String underlyingSymbolCharacterEncoding() + { + return "UTF-8"; + } + + public int getUnderlyingSymbol(final byte[] dst, final int dstOffset) + { + final int length = 20; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 4, dst, dstOffset, length); + + return length; + } + + public String underlyingSymbol() + { + final byte[] dst = new byte[20]; + buffer.getBytes(this.offset + 4, dst, 0, 20); + + int end = 0; + for (; end < 20 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='UnderlyingSecurityID', referencedName='null', description='Unique Instrument ID as qualified by the exchange per tag 305-UnderlyingSecurityIDSource', id=309, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32', referencedName='null', description='Unique Instrument ID as qualified by the exchange per tag 305-UnderlyingSecurityIDSource', id=-1, version=0, deprecated=0, encodedLength=4, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("underlyingSecurityID="); + builder.append(underlyingSecurityID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='UnderlyingSecurityIDSource', referencedName='null', description='This value is always '8' for CME', id=305, version=0, deprecated=0, encodedLength=0, offset=4, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=ENCODING, name='SecurityIDSource', referencedName='null', description='This value is always '8' for CME', id=-1, version=0, deprecated=0, encodedLength=0, offset=4, componentTokenCount=1, encoding=Encoding{presence=CONSTANT, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=56, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=BEGIN_FIELD, name='UnderlyingSymbol', referencedName='null', description='Underlying Instrument Symbol (Contract Name)', id=311, version=0, deprecated=0, encodedLength=0, offset=4, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='UnderlyingSymbol', referencedName='null', description='Underlying Instrument Symbol (Contract Name)', id=-1, version=0, deprecated=0, encodedLength=20, offset=4, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("underlyingSymbol="); + for (int i = 0; i < underlyingSymbolLength() && underlyingSymbol(i) > 0; i++) + { + builder.append((char)underlyingSymbol(i)); + } + builder.append(')'); + return builder; + } + } + + private final NoRelatedInstrumentsDecoder noRelatedInstruments = new NoRelatedInstrumentsDecoder(); + + public static long noRelatedInstrumentsDecoderId() + { + return 1647; + } + + public static int noRelatedInstrumentsDecoderSinceVersion() + { + return 7; + } + + public NoRelatedInstrumentsDecoder noRelatedInstruments() + { + if (parentMessage.actingVersion < 7) + { + noRelatedInstruments.count = 0; + noRelatedInstruments.index = -1; + return noRelatedInstruments; + } + + noRelatedInstruments.wrap(parentMessage, buffer); + return noRelatedInstruments; + } + + public static class NoRelatedInstrumentsDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private MDInstrumentDefinitionOption41Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDInstrumentDefinitionOption41Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 24; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoRelatedInstrumentsDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int relatedSecurityIDId() + { + return 1650; + } + + public static int relatedSecurityIDSinceVersion() + { + return 0; + } + + public static int relatedSecurityIDEncodingOffset() + { + return 0; + } + + public static int relatedSecurityIDEncodingLength() + { + return 4; + } + + public static String relatedSecurityIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int relatedSecurityIDNullValue() + { + return -2147483648; + } + + public static int relatedSecurityIDMinValue() + { + return -2147483647; + } + + public static int relatedSecurityIDMaxValue() + { + return 2147483647; + } + + public int relatedSecurityID() + { + return buffer.getInt(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int relatedSecurityIDSourceId() + { + return 1651; + } + + public static int relatedSecurityIDSourceSinceVersion() + { + return 0; + } + + public static int relatedSecurityIDSourceEncodingOffset() + { + return 4; + } + + public static int relatedSecurityIDSourceEncodingLength() + { + return 0; + } + + public static String relatedSecurityIDSourceMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public static byte relatedSecurityIDSourceNullValue() + { + return (byte)0; + } + + public static byte relatedSecurityIDSourceMinValue() + { + return (byte)32; + } + + public static byte relatedSecurityIDSourceMaxValue() + { + return (byte)126; + } + + private static final byte[] RELATEDSECURITYIDSOURCE_VALUE = {56}; + + public static int relatedSecurityIDSourceLength() + { + return 1; + } + + public byte relatedSecurityIDSource(final int index) + { + return RELATEDSECURITYIDSOURCE_VALUE[index]; + } + + public int getRelatedSecurityIDSource(final byte[] dst, final int offset, final int length) + { + final int bytesCopied = Math.min(length, 1); + System.arraycopy(RELATEDSECURITYIDSOURCE_VALUE, 0, dst, offset, bytesCopied); + + return bytesCopied; + } + + public static int relatedSymbolId() + { + return 1649; + } + + public static int relatedSymbolSinceVersion() + { + return 0; + } + + public static int relatedSymbolEncodingOffset() + { + return 4; + } + + public static int relatedSymbolEncodingLength() + { + return 20; + } + + public static String relatedSymbolMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte relatedSymbolNullValue() + { + return (byte)0; + } + + public static byte relatedSymbolMinValue() + { + return (byte)32; + } + + public static byte relatedSymbolMaxValue() + { + return (byte)126; + } + + public static int relatedSymbolLength() + { + return 20; + } + + public byte relatedSymbol(final int index) + { + if (index < 0 || index >= 20) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 4 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String relatedSymbolCharacterEncoding() + { + return "UTF-8"; + } + + public int getRelatedSymbol(final byte[] dst, final int dstOffset) + { + final int length = 20; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 4, dst, dstOffset, length); + + return length; + } + + public String relatedSymbol() + { + final byte[] dst = new byte[20]; + buffer.getBytes(this.offset + 4, dst, 0, 20); + + int end = 0; + for (; end < 20 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='RelatedSecurityID', referencedName='null', description='Related Security ID', id=1650, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32', referencedName='null', description='Related Security ID', id=-1, version=0, deprecated=0, encodedLength=4, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("relatedSecurityID="); + builder.append(relatedSecurityID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='RelatedSecurityIDSource', referencedName='null', description='Related Security ID source', id=1651, version=0, deprecated=0, encodedLength=0, offset=4, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=ENCODING, name='SecurityIDSource', referencedName='null', description='Related Security ID source', id=-1, version=0, deprecated=0, encodedLength=0, offset=4, componentTokenCount=1, encoding=Encoding{presence=CONSTANT, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=56, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=BEGIN_FIELD, name='RelatedSymbol', referencedName='null', description='Related instrument Symbol', id=1649, version=0, deprecated=0, encodedLength=0, offset=4, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='Symbol', referencedName='null', description='Related instrument Symbol', id=-1, version=0, deprecated=0, encodedLength=20, offset=4, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("relatedSymbol="); + for (int i = 0; i < relatedSymbolLength() && relatedSymbol(i) > 0; i++) + { + builder.append((char)relatedSymbol(i)); + } + builder.append(')'); + return builder; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + final int originalLimit = limit(); + limit(offset + actingBlockLength); + builder.append("[MDInstrumentDefinitionOption41](sbeTemplateId="); + builder.append(TEMPLATE_ID); + builder.append("|sbeSchemaId="); + builder.append(SCHEMA_ID); + builder.append("|sbeSchemaVersion="); + if (parentMessage.actingVersion != SCHEMA_VERSION) + { + builder.append(parentMessage.actingVersion); + builder.append('/'); + } + builder.append(SCHEMA_VERSION); + builder.append("|sbeBlockLength="); + if (actingBlockLength != BLOCK_LENGTH) + { + builder.append(actingBlockLength); + builder.append('/'); + } + builder.append(BLOCK_LENGTH); + builder.append("):"); + //Token{signal=BEGIN_FIELD, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=5799, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=12, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MultipleCharValue'}} + //Token{signal=BEGIN_SET, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=-1, version=0, deprecated=0, encodedLength=1, offset=0, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MultipleCharValue'}} + builder.append("matchEventIndicator="); + builder.append(matchEventIndicator()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='TotNumReports', referencedName='null', description='Total number of instruments in the Replay loop. Used on Replay Feed only ', id=911, version=0, deprecated=0, encodedLength=0, offset=1, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt32NULL', referencedName='null', description='Total number of instruments in the Replay loop. Used on Replay Feed only ', id=-1, version=0, deprecated=0, encodedLength=4, offset=1, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=4294967295, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("totNumReports="); + builder.append(totNumReports()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityUpdateAction', referencedName='null', description='Last Security update action on Incremental feed, 'D' or 'M' is used when a mid-week deletion or modification (i.e. extension) occurs', id=980, version=0, deprecated=0, encodedLength=0, offset=5, componentTokenCount=7, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=BEGIN_ENUM, name='SecurityUpdateAction', referencedName='null', description='Last Security update action on Incremental feed, 'D' or 'M' is used when a mid-week deletion or modification (i.e. extension) occurs', id=-1, version=0, deprecated=0, encodedLength=1, offset=5, componentTokenCount=5, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='char'}} + builder.append("securityUpdateAction="); + builder.append(securityUpdateAction()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='LastUpdateTime', referencedName='null', description='Timestamp of when the instrument was last added, modified or deleted', id=779, version=0, deprecated=0, encodedLength=0, offset=6, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + //Token{signal=ENCODING, name='uInt64', referencedName='null', description='Timestamp of when the instrument was last added, modified or deleted', id=-1, version=0, deprecated=0, encodedLength=8, offset=6, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + builder.append("lastUpdateTime="); + builder.append(lastUpdateTime()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDSecurityTradingStatus', referencedName='null', description='Identifies the current state of the instrument. The data is available in the Instrument Replay feed only ', id=1682, version=0, deprecated=0, encodedLength=0, offset=14, componentTokenCount=15, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='SecurityTradingStatus', referencedName='null', description='Identifies the current state of the instrument. The data is available in the Instrument Replay feed only ', id=-1, version=0, deprecated=0, encodedLength=1, offset=14, componentTokenCount=13, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("mDSecurityTradingStatus="); + builder.append(mDSecurityTradingStatus()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='ApplID', referencedName='null', description='The channel ID as defined in the XML Configuration file', id=1180, version=0, deprecated=0, encodedLength=0, offset=15, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int16', referencedName='null', description='The channel ID as defined in the XML Configuration file', id=-1, version=0, deprecated=0, encodedLength=2, offset=15, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT16, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("applID="); + builder.append(applID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MarketSegmentID', referencedName='null', description='Identifies the market segment, populated for all CME Globex instruments', id=1300, version=0, deprecated=0, encodedLength=0, offset=17, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt8', referencedName='null', description='Identifies the market segment, populated for all CME Globex instruments', id=-1, version=0, deprecated=0, encodedLength=1, offset=17, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("marketSegmentID="); + builder.append(marketSegmentID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='UnderlyingProduct', referencedName='null', description='Indicates the product complex', id=462, version=0, deprecated=0, encodedLength=0, offset=18, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt8', referencedName='null', description='Indicates the product complex', id=-1, version=0, deprecated=0, encodedLength=1, offset=18, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("underlyingProduct="); + builder.append(underlyingProduct()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityExchange', referencedName='null', description='Exchange used to identify a security', id=207, version=0, deprecated=0, encodedLength=0, offset=19, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Exchange'}} + //Token{signal=ENCODING, name='SecurityExchange', referencedName='null', description='Exchange used to identify a security', id=-1, version=0, deprecated=0, encodedLength=4, offset=19, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Exchange'}} + builder.append("securityExchange="); + for (int i = 0; i < securityExchangeLength() && securityExchange(i) > 0; i++) + { + builder.append((char)securityExchange(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityGroup', referencedName='null', description='Security Group Code ', id=1151, version=0, deprecated=0, encodedLength=0, offset=23, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='SecurityGroup', referencedName='null', description='Security Group Code ', id=-1, version=0, deprecated=0, encodedLength=6, offset=23, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("securityGroup="); + for (int i = 0; i < securityGroupLength() && securityGroup(i) > 0; i++) + { + builder.append((char)securityGroup(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='Asset', referencedName='null', description='The underlying asset code also known as Product Code', id=6937, version=0, deprecated=0, encodedLength=0, offset=29, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='Asset', referencedName='null', description='The underlying asset code also known as Product Code', id=-1, version=0, deprecated=0, encodedLength=6, offset=29, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("asset="); + for (int i = 0; i < assetLength() && asset(i) > 0; i++) + { + builder.append((char)asset(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='Symbol', referencedName='null', description='Instrument Name or Symbol. Previously used as Instrument Group Code ', id=55, version=0, deprecated=0, encodedLength=0, offset=35, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='Symbol', referencedName='null', description='Instrument Name or Symbol. Previously used as Instrument Group Code ', id=-1, version=0, deprecated=0, encodedLength=20, offset=35, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("symbol="); + for (int i = 0; i < symbolLength() && symbol(i) > 0; i++) + { + builder.append((char)symbol(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityID', referencedName='null', description='Unique Instrument ID', id=48, version=0, deprecated=0, encodedLength=0, offset=55, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32', referencedName='null', description='Unique Instrument ID', id=-1, version=0, deprecated=0, encodedLength=4, offset=55, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("securityID="); + builder.append(securityID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityIDSource', referencedName='null', description='Identifies class or source of tag 48-SecurityID value', id=22, version=0, deprecated=0, encodedLength=0, offset=59, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=ENCODING, name='SecurityIDSource', referencedName='null', description='Identifies class or source of tag 48-SecurityID value', id=-1, version=0, deprecated=0, encodedLength=0, offset=59, componentTokenCount=1, encoding=Encoding{presence=CONSTANT, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=56, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=BEGIN_FIELD, name='SecurityType', referencedName='null', description='Security Type', id=167, version=0, deprecated=0, encodedLength=0, offset=59, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='SecurityType', referencedName='null', description='Security Type', id=-1, version=0, deprecated=0, encodedLength=6, offset=59, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("securityType="); + for (int i = 0; i < securityTypeLength() && securityType(i) > 0; i++) + { + builder.append((char)securityType(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='CFICode', referencedName='null', description='ISO standard instrument categorization code', id=461, version=0, deprecated=0, encodedLength=0, offset=65, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='CFICode', referencedName='null', description='ISO standard instrument categorization code', id=-1, version=0, deprecated=0, encodedLength=6, offset=65, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("cFICode="); + for (int i = 0; i < cFICodeLength() && cFICode(i) > 0; i++) + { + builder.append((char)cFICode(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='PutOrCall', referencedName='null', description='Indicates whether an option instrument is a put or call', id=201, version=0, deprecated=0, encodedLength=0, offset=71, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='PutOrCall', referencedName='null', description='Indicates whether an option instrument is a put or call', id=-1, version=0, deprecated=0, encodedLength=1, offset=71, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("putOrCall="); + builder.append(putOrCall()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MaturityMonthYear', referencedName='null', description='This field provides the actual calendar date for contract maturity', id=200, version=0, deprecated=0, encodedLength=0, offset=72, componentTokenCount=8, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MonthYear'}} + //Token{signal=BEGIN_COMPOSITE, name='MaturityMonthYear', referencedName='null', description='This field provides the actual calendar date for contract maturity', id=-1, version=0, deprecated=0, encodedLength=5, offset=72, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MonthYear'}} + builder.append("maturityMonthYear="); + maturityMonthYear().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='Currency', referencedName='null', description='Identifies currency used for price', id=15, version=0, deprecated=0, encodedLength=0, offset=77, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Currency'}} + //Token{signal=ENCODING, name='Currency', referencedName='null', description='Identifies currency used for price', id=-1, version=0, deprecated=0, encodedLength=3, offset=77, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Currency'}} + builder.append("currency="); + for (int i = 0; i < currencyLength() && currency(i) > 0; i++) + { + builder.append((char)currency(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='StrikePrice', referencedName='null', description='Strike Price for an option instrument', id=202, version=0, deprecated=0, encodedLength=0, offset=80, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Strike Price for an option instrument', id=-1, version=0, deprecated=0, encodedLength=8, offset=80, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("strikePrice="); + strikePrice().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='StrikeCurrency', referencedName='null', description='Currency in which the StrikePrice is denominated', id=947, version=0, deprecated=0, encodedLength=0, offset=88, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Currency'}} + //Token{signal=ENCODING, name='Currency', referencedName='null', description='Currency in which the StrikePrice is denominated', id=-1, version=0, deprecated=0, encodedLength=3, offset=88, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Currency'}} + builder.append("strikeCurrency="); + for (int i = 0; i < strikeCurrencyLength() && strikeCurrency(i) > 0; i++) + { + builder.append((char)strikeCurrency(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SettlCurrency', referencedName='null', description='Identifies currency used for settlement, if different from trade price currency', id=120, version=0, deprecated=0, encodedLength=0, offset=91, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Currency'}} + //Token{signal=ENCODING, name='Currency', referencedName='null', description='Identifies currency used for settlement, if different from trade price currency', id=-1, version=0, deprecated=0, encodedLength=3, offset=91, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Currency'}} + builder.append("settlCurrency="); + for (int i = 0; i < settlCurrencyLength() && settlCurrency(i) > 0; i++) + { + builder.append((char)settlCurrency(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MinCabPrice', referencedName='null', description='Defines cabinet price for outright options products', id=9850, version=0, deprecated=0, encodedLength=0, offset=94, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Defines cabinet price for outright options products', id=-1, version=0, deprecated=0, encodedLength=8, offset=94, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("minCabPrice="); + minCabPrice().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MatchAlgorithm', referencedName='null', description='Matching algorithm', id=1142, version=0, deprecated=0, encodedLength=0, offset=102, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=ENCODING, name='CHAR', referencedName='null', description='Matching algorithm', id=-1, version=0, deprecated=0, encodedLength=1, offset=102, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + builder.append("matchAlgorithm="); + builder.append(matchAlgorithm()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MinTradeVol', referencedName='null', description='The minimum trading volume for a security.', id=562, version=0, deprecated=0, encodedLength=0, offset=103, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='uInt32', referencedName='null', description='The minimum trading volume for a security.', id=-1, version=0, deprecated=0, encodedLength=4, offset=103, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("minTradeVol="); + builder.append(minTradeVol()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MaxTradeVol', referencedName='null', description='The maximum trading volume for a security.', id=1140, version=0, deprecated=0, encodedLength=0, offset=107, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='uInt32', referencedName='null', description='The maximum trading volume for a security.', id=-1, version=0, deprecated=0, encodedLength=4, offset=107, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("maxTradeVol="); + builder.append(maxTradeVol()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MinPriceIncrement', referencedName='null', description='Minimum constant tick for the instrument', id=969, version=0, deprecated=0, encodedLength=0, offset=111, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Minimum constant tick for the instrument', id=-1, version=0, deprecated=0, encodedLength=8, offset=111, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("minPriceIncrement="); + minPriceIncrement().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MinPriceIncrementAmount', referencedName='null', description='Monetary value equivalent to the minimum price fluctuation', id=1146, version=0, deprecated=0, encodedLength=0, offset=119, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Monetary value equivalent to the minimum price fluctuation', id=-1, version=0, deprecated=0, encodedLength=8, offset=119, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("minPriceIncrementAmount="); + minPriceIncrementAmount().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='DisplayFactor', referencedName='null', description='Contains the multiplier to convert the CME Globex display price to the conventional price', id=9787, version=0, deprecated=0, encodedLength=0, offset=127, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='float'}} + //Token{signal=BEGIN_COMPOSITE, name='FLOAT', referencedName='null', description='Contains the multiplier to convert the CME Globex display price to the conventional price', id=-1, version=0, deprecated=0, encodedLength=8, offset=127, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='float'}} + builder.append("displayFactor="); + displayFactor().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='TickRule', referencedName='null', description='VTT code referencing variable tick table ', id=6350, version=0, deprecated=0, encodedLength=0, offset=135, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int8NULL', referencedName='null', description='VTT code referencing variable tick table ', id=-1, version=0, deprecated=0, encodedLength=1, offset=135, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=127, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("tickRule="); + builder.append(tickRule()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MainFraction', referencedName='null', description='Price Denominator of Main Fraction', id=37702, version=0, deprecated=0, encodedLength=0, offset=136, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt8NULL', referencedName='null', description='Price Denominator of Main Fraction', id=-1, version=0, deprecated=0, encodedLength=1, offset=136, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=255, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("mainFraction="); + builder.append(mainFraction()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SubFraction', referencedName='null', description='Price Denominator of Sub Fraction', id=37703, version=0, deprecated=0, encodedLength=0, offset=137, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt8NULL', referencedName='null', description='Price Denominator of Sub Fraction', id=-1, version=0, deprecated=0, encodedLength=1, offset=137, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=255, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("subFraction="); + builder.append(subFraction()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='PriceDisplayFormat', referencedName='null', description='Number of decimals in fractional display price', id=9800, version=0, deprecated=0, encodedLength=0, offset=138, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt8NULL', referencedName='null', description='Number of decimals in fractional display price', id=-1, version=0, deprecated=0, encodedLength=1, offset=138, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=255, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("priceDisplayFormat="); + builder.append(priceDisplayFormat()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='UnitOfMeasure', referencedName='null', description='Unit of measure for the products' original contract size. This will be populated for all products listed on CME Globex', id=996, version=0, deprecated=0, encodedLength=0, offset=139, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='UnitOfMeasure', referencedName='null', description='Unit of measure for the products' original contract size. This will be populated for all products listed on CME Globex', id=-1, version=0, deprecated=0, encodedLength=30, offset=139, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("unitOfMeasure="); + for (int i = 0; i < unitOfMeasureLength() && unitOfMeasure(i) > 0; i++) + { + builder.append((char)unitOfMeasure(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='UnitOfMeasureQty', referencedName='null', description='This field contains the contract size for each instrument. Used in combination with tag 996-UnitofMeasure', id=1147, version=0, deprecated=0, encodedLength=0, offset=169, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='This field contains the contract size for each instrument. Used in combination with tag 996-UnitofMeasure', id=-1, version=0, deprecated=0, encodedLength=8, offset=169, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Qty'}} + builder.append("unitOfMeasureQty="); + unitOfMeasureQty().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='TradingReferencePrice', referencedName='null', description='Reference price - the most recently available Settlement whether it be Theoretical, Preliminary or a Final Settle of the session', id=1150, version=0, deprecated=0, encodedLength=0, offset=177, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Reference price - the most recently available Settlement whether it be Theoretical, Preliminary or a Final Settle of the session', id=-1, version=0, deprecated=0, encodedLength=8, offset=177, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("tradingReferencePrice="); + tradingReferencePrice().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SettlPriceType', referencedName='null', description='Bitmap field of eight Boolean type indicators representing settlement price type', id=731, version=0, deprecated=0, encodedLength=0, offset=185, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MultipleCharValue'}} + //Token{signal=BEGIN_SET, name='SettlPriceType', referencedName='null', description='Bitmap field of eight Boolean type indicators representing settlement price type', id=-1, version=0, deprecated=0, encodedLength=1, offset=185, componentTokenCount=8, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MultipleCharValue'}} + builder.append("settlPriceType="); + builder.append(settlPriceType()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='ClearedVolume', referencedName='null', description='The total cleared volume of instrument traded during the prior trading session', id=5791, version=0, deprecated=0, encodedLength=0, offset=186, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='Int32NULL', referencedName='null', description='The total cleared volume of instrument traded during the prior trading session', id=-1, version=0, deprecated=0, encodedLength=4, offset=186, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=2147483647, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("clearedVolume="); + builder.append(clearedVolume()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='OpenInterestQty', referencedName='null', description='The total open interest for the market at the close of the prior trading session.', id=5792, version=0, deprecated=0, encodedLength=0, offset=190, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='Int32NULL', referencedName='null', description='The total open interest for the market at the close of the prior trading session.', id=-1, version=0, deprecated=0, encodedLength=4, offset=190, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=2147483647, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("openInterestQty="); + builder.append(openInterestQty()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='LowLimitPrice', referencedName='null', description='Allowable low limit price for the trading day ', id=1148, version=0, deprecated=0, encodedLength=0, offset=194, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Allowable low limit price for the trading day ', id=-1, version=0, deprecated=0, encodedLength=8, offset=194, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("lowLimitPrice="); + lowLimitPrice().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='HighLimitPrice', referencedName='null', description='Allowable high limit price for the trading day', id=1149, version=0, deprecated=0, encodedLength=0, offset=202, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Allowable high limit price for the trading day', id=-1, version=0, deprecated=0, encodedLength=8, offset=202, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("highLimitPrice="); + highLimitPrice().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='UserDefinedInstrument', referencedName='null', description='User-defined instruments flag', id=9779, version=0, deprecated=0, encodedLength=0, offset=210, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=ENCODING, name='UserDefinedInstrument', referencedName='null', description='User-defined instruments flag', id=-1, version=0, deprecated=0, encodedLength=1, offset=210, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + builder.append("userDefinedInstrument="); + builder.append(userDefinedInstrument()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='TradingReferenceDate', referencedName='null', description='Indicates session date corresponding to the settlement price in tag 1150-TradingReferencePrice', id=5796, version=6, deprecated=0, encodedLength=0, offset=211, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='LocalMktDate'}} + //Token{signal=ENCODING, name='LocalMktDate', referencedName='null', description='Indicates session date corresponding to the settlement price in tag 1150-TradingReferencePrice', id=-1, version=6, deprecated=0, encodedLength=2, offset=211, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT16, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=65535, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='LocalMktDate'}} + builder.append("tradingReferenceDate="); + builder.append(tradingReferenceDate()); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoEvents', referencedName='null', description='Number of EventType entries', id=864, version=0, deprecated=0, encodedLength=9, offset=213, componentTokenCount=15, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noEvents=["); + NoEventsDecoder noEvents = noEvents(); + if (noEvents.count() > 0) + { + while (noEvents.hasNext()) + { + noEvents.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoMDFeedTypes', referencedName='null', description='Number of FeedType entries', id=1141, version=0, deprecated=0, encodedLength=4, offset=-1, componentTokenCount=12, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noMDFeedTypes=["); + NoMDFeedTypesDecoder noMDFeedTypes = noMDFeedTypes(); + if (noMDFeedTypes.count() > 0) + { + while (noMDFeedTypes.hasNext()) + { + noMDFeedTypes.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoInstAttrib', referencedName='null', description='Number of InstrAttribType entries', id=870, version=0, deprecated=0, encodedLength=4, offset=-1, componentTokenCount=33, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noInstAttrib=["); + NoInstAttribDecoder noInstAttrib = noInstAttrib(); + if (noInstAttrib.count() > 0) + { + while (noInstAttrib.hasNext()) + { + noInstAttrib.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoLotTypeRules', referencedName='null', description='Number of entries', id=1234, version=0, deprecated=0, encodedLength=5, offset=-1, componentTokenCount=15, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noLotTypeRules=["); + NoLotTypeRulesDecoder noLotTypeRules = noLotTypeRules(); + if (noLotTypeRules.count() > 0) + { + while (noLotTypeRules.hasNext()) + { + noLotTypeRules.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoUnderlyings', referencedName='null', description='Number of underlying instruments', id=711, version=0, deprecated=0, encodedLength=24, offset=-1, componentTokenCount=15, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noUnderlyings=["); + NoUnderlyingsDecoder noUnderlyings = noUnderlyings(); + if (noUnderlyings.count() > 0) + { + while (noUnderlyings.hasNext()) + { + noUnderlyings.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoRelatedInstruments', referencedName='null', description='Number of related instruments group', id=1647, version=7, deprecated=0, encodedLength=24, offset=-1, componentTokenCount=15, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noRelatedInstruments=["); + NoRelatedInstrumentsDecoder noRelatedInstruments = noRelatedInstruments(); + if (noRelatedInstruments.count() > 0) + { + while (noRelatedInstruments.hasNext()) + { + noRelatedInstruments.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + + limit(originalLimit); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDInstrumentDefinitionOption41Encoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDInstrumentDefinitionOption41Encoder.java new file mode 100644 index 0000000..a9aed0d --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDInstrumentDefinitionOption41Encoder.java @@ -0,0 +1,2688 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDInstrumentDefinitionOption41Encoder"}) +@SuppressWarnings("all") +public class MDInstrumentDefinitionOption41Encoder +{ + public static final int BLOCK_LENGTH = 213; + public static final int TEMPLATE_ID = 41; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final MDInstrumentDefinitionOption41Encoder parentMessage = this; + private MutableDirectBuffer buffer; + protected int offset; + protected int limit; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "d"; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public MDInstrumentDefinitionOption41Encoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + limit(offset + BLOCK_LENGTH); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int matchEventIndicatorEncodingOffset() + { + return 0; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + private final MatchEventIndicatorEncoder matchEventIndicator = new MatchEventIndicatorEncoder(); + + public MatchEventIndicatorEncoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 0); + return matchEventIndicator; + } + + public static int totNumReportsEncodingOffset() + { + return 1; + } + + public static int totNumReportsEncodingLength() + { + return 4; + } + + public static long totNumReportsNullValue() + { + return 4294967295L; + } + + public static long totNumReportsMinValue() + { + return 0L; + } + + public static long totNumReportsMaxValue() + { + return 4294967293L; + } + + public MDInstrumentDefinitionOption41Encoder totNumReports(final long value) + { + buffer.putInt(offset + 1, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int securityUpdateActionEncodingOffset() + { + return 5; + } + + public static int securityUpdateActionEncodingLength() + { + return 1; + } + + public MDInstrumentDefinitionOption41Encoder securityUpdateAction(final SecurityUpdateAction value) + { + buffer.putByte(offset + 5, value.value()); + return this; + } + + public static int lastUpdateTimeEncodingOffset() + { + return 6; + } + + public static int lastUpdateTimeEncodingLength() + { + return 8; + } + + public static long lastUpdateTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long lastUpdateTimeMinValue() + { + return 0x0L; + } + + public static long lastUpdateTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public MDInstrumentDefinitionOption41Encoder lastUpdateTime(final long value) + { + buffer.putLong(offset + 6, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int mDSecurityTradingStatusEncodingOffset() + { + return 14; + } + + public static int mDSecurityTradingStatusEncodingLength() + { + return 1; + } + + public MDInstrumentDefinitionOption41Encoder mDSecurityTradingStatus(final SecurityTradingStatus value) + { + buffer.putByte(offset + 14, (byte)value.value()); + return this; + } + + public static int applIDEncodingOffset() + { + return 15; + } + + public static int applIDEncodingLength() + { + return 2; + } + + public static short applIDNullValue() + { + return (short)-32768; + } + + public static short applIDMinValue() + { + return (short)-32767; + } + + public static short applIDMaxValue() + { + return (short)32767; + } + + public MDInstrumentDefinitionOption41Encoder applID(final short value) + { + buffer.putShort(offset + 15, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int marketSegmentIDEncodingOffset() + { + return 17; + } + + public static int marketSegmentIDEncodingLength() + { + return 1; + } + + public static short marketSegmentIDNullValue() + { + return (short)255; + } + + public static short marketSegmentIDMinValue() + { + return (short)0; + } + + public static short marketSegmentIDMaxValue() + { + return (short)254; + } + + public MDInstrumentDefinitionOption41Encoder marketSegmentID(final short value) + { + buffer.putByte(offset + 17, (byte)value); + return this; + } + + + public static int underlyingProductEncodingOffset() + { + return 18; + } + + public static int underlyingProductEncodingLength() + { + return 1; + } + + public static short underlyingProductNullValue() + { + return (short)255; + } + + public static short underlyingProductMinValue() + { + return (short)0; + } + + public static short underlyingProductMaxValue() + { + return (short)254; + } + + public MDInstrumentDefinitionOption41Encoder underlyingProduct(final short value) + { + buffer.putByte(offset + 18, (byte)value); + return this; + } + + + public static int securityExchangeEncodingOffset() + { + return 19; + } + + public static int securityExchangeEncodingLength() + { + return 4; + } + + public static byte securityExchangeNullValue() + { + return (byte)0; + } + + public static byte securityExchangeMinValue() + { + return (byte)32; + } + + public static byte securityExchangeMaxValue() + { + return (byte)126; + } + + public static int securityExchangeLength() + { + return 4; + } + + public void securityExchange(final int index, final byte value) + { + if (index < 0 || index >= 4) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 19 + (index * 1); + buffer.putByte(pos, value); + } + + public static String securityExchangeCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionOption41Encoder putSecurityExchange(final byte[] src, final int srcOffset) + { + final int length = 4; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 19, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionOption41Encoder securityExchange(final String src) + { + final int length = 4; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 19, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 19 + start, (byte)0); + } + + return this; + } + + public static int securityGroupEncodingOffset() + { + return 23; + } + + public static int securityGroupEncodingLength() + { + return 6; + } + + public static byte securityGroupNullValue() + { + return (byte)0; + } + + public static byte securityGroupMinValue() + { + return (byte)32; + } + + public static byte securityGroupMaxValue() + { + return (byte)126; + } + + public static int securityGroupLength() + { + return 6; + } + + public void securityGroup(final int index, final byte value) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 23 + (index * 1); + buffer.putByte(pos, value); + } + + public static String securityGroupCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionOption41Encoder putSecurityGroup(final byte[] src, final int srcOffset) + { + final int length = 6; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 23, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionOption41Encoder securityGroup(final String src) + { + final int length = 6; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 23, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 23 + start, (byte)0); + } + + return this; + } + + public static int assetEncodingOffset() + { + return 29; + } + + public static int assetEncodingLength() + { + return 6; + } + + public static byte assetNullValue() + { + return (byte)0; + } + + public static byte assetMinValue() + { + return (byte)32; + } + + public static byte assetMaxValue() + { + return (byte)126; + } + + public static int assetLength() + { + return 6; + } + + public void asset(final int index, final byte value) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 29 + (index * 1); + buffer.putByte(pos, value); + } + + public static String assetCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionOption41Encoder putAsset(final byte[] src, final int srcOffset) + { + final int length = 6; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 29, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionOption41Encoder asset(final String src) + { + final int length = 6; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 29, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 29 + start, (byte)0); + } + + return this; + } + + public static int symbolEncodingOffset() + { + return 35; + } + + public static int symbolEncodingLength() + { + return 20; + } + + public static byte symbolNullValue() + { + return (byte)0; + } + + public static byte symbolMinValue() + { + return (byte)32; + } + + public static byte symbolMaxValue() + { + return (byte)126; + } + + public static int symbolLength() + { + return 20; + } + + public void symbol(final int index, final byte value) + { + if (index < 0 || index >= 20) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 35 + (index * 1); + buffer.putByte(pos, value); + } + + public static String symbolCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionOption41Encoder putSymbol(final byte[] src, final int srcOffset) + { + final int length = 20; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 35, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionOption41Encoder symbol(final String src) + { + final int length = 20; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 35, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 35 + start, (byte)0); + } + + return this; + } + + public static int securityIDEncodingOffset() + { + return 55; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public MDInstrumentDefinitionOption41Encoder securityID(final int value) + { + buffer.putInt(offset + 55, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int securityIDSourceEncodingOffset() + { + return 59; + } + + public static int securityIDSourceEncodingLength() + { + return 0; + } + + public static byte securityIDSourceNullValue() + { + return (byte)0; + } + + public static byte securityIDSourceMinValue() + { + return (byte)32; + } + + public static byte securityIDSourceMaxValue() + { + return (byte)126; + } + + private static final byte[] SECURITYIDSOURCE_VALUE = {56}; + + public static int securityIDSourceLength() + { + return 1; + } + + public byte securityIDSource(final int index) + { + return SECURITYIDSOURCE_VALUE[index]; + } + + public int getSecurityIDSource(final byte[] dst, final int offset, final int length) + { + final int bytesCopied = Math.min(length, 1); + System.arraycopy(SECURITYIDSOURCE_VALUE, 0, dst, offset, bytesCopied); + + return bytesCopied; + } + + public static int securityTypeEncodingOffset() + { + return 59; + } + + public static int securityTypeEncodingLength() + { + return 6; + } + + public static byte securityTypeNullValue() + { + return (byte)0; + } + + public static byte securityTypeMinValue() + { + return (byte)32; + } + + public static byte securityTypeMaxValue() + { + return (byte)126; + } + + public static int securityTypeLength() + { + return 6; + } + + public void securityType(final int index, final byte value) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 59 + (index * 1); + buffer.putByte(pos, value); + } + + public static String securityTypeCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionOption41Encoder putSecurityType(final byte[] src, final int srcOffset) + { + final int length = 6; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 59, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionOption41Encoder securityType(final String src) + { + final int length = 6; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 59, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 59 + start, (byte)0); + } + + return this; + } + + public static int cFICodeEncodingOffset() + { + return 65; + } + + public static int cFICodeEncodingLength() + { + return 6; + } + + public static byte cFICodeNullValue() + { + return (byte)0; + } + + public static byte cFICodeMinValue() + { + return (byte)32; + } + + public static byte cFICodeMaxValue() + { + return (byte)126; + } + + public static int cFICodeLength() + { + return 6; + } + + public void cFICode(final int index, final byte value) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 65 + (index * 1); + buffer.putByte(pos, value); + } + + public static String cFICodeCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionOption41Encoder putCFICode(final byte[] src, final int srcOffset) + { + final int length = 6; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 65, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionOption41Encoder cFICode(final String src) + { + final int length = 6; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 65, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 65 + start, (byte)0); + } + + return this; + } + + public static int putOrCallEncodingOffset() + { + return 71; + } + + public static int putOrCallEncodingLength() + { + return 1; + } + + public MDInstrumentDefinitionOption41Encoder putOrCall(final PutOrCall value) + { + buffer.putByte(offset + 71, (byte)value.value()); + return this; + } + + public static int maturityMonthYearEncodingOffset() + { + return 72; + } + + public static int maturityMonthYearEncodingLength() + { + return 5; + } + + private final MaturityMonthYearEncoder maturityMonthYear = new MaturityMonthYearEncoder(); + + public MaturityMonthYearEncoder maturityMonthYear() + { + maturityMonthYear.wrap(buffer, offset + 72); + return maturityMonthYear; + } + + public static int currencyEncodingOffset() + { + return 77; + } + + public static int currencyEncodingLength() + { + return 3; + } + + public static byte currencyNullValue() + { + return (byte)0; + } + + public static byte currencyMinValue() + { + return (byte)32; + } + + public static byte currencyMaxValue() + { + return (byte)126; + } + + public static int currencyLength() + { + return 3; + } + + public void currency(final int index, final byte value) + { + if (index < 0 || index >= 3) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 77 + (index * 1); + buffer.putByte(pos, value); + } + + public static String currencyCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionOption41Encoder putCurrency(final byte[] src, final int srcOffset) + { + final int length = 3; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 77, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionOption41Encoder currency(final String src) + { + final int length = 3; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 77, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 77 + start, (byte)0); + } + + return this; + } + + public static int strikePriceEncodingOffset() + { + return 80; + } + + public static int strikePriceEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder strikePrice = new PRICENULLEncoder(); + + public PRICENULLEncoder strikePrice() + { + strikePrice.wrap(buffer, offset + 80); + return strikePrice; + } + + public static int strikeCurrencyEncodingOffset() + { + return 88; + } + + public static int strikeCurrencyEncodingLength() + { + return 3; + } + + public static byte strikeCurrencyNullValue() + { + return (byte)0; + } + + public static byte strikeCurrencyMinValue() + { + return (byte)32; + } + + public static byte strikeCurrencyMaxValue() + { + return (byte)126; + } + + public static int strikeCurrencyLength() + { + return 3; + } + + public void strikeCurrency(final int index, final byte value) + { + if (index < 0 || index >= 3) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 88 + (index * 1); + buffer.putByte(pos, value); + } + + public static String strikeCurrencyCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionOption41Encoder putStrikeCurrency(final byte[] src, final int srcOffset) + { + final int length = 3; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 88, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionOption41Encoder strikeCurrency(final String src) + { + final int length = 3; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 88, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 88 + start, (byte)0); + } + + return this; + } + + public static int settlCurrencyEncodingOffset() + { + return 91; + } + + public static int settlCurrencyEncodingLength() + { + return 3; + } + + public static byte settlCurrencyNullValue() + { + return (byte)0; + } + + public static byte settlCurrencyMinValue() + { + return (byte)32; + } + + public static byte settlCurrencyMaxValue() + { + return (byte)126; + } + + public static int settlCurrencyLength() + { + return 3; + } + + public void settlCurrency(final int index, final byte value) + { + if (index < 0 || index >= 3) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 91 + (index * 1); + buffer.putByte(pos, value); + } + + public static String settlCurrencyCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionOption41Encoder putSettlCurrency(final byte[] src, final int srcOffset) + { + final int length = 3; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 91, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionOption41Encoder settlCurrency(final String src) + { + final int length = 3; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 91, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 91 + start, (byte)0); + } + + return this; + } + + public static int minCabPriceEncodingOffset() + { + return 94; + } + + public static int minCabPriceEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder minCabPrice = new PRICENULLEncoder(); + + public PRICENULLEncoder minCabPrice() + { + minCabPrice.wrap(buffer, offset + 94); + return minCabPrice; + } + + public static int matchAlgorithmEncodingOffset() + { + return 102; + } + + public static int matchAlgorithmEncodingLength() + { + return 1; + } + + public static byte matchAlgorithmNullValue() + { + return (byte)0; + } + + public static byte matchAlgorithmMinValue() + { + return (byte)32; + } + + public static byte matchAlgorithmMaxValue() + { + return (byte)126; + } + + public MDInstrumentDefinitionOption41Encoder matchAlgorithm(final byte value) + { + buffer.putByte(offset + 102, value); + return this; + } + + + public static int minTradeVolEncodingOffset() + { + return 103; + } + + public static int minTradeVolEncodingLength() + { + return 4; + } + + public static long minTradeVolNullValue() + { + return 4294967294L; + } + + public static long minTradeVolMinValue() + { + return 0L; + } + + public static long minTradeVolMaxValue() + { + return 4294967293L; + } + + public MDInstrumentDefinitionOption41Encoder minTradeVol(final long value) + { + buffer.putInt(offset + 103, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int maxTradeVolEncodingOffset() + { + return 107; + } + + public static int maxTradeVolEncodingLength() + { + return 4; + } + + public static long maxTradeVolNullValue() + { + return 4294967294L; + } + + public static long maxTradeVolMinValue() + { + return 0L; + } + + public static long maxTradeVolMaxValue() + { + return 4294967293L; + } + + public MDInstrumentDefinitionOption41Encoder maxTradeVol(final long value) + { + buffer.putInt(offset + 107, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int minPriceIncrementEncodingOffset() + { + return 111; + } + + public static int minPriceIncrementEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder minPriceIncrement = new PRICENULLEncoder(); + + public PRICENULLEncoder minPriceIncrement() + { + minPriceIncrement.wrap(buffer, offset + 111); + return minPriceIncrement; + } + + public static int minPriceIncrementAmountEncodingOffset() + { + return 119; + } + + public static int minPriceIncrementAmountEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder minPriceIncrementAmount = new PRICENULLEncoder(); + + public PRICENULLEncoder minPriceIncrementAmount() + { + minPriceIncrementAmount.wrap(buffer, offset + 119); + return minPriceIncrementAmount; + } + + public static int displayFactorEncodingOffset() + { + return 127; + } + + public static int displayFactorEncodingLength() + { + return 8; + } + + private final FLOATEncoder displayFactor = new FLOATEncoder(); + + public FLOATEncoder displayFactor() + { + displayFactor.wrap(buffer, offset + 127); + return displayFactor; + } + + public static int tickRuleEncodingOffset() + { + return 135; + } + + public static int tickRuleEncodingLength() + { + return 1; + } + + public static byte tickRuleNullValue() + { + return (byte)127; + } + + public static byte tickRuleMinValue() + { + return (byte)-127; + } + + public static byte tickRuleMaxValue() + { + return (byte)127; + } + + public MDInstrumentDefinitionOption41Encoder tickRule(final byte value) + { + buffer.putByte(offset + 135, value); + return this; + } + + + public static int mainFractionEncodingOffset() + { + return 136; + } + + public static int mainFractionEncodingLength() + { + return 1; + } + + public static short mainFractionNullValue() + { + return (short)255; + } + + public static short mainFractionMinValue() + { + return (short)0; + } + + public static short mainFractionMaxValue() + { + return (short)254; + } + + public MDInstrumentDefinitionOption41Encoder mainFraction(final short value) + { + buffer.putByte(offset + 136, (byte)value); + return this; + } + + + public static int subFractionEncodingOffset() + { + return 137; + } + + public static int subFractionEncodingLength() + { + return 1; + } + + public static short subFractionNullValue() + { + return (short)255; + } + + public static short subFractionMinValue() + { + return (short)0; + } + + public static short subFractionMaxValue() + { + return (short)254; + } + + public MDInstrumentDefinitionOption41Encoder subFraction(final short value) + { + buffer.putByte(offset + 137, (byte)value); + return this; + } + + + public static int priceDisplayFormatEncodingOffset() + { + return 138; + } + + public static int priceDisplayFormatEncodingLength() + { + return 1; + } + + public static short priceDisplayFormatNullValue() + { + return (short)255; + } + + public static short priceDisplayFormatMinValue() + { + return (short)0; + } + + public static short priceDisplayFormatMaxValue() + { + return (short)254; + } + + public MDInstrumentDefinitionOption41Encoder priceDisplayFormat(final short value) + { + buffer.putByte(offset + 138, (byte)value); + return this; + } + + + public static int unitOfMeasureEncodingOffset() + { + return 139; + } + + public static int unitOfMeasureEncodingLength() + { + return 30; + } + + public static byte unitOfMeasureNullValue() + { + return (byte)0; + } + + public static byte unitOfMeasureMinValue() + { + return (byte)32; + } + + public static byte unitOfMeasureMaxValue() + { + return (byte)126; + } + + public static int unitOfMeasureLength() + { + return 30; + } + + public void unitOfMeasure(final int index, final byte value) + { + if (index < 0 || index >= 30) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 139 + (index * 1); + buffer.putByte(pos, value); + } + + public static String unitOfMeasureCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionOption41Encoder putUnitOfMeasure(final byte[] src, final int srcOffset) + { + final int length = 30; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 139, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionOption41Encoder unitOfMeasure(final String src) + { + final int length = 30; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 139, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 139 + start, (byte)0); + } + + return this; + } + + public static int unitOfMeasureQtyEncodingOffset() + { + return 169; + } + + public static int unitOfMeasureQtyEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder unitOfMeasureQty = new PRICENULLEncoder(); + + public PRICENULLEncoder unitOfMeasureQty() + { + unitOfMeasureQty.wrap(buffer, offset + 169); + return unitOfMeasureQty; + } + + public static int tradingReferencePriceEncodingOffset() + { + return 177; + } + + public static int tradingReferencePriceEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder tradingReferencePrice = new PRICENULLEncoder(); + + public PRICENULLEncoder tradingReferencePrice() + { + tradingReferencePrice.wrap(buffer, offset + 177); + return tradingReferencePrice; + } + + public static int settlPriceTypeEncodingOffset() + { + return 185; + } + + public static int settlPriceTypeEncodingLength() + { + return 1; + } + + private final SettlPriceTypeEncoder settlPriceType = new SettlPriceTypeEncoder(); + + public SettlPriceTypeEncoder settlPriceType() + { + settlPriceType.wrap(buffer, offset + 185); + return settlPriceType; + } + + public static int clearedVolumeEncodingOffset() + { + return 186; + } + + public static int clearedVolumeEncodingLength() + { + return 4; + } + + public static int clearedVolumeNullValue() + { + return 2147483647; + } + + public static int clearedVolumeMinValue() + { + return -2147483647; + } + + public static int clearedVolumeMaxValue() + { + return 2147483647; + } + + public MDInstrumentDefinitionOption41Encoder clearedVolume(final int value) + { + buffer.putInt(offset + 186, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int openInterestQtyEncodingOffset() + { + return 190; + } + + public static int openInterestQtyEncodingLength() + { + return 4; + } + + public static int openInterestQtyNullValue() + { + return 2147483647; + } + + public static int openInterestQtyMinValue() + { + return -2147483647; + } + + public static int openInterestQtyMaxValue() + { + return 2147483647; + } + + public MDInstrumentDefinitionOption41Encoder openInterestQty(final int value) + { + buffer.putInt(offset + 190, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int lowLimitPriceEncodingOffset() + { + return 194; + } + + public static int lowLimitPriceEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder lowLimitPrice = new PRICENULLEncoder(); + + public PRICENULLEncoder lowLimitPrice() + { + lowLimitPrice.wrap(buffer, offset + 194); + return lowLimitPrice; + } + + public static int highLimitPriceEncodingOffset() + { + return 202; + } + + public static int highLimitPriceEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder highLimitPrice = new PRICENULLEncoder(); + + public PRICENULLEncoder highLimitPrice() + { + highLimitPrice.wrap(buffer, offset + 202); + return highLimitPrice; + } + + public static int userDefinedInstrumentEncodingOffset() + { + return 210; + } + + public static int userDefinedInstrumentEncodingLength() + { + return 1; + } + + public static byte userDefinedInstrumentNullValue() + { + return (byte)0; + } + + public static byte userDefinedInstrumentMinValue() + { + return (byte)32; + } + + public static byte userDefinedInstrumentMaxValue() + { + return (byte)126; + } + + public MDInstrumentDefinitionOption41Encoder userDefinedInstrument(final byte value) + { + buffer.putByte(offset + 210, value); + return this; + } + + + public static int tradingReferenceDateEncodingOffset() + { + return 211; + } + + public static int tradingReferenceDateEncodingLength() + { + return 2; + } + + public static int tradingReferenceDateNullValue() + { + return 65535; + } + + public static int tradingReferenceDateMinValue() + { + return 0; + } + + public static int tradingReferenceDateMaxValue() + { + return 65534; + } + + public MDInstrumentDefinitionOption41Encoder tradingReferenceDate(final int value) + { + buffer.putShort(offset + 211, (short)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + private final NoEventsEncoder noEvents = new NoEventsEncoder(); + + public static long noEventsId() + { + return 864; + } + + public NoEventsEncoder noEventsCount(final int count) + { + noEvents.wrap(parentMessage, buffer, count); + return noEvents; + } + + public static class NoEventsEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private MDInstrumentDefinitionOption41Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDInstrumentDefinitionOption41Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)9); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 9; + } + + public NoEventsEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int eventTypeEncodingOffset() + { + return 0; + } + + public static int eventTypeEncodingLength() + { + return 1; + } + + public NoEventsEncoder eventType(final EventType value) + { + buffer.putByte(offset + 0, (byte)value.value()); + return this; + } + + public static int eventTimeEncodingOffset() + { + return 1; + } + + public static int eventTimeEncodingLength() + { + return 8; + } + + public static long eventTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long eventTimeMinValue() + { + return 0x0L; + } + + public static long eventTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public NoEventsEncoder eventTime(final long value) + { + buffer.putLong(offset + 1, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + } + + private final NoMDFeedTypesEncoder noMDFeedTypes = new NoMDFeedTypesEncoder(); + + public static long noMDFeedTypesId() + { + return 1141; + } + + public NoMDFeedTypesEncoder noMDFeedTypesCount(final int count) + { + noMDFeedTypes.wrap(parentMessage, buffer, count); + return noMDFeedTypes; + } + + public static class NoMDFeedTypesEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private MDInstrumentDefinitionOption41Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDInstrumentDefinitionOption41Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)4); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 4; + } + + public NoMDFeedTypesEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int mDFeedTypeEncodingOffset() + { + return 0; + } + + public static int mDFeedTypeEncodingLength() + { + return 3; + } + + public static byte mDFeedTypeNullValue() + { + return (byte)0; + } + + public static byte mDFeedTypeMinValue() + { + return (byte)32; + } + + public static byte mDFeedTypeMaxValue() + { + return (byte)126; + } + + public static int mDFeedTypeLength() + { + return 3; + } + + public void mDFeedType(final int index, final byte value) + { + if (index < 0 || index >= 3) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 0 + (index * 1); + buffer.putByte(pos, value); + } + + public static String mDFeedTypeCharacterEncoding() + { + return "UTF-8"; + } + + public NoMDFeedTypesEncoder putMDFeedType(final byte[] src, final int srcOffset) + { + final int length = 3; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 0, src, srcOffset, length); + + return this; + } + + public NoMDFeedTypesEncoder mDFeedType(final String src) + { + final int length = 3; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 0, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 0 + start, (byte)0); + } + + return this; + } + + public static int marketDepthEncodingOffset() + { + return 3; + } + + public static int marketDepthEncodingLength() + { + return 1; + } + + public static byte marketDepthNullValue() + { + return (byte)-128; + } + + public static byte marketDepthMinValue() + { + return (byte)-127; + } + + public static byte marketDepthMaxValue() + { + return (byte)127; + } + + public NoMDFeedTypesEncoder marketDepth(final byte value) + { + buffer.putByte(offset + 3, value); + return this; + } + + } + + private final NoInstAttribEncoder noInstAttrib = new NoInstAttribEncoder(); + + public static long noInstAttribId() + { + return 870; + } + + public NoInstAttribEncoder noInstAttribCount(final int count) + { + noInstAttrib.wrap(parentMessage, buffer, count); + return noInstAttrib; + } + + public static class NoInstAttribEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private MDInstrumentDefinitionOption41Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDInstrumentDefinitionOption41Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)4); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 4; + } + + public NoInstAttribEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int instAttribTypeEncodingOffset() + { + return 0; + } + + public static int instAttribTypeEncodingLength() + { + return 0; + } + + public static byte instAttribTypeNullValue() + { + return (byte)-128; + } + + public static byte instAttribTypeMinValue() + { + return (byte)-127; + } + + public static byte instAttribTypeMaxValue() + { + return (byte)127; + } + + public byte instAttribType() + { + return (byte)24; + } + + public static int instAttribValueEncodingOffset() + { + return 0; + } + + public static int instAttribValueEncodingLength() + { + return 4; + } + + private final InstAttribValueEncoder instAttribValue = new InstAttribValueEncoder(); + + public InstAttribValueEncoder instAttribValue() + { + instAttribValue.wrap(buffer, offset + 0); + return instAttribValue; + } + } + + private final NoLotTypeRulesEncoder noLotTypeRules = new NoLotTypeRulesEncoder(); + + public static long noLotTypeRulesId() + { + return 1234; + } + + public NoLotTypeRulesEncoder noLotTypeRulesCount(final int count) + { + noLotTypeRules.wrap(parentMessage, buffer, count); + return noLotTypeRules; + } + + public static class NoLotTypeRulesEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private MDInstrumentDefinitionOption41Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDInstrumentDefinitionOption41Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)5); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 5; + } + + public NoLotTypeRulesEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int lotTypeEncodingOffset() + { + return 0; + } + + public static int lotTypeEncodingLength() + { + return 1; + } + + public static byte lotTypeNullValue() + { + return (byte)-128; + } + + public static byte lotTypeMinValue() + { + return (byte)-127; + } + + public static byte lotTypeMaxValue() + { + return (byte)127; + } + + public NoLotTypeRulesEncoder lotType(final byte value) + { + buffer.putByte(offset + 0, value); + return this; + } + + + public static int minLotSizeEncodingOffset() + { + return 1; + } + + public static int minLotSizeEncodingLength() + { + return 4; + } + + private final DecimalQtyEncoder minLotSize = new DecimalQtyEncoder(); + + public DecimalQtyEncoder minLotSize() + { + minLotSize.wrap(buffer, offset + 1); + return minLotSize; + } + } + + private final NoUnderlyingsEncoder noUnderlyings = new NoUnderlyingsEncoder(); + + public static long noUnderlyingsId() + { + return 711; + } + + public NoUnderlyingsEncoder noUnderlyingsCount(final int count) + { + noUnderlyings.wrap(parentMessage, buffer, count); + return noUnderlyings; + } + + public static class NoUnderlyingsEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private MDInstrumentDefinitionOption41Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDInstrumentDefinitionOption41Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)24); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 24; + } + + public NoUnderlyingsEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int underlyingSecurityIDEncodingOffset() + { + return 0; + } + + public static int underlyingSecurityIDEncodingLength() + { + return 4; + } + + public static int underlyingSecurityIDNullValue() + { + return -2147483648; + } + + public static int underlyingSecurityIDMinValue() + { + return -2147483647; + } + + public static int underlyingSecurityIDMaxValue() + { + return 2147483647; + } + + public NoUnderlyingsEncoder underlyingSecurityID(final int value) + { + buffer.putInt(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int underlyingSecurityIDSourceEncodingOffset() + { + return 4; + } + + public static int underlyingSecurityIDSourceEncodingLength() + { + return 0; + } + + public static byte underlyingSecurityIDSourceNullValue() + { + return (byte)0; + } + + public static byte underlyingSecurityIDSourceMinValue() + { + return (byte)32; + } + + public static byte underlyingSecurityIDSourceMaxValue() + { + return (byte)126; + } + + private static final byte[] UNDERLYINGSECURITYIDSOURCE_VALUE = {56}; + + public static int underlyingSecurityIDSourceLength() + { + return 1; + } + + public byte underlyingSecurityIDSource(final int index) + { + return UNDERLYINGSECURITYIDSOURCE_VALUE[index]; + } + + public int getUnderlyingSecurityIDSource(final byte[] dst, final int offset, final int length) + { + final int bytesCopied = Math.min(length, 1); + System.arraycopy(UNDERLYINGSECURITYIDSOURCE_VALUE, 0, dst, offset, bytesCopied); + + return bytesCopied; + } + + public static int underlyingSymbolEncodingOffset() + { + return 4; + } + + public static int underlyingSymbolEncodingLength() + { + return 20; + } + + public static byte underlyingSymbolNullValue() + { + return (byte)0; + } + + public static byte underlyingSymbolMinValue() + { + return (byte)32; + } + + public static byte underlyingSymbolMaxValue() + { + return (byte)126; + } + + public static int underlyingSymbolLength() + { + return 20; + } + + public void underlyingSymbol(final int index, final byte value) + { + if (index < 0 || index >= 20) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 4 + (index * 1); + buffer.putByte(pos, value); + } + + public static String underlyingSymbolCharacterEncoding() + { + return "UTF-8"; + } + + public NoUnderlyingsEncoder putUnderlyingSymbol(final byte[] src, final int srcOffset) + { + final int length = 20; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 4, src, srcOffset, length); + + return this; + } + + public NoUnderlyingsEncoder underlyingSymbol(final String src) + { + final int length = 20; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 4, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 4 + start, (byte)0); + } + + return this; + } + } + + private final NoRelatedInstrumentsEncoder noRelatedInstruments = new NoRelatedInstrumentsEncoder(); + + public static long noRelatedInstrumentsId() + { + return 1647; + } + + public NoRelatedInstrumentsEncoder noRelatedInstrumentsCount(final int count) + { + noRelatedInstruments.wrap(parentMessage, buffer, count); + return noRelatedInstruments; + } + + public static class NoRelatedInstrumentsEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private MDInstrumentDefinitionOption41Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDInstrumentDefinitionOption41Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)24); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 24; + } + + public NoRelatedInstrumentsEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int relatedSecurityIDEncodingOffset() + { + return 0; + } + + public static int relatedSecurityIDEncodingLength() + { + return 4; + } + + public static int relatedSecurityIDNullValue() + { + return -2147483648; + } + + public static int relatedSecurityIDMinValue() + { + return -2147483647; + } + + public static int relatedSecurityIDMaxValue() + { + return 2147483647; + } + + public NoRelatedInstrumentsEncoder relatedSecurityID(final int value) + { + buffer.putInt(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int relatedSecurityIDSourceEncodingOffset() + { + return 4; + } + + public static int relatedSecurityIDSourceEncodingLength() + { + return 0; + } + + public static byte relatedSecurityIDSourceNullValue() + { + return (byte)0; + } + + public static byte relatedSecurityIDSourceMinValue() + { + return (byte)32; + } + + public static byte relatedSecurityIDSourceMaxValue() + { + return (byte)126; + } + + private static final byte[] RELATEDSECURITYIDSOURCE_VALUE = {56}; + + public static int relatedSecurityIDSourceLength() + { + return 1; + } + + public byte relatedSecurityIDSource(final int index) + { + return RELATEDSECURITYIDSOURCE_VALUE[index]; + } + + public int getRelatedSecurityIDSource(final byte[] dst, final int offset, final int length) + { + final int bytesCopied = Math.min(length, 1); + System.arraycopy(RELATEDSECURITYIDSOURCE_VALUE, 0, dst, offset, bytesCopied); + + return bytesCopied; + } + + public static int relatedSymbolEncodingOffset() + { + return 4; + } + + public static int relatedSymbolEncodingLength() + { + return 20; + } + + public static byte relatedSymbolNullValue() + { + return (byte)0; + } + + public static byte relatedSymbolMinValue() + { + return (byte)32; + } + + public static byte relatedSymbolMaxValue() + { + return (byte)126; + } + + public static int relatedSymbolLength() + { + return 20; + } + + public void relatedSymbol(final int index, final byte value) + { + if (index < 0 || index >= 20) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 4 + (index * 1); + buffer.putByte(pos, value); + } + + public static String relatedSymbolCharacterEncoding() + { + return "UTF-8"; + } + + public NoRelatedInstrumentsEncoder putRelatedSymbol(final byte[] src, final int srcOffset) + { + final int length = 20; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 4, src, srcOffset, length); + + return this; + } + + public NoRelatedInstrumentsEncoder relatedSymbol(final String src) + { + final int length = 20; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 4, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 4 + start, (byte)0); + } + + return this; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + MDInstrumentDefinitionOption41Decoder writer = new MDInstrumentDefinitionOption41Decoder(); + writer.wrap(buffer, offset, BLOCK_LENGTH, SCHEMA_VERSION); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDInstrumentDefinitionSpread29Decoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDInstrumentDefinitionSpread29Decoder.java new file mode 100644 index 0000000..829b7eb --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDInstrumentDefinitionSpread29Decoder.java @@ -0,0 +1,4013 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDInstrumentDefinitionSpread29Decoder"}) +@SuppressWarnings("all") +public class MDInstrumentDefinitionSpread29Decoder +{ + public static final int BLOCK_LENGTH = 195; + public static final int TEMPLATE_ID = 29; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final MDInstrumentDefinitionSpread29Decoder parentMessage = this; + private DirectBuffer buffer; + protected int offset; + protected int limit; + protected int actingBlockLength; + protected int actingVersion; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "d"; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public MDInstrumentDefinitionSpread29Decoder wrap( + final DirectBuffer buffer, final int offset, final int actingBlockLength, final int actingVersion) + { + this.buffer = buffer; + this.offset = offset; + this.actingBlockLength = actingBlockLength; + this.actingVersion = actingVersion; + limit(offset + actingBlockLength); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int matchEventIndicatorId() + { + return 5799; + } + + public static int matchEventIndicatorSinceVersion() + { + return 0; + } + + public static int matchEventIndicatorEncodingOffset() + { + return 0; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + public static String matchEventIndicatorMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MultipleCharValue"; + } + + return ""; + } + + private final MatchEventIndicatorDecoder matchEventIndicator = new MatchEventIndicatorDecoder(); + + public MatchEventIndicatorDecoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 0); + return matchEventIndicator; + } + + public static int totNumReportsId() + { + return 911; + } + + public static int totNumReportsSinceVersion() + { + return 0; + } + + public static int totNumReportsEncodingOffset() + { + return 1; + } + + public static int totNumReportsEncodingLength() + { + return 4; + } + + public static String totNumReportsMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static long totNumReportsNullValue() + { + return 4294967295L; + } + + public static long totNumReportsMinValue() + { + return 0L; + } + + public static long totNumReportsMaxValue() + { + return 4294967293L; + } + + public long totNumReports() + { + return (buffer.getInt(offset + 1, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + public static int securityUpdateActionId() + { + return 980; + } + + public static int securityUpdateActionSinceVersion() + { + return 0; + } + + public static int securityUpdateActionEncodingOffset() + { + return 5; + } + + public static int securityUpdateActionEncodingLength() + { + return 1; + } + + public static String securityUpdateActionMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public SecurityUpdateAction securityUpdateAction() + { + return SecurityUpdateAction.get(buffer.getByte(offset + 5)); + } + + + public static int lastUpdateTimeId() + { + return 779; + } + + public static int lastUpdateTimeSinceVersion() + { + return 0; + } + + public static int lastUpdateTimeEncodingOffset() + { + return 6; + } + + public static int lastUpdateTimeEncodingLength() + { + return 8; + } + + public static String lastUpdateTimeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "UTCTimestamp"; + } + + return ""; + } + + public static long lastUpdateTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long lastUpdateTimeMinValue() + { + return 0x0L; + } + + public static long lastUpdateTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long lastUpdateTime() + { + return buffer.getLong(offset + 6, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int mDSecurityTradingStatusId() + { + return 1682; + } + + public static int mDSecurityTradingStatusSinceVersion() + { + return 0; + } + + public static int mDSecurityTradingStatusEncodingOffset() + { + return 14; + } + + public static int mDSecurityTradingStatusEncodingLength() + { + return 1; + } + + public static String mDSecurityTradingStatusMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public SecurityTradingStatus mDSecurityTradingStatus() + { + return SecurityTradingStatus.get(((short)(buffer.getByte(offset + 14) & 0xFF))); + } + + + public static int applIDId() + { + return 1180; + } + + public static int applIDSinceVersion() + { + return 0; + } + + public static int applIDEncodingOffset() + { + return 15; + } + + public static int applIDEncodingLength() + { + return 2; + } + + public static String applIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static short applIDNullValue() + { + return (short)-32768; + } + + public static short applIDMinValue() + { + return (short)-32767; + } + + public static short applIDMaxValue() + { + return (short)32767; + } + + public short applID() + { + return buffer.getShort(offset + 15, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int marketSegmentIDId() + { + return 1300; + } + + public static int marketSegmentIDSinceVersion() + { + return 0; + } + + public static int marketSegmentIDEncodingOffset() + { + return 17; + } + + public static int marketSegmentIDEncodingLength() + { + return 1; + } + + public static String marketSegmentIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static short marketSegmentIDNullValue() + { + return (short)255; + } + + public static short marketSegmentIDMinValue() + { + return (short)0; + } + + public static short marketSegmentIDMaxValue() + { + return (short)254; + } + + public short marketSegmentID() + { + return ((short)(buffer.getByte(offset + 17) & 0xFF)); + } + + + public static int underlyingProductId() + { + return 462; + } + + public static int underlyingProductSinceVersion() + { + return 0; + } + + public static int underlyingProductEncodingOffset() + { + return 18; + } + + public static int underlyingProductEncodingLength() + { + return 1; + } + + public static String underlyingProductMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static short underlyingProductNullValue() + { + return (short)255; + } + + public static short underlyingProductMinValue() + { + return (short)0; + } + + public static short underlyingProductMaxValue() + { + return (short)254; + } + + public short underlyingProduct() + { + return ((short)(buffer.getByte(offset + 18) & 0xFF)); + } + + + public static int securityExchangeId() + { + return 207; + } + + public static int securityExchangeSinceVersion() + { + return 0; + } + + public static int securityExchangeEncodingOffset() + { + return 19; + } + + public static int securityExchangeEncodingLength() + { + return 4; + } + + public static String securityExchangeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Exchange"; + } + + return ""; + } + + public static byte securityExchangeNullValue() + { + return (byte)0; + } + + public static byte securityExchangeMinValue() + { + return (byte)32; + } + + public static byte securityExchangeMaxValue() + { + return (byte)126; + } + + public static int securityExchangeLength() + { + return 4; + } + + public byte securityExchange(final int index) + { + if (index < 0 || index >= 4) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 19 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String securityExchangeCharacterEncoding() + { + return "UTF-8"; + } + + public int getSecurityExchange(final byte[] dst, final int dstOffset) + { + final int length = 4; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 19, dst, dstOffset, length); + + return length; + } + + public String securityExchange() + { + final byte[] dst = new byte[4]; + buffer.getBytes(this.offset + 19, dst, 0, 4); + + int end = 0; + for (; end < 4 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int securityGroupId() + { + return 1151; + } + + public static int securityGroupSinceVersion() + { + return 0; + } + + public static int securityGroupEncodingOffset() + { + return 23; + } + + public static int securityGroupEncodingLength() + { + return 6; + } + + public static String securityGroupMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte securityGroupNullValue() + { + return (byte)0; + } + + public static byte securityGroupMinValue() + { + return (byte)32; + } + + public static byte securityGroupMaxValue() + { + return (byte)126; + } + + public static int securityGroupLength() + { + return 6; + } + + public byte securityGroup(final int index) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 23 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String securityGroupCharacterEncoding() + { + return "UTF-8"; + } + + public int getSecurityGroup(final byte[] dst, final int dstOffset) + { + final int length = 6; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 23, dst, dstOffset, length); + + return length; + } + + public String securityGroup() + { + final byte[] dst = new byte[6]; + buffer.getBytes(this.offset + 23, dst, 0, 6); + + int end = 0; + for (; end < 6 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int assetId() + { + return 6937; + } + + public static int assetSinceVersion() + { + return 0; + } + + public static int assetEncodingOffset() + { + return 29; + } + + public static int assetEncodingLength() + { + return 6; + } + + public static String assetMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte assetNullValue() + { + return (byte)0; + } + + public static byte assetMinValue() + { + return (byte)32; + } + + public static byte assetMaxValue() + { + return (byte)126; + } + + public static int assetLength() + { + return 6; + } + + public byte asset(final int index) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 29 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String assetCharacterEncoding() + { + return "UTF-8"; + } + + public int getAsset(final byte[] dst, final int dstOffset) + { + final int length = 6; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 29, dst, dstOffset, length); + + return length; + } + + public String asset() + { + final byte[] dst = new byte[6]; + buffer.getBytes(this.offset + 29, dst, 0, 6); + + int end = 0; + for (; end < 6 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int symbolId() + { + return 55; + } + + public static int symbolSinceVersion() + { + return 0; + } + + public static int symbolEncodingOffset() + { + return 35; + } + + public static int symbolEncodingLength() + { + return 20; + } + + public static String symbolMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte symbolNullValue() + { + return (byte)0; + } + + public static byte symbolMinValue() + { + return (byte)32; + } + + public static byte symbolMaxValue() + { + return (byte)126; + } + + public static int symbolLength() + { + return 20; + } + + public byte symbol(final int index) + { + if (index < 0 || index >= 20) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 35 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String symbolCharacterEncoding() + { + return "UTF-8"; + } + + public int getSymbol(final byte[] dst, final int dstOffset) + { + final int length = 20; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 35, dst, dstOffset, length); + + return length; + } + + public String symbol() + { + final byte[] dst = new byte[20]; + buffer.getBytes(this.offset + 35, dst, 0, 20); + + int end = 0; + for (; end < 20 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int securityIDId() + { + return 48; + } + + public static int securityIDSinceVersion() + { + return 0; + } + + public static int securityIDEncodingOffset() + { + return 55; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static String securityIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public int securityID() + { + return buffer.getInt(offset + 55, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int securityIDSourceId() + { + return 22; + } + + public static int securityIDSourceSinceVersion() + { + return 0; + } + + public static int securityIDSourceEncodingOffset() + { + return 59; + } + + public static int securityIDSourceEncodingLength() + { + return 0; + } + + public static String securityIDSourceMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public static byte securityIDSourceNullValue() + { + return (byte)0; + } + + public static byte securityIDSourceMinValue() + { + return (byte)32; + } + + public static byte securityIDSourceMaxValue() + { + return (byte)126; + } + + private static final byte[] SECURITYIDSOURCE_VALUE = {56}; + + public static int securityIDSourceLength() + { + return 1; + } + + public byte securityIDSource(final int index) + { + return SECURITYIDSOURCE_VALUE[index]; + } + + public int getSecurityIDSource(final byte[] dst, final int offset, final int length) + { + final int bytesCopied = Math.min(length, 1); + System.arraycopy(SECURITYIDSOURCE_VALUE, 0, dst, offset, bytesCopied); + + return bytesCopied; + } + + public static int securityTypeId() + { + return 167; + } + + public static int securityTypeSinceVersion() + { + return 0; + } + + public static int securityTypeEncodingOffset() + { + return 59; + } + + public static int securityTypeEncodingLength() + { + return 6; + } + + public static String securityTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte securityTypeNullValue() + { + return (byte)0; + } + + public static byte securityTypeMinValue() + { + return (byte)32; + } + + public static byte securityTypeMaxValue() + { + return (byte)126; + } + + public static int securityTypeLength() + { + return 6; + } + + public byte securityType(final int index) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 59 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String securityTypeCharacterEncoding() + { + return "UTF-8"; + } + + public int getSecurityType(final byte[] dst, final int dstOffset) + { + final int length = 6; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 59, dst, dstOffset, length); + + return length; + } + + public String securityType() + { + final byte[] dst = new byte[6]; + buffer.getBytes(this.offset + 59, dst, 0, 6); + + int end = 0; + for (; end < 6 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int cFICodeId() + { + return 461; + } + + public static int cFICodeSinceVersion() + { + return 0; + } + + public static int cFICodeEncodingOffset() + { + return 65; + } + + public static int cFICodeEncodingLength() + { + return 6; + } + + public static String cFICodeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte cFICodeNullValue() + { + return (byte)0; + } + + public static byte cFICodeMinValue() + { + return (byte)32; + } + + public static byte cFICodeMaxValue() + { + return (byte)126; + } + + public static int cFICodeLength() + { + return 6; + } + + public byte cFICode(final int index) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 65 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String cFICodeCharacterEncoding() + { + return "UTF-8"; + } + + public int getCFICode(final byte[] dst, final int dstOffset) + { + final int length = 6; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 65, dst, dstOffset, length); + + return length; + } + + public String cFICode() + { + final byte[] dst = new byte[6]; + buffer.getBytes(this.offset + 65, dst, 0, 6); + + int end = 0; + for (; end < 6 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int maturityMonthYearId() + { + return 200; + } + + public static int maturityMonthYearSinceVersion() + { + return 0; + } + + public static int maturityMonthYearEncodingOffset() + { + return 71; + } + + public static int maturityMonthYearEncodingLength() + { + return 5; + } + + public static String maturityMonthYearMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MonthYear"; + } + + return ""; + } + + private final MaturityMonthYearDecoder maturityMonthYear = new MaturityMonthYearDecoder(); + + public MaturityMonthYearDecoder maturityMonthYear() + { + maturityMonthYear.wrap(buffer, offset + 71); + return maturityMonthYear; + } + + public static int currencyId() + { + return 15; + } + + public static int currencySinceVersion() + { + return 0; + } + + public static int currencyEncodingOffset() + { + return 76; + } + + public static int currencyEncodingLength() + { + return 3; + } + + public static String currencyMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Currency"; + } + + return ""; + } + + public static byte currencyNullValue() + { + return (byte)0; + } + + public static byte currencyMinValue() + { + return (byte)32; + } + + public static byte currencyMaxValue() + { + return (byte)126; + } + + public static int currencyLength() + { + return 3; + } + + public byte currency(final int index) + { + if (index < 0 || index >= 3) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 76 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String currencyCharacterEncoding() + { + return "UTF-8"; + } + + public int getCurrency(final byte[] dst, final int dstOffset) + { + final int length = 3; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 76, dst, dstOffset, length); + + return length; + } + + public String currency() + { + final byte[] dst = new byte[3]; + buffer.getBytes(this.offset + 76, dst, 0, 3); + + int end = 0; + for (; end < 3 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int securitySubTypeId() + { + return 762; + } + + public static int securitySubTypeSinceVersion() + { + return 0; + } + + public static int securitySubTypeEncodingOffset() + { + return 79; + } + + public static int securitySubTypeEncodingLength() + { + return 5; + } + + public static String securitySubTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte securitySubTypeNullValue() + { + return (byte)0; + } + + public static byte securitySubTypeMinValue() + { + return (byte)32; + } + + public static byte securitySubTypeMaxValue() + { + return (byte)126; + } + + public static int securitySubTypeLength() + { + return 5; + } + + public byte securitySubType(final int index) + { + if (index < 0 || index >= 5) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 79 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String securitySubTypeCharacterEncoding() + { + return "UTF-8"; + } + + public int getSecuritySubType(final byte[] dst, final int dstOffset) + { + final int length = 5; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 79, dst, dstOffset, length); + + return length; + } + + public String securitySubType() + { + final byte[] dst = new byte[5]; + buffer.getBytes(this.offset + 79, dst, 0, 5); + + int end = 0; + for (; end < 5 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int userDefinedInstrumentId() + { + return 9779; + } + + public static int userDefinedInstrumentSinceVersion() + { + return 0; + } + + public static int userDefinedInstrumentEncodingOffset() + { + return 84; + } + + public static int userDefinedInstrumentEncodingLength() + { + return 1; + } + + public static String userDefinedInstrumentMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public static byte userDefinedInstrumentNullValue() + { + return (byte)0; + } + + public static byte userDefinedInstrumentMinValue() + { + return (byte)32; + } + + public static byte userDefinedInstrumentMaxValue() + { + return (byte)126; + } + + public byte userDefinedInstrument() + { + return buffer.getByte(offset + 84); + } + + + public static int matchAlgorithmId() + { + return 1142; + } + + public static int matchAlgorithmSinceVersion() + { + return 0; + } + + public static int matchAlgorithmEncodingOffset() + { + return 85; + } + + public static int matchAlgorithmEncodingLength() + { + return 1; + } + + public static String matchAlgorithmMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public static byte matchAlgorithmNullValue() + { + return (byte)0; + } + + public static byte matchAlgorithmMinValue() + { + return (byte)32; + } + + public static byte matchAlgorithmMaxValue() + { + return (byte)126; + } + + public byte matchAlgorithm() + { + return buffer.getByte(offset + 85); + } + + + public static int minTradeVolId() + { + return 562; + } + + public static int minTradeVolSinceVersion() + { + return 0; + } + + public static int minTradeVolEncodingOffset() + { + return 86; + } + + public static int minTradeVolEncodingLength() + { + return 4; + } + + public static String minTradeVolMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static long minTradeVolNullValue() + { + return 4294967294L; + } + + public static long minTradeVolMinValue() + { + return 0L; + } + + public static long minTradeVolMaxValue() + { + return 4294967293L; + } + + public long minTradeVol() + { + return (buffer.getInt(offset + 86, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + public static int maxTradeVolId() + { + return 1140; + } + + public static int maxTradeVolSinceVersion() + { + return 0; + } + + public static int maxTradeVolEncodingOffset() + { + return 90; + } + + public static int maxTradeVolEncodingLength() + { + return 4; + } + + public static String maxTradeVolMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static long maxTradeVolNullValue() + { + return 4294967294L; + } + + public static long maxTradeVolMinValue() + { + return 0L; + } + + public static long maxTradeVolMaxValue() + { + return 4294967293L; + } + + public long maxTradeVol() + { + return (buffer.getInt(offset + 90, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + public static int minPriceIncrementId() + { + return 969; + } + + public static int minPriceIncrementSinceVersion() + { + return 0; + } + + public static int minPriceIncrementEncodingOffset() + { + return 94; + } + + public static int minPriceIncrementEncodingLength() + { + return 8; + } + + public static String minPriceIncrementMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICEDecoder minPriceIncrement = new PRICEDecoder(); + + public PRICEDecoder minPriceIncrement() + { + minPriceIncrement.wrap(buffer, offset + 94); + return minPriceIncrement; + } + + public static int displayFactorId() + { + return 9787; + } + + public static int displayFactorSinceVersion() + { + return 0; + } + + public static int displayFactorEncodingOffset() + { + return 102; + } + + public static int displayFactorEncodingLength() + { + return 8; + } + + public static String displayFactorMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "float"; + } + + return ""; + } + + private final FLOATDecoder displayFactor = new FLOATDecoder(); + + public FLOATDecoder displayFactor() + { + displayFactor.wrap(buffer, offset + 102); + return displayFactor; + } + + public static int priceDisplayFormatId() + { + return 9800; + } + + public static int priceDisplayFormatSinceVersion() + { + return 0; + } + + public static int priceDisplayFormatEncodingOffset() + { + return 110; + } + + public static int priceDisplayFormatEncodingLength() + { + return 1; + } + + public static String priceDisplayFormatMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static short priceDisplayFormatNullValue() + { + return (short)255; + } + + public static short priceDisplayFormatMinValue() + { + return (short)0; + } + + public static short priceDisplayFormatMaxValue() + { + return (short)254; + } + + public short priceDisplayFormat() + { + return ((short)(buffer.getByte(offset + 110) & 0xFF)); + } + + + public static int priceRatioId() + { + return 5770; + } + + public static int priceRatioSinceVersion() + { + return 0; + } + + public static int priceRatioEncodingOffset() + { + return 111; + } + + public static int priceRatioEncodingLength() + { + return 8; + } + + public static String priceRatioMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder priceRatio = new PRICENULLDecoder(); + + public PRICENULLDecoder priceRatio() + { + priceRatio.wrap(buffer, offset + 111); + return priceRatio; + } + + public static int tickRuleId() + { + return 6350; + } + + public static int tickRuleSinceVersion() + { + return 0; + } + + public static int tickRuleEncodingOffset() + { + return 119; + } + + public static int tickRuleEncodingLength() + { + return 1; + } + + public static String tickRuleMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static byte tickRuleNullValue() + { + return (byte)127; + } + + public static byte tickRuleMinValue() + { + return (byte)-127; + } + + public static byte tickRuleMaxValue() + { + return (byte)127; + } + + public byte tickRule() + { + return buffer.getByte(offset + 119); + } + + + public static int unitOfMeasureId() + { + return 996; + } + + public static int unitOfMeasureSinceVersion() + { + return 0; + } + + public static int unitOfMeasureEncodingOffset() + { + return 120; + } + + public static int unitOfMeasureEncodingLength() + { + return 30; + } + + public static String unitOfMeasureMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte unitOfMeasureNullValue() + { + return (byte)0; + } + + public static byte unitOfMeasureMinValue() + { + return (byte)32; + } + + public static byte unitOfMeasureMaxValue() + { + return (byte)126; + } + + public static int unitOfMeasureLength() + { + return 30; + } + + public byte unitOfMeasure(final int index) + { + if (index < 0 || index >= 30) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 120 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String unitOfMeasureCharacterEncoding() + { + return "UTF-8"; + } + + public int getUnitOfMeasure(final byte[] dst, final int dstOffset) + { + final int length = 30; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 120, dst, dstOffset, length); + + return length; + } + + public String unitOfMeasure() + { + final byte[] dst = new byte[30]; + buffer.getBytes(this.offset + 120, dst, 0, 30); + + int end = 0; + for (; end < 30 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int tradingReferencePriceId() + { + return 1150; + } + + public static int tradingReferencePriceSinceVersion() + { + return 0; + } + + public static int tradingReferencePriceEncodingOffset() + { + return 150; + } + + public static int tradingReferencePriceEncodingLength() + { + return 8; + } + + public static String tradingReferencePriceMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder tradingReferencePrice = new PRICENULLDecoder(); + + public PRICENULLDecoder tradingReferencePrice() + { + tradingReferencePrice.wrap(buffer, offset + 150); + return tradingReferencePrice; + } + + public static int settlPriceTypeId() + { + return 731; + } + + public static int settlPriceTypeSinceVersion() + { + return 0; + } + + public static int settlPriceTypeEncodingOffset() + { + return 158; + } + + public static int settlPriceTypeEncodingLength() + { + return 1; + } + + public static String settlPriceTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MultipleCharValue"; + } + + return ""; + } + + private final SettlPriceTypeDecoder settlPriceType = new SettlPriceTypeDecoder(); + + public SettlPriceTypeDecoder settlPriceType() + { + settlPriceType.wrap(buffer, offset + 158); + return settlPriceType; + } + + public static int openInterestQtyId() + { + return 5792; + } + + public static int openInterestQtySinceVersion() + { + return 0; + } + + public static int openInterestQtyEncodingOffset() + { + return 159; + } + + public static int openInterestQtyEncodingLength() + { + return 4; + } + + public static String openInterestQtyMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static int openInterestQtyNullValue() + { + return 2147483647; + } + + public static int openInterestQtyMinValue() + { + return -2147483647; + } + + public static int openInterestQtyMaxValue() + { + return 2147483647; + } + + public int openInterestQty() + { + return buffer.getInt(offset + 159, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int clearedVolumeId() + { + return 5791; + } + + public static int clearedVolumeSinceVersion() + { + return 0; + } + + public static int clearedVolumeEncodingOffset() + { + return 163; + } + + public static int clearedVolumeEncodingLength() + { + return 4; + } + + public static String clearedVolumeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static int clearedVolumeNullValue() + { + return 2147483647; + } + + public static int clearedVolumeMinValue() + { + return -2147483647; + } + + public static int clearedVolumeMaxValue() + { + return 2147483647; + } + + public int clearedVolume() + { + return buffer.getInt(offset + 163, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int highLimitPriceId() + { + return 1149; + } + + public static int highLimitPriceSinceVersion() + { + return 0; + } + + public static int highLimitPriceEncodingOffset() + { + return 167; + } + + public static int highLimitPriceEncodingLength() + { + return 8; + } + + public static String highLimitPriceMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder highLimitPrice = new PRICENULLDecoder(); + + public PRICENULLDecoder highLimitPrice() + { + highLimitPrice.wrap(buffer, offset + 167); + return highLimitPrice; + } + + public static int lowLimitPriceId() + { + return 1148; + } + + public static int lowLimitPriceSinceVersion() + { + return 0; + } + + public static int lowLimitPriceEncodingOffset() + { + return 175; + } + + public static int lowLimitPriceEncodingLength() + { + return 8; + } + + public static String lowLimitPriceMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder lowLimitPrice = new PRICENULLDecoder(); + + public PRICENULLDecoder lowLimitPrice() + { + lowLimitPrice.wrap(buffer, offset + 175); + return lowLimitPrice; + } + + public static int maxPriceVariationId() + { + return 1143; + } + + public static int maxPriceVariationSinceVersion() + { + return 0; + } + + public static int maxPriceVariationEncodingOffset() + { + return 183; + } + + public static int maxPriceVariationEncodingLength() + { + return 8; + } + + public static String maxPriceVariationMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder maxPriceVariation = new PRICENULLDecoder(); + + public PRICENULLDecoder maxPriceVariation() + { + maxPriceVariation.wrap(buffer, offset + 183); + return maxPriceVariation; + } + + public static int mainFractionId() + { + return 37702; + } + + public static int mainFractionSinceVersion() + { + return 0; + } + + public static int mainFractionEncodingOffset() + { + return 191; + } + + public static int mainFractionEncodingLength() + { + return 1; + } + + public static String mainFractionMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static short mainFractionNullValue() + { + return (short)255; + } + + public static short mainFractionMinValue() + { + return (short)0; + } + + public static short mainFractionMaxValue() + { + return (short)254; + } + + public short mainFraction() + { + return ((short)(buffer.getByte(offset + 191) & 0xFF)); + } + + + public static int subFractionId() + { + return 37703; + } + + public static int subFractionSinceVersion() + { + return 0; + } + + public static int subFractionEncodingOffset() + { + return 192; + } + + public static int subFractionEncodingLength() + { + return 1; + } + + public static String subFractionMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static short subFractionNullValue() + { + return (short)255; + } + + public static short subFractionMinValue() + { + return (short)0; + } + + public static short subFractionMaxValue() + { + return (short)254; + } + + public short subFraction() + { + return ((short)(buffer.getByte(offset + 192) & 0xFF)); + } + + + public static int tradingReferenceDateId() + { + return 5796; + } + + public static int tradingReferenceDateSinceVersion() + { + return 6; + } + + public static int tradingReferenceDateEncodingOffset() + { + return 193; + } + + public static int tradingReferenceDateEncodingLength() + { + return 2; + } + + public static String tradingReferenceDateMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "LocalMktDate"; + } + + return ""; + } + + public static int tradingReferenceDateNullValue() + { + return 65535; + } + + public static int tradingReferenceDateMinValue() + { + return 0; + } + + public static int tradingReferenceDateMaxValue() + { + return 65534; + } + + public int tradingReferenceDate() + { + if (parentMessage.actingVersion < 6) + { + return 65535; + } + + return (buffer.getShort(offset + 193, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); + } + + + private final NoEventsDecoder noEvents = new NoEventsDecoder(); + + public static long noEventsDecoderId() + { + return 864; + } + + public static int noEventsDecoderSinceVersion() + { + return 0; + } + + public NoEventsDecoder noEvents() + { + noEvents.wrap(parentMessage, buffer); + return noEvents; + } + + public static class NoEventsDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private MDInstrumentDefinitionSpread29Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDInstrumentDefinitionSpread29Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 9; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoEventsDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int eventTypeId() + { + return 865; + } + + public static int eventTypeSinceVersion() + { + return 0; + } + + public static int eventTypeEncodingOffset() + { + return 0; + } + + public static int eventTypeEncodingLength() + { + return 1; + } + + public static String eventTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public EventType eventType() + { + return EventType.get(((short)(buffer.getByte(offset + 0) & 0xFF))); + } + + + public static int eventTimeId() + { + return 1145; + } + + public static int eventTimeSinceVersion() + { + return 0; + } + + public static int eventTimeEncodingOffset() + { + return 1; + } + + public static int eventTimeEncodingLength() + { + return 8; + } + + public static String eventTimeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "UTCTimestamp"; + } + + return ""; + } + + public static long eventTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long eventTimeMinValue() + { + return 0x0L; + } + + public static long eventTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long eventTime() + { + return buffer.getLong(offset + 1, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='EventType', referencedName='null', description='Code to represent the type of event', id=865, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='EventType', referencedName='null', description='Code to represent the type of event', id=-1, version=0, deprecated=0, encodedLength=1, offset=0, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("eventType="); + builder.append(eventType()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='EventTime', referencedName='null', description='Date and time of instument Activation or Expiration event sent as number of nanoseconds since Unix epoch', id=1145, version=0, deprecated=0, encodedLength=0, offset=1, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + //Token{signal=ENCODING, name='uInt64', referencedName='null', description='Date and time of instument Activation or Expiration event sent as number of nanoseconds since Unix epoch', id=-1, version=0, deprecated=0, encodedLength=8, offset=1, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + builder.append("eventTime="); + builder.append(eventTime()); + builder.append(')'); + return builder; + } + } + + private final NoMDFeedTypesDecoder noMDFeedTypes = new NoMDFeedTypesDecoder(); + + public static long noMDFeedTypesDecoderId() + { + return 1141; + } + + public static int noMDFeedTypesDecoderSinceVersion() + { + return 0; + } + + public NoMDFeedTypesDecoder noMDFeedTypes() + { + noMDFeedTypes.wrap(parentMessage, buffer); + return noMDFeedTypes; + } + + public static class NoMDFeedTypesDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private MDInstrumentDefinitionSpread29Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDInstrumentDefinitionSpread29Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 4; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoMDFeedTypesDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int mDFeedTypeId() + { + return 1022; + } + + public static int mDFeedTypeSinceVersion() + { + return 0; + } + + public static int mDFeedTypeEncodingOffset() + { + return 0; + } + + public static int mDFeedTypeEncodingLength() + { + return 3; + } + + public static String mDFeedTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte mDFeedTypeNullValue() + { + return (byte)0; + } + + public static byte mDFeedTypeMinValue() + { + return (byte)32; + } + + public static byte mDFeedTypeMaxValue() + { + return (byte)126; + } + + public static int mDFeedTypeLength() + { + return 3; + } + + public byte mDFeedType(final int index) + { + if (index < 0 || index >= 3) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 0 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String mDFeedTypeCharacterEncoding() + { + return "UTF-8"; + } + + public int getMDFeedType(final byte[] dst, final int dstOffset) + { + final int length = 3; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 0, dst, dstOffset, length); + + return length; + } + + public String mDFeedType() + { + final byte[] dst = new byte[3]; + buffer.getBytes(this.offset + 0, dst, 0, 3); + + int end = 0; + for (; end < 3 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int marketDepthId() + { + return 264; + } + + public static int marketDepthSinceVersion() + { + return 0; + } + + public static int marketDepthEncodingOffset() + { + return 3; + } + + public static int marketDepthEncodingLength() + { + return 1; + } + + public static String marketDepthMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static byte marketDepthNullValue() + { + return (byte)-128; + } + + public static byte marketDepthMinValue() + { + return (byte)-127; + } + + public static byte marketDepthMaxValue() + { + return (byte)127; + } + + public byte marketDepth() + { + return buffer.getByte(offset + 3); + } + + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='MDFeedType', referencedName='null', description='Describes a class of service for a given data feed. GBX- Real Book, GBI-Implied Book', id=1022, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='MDFeedType', referencedName='null', description='Describes a class of service for a given data feed. GBX- Real Book, GBI-Implied Book', id=-1, version=0, deprecated=0, encodedLength=3, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("mDFeedType="); + for (int i = 0; i < mDFeedTypeLength() && mDFeedType(i) > 0; i++) + { + builder.append((char)mDFeedType(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MarketDepth', referencedName='null', description='Identifies the depth of book', id=264, version=0, deprecated=0, encodedLength=0, offset=3, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int8', referencedName='null', description='Identifies the depth of book', id=-1, version=0, deprecated=0, encodedLength=1, offset=3, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("marketDepth="); + builder.append(marketDepth()); + builder.append(')'); + return builder; + } + } + + private final NoInstAttribDecoder noInstAttrib = new NoInstAttribDecoder(); + + public static long noInstAttribDecoderId() + { + return 870; + } + + public static int noInstAttribDecoderSinceVersion() + { + return 0; + } + + public NoInstAttribDecoder noInstAttrib() + { + noInstAttrib.wrap(parentMessage, buffer); + return noInstAttrib; + } + + public static class NoInstAttribDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private MDInstrumentDefinitionSpread29Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDInstrumentDefinitionSpread29Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 4; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoInstAttribDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int instAttribTypeId() + { + return 871; + } + + public static int instAttribTypeSinceVersion() + { + return 0; + } + + public static int instAttribTypeEncodingOffset() + { + return 0; + } + + public static int instAttribTypeEncodingLength() + { + return 0; + } + + public static String instAttribTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static byte instAttribTypeNullValue() + { + return (byte)-128; + } + + public static byte instAttribTypeMinValue() + { + return (byte)-127; + } + + public static byte instAttribTypeMaxValue() + { + return (byte)127; + } + + public byte instAttribType() + { + return (byte)24; + } + + public static int instAttribValueId() + { + return 872; + } + + public static int instAttribValueSinceVersion() + { + return 0; + } + + public static int instAttribValueEncodingOffset() + { + return 0; + } + + public static int instAttribValueEncodingLength() + { + return 4; + } + + public static String instAttribValueMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MultipleCharValue"; + } + + return ""; + } + + private final InstAttribValueDecoder instAttribValue = new InstAttribValueDecoder(); + + public InstAttribValueDecoder instAttribValue() + { + instAttribValue.wrap(buffer, offset + 0); + return instAttribValue; + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='InstAttribType', referencedName='null', description='Instrument Eligibility Attributes', id=871, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='InstAttribType', referencedName='null', description='Instrument Eligibility Attributes', id=-1, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=1, encoding=Encoding{presence=CONSTANT, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=24, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_FIELD, name='InstAttribValue', referencedName='null', description='Bitmap field of 32 Boolean type Instrument eligibility flags', id=872, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=24, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MultipleCharValue'}} + //Token{signal=BEGIN_SET, name='InstAttribValue', referencedName='null', description='Bitmap field of 32 Boolean type Instrument eligibility flags', id=-1, version=0, deprecated=0, encodedLength=4, offset=0, componentTokenCount=22, encoding=Encoding{presence=REQUIRED, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MultipleCharValue'}} + builder.append("instAttribValue="); + builder.append(instAttribValue()); + builder.append(')'); + return builder; + } + } + + private final NoLotTypeRulesDecoder noLotTypeRules = new NoLotTypeRulesDecoder(); + + public static long noLotTypeRulesDecoderId() + { + return 1234; + } + + public static int noLotTypeRulesDecoderSinceVersion() + { + return 0; + } + + public NoLotTypeRulesDecoder noLotTypeRules() + { + noLotTypeRules.wrap(parentMessage, buffer); + return noLotTypeRules; + } + + public static class NoLotTypeRulesDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private MDInstrumentDefinitionSpread29Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDInstrumentDefinitionSpread29Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 5; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoLotTypeRulesDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int lotTypeId() + { + return 1093; + } + + public static int lotTypeSinceVersion() + { + return 0; + } + + public static int lotTypeEncodingOffset() + { + return 0; + } + + public static int lotTypeEncodingLength() + { + return 1; + } + + public static String lotTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static byte lotTypeNullValue() + { + return (byte)-128; + } + + public static byte lotTypeMinValue() + { + return (byte)-127; + } + + public static byte lotTypeMaxValue() + { + return (byte)127; + } + + public byte lotType() + { + return buffer.getByte(offset + 0); + } + + + public static int minLotSizeId() + { + return 1231; + } + + public static int minLotSizeSinceVersion() + { + return 0; + } + + public static int minLotSizeEncodingOffset() + { + return 1; + } + + public static int minLotSizeEncodingLength() + { + return 4; + } + + public static String minLotSizeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + private final DecimalQtyDecoder minLotSize = new DecimalQtyDecoder(); + + public DecimalQtyDecoder minLotSize() + { + minLotSize.wrap(buffer, offset + 1); + return minLotSize; + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='LotType', referencedName='null', description='This tag is required to interpret the value in tag 1231-MinLotSize', id=1093, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int8', referencedName='null', description='This tag is required to interpret the value in tag 1231-MinLotSize', id=-1, version=0, deprecated=0, encodedLength=1, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("lotType="); + builder.append(lotType()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MinLotSize', referencedName='null', description='Minimum quantity accepted for order entry. If tag 1093-LotType=4, this value is the minimum quantity for order entry expressed in the applicable units, specified in tag 996-UnitOfMeasure, e.g. megawatts', id=1231, version=0, deprecated=0, encodedLength=0, offset=1, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=BEGIN_COMPOSITE, name='DecimalQty', referencedName='null', description='Minimum quantity accepted for order entry. If tag 1093-LotType=4, this value is the minimum quantity for order entry expressed in the applicable units, specified in tag 996-UnitOfMeasure, e.g. megawatts', id=-1, version=0, deprecated=0, encodedLength=4, offset=1, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Qty'}} + builder.append("minLotSize="); + minLotSize().appendTo(builder); + builder.append(')'); + return builder; + } + } + + private final NoLegsDecoder noLegs = new NoLegsDecoder(); + + public static long noLegsDecoderId() + { + return 555; + } + + public static int noLegsDecoderSinceVersion() + { + return 0; + } + + public NoLegsDecoder noLegs() + { + noLegs.wrap(parentMessage, buffer); + return noLegs; + } + + public static class NoLegsDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private MDInstrumentDefinitionSpread29Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final MDInstrumentDefinitionSpread29Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 18; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoLegsDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int legSecurityIDId() + { + return 602; + } + + public static int legSecurityIDSinceVersion() + { + return 0; + } + + public static int legSecurityIDEncodingOffset() + { + return 0; + } + + public static int legSecurityIDEncodingLength() + { + return 4; + } + + public static String legSecurityIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int legSecurityIDNullValue() + { + return -2147483648; + } + + public static int legSecurityIDMinValue() + { + return -2147483647; + } + + public static int legSecurityIDMaxValue() + { + return 2147483647; + } + + public int legSecurityID() + { + return buffer.getInt(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int legSecurityIDSourceId() + { + return 603; + } + + public static int legSecurityIDSourceSinceVersion() + { + return 0; + } + + public static int legSecurityIDSourceEncodingOffset() + { + return 4; + } + + public static int legSecurityIDSourceEncodingLength() + { + return 0; + } + + public static String legSecurityIDSourceMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public static byte legSecurityIDSourceNullValue() + { + return (byte)0; + } + + public static byte legSecurityIDSourceMinValue() + { + return (byte)32; + } + + public static byte legSecurityIDSourceMaxValue() + { + return (byte)126; + } + + private static final byte[] LEGSECURITYIDSOURCE_VALUE = {56}; + + public static int legSecurityIDSourceLength() + { + return 1; + } + + public byte legSecurityIDSource(final int index) + { + return LEGSECURITYIDSOURCE_VALUE[index]; + } + + public int getLegSecurityIDSource(final byte[] dst, final int offset, final int length) + { + final int bytesCopied = Math.min(length, 1); + System.arraycopy(LEGSECURITYIDSOURCE_VALUE, 0, dst, offset, bytesCopied); + + return bytesCopied; + } + + public static int legSideId() + { + return 624; + } + + public static int legSideSinceVersion() + { + return 0; + } + + public static int legSideEncodingOffset() + { + return 4; + } + + public static int legSideEncodingLength() + { + return 1; + } + + public static String legSideMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public LegSide legSide() + { + return LegSide.get(((short)(buffer.getByte(offset + 4) & 0xFF))); + } + + + public static int legRatioQtyId() + { + return 623; + } + + public static int legRatioQtySinceVersion() + { + return 0; + } + + public static int legRatioQtyEncodingOffset() + { + return 5; + } + + public static int legRatioQtyEncodingLength() + { + return 1; + } + + public static String legRatioQtyMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static byte legRatioQtyNullValue() + { + return (byte)-128; + } + + public static byte legRatioQtyMinValue() + { + return (byte)-127; + } + + public static byte legRatioQtyMaxValue() + { + return (byte)127; + } + + public byte legRatioQty() + { + return buffer.getByte(offset + 5); + } + + + public static int legPriceId() + { + return 566; + } + + public static int legPriceSinceVersion() + { + return 0; + } + + public static int legPriceEncodingOffset() + { + return 6; + } + + public static int legPriceEncodingLength() + { + return 8; + } + + public static String legPriceMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder legPrice = new PRICENULLDecoder(); + + public PRICENULLDecoder legPrice() + { + legPrice.wrap(buffer, offset + 6); + return legPrice; + } + + public static int legOptionDeltaId() + { + return 1017; + } + + public static int legOptionDeltaSinceVersion() + { + return 0; + } + + public static int legOptionDeltaEncodingOffset() + { + return 14; + } + + public static int legOptionDeltaEncodingLength() + { + return 4; + } + + public static String legOptionDeltaMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + private final DecimalQtyDecoder legOptionDelta = new DecimalQtyDecoder(); + + public DecimalQtyDecoder legOptionDelta() + { + legOptionDelta.wrap(buffer, offset + 14); + return legOptionDelta; + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='LegSecurityID', referencedName='null', description='Leg Security ID', id=602, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32', referencedName='null', description='Leg Security ID', id=-1, version=0, deprecated=0, encodedLength=4, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("legSecurityID="); + builder.append(legSecurityID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='LegSecurityIDSource', referencedName='null', description='Identifies source of tag 602-LegSecurityID value', id=603, version=0, deprecated=0, encodedLength=0, offset=4, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=ENCODING, name='SecurityIDSource', referencedName='null', description='Identifies source of tag 602-LegSecurityID value', id=-1, version=0, deprecated=0, encodedLength=0, offset=4, componentTokenCount=1, encoding=Encoding{presence=CONSTANT, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=56, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=BEGIN_FIELD, name='LegSide', referencedName='null', description='Leg side', id=624, version=0, deprecated=0, encodedLength=0, offset=4, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='LegSide', referencedName='null', description='Leg side', id=-1, version=0, deprecated=0, encodedLength=1, offset=4, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("legSide="); + builder.append(legSide()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='LegRatioQty', referencedName='null', description='Leg ratio of quantity for this individual leg relative to the entire multi-leg instrument', id=623, version=0, deprecated=0, encodedLength=0, offset=5, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='Int8', referencedName='null', description='Leg ratio of quantity for this individual leg relative to the entire multi-leg instrument', id=-1, version=0, deprecated=0, encodedLength=1, offset=5, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("legRatioQty="); + builder.append(legRatioQty()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='LegPrice', referencedName='null', description='Price for the future leg of a UDS Covered instrument ', id=566, version=0, deprecated=0, encodedLength=0, offset=6, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Price for the future leg of a UDS Covered instrument ', id=-1, version=0, deprecated=0, encodedLength=8, offset=6, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("legPrice="); + legPrice().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='LegOptionDelta', referencedName='null', description='Delta used to calculate the quantity of futures used to cover the option or option strategy', id=1017, version=0, deprecated=0, encodedLength=0, offset=14, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=BEGIN_COMPOSITE, name='DecimalQty', referencedName='null', description='Delta used to calculate the quantity of futures used to cover the option or option strategy', id=-1, version=0, deprecated=0, encodedLength=4, offset=14, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Qty'}} + builder.append("legOptionDelta="); + legOptionDelta().appendTo(builder); + builder.append(')'); + return builder; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + final int originalLimit = limit(); + limit(offset + actingBlockLength); + builder.append("[MDInstrumentDefinitionSpread29](sbeTemplateId="); + builder.append(TEMPLATE_ID); + builder.append("|sbeSchemaId="); + builder.append(SCHEMA_ID); + builder.append("|sbeSchemaVersion="); + if (parentMessage.actingVersion != SCHEMA_VERSION) + { + builder.append(parentMessage.actingVersion); + builder.append('/'); + } + builder.append(SCHEMA_VERSION); + builder.append("|sbeBlockLength="); + if (actingBlockLength != BLOCK_LENGTH) + { + builder.append(actingBlockLength); + builder.append('/'); + } + builder.append(BLOCK_LENGTH); + builder.append("):"); + //Token{signal=BEGIN_FIELD, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=5799, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=12, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MultipleCharValue'}} + //Token{signal=BEGIN_SET, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=-1, version=0, deprecated=0, encodedLength=1, offset=0, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MultipleCharValue'}} + builder.append("matchEventIndicator="); + builder.append(matchEventIndicator()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='TotNumReports', referencedName='null', description='Total number of instruments in the Replay loop. Used on Replay Feed only', id=911, version=0, deprecated=0, encodedLength=0, offset=1, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt32NULL', referencedName='null', description='Total number of instruments in the Replay loop. Used on Replay Feed only', id=-1, version=0, deprecated=0, encodedLength=4, offset=1, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=4294967295, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("totNumReports="); + builder.append(totNumReports()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityUpdateAction', referencedName='null', description='Last Security update action on Incremental feed, 'D' or 'M' is used when a mid-week deletion or modification (i.e. extension) occurs', id=980, version=0, deprecated=0, encodedLength=0, offset=5, componentTokenCount=7, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=BEGIN_ENUM, name='SecurityUpdateAction', referencedName='null', description='Last Security update action on Incremental feed, 'D' or 'M' is used when a mid-week deletion or modification (i.e. extension) occurs', id=-1, version=0, deprecated=0, encodedLength=1, offset=5, componentTokenCount=5, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='char'}} + builder.append("securityUpdateAction="); + builder.append(securityUpdateAction()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='LastUpdateTime', referencedName='null', description='Timestamp of when the instrument was last added, modified or deleted', id=779, version=0, deprecated=0, encodedLength=0, offset=6, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + //Token{signal=ENCODING, name='uInt64', referencedName='null', description='Timestamp of when the instrument was last added, modified or deleted', id=-1, version=0, deprecated=0, encodedLength=8, offset=6, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + builder.append("lastUpdateTime="); + builder.append(lastUpdateTime()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDSecurityTradingStatus', referencedName='null', description='Identifies the current state of the instrument. The data is available in the Instrument Replay feed only', id=1682, version=0, deprecated=0, encodedLength=0, offset=14, componentTokenCount=15, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='SecurityTradingStatus', referencedName='null', description='Identifies the current state of the instrument. The data is available in the Instrument Replay feed only', id=-1, version=0, deprecated=0, encodedLength=1, offset=14, componentTokenCount=13, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("mDSecurityTradingStatus="); + builder.append(mDSecurityTradingStatus()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='ApplID', referencedName='null', description='The channel ID as defined in the XML Configuration file', id=1180, version=0, deprecated=0, encodedLength=0, offset=15, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int16', referencedName='null', description='The channel ID as defined in the XML Configuration file', id=-1, version=0, deprecated=0, encodedLength=2, offset=15, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT16, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("applID="); + builder.append(applID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MarketSegmentID', referencedName='null', description='Identifies the market segment, populated for all CME Globex instruments', id=1300, version=0, deprecated=0, encodedLength=0, offset=17, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt8', referencedName='null', description='Identifies the market segment, populated for all CME Globex instruments', id=-1, version=0, deprecated=0, encodedLength=1, offset=17, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("marketSegmentID="); + builder.append(marketSegmentID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='UnderlyingProduct', referencedName='null', description='Product complex', id=462, version=0, deprecated=0, encodedLength=0, offset=18, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt8NULL', referencedName='null', description='Product complex', id=-1, version=0, deprecated=0, encodedLength=1, offset=18, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=255, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("underlyingProduct="); + builder.append(underlyingProduct()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityExchange', referencedName='null', description='Exchange used to identify a security', id=207, version=0, deprecated=0, encodedLength=0, offset=19, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Exchange'}} + //Token{signal=ENCODING, name='SecurityExchange', referencedName='null', description='Exchange used to identify a security', id=-1, version=0, deprecated=0, encodedLength=4, offset=19, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Exchange'}} + builder.append("securityExchange="); + for (int i = 0; i < securityExchangeLength() && securityExchange(i) > 0; i++) + { + builder.append((char)securityExchange(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityGroup', referencedName='null', description='Security Group Code', id=1151, version=0, deprecated=0, encodedLength=0, offset=23, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='SecurityGroup', referencedName='null', description='Security Group Code', id=-1, version=0, deprecated=0, encodedLength=6, offset=23, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("securityGroup="); + for (int i = 0; i < securityGroupLength() && securityGroup(i) > 0; i++) + { + builder.append((char)securityGroup(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='Asset', referencedName='null', description='The underlying asset code also known as Product Code', id=6937, version=0, deprecated=0, encodedLength=0, offset=29, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='Asset', referencedName='null', description='The underlying asset code also known as Product Code', id=-1, version=0, deprecated=0, encodedLength=6, offset=29, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("asset="); + for (int i = 0; i < assetLength() && asset(i) > 0; i++) + { + builder.append((char)asset(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='Symbol', referencedName='null', description='Instrument Name or Symbol. Previously used as Group Code ', id=55, version=0, deprecated=0, encodedLength=0, offset=35, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='Symbol', referencedName='null', description='Instrument Name or Symbol. Previously used as Group Code ', id=-1, version=0, deprecated=0, encodedLength=20, offset=35, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("symbol="); + for (int i = 0; i < symbolLength() && symbol(i) > 0; i++) + { + builder.append((char)symbol(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityID', referencedName='null', description='Unique instrument ID', id=48, version=0, deprecated=0, encodedLength=0, offset=55, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32', referencedName='null', description='Unique instrument ID', id=-1, version=0, deprecated=0, encodedLength=4, offset=55, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("securityID="); + builder.append(securityID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityIDSource', referencedName='null', description='Identifies class or source of the security ID (Tag 48) value', id=22, version=0, deprecated=0, encodedLength=0, offset=59, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=ENCODING, name='SecurityIDSource', referencedName='null', description='Identifies class or source of the security ID (Tag 48) value', id=-1, version=0, deprecated=0, encodedLength=0, offset=59, componentTokenCount=1, encoding=Encoding{presence=CONSTANT, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=56, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=BEGIN_FIELD, name='SecurityType', referencedName='null', description='Security Type', id=167, version=0, deprecated=0, encodedLength=0, offset=59, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='SecurityType', referencedName='null', description='Security Type', id=-1, version=0, deprecated=0, encodedLength=6, offset=59, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("securityType="); + for (int i = 0; i < securityTypeLength() && securityType(i) > 0; i++) + { + builder.append((char)securityType(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='CFICode', referencedName='null', description='ISO standard instrument categorization code', id=461, version=0, deprecated=0, encodedLength=0, offset=65, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='CFICode', referencedName='null', description='ISO standard instrument categorization code', id=-1, version=0, deprecated=0, encodedLength=6, offset=65, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("cFICode="); + for (int i = 0; i < cFICodeLength() && cFICode(i) > 0; i++) + { + builder.append((char)cFICode(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MaturityMonthYear', referencedName='null', description='This field provides the actual calendar date for contract maturity', id=200, version=0, deprecated=0, encodedLength=0, offset=71, componentTokenCount=8, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MonthYear'}} + //Token{signal=BEGIN_COMPOSITE, name='MaturityMonthYear', referencedName='null', description='This field provides the actual calendar date for contract maturity', id=-1, version=0, deprecated=0, encodedLength=5, offset=71, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MonthYear'}} + builder.append("maturityMonthYear="); + maturityMonthYear().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='Currency', referencedName='null', description='Identifies currency used for price', id=15, version=0, deprecated=0, encodedLength=0, offset=76, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Currency'}} + //Token{signal=ENCODING, name='Currency', referencedName='null', description='Identifies currency used for price', id=-1, version=0, deprecated=0, encodedLength=3, offset=76, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Currency'}} + builder.append("currency="); + for (int i = 0; i < currencyLength() && currency(i) > 0; i++) + { + builder.append((char)currency(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecuritySubType', referencedName='null', description='Strategy type', id=762, version=0, deprecated=0, encodedLength=0, offset=79, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='SecuritySubType', referencedName='null', description='Strategy type', id=-1, version=0, deprecated=0, encodedLength=5, offset=79, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("securitySubType="); + for (int i = 0; i < securitySubTypeLength() && securitySubType(i) > 0; i++) + { + builder.append((char)securitySubType(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='UserDefinedInstrument', referencedName='null', description='User-defined instruments flag', id=9779, version=0, deprecated=0, encodedLength=0, offset=84, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=ENCODING, name='UserDefinedInstrument', referencedName='null', description='User-defined instruments flag', id=-1, version=0, deprecated=0, encodedLength=1, offset=84, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + builder.append("userDefinedInstrument="); + builder.append(userDefinedInstrument()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MatchAlgorithm', referencedName='null', description='Matching algorithm', id=1142, version=0, deprecated=0, encodedLength=0, offset=85, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=ENCODING, name='CHAR', referencedName='null', description='Matching algorithm', id=-1, version=0, deprecated=0, encodedLength=1, offset=85, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + builder.append("matchAlgorithm="); + builder.append(matchAlgorithm()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MinTradeVol', referencedName='null', description='The minimum trading volume for a security', id=562, version=0, deprecated=0, encodedLength=0, offset=86, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='uInt32', referencedName='null', description='The minimum trading volume for a security', id=-1, version=0, deprecated=0, encodedLength=4, offset=86, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("minTradeVol="); + builder.append(minTradeVol()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MaxTradeVol', referencedName='null', description='The maximum trading volume for a security', id=1140, version=0, deprecated=0, encodedLength=0, offset=90, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='uInt32', referencedName='null', description='The maximum trading volume for a security', id=-1, version=0, deprecated=0, encodedLength=4, offset=90, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("maxTradeVol="); + builder.append(maxTradeVol()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MinPriceIncrement', referencedName='null', description='Minimum constant tick for the instrument, sent only if instrument is non-VTT (Variable Tick table) eligible', id=969, version=0, deprecated=0, encodedLength=0, offset=94, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICE', referencedName='null', description='Minimum constant tick for the instrument, sent only if instrument is non-VTT (Variable Tick table) eligible', id=-1, version=0, deprecated=0, encodedLength=8, offset=94, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("minPriceIncrement="); + minPriceIncrement().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='DisplayFactor', referencedName='null', description='Contains the multiplier to convert the CME Globex display price to the conventional price', id=9787, version=0, deprecated=0, encodedLength=0, offset=102, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='float'}} + //Token{signal=BEGIN_COMPOSITE, name='FLOAT', referencedName='null', description='Contains the multiplier to convert the CME Globex display price to the conventional price', id=-1, version=0, deprecated=0, encodedLength=8, offset=102, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='float'}} + builder.append("displayFactor="); + displayFactor().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='PriceDisplayFormat', referencedName='null', description='Number of decimals in fractional display price', id=9800, version=0, deprecated=0, encodedLength=0, offset=110, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt8NULL', referencedName='null', description='Number of decimals in fractional display price', id=-1, version=0, deprecated=0, encodedLength=1, offset=110, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=255, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("priceDisplayFormat="); + builder.append(priceDisplayFormat()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='PriceRatio', referencedName='null', description='Used for price calculation in spread and leg pricing', id=5770, version=0, deprecated=0, encodedLength=0, offset=111, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Used for price calculation in spread and leg pricing', id=-1, version=0, deprecated=0, encodedLength=8, offset=111, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("priceRatio="); + priceRatio().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='TickRule', referencedName='null', description='Tick Rule ', id=6350, version=0, deprecated=0, encodedLength=0, offset=119, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int8NULL', referencedName='null', description='Tick Rule ', id=-1, version=0, deprecated=0, encodedLength=1, offset=119, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=127, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("tickRule="); + builder.append(tickRule()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='UnitOfMeasure', referencedName='null', description='Unit of measure for the products' original contract size', id=996, version=0, deprecated=0, encodedLength=0, offset=120, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='UnitOfMeasure', referencedName='null', description='Unit of measure for the products' original contract size', id=-1, version=0, deprecated=0, encodedLength=30, offset=120, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("unitOfMeasure="); + for (int i = 0; i < unitOfMeasureLength() && unitOfMeasure(i) > 0; i++) + { + builder.append((char)unitOfMeasure(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='TradingReferencePrice', referencedName='null', description='Reference price - the most recently available Settlement whether it be Theoretical, Preliminary or a Final Settle of the session', id=1150, version=0, deprecated=0, encodedLength=0, offset=150, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Reference price - the most recently available Settlement whether it be Theoretical, Preliminary or a Final Settle of the session', id=-1, version=0, deprecated=0, encodedLength=8, offset=150, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("tradingReferencePrice="); + tradingReferencePrice().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SettlPriceType', referencedName='null', description='Bitmap field of eight Boolean type indicators representing settlement price type', id=731, version=0, deprecated=0, encodedLength=0, offset=158, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MultipleCharValue'}} + //Token{signal=BEGIN_SET, name='SettlPriceType', referencedName='null', description='Bitmap field of eight Boolean type indicators representing settlement price type', id=-1, version=0, deprecated=0, encodedLength=1, offset=158, componentTokenCount=8, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MultipleCharValue'}} + builder.append("settlPriceType="); + builder.append(settlPriceType()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='OpenInterestQty', referencedName='null', description='The total open interest for the market at the close of the prior trading session', id=5792, version=0, deprecated=0, encodedLength=0, offset=159, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='Int32NULL', referencedName='null', description='The total open interest for the market at the close of the prior trading session', id=-1, version=0, deprecated=0, encodedLength=4, offset=159, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=2147483647, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("openInterestQty="); + builder.append(openInterestQty()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='ClearedVolume', referencedName='null', description='The total cleared volume of instrument traded during the prior trading session', id=5791, version=0, deprecated=0, encodedLength=0, offset=163, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='Int32NULL', referencedName='null', description='The total cleared volume of instrument traded during the prior trading session', id=-1, version=0, deprecated=0, encodedLength=4, offset=163, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=2147483647, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("clearedVolume="); + builder.append(clearedVolume()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='HighLimitPrice', referencedName='null', description='Allowable high limit price for the trading day', id=1149, version=0, deprecated=0, encodedLength=0, offset=167, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Allowable high limit price for the trading day', id=-1, version=0, deprecated=0, encodedLength=8, offset=167, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("highLimitPrice="); + highLimitPrice().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='LowLimitPrice', referencedName='null', description='Allowable low limit price for the trading day', id=1148, version=0, deprecated=0, encodedLength=0, offset=175, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Allowable low limit price for the trading day', id=-1, version=0, deprecated=0, encodedLength=8, offset=175, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("lowLimitPrice="); + lowLimitPrice().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MaxPriceVariation', referencedName='null', description='Differential value for price banding', id=1143, version=0, deprecated=0, encodedLength=0, offset=183, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Differential value for price banding', id=-1, version=0, deprecated=0, encodedLength=8, offset=183, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("maxPriceVariation="); + maxPriceVariation().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MainFraction', referencedName='null', description='Price Denominator of Main Fraction', id=37702, version=0, deprecated=0, encodedLength=0, offset=191, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt8NULL', referencedName='null', description='Price Denominator of Main Fraction', id=-1, version=0, deprecated=0, encodedLength=1, offset=191, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=255, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("mainFraction="); + builder.append(mainFraction()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SubFraction', referencedName='null', description='Price Denominator of Sub Fraction', id=37703, version=0, deprecated=0, encodedLength=0, offset=192, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt8NULL', referencedName='null', description='Price Denominator of Sub Fraction', id=-1, version=0, deprecated=0, encodedLength=1, offset=192, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=255, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("subFraction="); + builder.append(subFraction()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='TradingReferenceDate', referencedName='null', description='Indicates session date corresponding to the settlement price in tag 1150-TradingReferencePrice', id=5796, version=6, deprecated=0, encodedLength=0, offset=193, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='LocalMktDate'}} + //Token{signal=ENCODING, name='LocalMktDate', referencedName='null', description='Indicates session date corresponding to the settlement price in tag 1150-TradingReferencePrice', id=-1, version=6, deprecated=0, encodedLength=2, offset=193, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT16, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=65535, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='LocalMktDate'}} + builder.append("tradingReferenceDate="); + builder.append(tradingReferenceDate()); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoEvents', referencedName='null', description='Number of repeating EventType entries', id=864, version=0, deprecated=0, encodedLength=9, offset=195, componentTokenCount=15, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noEvents=["); + NoEventsDecoder noEvents = noEvents(); + if (noEvents.count() > 0) + { + while (noEvents.hasNext()) + { + noEvents.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoMDFeedTypes', referencedName='null', description='Number of FeedType entries', id=1141, version=0, deprecated=0, encodedLength=4, offset=-1, componentTokenCount=12, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noMDFeedTypes=["); + NoMDFeedTypesDecoder noMDFeedTypes = noMDFeedTypes(); + if (noMDFeedTypes.count() > 0) + { + while (noMDFeedTypes.hasNext()) + { + noMDFeedTypes.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoInstAttrib', referencedName='null', description='Number of InstrAttribType entries', id=870, version=0, deprecated=0, encodedLength=4, offset=-1, componentTokenCount=33, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noInstAttrib=["); + NoInstAttribDecoder noInstAttrib = noInstAttrib(); + if (noInstAttrib.count() > 0) + { + while (noInstAttrib.hasNext()) + { + noInstAttrib.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoLotTypeRules', referencedName='null', description='Number of entries', id=1234, version=0, deprecated=0, encodedLength=5, offset=-1, componentTokenCount=15, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noLotTypeRules=["); + NoLotTypeRulesDecoder noLotTypeRules = noLotTypeRules(); + if (noLotTypeRules.count() > 0) + { + while (noLotTypeRules.hasNext()) + { + noLotTypeRules.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoLegs', referencedName='null', description='Number of Leg entries', id=555, version=0, deprecated=0, encodedLength=18, offset=-1, componentTokenCount=33, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noLegs=["); + NoLegsDecoder noLegs = noLegs(); + if (noLegs.count() > 0) + { + while (noLegs.hasNext()) + { + noLegs.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + + limit(originalLimit); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDInstrumentDefinitionSpread29Encoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDInstrumentDefinitionSpread29Encoder.java new file mode 100644 index 0000000..cbdbfa3 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDInstrumentDefinitionSpread29Encoder.java @@ -0,0 +1,2343 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDInstrumentDefinitionSpread29Encoder"}) +@SuppressWarnings("all") +public class MDInstrumentDefinitionSpread29Encoder +{ + public static final int BLOCK_LENGTH = 195; + public static final int TEMPLATE_ID = 29; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final MDInstrumentDefinitionSpread29Encoder parentMessage = this; + private MutableDirectBuffer buffer; + protected int offset; + protected int limit; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "d"; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public MDInstrumentDefinitionSpread29Encoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + limit(offset + BLOCK_LENGTH); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int matchEventIndicatorEncodingOffset() + { + return 0; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + private final MatchEventIndicatorEncoder matchEventIndicator = new MatchEventIndicatorEncoder(); + + public MatchEventIndicatorEncoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 0); + return matchEventIndicator; + } + + public static int totNumReportsEncodingOffset() + { + return 1; + } + + public static int totNumReportsEncodingLength() + { + return 4; + } + + public static long totNumReportsNullValue() + { + return 4294967295L; + } + + public static long totNumReportsMinValue() + { + return 0L; + } + + public static long totNumReportsMaxValue() + { + return 4294967293L; + } + + public MDInstrumentDefinitionSpread29Encoder totNumReports(final long value) + { + buffer.putInt(offset + 1, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int securityUpdateActionEncodingOffset() + { + return 5; + } + + public static int securityUpdateActionEncodingLength() + { + return 1; + } + + public MDInstrumentDefinitionSpread29Encoder securityUpdateAction(final SecurityUpdateAction value) + { + buffer.putByte(offset + 5, value.value()); + return this; + } + + public static int lastUpdateTimeEncodingOffset() + { + return 6; + } + + public static int lastUpdateTimeEncodingLength() + { + return 8; + } + + public static long lastUpdateTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long lastUpdateTimeMinValue() + { + return 0x0L; + } + + public static long lastUpdateTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public MDInstrumentDefinitionSpread29Encoder lastUpdateTime(final long value) + { + buffer.putLong(offset + 6, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int mDSecurityTradingStatusEncodingOffset() + { + return 14; + } + + public static int mDSecurityTradingStatusEncodingLength() + { + return 1; + } + + public MDInstrumentDefinitionSpread29Encoder mDSecurityTradingStatus(final SecurityTradingStatus value) + { + buffer.putByte(offset + 14, (byte)value.value()); + return this; + } + + public static int applIDEncodingOffset() + { + return 15; + } + + public static int applIDEncodingLength() + { + return 2; + } + + public static short applIDNullValue() + { + return (short)-32768; + } + + public static short applIDMinValue() + { + return (short)-32767; + } + + public static short applIDMaxValue() + { + return (short)32767; + } + + public MDInstrumentDefinitionSpread29Encoder applID(final short value) + { + buffer.putShort(offset + 15, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int marketSegmentIDEncodingOffset() + { + return 17; + } + + public static int marketSegmentIDEncodingLength() + { + return 1; + } + + public static short marketSegmentIDNullValue() + { + return (short)255; + } + + public static short marketSegmentIDMinValue() + { + return (short)0; + } + + public static short marketSegmentIDMaxValue() + { + return (short)254; + } + + public MDInstrumentDefinitionSpread29Encoder marketSegmentID(final short value) + { + buffer.putByte(offset + 17, (byte)value); + return this; + } + + + public static int underlyingProductEncodingOffset() + { + return 18; + } + + public static int underlyingProductEncodingLength() + { + return 1; + } + + public static short underlyingProductNullValue() + { + return (short)255; + } + + public static short underlyingProductMinValue() + { + return (short)0; + } + + public static short underlyingProductMaxValue() + { + return (short)254; + } + + public MDInstrumentDefinitionSpread29Encoder underlyingProduct(final short value) + { + buffer.putByte(offset + 18, (byte)value); + return this; + } + + + public static int securityExchangeEncodingOffset() + { + return 19; + } + + public static int securityExchangeEncodingLength() + { + return 4; + } + + public static byte securityExchangeNullValue() + { + return (byte)0; + } + + public static byte securityExchangeMinValue() + { + return (byte)32; + } + + public static byte securityExchangeMaxValue() + { + return (byte)126; + } + + public static int securityExchangeLength() + { + return 4; + } + + public void securityExchange(final int index, final byte value) + { + if (index < 0 || index >= 4) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 19 + (index * 1); + buffer.putByte(pos, value); + } + + public static String securityExchangeCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionSpread29Encoder putSecurityExchange(final byte[] src, final int srcOffset) + { + final int length = 4; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 19, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionSpread29Encoder securityExchange(final String src) + { + final int length = 4; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 19, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 19 + start, (byte)0); + } + + return this; + } + + public static int securityGroupEncodingOffset() + { + return 23; + } + + public static int securityGroupEncodingLength() + { + return 6; + } + + public static byte securityGroupNullValue() + { + return (byte)0; + } + + public static byte securityGroupMinValue() + { + return (byte)32; + } + + public static byte securityGroupMaxValue() + { + return (byte)126; + } + + public static int securityGroupLength() + { + return 6; + } + + public void securityGroup(final int index, final byte value) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 23 + (index * 1); + buffer.putByte(pos, value); + } + + public static String securityGroupCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionSpread29Encoder putSecurityGroup(final byte[] src, final int srcOffset) + { + final int length = 6; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 23, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionSpread29Encoder securityGroup(final String src) + { + final int length = 6; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 23, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 23 + start, (byte)0); + } + + return this; + } + + public static int assetEncodingOffset() + { + return 29; + } + + public static int assetEncodingLength() + { + return 6; + } + + public static byte assetNullValue() + { + return (byte)0; + } + + public static byte assetMinValue() + { + return (byte)32; + } + + public static byte assetMaxValue() + { + return (byte)126; + } + + public static int assetLength() + { + return 6; + } + + public void asset(final int index, final byte value) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 29 + (index * 1); + buffer.putByte(pos, value); + } + + public static String assetCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionSpread29Encoder putAsset(final byte[] src, final int srcOffset) + { + final int length = 6; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 29, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionSpread29Encoder asset(final String src) + { + final int length = 6; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 29, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 29 + start, (byte)0); + } + + return this; + } + + public static int symbolEncodingOffset() + { + return 35; + } + + public static int symbolEncodingLength() + { + return 20; + } + + public static byte symbolNullValue() + { + return (byte)0; + } + + public static byte symbolMinValue() + { + return (byte)32; + } + + public static byte symbolMaxValue() + { + return (byte)126; + } + + public static int symbolLength() + { + return 20; + } + + public void symbol(final int index, final byte value) + { + if (index < 0 || index >= 20) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 35 + (index * 1); + buffer.putByte(pos, value); + } + + public static String symbolCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionSpread29Encoder putSymbol(final byte[] src, final int srcOffset) + { + final int length = 20; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 35, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionSpread29Encoder symbol(final String src) + { + final int length = 20; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 35, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 35 + start, (byte)0); + } + + return this; + } + + public static int securityIDEncodingOffset() + { + return 55; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public MDInstrumentDefinitionSpread29Encoder securityID(final int value) + { + buffer.putInt(offset + 55, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int securityIDSourceEncodingOffset() + { + return 59; + } + + public static int securityIDSourceEncodingLength() + { + return 0; + } + + public static byte securityIDSourceNullValue() + { + return (byte)0; + } + + public static byte securityIDSourceMinValue() + { + return (byte)32; + } + + public static byte securityIDSourceMaxValue() + { + return (byte)126; + } + + private static final byte[] SECURITYIDSOURCE_VALUE = {56}; + + public static int securityIDSourceLength() + { + return 1; + } + + public byte securityIDSource(final int index) + { + return SECURITYIDSOURCE_VALUE[index]; + } + + public int getSecurityIDSource(final byte[] dst, final int offset, final int length) + { + final int bytesCopied = Math.min(length, 1); + System.arraycopy(SECURITYIDSOURCE_VALUE, 0, dst, offset, bytesCopied); + + return bytesCopied; + } + + public static int securityTypeEncodingOffset() + { + return 59; + } + + public static int securityTypeEncodingLength() + { + return 6; + } + + public static byte securityTypeNullValue() + { + return (byte)0; + } + + public static byte securityTypeMinValue() + { + return (byte)32; + } + + public static byte securityTypeMaxValue() + { + return (byte)126; + } + + public static int securityTypeLength() + { + return 6; + } + + public void securityType(final int index, final byte value) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 59 + (index * 1); + buffer.putByte(pos, value); + } + + public static String securityTypeCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionSpread29Encoder putSecurityType(final byte[] src, final int srcOffset) + { + final int length = 6; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 59, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionSpread29Encoder securityType(final String src) + { + final int length = 6; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 59, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 59 + start, (byte)0); + } + + return this; + } + + public static int cFICodeEncodingOffset() + { + return 65; + } + + public static int cFICodeEncodingLength() + { + return 6; + } + + public static byte cFICodeNullValue() + { + return (byte)0; + } + + public static byte cFICodeMinValue() + { + return (byte)32; + } + + public static byte cFICodeMaxValue() + { + return (byte)126; + } + + public static int cFICodeLength() + { + return 6; + } + + public void cFICode(final int index, final byte value) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 65 + (index * 1); + buffer.putByte(pos, value); + } + + public static String cFICodeCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionSpread29Encoder putCFICode(final byte[] src, final int srcOffset) + { + final int length = 6; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 65, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionSpread29Encoder cFICode(final String src) + { + final int length = 6; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 65, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 65 + start, (byte)0); + } + + return this; + } + + public static int maturityMonthYearEncodingOffset() + { + return 71; + } + + public static int maturityMonthYearEncodingLength() + { + return 5; + } + + private final MaturityMonthYearEncoder maturityMonthYear = new MaturityMonthYearEncoder(); + + public MaturityMonthYearEncoder maturityMonthYear() + { + maturityMonthYear.wrap(buffer, offset + 71); + return maturityMonthYear; + } + + public static int currencyEncodingOffset() + { + return 76; + } + + public static int currencyEncodingLength() + { + return 3; + } + + public static byte currencyNullValue() + { + return (byte)0; + } + + public static byte currencyMinValue() + { + return (byte)32; + } + + public static byte currencyMaxValue() + { + return (byte)126; + } + + public static int currencyLength() + { + return 3; + } + + public void currency(final int index, final byte value) + { + if (index < 0 || index >= 3) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 76 + (index * 1); + buffer.putByte(pos, value); + } + + public static String currencyCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionSpread29Encoder putCurrency(final byte[] src, final int srcOffset) + { + final int length = 3; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 76, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionSpread29Encoder currency(final String src) + { + final int length = 3; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 76, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 76 + start, (byte)0); + } + + return this; + } + + public static int securitySubTypeEncodingOffset() + { + return 79; + } + + public static int securitySubTypeEncodingLength() + { + return 5; + } + + public static byte securitySubTypeNullValue() + { + return (byte)0; + } + + public static byte securitySubTypeMinValue() + { + return (byte)32; + } + + public static byte securitySubTypeMaxValue() + { + return (byte)126; + } + + public static int securitySubTypeLength() + { + return 5; + } + + public void securitySubType(final int index, final byte value) + { + if (index < 0 || index >= 5) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 79 + (index * 1); + buffer.putByte(pos, value); + } + + public static String securitySubTypeCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionSpread29Encoder putSecuritySubType(final byte[] src, final int srcOffset) + { + final int length = 5; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 79, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionSpread29Encoder securitySubType(final String src) + { + final int length = 5; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 79, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 79 + start, (byte)0); + } + + return this; + } + + public static int userDefinedInstrumentEncodingOffset() + { + return 84; + } + + public static int userDefinedInstrumentEncodingLength() + { + return 1; + } + + public static byte userDefinedInstrumentNullValue() + { + return (byte)0; + } + + public static byte userDefinedInstrumentMinValue() + { + return (byte)32; + } + + public static byte userDefinedInstrumentMaxValue() + { + return (byte)126; + } + + public MDInstrumentDefinitionSpread29Encoder userDefinedInstrument(final byte value) + { + buffer.putByte(offset + 84, value); + return this; + } + + + public static int matchAlgorithmEncodingOffset() + { + return 85; + } + + public static int matchAlgorithmEncodingLength() + { + return 1; + } + + public static byte matchAlgorithmNullValue() + { + return (byte)0; + } + + public static byte matchAlgorithmMinValue() + { + return (byte)32; + } + + public static byte matchAlgorithmMaxValue() + { + return (byte)126; + } + + public MDInstrumentDefinitionSpread29Encoder matchAlgorithm(final byte value) + { + buffer.putByte(offset + 85, value); + return this; + } + + + public static int minTradeVolEncodingOffset() + { + return 86; + } + + public static int minTradeVolEncodingLength() + { + return 4; + } + + public static long minTradeVolNullValue() + { + return 4294967294L; + } + + public static long minTradeVolMinValue() + { + return 0L; + } + + public static long minTradeVolMaxValue() + { + return 4294967293L; + } + + public MDInstrumentDefinitionSpread29Encoder minTradeVol(final long value) + { + buffer.putInt(offset + 86, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int maxTradeVolEncodingOffset() + { + return 90; + } + + public static int maxTradeVolEncodingLength() + { + return 4; + } + + public static long maxTradeVolNullValue() + { + return 4294967294L; + } + + public static long maxTradeVolMinValue() + { + return 0L; + } + + public static long maxTradeVolMaxValue() + { + return 4294967293L; + } + + public MDInstrumentDefinitionSpread29Encoder maxTradeVol(final long value) + { + buffer.putInt(offset + 90, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int minPriceIncrementEncodingOffset() + { + return 94; + } + + public static int minPriceIncrementEncodingLength() + { + return 8; + } + + private final PRICEEncoder minPriceIncrement = new PRICEEncoder(); + + public PRICEEncoder minPriceIncrement() + { + minPriceIncrement.wrap(buffer, offset + 94); + return minPriceIncrement; + } + + public static int displayFactorEncodingOffset() + { + return 102; + } + + public static int displayFactorEncodingLength() + { + return 8; + } + + private final FLOATEncoder displayFactor = new FLOATEncoder(); + + public FLOATEncoder displayFactor() + { + displayFactor.wrap(buffer, offset + 102); + return displayFactor; + } + + public static int priceDisplayFormatEncodingOffset() + { + return 110; + } + + public static int priceDisplayFormatEncodingLength() + { + return 1; + } + + public static short priceDisplayFormatNullValue() + { + return (short)255; + } + + public static short priceDisplayFormatMinValue() + { + return (short)0; + } + + public static short priceDisplayFormatMaxValue() + { + return (short)254; + } + + public MDInstrumentDefinitionSpread29Encoder priceDisplayFormat(final short value) + { + buffer.putByte(offset + 110, (byte)value); + return this; + } + + + public static int priceRatioEncodingOffset() + { + return 111; + } + + public static int priceRatioEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder priceRatio = new PRICENULLEncoder(); + + public PRICENULLEncoder priceRatio() + { + priceRatio.wrap(buffer, offset + 111); + return priceRatio; + } + + public static int tickRuleEncodingOffset() + { + return 119; + } + + public static int tickRuleEncodingLength() + { + return 1; + } + + public static byte tickRuleNullValue() + { + return (byte)127; + } + + public static byte tickRuleMinValue() + { + return (byte)-127; + } + + public static byte tickRuleMaxValue() + { + return (byte)127; + } + + public MDInstrumentDefinitionSpread29Encoder tickRule(final byte value) + { + buffer.putByte(offset + 119, value); + return this; + } + + + public static int unitOfMeasureEncodingOffset() + { + return 120; + } + + public static int unitOfMeasureEncodingLength() + { + return 30; + } + + public static byte unitOfMeasureNullValue() + { + return (byte)0; + } + + public static byte unitOfMeasureMinValue() + { + return (byte)32; + } + + public static byte unitOfMeasureMaxValue() + { + return (byte)126; + } + + public static int unitOfMeasureLength() + { + return 30; + } + + public void unitOfMeasure(final int index, final byte value) + { + if (index < 0 || index >= 30) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 120 + (index * 1); + buffer.putByte(pos, value); + } + + public static String unitOfMeasureCharacterEncoding() + { + return "UTF-8"; + } + + public MDInstrumentDefinitionSpread29Encoder putUnitOfMeasure(final byte[] src, final int srcOffset) + { + final int length = 30; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 120, src, srcOffset, length); + + return this; + } + + public MDInstrumentDefinitionSpread29Encoder unitOfMeasure(final String src) + { + final int length = 30; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 120, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 120 + start, (byte)0); + } + + return this; + } + + public static int tradingReferencePriceEncodingOffset() + { + return 150; + } + + public static int tradingReferencePriceEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder tradingReferencePrice = new PRICENULLEncoder(); + + public PRICENULLEncoder tradingReferencePrice() + { + tradingReferencePrice.wrap(buffer, offset + 150); + return tradingReferencePrice; + } + + public static int settlPriceTypeEncodingOffset() + { + return 158; + } + + public static int settlPriceTypeEncodingLength() + { + return 1; + } + + private final SettlPriceTypeEncoder settlPriceType = new SettlPriceTypeEncoder(); + + public SettlPriceTypeEncoder settlPriceType() + { + settlPriceType.wrap(buffer, offset + 158); + return settlPriceType; + } + + public static int openInterestQtyEncodingOffset() + { + return 159; + } + + public static int openInterestQtyEncodingLength() + { + return 4; + } + + public static int openInterestQtyNullValue() + { + return 2147483647; + } + + public static int openInterestQtyMinValue() + { + return -2147483647; + } + + public static int openInterestQtyMaxValue() + { + return 2147483647; + } + + public MDInstrumentDefinitionSpread29Encoder openInterestQty(final int value) + { + buffer.putInt(offset + 159, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int clearedVolumeEncodingOffset() + { + return 163; + } + + public static int clearedVolumeEncodingLength() + { + return 4; + } + + public static int clearedVolumeNullValue() + { + return 2147483647; + } + + public static int clearedVolumeMinValue() + { + return -2147483647; + } + + public static int clearedVolumeMaxValue() + { + return 2147483647; + } + + public MDInstrumentDefinitionSpread29Encoder clearedVolume(final int value) + { + buffer.putInt(offset + 163, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int highLimitPriceEncodingOffset() + { + return 167; + } + + public static int highLimitPriceEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder highLimitPrice = new PRICENULLEncoder(); + + public PRICENULLEncoder highLimitPrice() + { + highLimitPrice.wrap(buffer, offset + 167); + return highLimitPrice; + } + + public static int lowLimitPriceEncodingOffset() + { + return 175; + } + + public static int lowLimitPriceEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder lowLimitPrice = new PRICENULLEncoder(); + + public PRICENULLEncoder lowLimitPrice() + { + lowLimitPrice.wrap(buffer, offset + 175); + return lowLimitPrice; + } + + public static int maxPriceVariationEncodingOffset() + { + return 183; + } + + public static int maxPriceVariationEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder maxPriceVariation = new PRICENULLEncoder(); + + public PRICENULLEncoder maxPriceVariation() + { + maxPriceVariation.wrap(buffer, offset + 183); + return maxPriceVariation; + } + + public static int mainFractionEncodingOffset() + { + return 191; + } + + public static int mainFractionEncodingLength() + { + return 1; + } + + public static short mainFractionNullValue() + { + return (short)255; + } + + public static short mainFractionMinValue() + { + return (short)0; + } + + public static short mainFractionMaxValue() + { + return (short)254; + } + + public MDInstrumentDefinitionSpread29Encoder mainFraction(final short value) + { + buffer.putByte(offset + 191, (byte)value); + return this; + } + + + public static int subFractionEncodingOffset() + { + return 192; + } + + public static int subFractionEncodingLength() + { + return 1; + } + + public static short subFractionNullValue() + { + return (short)255; + } + + public static short subFractionMinValue() + { + return (short)0; + } + + public static short subFractionMaxValue() + { + return (short)254; + } + + public MDInstrumentDefinitionSpread29Encoder subFraction(final short value) + { + buffer.putByte(offset + 192, (byte)value); + return this; + } + + + public static int tradingReferenceDateEncodingOffset() + { + return 193; + } + + public static int tradingReferenceDateEncodingLength() + { + return 2; + } + + public static int tradingReferenceDateNullValue() + { + return 65535; + } + + public static int tradingReferenceDateMinValue() + { + return 0; + } + + public static int tradingReferenceDateMaxValue() + { + return 65534; + } + + public MDInstrumentDefinitionSpread29Encoder tradingReferenceDate(final int value) + { + buffer.putShort(offset + 193, (short)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + private final NoEventsEncoder noEvents = new NoEventsEncoder(); + + public static long noEventsId() + { + return 864; + } + + public NoEventsEncoder noEventsCount(final int count) + { + noEvents.wrap(parentMessage, buffer, count); + return noEvents; + } + + public static class NoEventsEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private MDInstrumentDefinitionSpread29Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDInstrumentDefinitionSpread29Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)9); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 9; + } + + public NoEventsEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int eventTypeEncodingOffset() + { + return 0; + } + + public static int eventTypeEncodingLength() + { + return 1; + } + + public NoEventsEncoder eventType(final EventType value) + { + buffer.putByte(offset + 0, (byte)value.value()); + return this; + } + + public static int eventTimeEncodingOffset() + { + return 1; + } + + public static int eventTimeEncodingLength() + { + return 8; + } + + public static long eventTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long eventTimeMinValue() + { + return 0x0L; + } + + public static long eventTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public NoEventsEncoder eventTime(final long value) + { + buffer.putLong(offset + 1, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + } + + private final NoMDFeedTypesEncoder noMDFeedTypes = new NoMDFeedTypesEncoder(); + + public static long noMDFeedTypesId() + { + return 1141; + } + + public NoMDFeedTypesEncoder noMDFeedTypesCount(final int count) + { + noMDFeedTypes.wrap(parentMessage, buffer, count); + return noMDFeedTypes; + } + + public static class NoMDFeedTypesEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private MDInstrumentDefinitionSpread29Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDInstrumentDefinitionSpread29Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)4); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 4; + } + + public NoMDFeedTypesEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int mDFeedTypeEncodingOffset() + { + return 0; + } + + public static int mDFeedTypeEncodingLength() + { + return 3; + } + + public static byte mDFeedTypeNullValue() + { + return (byte)0; + } + + public static byte mDFeedTypeMinValue() + { + return (byte)32; + } + + public static byte mDFeedTypeMaxValue() + { + return (byte)126; + } + + public static int mDFeedTypeLength() + { + return 3; + } + + public void mDFeedType(final int index, final byte value) + { + if (index < 0 || index >= 3) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 0 + (index * 1); + buffer.putByte(pos, value); + } + + public static String mDFeedTypeCharacterEncoding() + { + return "UTF-8"; + } + + public NoMDFeedTypesEncoder putMDFeedType(final byte[] src, final int srcOffset) + { + final int length = 3; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 0, src, srcOffset, length); + + return this; + } + + public NoMDFeedTypesEncoder mDFeedType(final String src) + { + final int length = 3; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 0, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 0 + start, (byte)0); + } + + return this; + } + + public static int marketDepthEncodingOffset() + { + return 3; + } + + public static int marketDepthEncodingLength() + { + return 1; + } + + public static byte marketDepthNullValue() + { + return (byte)-128; + } + + public static byte marketDepthMinValue() + { + return (byte)-127; + } + + public static byte marketDepthMaxValue() + { + return (byte)127; + } + + public NoMDFeedTypesEncoder marketDepth(final byte value) + { + buffer.putByte(offset + 3, value); + return this; + } + + } + + private final NoInstAttribEncoder noInstAttrib = new NoInstAttribEncoder(); + + public static long noInstAttribId() + { + return 870; + } + + public NoInstAttribEncoder noInstAttribCount(final int count) + { + noInstAttrib.wrap(parentMessage, buffer, count); + return noInstAttrib; + } + + public static class NoInstAttribEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private MDInstrumentDefinitionSpread29Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDInstrumentDefinitionSpread29Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)4); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 4; + } + + public NoInstAttribEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int instAttribTypeEncodingOffset() + { + return 0; + } + + public static int instAttribTypeEncodingLength() + { + return 0; + } + + public static byte instAttribTypeNullValue() + { + return (byte)-128; + } + + public static byte instAttribTypeMinValue() + { + return (byte)-127; + } + + public static byte instAttribTypeMaxValue() + { + return (byte)127; + } + + public byte instAttribType() + { + return (byte)24; + } + + public static int instAttribValueEncodingOffset() + { + return 0; + } + + public static int instAttribValueEncodingLength() + { + return 4; + } + + private final InstAttribValueEncoder instAttribValue = new InstAttribValueEncoder(); + + public InstAttribValueEncoder instAttribValue() + { + instAttribValue.wrap(buffer, offset + 0); + return instAttribValue; + } + } + + private final NoLotTypeRulesEncoder noLotTypeRules = new NoLotTypeRulesEncoder(); + + public static long noLotTypeRulesId() + { + return 1234; + } + + public NoLotTypeRulesEncoder noLotTypeRulesCount(final int count) + { + noLotTypeRules.wrap(parentMessage, buffer, count); + return noLotTypeRules; + } + + public static class NoLotTypeRulesEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private MDInstrumentDefinitionSpread29Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDInstrumentDefinitionSpread29Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)5); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 5; + } + + public NoLotTypeRulesEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int lotTypeEncodingOffset() + { + return 0; + } + + public static int lotTypeEncodingLength() + { + return 1; + } + + public static byte lotTypeNullValue() + { + return (byte)-128; + } + + public static byte lotTypeMinValue() + { + return (byte)-127; + } + + public static byte lotTypeMaxValue() + { + return (byte)127; + } + + public NoLotTypeRulesEncoder lotType(final byte value) + { + buffer.putByte(offset + 0, value); + return this; + } + + + public static int minLotSizeEncodingOffset() + { + return 1; + } + + public static int minLotSizeEncodingLength() + { + return 4; + } + + private final DecimalQtyEncoder minLotSize = new DecimalQtyEncoder(); + + public DecimalQtyEncoder minLotSize() + { + minLotSize.wrap(buffer, offset + 1); + return minLotSize; + } + } + + private final NoLegsEncoder noLegs = new NoLegsEncoder(); + + public static long noLegsId() + { + return 555; + } + + public NoLegsEncoder noLegsCount(final int count) + { + noLegs.wrap(parentMessage, buffer, count); + return noLegs; + } + + public static class NoLegsEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private MDInstrumentDefinitionSpread29Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final MDInstrumentDefinitionSpread29Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)18); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 18; + } + + public NoLegsEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int legSecurityIDEncodingOffset() + { + return 0; + } + + public static int legSecurityIDEncodingLength() + { + return 4; + } + + public static int legSecurityIDNullValue() + { + return -2147483648; + } + + public static int legSecurityIDMinValue() + { + return -2147483647; + } + + public static int legSecurityIDMaxValue() + { + return 2147483647; + } + + public NoLegsEncoder legSecurityID(final int value) + { + buffer.putInt(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int legSecurityIDSourceEncodingOffset() + { + return 4; + } + + public static int legSecurityIDSourceEncodingLength() + { + return 0; + } + + public static byte legSecurityIDSourceNullValue() + { + return (byte)0; + } + + public static byte legSecurityIDSourceMinValue() + { + return (byte)32; + } + + public static byte legSecurityIDSourceMaxValue() + { + return (byte)126; + } + + private static final byte[] LEGSECURITYIDSOURCE_VALUE = {56}; + + public static int legSecurityIDSourceLength() + { + return 1; + } + + public byte legSecurityIDSource(final int index) + { + return LEGSECURITYIDSOURCE_VALUE[index]; + } + + public int getLegSecurityIDSource(final byte[] dst, final int offset, final int length) + { + final int bytesCopied = Math.min(length, 1); + System.arraycopy(LEGSECURITYIDSOURCE_VALUE, 0, dst, offset, bytesCopied); + + return bytesCopied; + } + + public static int legSideEncodingOffset() + { + return 4; + } + + public static int legSideEncodingLength() + { + return 1; + } + + public NoLegsEncoder legSide(final LegSide value) + { + buffer.putByte(offset + 4, (byte)value.value()); + return this; + } + + public static int legRatioQtyEncodingOffset() + { + return 5; + } + + public static int legRatioQtyEncodingLength() + { + return 1; + } + + public static byte legRatioQtyNullValue() + { + return (byte)-128; + } + + public static byte legRatioQtyMinValue() + { + return (byte)-127; + } + + public static byte legRatioQtyMaxValue() + { + return (byte)127; + } + + public NoLegsEncoder legRatioQty(final byte value) + { + buffer.putByte(offset + 5, value); + return this; + } + + + public static int legPriceEncodingOffset() + { + return 6; + } + + public static int legPriceEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder legPrice = new PRICENULLEncoder(); + + public PRICENULLEncoder legPrice() + { + legPrice.wrap(buffer, offset + 6); + return legPrice; + } + + public static int legOptionDeltaEncodingOffset() + { + return 14; + } + + public static int legOptionDeltaEncodingLength() + { + return 4; + } + + private final DecimalQtyEncoder legOptionDelta = new DecimalQtyEncoder(); + + public DecimalQtyEncoder legOptionDelta() + { + legOptionDelta.wrap(buffer, offset + 14); + return legOptionDelta; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + MDInstrumentDefinitionSpread29Decoder writer = new MDInstrumentDefinitionSpread29Decoder(); + writer.wrap(buffer, offset, BLOCK_LENGTH, SCHEMA_VERSION); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDUpdateAction.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDUpdateAction.java new file mode 100644 index 0000000..d9ab7f2 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MDUpdateAction.java @@ -0,0 +1,46 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MDUpdateAction"}) +public enum MDUpdateAction +{ + New((short)0), + Change((short)1), + Delete((short)2), + DeleteThru((short)3), + DeleteFrom((short)4), + Overlay((short)5), + NULL_VAL((short)255); + + private final short value; + + MDUpdateAction(final short value) + { + this.value = value; + } + + public short value() + { + return value; + } + + public static MDUpdateAction get(final short value) + { + switch (value) + { + case 0: return New; + case 1: return Change; + case 2: return Delete; + case 3: return DeleteThru; + case 4: return DeleteFrom; + case 5: return Overlay; + } + + if ((short)255 == value) + { + return NULL_VAL; + } + + throw new IllegalArgumentException("Unknown value: " + value); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MatchEventIndicatorDecoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MatchEventIndicatorDecoder.java new file mode 100644 index 0000000..6dc898e --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MatchEventIndicatorDecoder.java @@ -0,0 +1,162 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MatchEventIndicatorDecoder"}) +@SuppressWarnings("all") +public class MatchEventIndicatorDecoder +{ + public static final int ENCODED_LENGTH = 1; + private DirectBuffer buffer; + private int offset; + + public MatchEventIndicatorDecoder wrap(final DirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + + return this; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public int encodedLength() + { + return ENCODED_LENGTH; + } + + public boolean lastTradeMsg() + { + return 0 != (buffer.getByte(offset) & (1 << 0)); + } + + public boolean lastVolumeMsg() + { + return 0 != (buffer.getByte(offset) & (1 << 1)); + } + + public boolean lastQuoteMsg() + { + return 0 != (buffer.getByte(offset) & (1 << 2)); + } + + public boolean lastStatsMsg() + { + return 0 != (buffer.getByte(offset) & (1 << 3)); + } + + public boolean lastImpliedMsg() + { + return 0 != (buffer.getByte(offset) & (1 << 4)); + } + + public boolean recoveryMsg() + { + return 0 != (buffer.getByte(offset) & (1 << 5)); + } + + public boolean reserved() + { + return 0 != (buffer.getByte(offset) & (1 << 6)); + } + + public boolean endOfEvent() + { + return 0 != (buffer.getByte(offset) & (1 << 7)); + } + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('{'); + boolean atLeastOne = false; + if (lastTradeMsg()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("lastTradeMsg"); + atLeastOne = true; + } + if (lastVolumeMsg()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("lastVolumeMsg"); + atLeastOne = true; + } + if (lastQuoteMsg()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("lastQuoteMsg"); + atLeastOne = true; + } + if (lastStatsMsg()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("lastStatsMsg"); + atLeastOne = true; + } + if (lastImpliedMsg()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("lastImpliedMsg"); + atLeastOne = true; + } + if (recoveryMsg()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("recoveryMsg"); + atLeastOne = true; + } + if (reserved()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("reserved"); + atLeastOne = true; + } + if (endOfEvent()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("endOfEvent"); + atLeastOne = true; + } + builder.append('}'); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MatchEventIndicatorEncoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MatchEventIndicatorEncoder.java new file mode 100644 index 0000000..2568ed1 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MatchEventIndicatorEncoder.java @@ -0,0 +1,106 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MatchEventIndicatorEncoder"}) +@SuppressWarnings("all") +public class MatchEventIndicatorEncoder +{ + public static final int ENCODED_LENGTH = 1; + private MutableDirectBuffer buffer; + private int offset; + + public MatchEventIndicatorEncoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + + return this; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public int encodedLength() + { + return ENCODED_LENGTH; + } + + public MatchEventIndicatorEncoder clear() + { + buffer.putByte(offset, (byte)(short)0); + return this; + } + + public MatchEventIndicatorEncoder lastTradeMsg(final boolean value) + { + byte bits = buffer.getByte(offset); + bits = (byte)(value ? bits | (1 << 0) : bits & ~(1 << 0)); + buffer.putByte(offset, bits); + return this; + } + + public MatchEventIndicatorEncoder lastVolumeMsg(final boolean value) + { + byte bits = buffer.getByte(offset); + bits = (byte)(value ? bits | (1 << 1) : bits & ~(1 << 1)); + buffer.putByte(offset, bits); + return this; + } + + public MatchEventIndicatorEncoder lastQuoteMsg(final boolean value) + { + byte bits = buffer.getByte(offset); + bits = (byte)(value ? bits | (1 << 2) : bits & ~(1 << 2)); + buffer.putByte(offset, bits); + return this; + } + + public MatchEventIndicatorEncoder lastStatsMsg(final boolean value) + { + byte bits = buffer.getByte(offset); + bits = (byte)(value ? bits | (1 << 3) : bits & ~(1 << 3)); + buffer.putByte(offset, bits); + return this; + } + + public MatchEventIndicatorEncoder lastImpliedMsg(final boolean value) + { + byte bits = buffer.getByte(offset); + bits = (byte)(value ? bits | (1 << 4) : bits & ~(1 << 4)); + buffer.putByte(offset, bits); + return this; + } + + public MatchEventIndicatorEncoder recoveryMsg(final boolean value) + { + byte bits = buffer.getByte(offset); + bits = (byte)(value ? bits | (1 << 5) : bits & ~(1 << 5)); + buffer.putByte(offset, bits); + return this; + } + + public MatchEventIndicatorEncoder reserved(final boolean value) + { + byte bits = buffer.getByte(offset); + bits = (byte)(value ? bits | (1 << 6) : bits & ~(1 << 6)); + buffer.putByte(offset, bits); + return this; + } + + public MatchEventIndicatorEncoder endOfEvent(final boolean value) + { + byte bits = buffer.getByte(offset); + bits = (byte)(value ? bits | (1 << 7) : bits & ~(1 << 7)); + buffer.putByte(offset, bits); + return this; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MaturityMonthYearDecoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MaturityMonthYearDecoder.java new file mode 100644 index 0000000..6c04632 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MaturityMonthYearDecoder.java @@ -0,0 +1,188 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MaturityMonthYearDecoder"}) +@SuppressWarnings("all") +public class MaturityMonthYearDecoder +{ + public static final int ENCODED_LENGTH = 5; + private int offset; + private DirectBuffer buffer; + + public MaturityMonthYearDecoder wrap(final DirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + + return this; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public int encodedLength() + { + return ENCODED_LENGTH; + } + + public static int yearEncodingOffset() + { + return 0; + } + + public static int yearEncodingLength() + { + return 2; + } + + public static int yearNullValue() + { + return 65535; + } + + public static int yearMinValue() + { + return 0; + } + + public static int yearMaxValue() + { + return 65534; + } + + public int year() + { + return (buffer.getShort(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); + } + + + public static int monthEncodingOffset() + { + return 2; + } + + public static int monthEncodingLength() + { + return 1; + } + + public static short monthNullValue() + { + return (short)255; + } + + public static short monthMinValue() + { + return (short)0; + } + + public static short monthMaxValue() + { + return (short)254; + } + + public short month() + { + return ((short)(buffer.getByte(offset + 2) & 0xFF)); + } + + + public static int dayEncodingOffset() + { + return 3; + } + + public static int dayEncodingLength() + { + return 1; + } + + public static short dayNullValue() + { + return (short)255; + } + + public static short dayMinValue() + { + return (short)0; + } + + public static short dayMaxValue() + { + return (short)254; + } + + public short day() + { + return ((short)(buffer.getByte(offset + 3) & 0xFF)); + } + + + public static int weekEncodingOffset() + { + return 4; + } + + public static int weekEncodingLength() + { + return 1; + } + + public static short weekNullValue() + { + return (short)255; + } + + public static short weekMinValue() + { + return (short)0; + } + + public static short weekMaxValue() + { + return (short)254; + } + + public short week() + { + return ((short)(buffer.getByte(offset + 4) & 0xFF)); + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=ENCODING, name='year', referencedName='null', description='YYYY', id=-1, version=0, deprecated=0, encodedLength=2, offset=0, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT16, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=65535, constValue=null, characterEncoding='UTF-8', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("year="); + builder.append(year()); + builder.append('|'); + //Token{signal=ENCODING, name='month', referencedName='null', description='MM', id=-1, version=0, deprecated=0, encodedLength=1, offset=2, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=255, constValue=null, characterEncoding='UTF-8', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("month="); + builder.append(month()); + builder.append('|'); + //Token{signal=ENCODING, name='day', referencedName='null', description='DD', id=-1, version=0, deprecated=0, encodedLength=1, offset=3, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=255, constValue=null, characterEncoding='UTF-8', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("day="); + builder.append(day()); + builder.append('|'); + //Token{signal=ENCODING, name='week', referencedName='null', description='WW', id=-1, version=0, deprecated=0, encodedLength=1, offset=4, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=255, constValue=null, characterEncoding='UTF-8', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("week="); + builder.append(week()); + builder.append(')'); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MaturityMonthYearEncoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MaturityMonthYearEncoder.java new file mode 100644 index 0000000..75e5038 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MaturityMonthYearEncoder.java @@ -0,0 +1,177 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MaturityMonthYearEncoder"}) +@SuppressWarnings("all") +public class MaturityMonthYearEncoder +{ + public static final int ENCODED_LENGTH = 5; + private int offset; + private MutableDirectBuffer buffer; + + public MaturityMonthYearEncoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + + return this; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public int encodedLength() + { + return ENCODED_LENGTH; + } + + public static int yearEncodingOffset() + { + return 0; + } + + public static int yearEncodingLength() + { + return 2; + } + + public static int yearNullValue() + { + return 65535; + } + + public static int yearMinValue() + { + return 0; + } + + public static int yearMaxValue() + { + return 65534; + } + + public MaturityMonthYearEncoder year(final int value) + { + buffer.putShort(offset + 0, (short)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int monthEncodingOffset() + { + return 2; + } + + public static int monthEncodingLength() + { + return 1; + } + + public static short monthNullValue() + { + return (short)255; + } + + public static short monthMinValue() + { + return (short)0; + } + + public static short monthMaxValue() + { + return (short)254; + } + + public MaturityMonthYearEncoder month(final short value) + { + buffer.putByte(offset + 2, (byte)value); + return this; + } + + + public static int dayEncodingOffset() + { + return 3; + } + + public static int dayEncodingLength() + { + return 1; + } + + public static short dayNullValue() + { + return (short)255; + } + + public static short dayMinValue() + { + return (short)0; + } + + public static short dayMaxValue() + { + return (short)254; + } + + public MaturityMonthYearEncoder day(final short value) + { + buffer.putByte(offset + 3, (byte)value); + return this; + } + + + public static int weekEncodingOffset() + { + return 4; + } + + public static int weekEncodingLength() + { + return 1; + } + + public static short weekNullValue() + { + return (short)255; + } + + public static short weekMinValue() + { + return (short)0; + } + + public static short weekMaxValue() + { + return (short)254; + } + + public MaturityMonthYearEncoder week(final short value) + { + buffer.putByte(offset + 4, (byte)value); + return this; + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + MaturityMonthYearDecoder writer = new MaturityMonthYearDecoder(); + writer.wrap(buffer, offset); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MessageHeaderDecoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MessageHeaderDecoder.java new file mode 100644 index 0000000..c496f8e --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MessageHeaderDecoder.java @@ -0,0 +1,188 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MessageHeaderDecoder"}) +@SuppressWarnings("all") +public class MessageHeaderDecoder +{ + public static final int ENCODED_LENGTH = 8; + private int offset; + private DirectBuffer buffer; + + public MessageHeaderDecoder wrap(final DirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + + return this; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public int encodedLength() + { + return ENCODED_LENGTH; + } + + public static int blockLengthEncodingOffset() + { + return 0; + } + + public static int blockLengthEncodingLength() + { + return 2; + } + + public static int blockLengthNullValue() + { + return 65535; + } + + public static int blockLengthMinValue() + { + return 0; + } + + public static int blockLengthMaxValue() + { + return 65534; + } + + public int blockLength() + { + return (buffer.getShort(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); + } + + + public static int templateIdEncodingOffset() + { + return 2; + } + + public static int templateIdEncodingLength() + { + return 2; + } + + public static int templateIdNullValue() + { + return 65535; + } + + public static int templateIdMinValue() + { + return 0; + } + + public static int templateIdMaxValue() + { + return 65534; + } + + public int templateId() + { + return (buffer.getShort(offset + 2, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); + } + + + public static int schemaIdEncodingOffset() + { + return 4; + } + + public static int schemaIdEncodingLength() + { + return 2; + } + + public static int schemaIdNullValue() + { + return 65535; + } + + public static int schemaIdMinValue() + { + return 0; + } + + public static int schemaIdMaxValue() + { + return 65534; + } + + public int schemaId() + { + return (buffer.getShort(offset + 4, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); + } + + + public static int versionEncodingOffset() + { + return 6; + } + + public static int versionEncodingLength() + { + return 2; + } + + public static int versionNullValue() + { + return 65535; + } + + public static int versionMinValue() + { + return 0; + } + + public static int versionMaxValue() + { + return 65534; + } + + public int version() + { + return (buffer.getShort(offset + 6, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=ENCODING, name='blockLength', referencedName='null', description='null', id=-1, version=0, deprecated=0, encodedLength=2, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT16, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("blockLength="); + builder.append(blockLength()); + builder.append('|'); + //Token{signal=ENCODING, name='templateId', referencedName='null', description='null', id=-1, version=0, deprecated=0, encodedLength=2, offset=2, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT16, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("templateId="); + builder.append(templateId()); + builder.append('|'); + //Token{signal=ENCODING, name='schemaId', referencedName='null', description='null', id=-1, version=0, deprecated=0, encodedLength=2, offset=4, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT16, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("schemaId="); + builder.append(schemaId()); + builder.append('|'); + //Token{signal=ENCODING, name='version', referencedName='null', description='null', id=-1, version=0, deprecated=0, encodedLength=2, offset=6, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT16, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("version="); + builder.append(version()); + builder.append(')'); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MessageHeaderEncoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MessageHeaderEncoder.java new file mode 100644 index 0000000..70835fb --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MessageHeaderEncoder.java @@ -0,0 +1,177 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MessageHeaderEncoder"}) +@SuppressWarnings("all") +public class MessageHeaderEncoder +{ + public static final int ENCODED_LENGTH = 8; + private int offset; + private MutableDirectBuffer buffer; + + public MessageHeaderEncoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + + return this; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public int encodedLength() + { + return ENCODED_LENGTH; + } + + public static int blockLengthEncodingOffset() + { + return 0; + } + + public static int blockLengthEncodingLength() + { + return 2; + } + + public static int blockLengthNullValue() + { + return 65535; + } + + public static int blockLengthMinValue() + { + return 0; + } + + public static int blockLengthMaxValue() + { + return 65534; + } + + public MessageHeaderEncoder blockLength(final int value) + { + buffer.putShort(offset + 0, (short)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int templateIdEncodingOffset() + { + return 2; + } + + public static int templateIdEncodingLength() + { + return 2; + } + + public static int templateIdNullValue() + { + return 65535; + } + + public static int templateIdMinValue() + { + return 0; + } + + public static int templateIdMaxValue() + { + return 65534; + } + + public MessageHeaderEncoder templateId(final int value) + { + buffer.putShort(offset + 2, (short)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int schemaIdEncodingOffset() + { + return 4; + } + + public static int schemaIdEncodingLength() + { + return 2; + } + + public static int schemaIdNullValue() + { + return 65535; + } + + public static int schemaIdMinValue() + { + return 0; + } + + public static int schemaIdMaxValue() + { + return 65534; + } + + public MessageHeaderEncoder schemaId(final int value) + { + buffer.putShort(offset + 4, (short)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int versionEncodingOffset() + { + return 6; + } + + public static int versionEncodingLength() + { + return 2; + } + + public static int versionNullValue() + { + return 65535; + } + + public static int versionMinValue() + { + return 0; + } + + public static int versionMaxValue() + { + return 65534; + } + + public MessageHeaderEncoder version(final int value) + { + buffer.putShort(offset + 6, (short)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + MessageHeaderDecoder writer = new MessageHeaderDecoder(); + writer.wrap(buffer, offset); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MetaAttribute.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MetaAttribute.java new file mode 100644 index 0000000..0398c84 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/MetaAttribute.java @@ -0,0 +1,10 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.MetaAttribute"}) +public enum MetaAttribute +{ + EPOCH, + TIME_UNIT, + SEMANTIC_TYPE +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/OpenCloseSettlFlag.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/OpenCloseSettlFlag.java new file mode 100644 index 0000000..97c20a2 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/OpenCloseSettlFlag.java @@ -0,0 +1,38 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.OpenCloseSettlFlag"}) +public enum OpenCloseSettlFlag +{ + DailyOpenPrice((short)0), + IndicativeOpeningPrice((short)5), + NULL_VAL((short)255); + + private final short value; + + OpenCloseSettlFlag(final short value) + { + this.value = value; + } + + public short value() + { + return value; + } + + public static OpenCloseSettlFlag get(final short value) + { + switch (value) + { + case 0: return DailyOpenPrice; + case 5: return IndicativeOpeningPrice; + } + + if ((short)255 == value) + { + return NULL_VAL; + } + + throw new IllegalArgumentException("Unknown value: " + value); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/OrderUpdateAction.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/OrderUpdateAction.java new file mode 100644 index 0000000..3712ff4 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/OrderUpdateAction.java @@ -0,0 +1,40 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.OrderUpdateAction"}) +public enum OrderUpdateAction +{ + New((short)0), + Update((short)1), + Delete((short)2), + NULL_VAL((short)255); + + private final short value; + + OrderUpdateAction(final short value) + { + this.value = value; + } + + public short value() + { + return value; + } + + public static OrderUpdateAction get(final short value) + { + switch (value) + { + case 0: return New; + case 1: return Update; + case 2: return Delete; + } + + if ((short)255 == value) + { + return NULL_VAL; + } + + throw new IllegalArgumentException("Unknown value: " + value); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/PRICEDecoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/PRICEDecoder.java new file mode 100644 index 0000000..02e02fb --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/PRICEDecoder.java @@ -0,0 +1,115 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.PRICEDecoder"}) +@SuppressWarnings("all") +public class PRICEDecoder +{ + public static final int ENCODED_LENGTH = 8; + private int offset; + private DirectBuffer buffer; + + public PRICEDecoder wrap(final DirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + + return this; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public int encodedLength() + { + return ENCODED_LENGTH; + } + + public static int mantissaEncodingOffset() + { + return 0; + } + + public static int mantissaEncodingLength() + { + return 8; + } + + public static long mantissaNullValue() + { + return -9223372036854775808L; + } + + public static long mantissaMinValue() + { + return -9223372036854775807L; + } + + public static long mantissaMaxValue() + { + return 9223372036854775807L; + } + + public long mantissa() + { + return buffer.getLong(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int exponentEncodingOffset() + { + return 8; + } + + public static int exponentEncodingLength() + { + return 0; + } + + public static byte exponentNullValue() + { + return (byte)-128; + } + + public static byte exponentMinValue() + { + return (byte)-127; + } + + public static byte exponentMaxValue() + { + return (byte)127; + } + + public byte exponent() + { + return (byte)-7; + } + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=ENCODING, name='mantissa', referencedName='null', description='mantissa', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("mantissa="); + builder.append(mantissa()); + builder.append('|'); + //Token{signal=ENCODING, name='exponent', referencedName='null', description='exponent', id=-1, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=1, encoding=Encoding{presence=CONSTANT, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=-7, characterEncoding='UTF-8', epoch='null', timeUnit=null, semanticType='null'}} + builder.append(')'); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/PRICEEncoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/PRICEEncoder.java new file mode 100644 index 0000000..4ccbfdb --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/PRICEEncoder.java @@ -0,0 +1,111 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.PRICEEncoder"}) +@SuppressWarnings("all") +public class PRICEEncoder +{ + public static final int ENCODED_LENGTH = 8; + private int offset; + private MutableDirectBuffer buffer; + + public PRICEEncoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + + return this; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public int encodedLength() + { + return ENCODED_LENGTH; + } + + public static int mantissaEncodingOffset() + { + return 0; + } + + public static int mantissaEncodingLength() + { + return 8; + } + + public static long mantissaNullValue() + { + return -9223372036854775808L; + } + + public static long mantissaMinValue() + { + return -9223372036854775807L; + } + + public static long mantissaMaxValue() + { + return 9223372036854775807L; + } + + public PRICEEncoder mantissa(final long value) + { + buffer.putLong(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int exponentEncodingOffset() + { + return 8; + } + + public static int exponentEncodingLength() + { + return 0; + } + + public static byte exponentNullValue() + { + return (byte)-128; + } + + public static byte exponentMinValue() + { + return (byte)-127; + } + + public static byte exponentMaxValue() + { + return (byte)127; + } + + public byte exponent() + { + return (byte)-7; + } + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + PRICEDecoder writer = new PRICEDecoder(); + writer.wrap(buffer, offset); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/PRICENULLDecoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/PRICENULLDecoder.java new file mode 100644 index 0000000..8f33c3b --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/PRICENULLDecoder.java @@ -0,0 +1,115 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.PRICENULLDecoder"}) +@SuppressWarnings("all") +public class PRICENULLDecoder +{ + public static final int ENCODED_LENGTH = 8; + private int offset; + private DirectBuffer buffer; + + public PRICENULLDecoder wrap(final DirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + + return this; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public int encodedLength() + { + return ENCODED_LENGTH; + } + + public static int mantissaEncodingOffset() + { + return 0; + } + + public static int mantissaEncodingLength() + { + return 8; + } + + public static long mantissaNullValue() + { + return 9223372036854775807L; + } + + public static long mantissaMinValue() + { + return -9223372036854775807L; + } + + public static long mantissaMaxValue() + { + return 9223372036854775807L; + } + + public long mantissa() + { + return buffer.getLong(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int exponentEncodingOffset() + { + return 8; + } + + public static int exponentEncodingLength() + { + return 0; + } + + public static byte exponentNullValue() + { + return (byte)-128; + } + + public static byte exponentMinValue() + { + return (byte)-127; + } + + public static byte exponentMaxValue() + { + return (byte)127; + } + + public byte exponent() + { + return (byte)-7; + } + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=ENCODING, name='mantissa', referencedName='null', description='mantissa', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=9223372036854775807, constValue=null, characterEncoding='UTF-8', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("mantissa="); + builder.append(mantissa()); + builder.append('|'); + //Token{signal=ENCODING, name='exponent', referencedName='null', description='exponent', id=-1, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=1, encoding=Encoding{presence=CONSTANT, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=-7, characterEncoding='UTF-8', epoch='null', timeUnit=null, semanticType='null'}} + builder.append(')'); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/PRICENULLEncoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/PRICENULLEncoder.java new file mode 100644 index 0000000..467694d --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/PRICENULLEncoder.java @@ -0,0 +1,111 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.PRICENULLEncoder"}) +@SuppressWarnings("all") +public class PRICENULLEncoder +{ + public static final int ENCODED_LENGTH = 8; + private int offset; + private MutableDirectBuffer buffer; + + public PRICENULLEncoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + + return this; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public int encodedLength() + { + return ENCODED_LENGTH; + } + + public static int mantissaEncodingOffset() + { + return 0; + } + + public static int mantissaEncodingLength() + { + return 8; + } + + public static long mantissaNullValue() + { + return 9223372036854775807L; + } + + public static long mantissaMinValue() + { + return -9223372036854775807L; + } + + public static long mantissaMaxValue() + { + return 9223372036854775807L; + } + + public PRICENULLEncoder mantissa(final long value) + { + buffer.putLong(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int exponentEncodingOffset() + { + return 8; + } + + public static int exponentEncodingLength() + { + return 0; + } + + public static byte exponentNullValue() + { + return (byte)-128; + } + + public static byte exponentMinValue() + { + return (byte)-127; + } + + public static byte exponentMaxValue() + { + return (byte)127; + } + + public byte exponent() + { + return (byte)-7; + } + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + PRICENULLDecoder writer = new PRICENULLDecoder(); + writer.wrap(buffer, offset); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/PutOrCall.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/PutOrCall.java new file mode 100644 index 0000000..305c1fc --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/PutOrCall.java @@ -0,0 +1,38 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.PutOrCall"}) +public enum PutOrCall +{ + Put((short)0), + Call((short)1), + NULL_VAL((short)255); + + private final short value; + + PutOrCall(final short value) + { + this.value = value; + } + + public short value() + { + return value; + } + + public static PutOrCall get(final short value) + { + switch (value) + { + case 0: return Put; + case 1: return Call; + } + + if ((short)255 == value) + { + return NULL_VAL; + } + + throw new IllegalArgumentException("Unknown value: " + value); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/QuoteRequest39Decoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/QuoteRequest39Decoder.java new file mode 100644 index 0000000..c793346 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/QuoteRequest39Decoder.java @@ -0,0 +1,777 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.QuoteRequest39Decoder"}) +@SuppressWarnings("all") +public class QuoteRequest39Decoder +{ + public static final int BLOCK_LENGTH = 35; + public static final int TEMPLATE_ID = 39; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final QuoteRequest39Decoder parentMessage = this; + private DirectBuffer buffer; + protected int offset; + protected int limit; + protected int actingBlockLength; + protected int actingVersion; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "R"; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public QuoteRequest39Decoder wrap( + final DirectBuffer buffer, final int offset, final int actingBlockLength, final int actingVersion) + { + this.buffer = buffer; + this.offset = offset; + this.actingBlockLength = actingBlockLength; + this.actingVersion = actingVersion; + limit(offset + actingBlockLength); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int transactTimeId() + { + return 60; + } + + public static int transactTimeSinceVersion() + { + return 0; + } + + public static int transactTimeEncodingOffset() + { + return 0; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static String transactTimeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "UTCTimestamp"; + } + + return ""; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long transactTime() + { + return buffer.getLong(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int quoteReqIDId() + { + return 131; + } + + public static int quoteReqIDSinceVersion() + { + return 0; + } + + public static int quoteReqIDEncodingOffset() + { + return 8; + } + + public static int quoteReqIDEncodingLength() + { + return 23; + } + + public static String quoteReqIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte quoteReqIDNullValue() + { + return (byte)0; + } + + public static byte quoteReqIDMinValue() + { + return (byte)32; + } + + public static byte quoteReqIDMaxValue() + { + return (byte)126; + } + + public static int quoteReqIDLength() + { + return 23; + } + + public byte quoteReqID(final int index) + { + if (index < 0 || index >= 23) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 8 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String quoteReqIDCharacterEncoding() + { + return "UTF-8"; + } + + public int getQuoteReqID(final byte[] dst, final int dstOffset) + { + final int length = 23; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 8, dst, dstOffset, length); + + return length; + } + + public String quoteReqID() + { + final byte[] dst = new byte[23]; + buffer.getBytes(this.offset + 8, dst, 0, 23); + + int end = 0; + for (; end < 23 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int matchEventIndicatorId() + { + return 5799; + } + + public static int matchEventIndicatorSinceVersion() + { + return 0; + } + + public static int matchEventIndicatorEncodingOffset() + { + return 31; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + public static String matchEventIndicatorMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MultipleCharValue"; + } + + return ""; + } + + private final MatchEventIndicatorDecoder matchEventIndicator = new MatchEventIndicatorDecoder(); + + public MatchEventIndicatorDecoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 31); + return matchEventIndicator; + } + + private final NoRelatedSymDecoder noRelatedSym = new NoRelatedSymDecoder(); + + public static long noRelatedSymDecoderId() + { + return 146; + } + + public static int noRelatedSymDecoderSinceVersion() + { + return 0; + } + + public NoRelatedSymDecoder noRelatedSym() + { + noRelatedSym.wrap(parentMessage, buffer); + return noRelatedSym; + } + + public static class NoRelatedSymDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private QuoteRequest39Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final QuoteRequest39Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 32; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoRelatedSymDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int symbolId() + { + return 55; + } + + public static int symbolSinceVersion() + { + return 0; + } + + public static int symbolEncodingOffset() + { + return 0; + } + + public static int symbolEncodingLength() + { + return 20; + } + + public static String symbolMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte symbolNullValue() + { + return (byte)0; + } + + public static byte symbolMinValue() + { + return (byte)32; + } + + public static byte symbolMaxValue() + { + return (byte)126; + } + + public static int symbolLength() + { + return 20; + } + + public byte symbol(final int index) + { + if (index < 0 || index >= 20) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 0 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String symbolCharacterEncoding() + { + return "UTF-8"; + } + + public int getSymbol(final byte[] dst, final int dstOffset) + { + final int length = 20; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 0, dst, dstOffset, length); + + return length; + } + + public String symbol() + { + final byte[] dst = new byte[20]; + buffer.getBytes(this.offset + 0, dst, 0, 20); + + int end = 0; + for (; end < 20 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int securityIDId() + { + return 48; + } + + public static int securityIDSinceVersion() + { + return 0; + } + + public static int securityIDEncodingOffset() + { + return 20; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static String securityIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public int securityID() + { + return buffer.getInt(offset + 20, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int orderQtyId() + { + return 38; + } + + public static int orderQtySinceVersion() + { + return 0; + } + + public static int orderQtyEncodingOffset() + { + return 24; + } + + public static int orderQtyEncodingLength() + { + return 4; + } + + public static String orderQtyMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static int orderQtyNullValue() + { + return 2147483647; + } + + public static int orderQtyMinValue() + { + return -2147483647; + } + + public static int orderQtyMaxValue() + { + return 2147483647; + } + + public int orderQty() + { + return buffer.getInt(offset + 24, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int quoteTypeId() + { + return 537; + } + + public static int quoteTypeSinceVersion() + { + return 0; + } + + public static int quoteTypeEncodingOffset() + { + return 28; + } + + public static int quoteTypeEncodingLength() + { + return 1; + } + + public static String quoteTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static byte quoteTypeNullValue() + { + return (byte)-128; + } + + public static byte quoteTypeMinValue() + { + return (byte)-127; + } + + public static byte quoteTypeMaxValue() + { + return (byte)127; + } + + public byte quoteType() + { + return buffer.getByte(offset + 28); + } + + + public static int sideId() + { + return 54; + } + + public static int sideSinceVersion() + { + return 0; + } + + public static int sideEncodingOffset() + { + return 29; + } + + public static int sideEncodingLength() + { + return 1; + } + + public static String sideMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static byte sideNullValue() + { + return (byte)127; + } + + public static byte sideMinValue() + { + return (byte)-127; + } + + public static byte sideMaxValue() + { + return (byte)127; + } + + public byte side() + { + return buffer.getByte(offset + 29); + } + + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='Symbol', referencedName='null', description='Instrument Name or Symbol', id=55, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='Symbol', referencedName='null', description='Instrument Name or Symbol', id=-1, version=0, deprecated=0, encodedLength=20, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("symbol="); + for (int i = 0; i < symbolLength() && symbol(i) > 0; i++) + { + builder.append((char)symbol(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityID', referencedName='null', description='Security ID', id=48, version=0, deprecated=0, encodedLength=0, offset=20, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32', referencedName='null', description='Security ID', id=-1, version=0, deprecated=0, encodedLength=4, offset=20, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("securityID="); + builder.append(securityID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='OrderQty', referencedName='null', description='Quantity requested', id=38, version=0, deprecated=0, encodedLength=0, offset=24, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='Int32NULL', referencedName='null', description='Quantity requested', id=-1, version=0, deprecated=0, encodedLength=4, offset=24, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=2147483647, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("orderQty="); + builder.append(orderQty()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='QuoteType', referencedName='null', description='Type of quote requested', id=537, version=0, deprecated=0, encodedLength=0, offset=28, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int8', referencedName='null', description='Type of quote requested', id=-1, version=0, deprecated=0, encodedLength=1, offset=28, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("quoteType="); + builder.append(quoteType()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='Side', referencedName='null', description='Side requested', id=54, version=0, deprecated=0, encodedLength=0, offset=29, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int8NULL', referencedName='null', description='Side requested', id=-1, version=0, deprecated=0, encodedLength=1, offset=29, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=127, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("side="); + builder.append(side()); + builder.append(')'); + return builder; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + final int originalLimit = limit(); + limit(offset + actingBlockLength); + builder.append("[QuoteRequest39](sbeTemplateId="); + builder.append(TEMPLATE_ID); + builder.append("|sbeSchemaId="); + builder.append(SCHEMA_ID); + builder.append("|sbeSchemaVersion="); + if (parentMessage.actingVersion != SCHEMA_VERSION) + { + builder.append(parentMessage.actingVersion); + builder.append('/'); + } + builder.append(SCHEMA_VERSION); + builder.append("|sbeBlockLength="); + if (actingBlockLength != BLOCK_LENGTH) + { + builder.append(actingBlockLength); + builder.append('/'); + } + builder.append(BLOCK_LENGTH); + builder.append("):"); + //Token{signal=BEGIN_FIELD, name='TransactTime', referencedName='null', description='Start of event processing time in number of nanoseconds since Unix epoch', id=60, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + //Token{signal=ENCODING, name='uInt64', referencedName='null', description='Start of event processing time in number of nanoseconds since Unix epoch', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + builder.append("transactTime="); + builder.append(transactTime()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='QuoteReqID', referencedName='null', description='Quote Request ID defined by the exchange', id=131, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='QuoteReqId', referencedName='null', description='Quote Request ID defined by the exchange', id=-1, version=0, deprecated=0, encodedLength=23, offset=8, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("quoteReqID="); + for (int i = 0; i < quoteReqIDLength() && quoteReqID(i) > 0; i++) + { + builder.append((char)quoteReqID(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=5799, version=0, deprecated=0, encodedLength=0, offset=31, componentTokenCount=12, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MultipleCharValue'}} + //Token{signal=BEGIN_SET, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=-1, version=0, deprecated=0, encodedLength=1, offset=31, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MultipleCharValue'}} + builder.append("matchEventIndicator="); + builder.append(matchEventIndicator()); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoRelatedSym', referencedName='null', description='Indicates the number of repeating symbols specified', id=146, version=0, deprecated=0, encodedLength=32, offset=35, componentTokenCount=21, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noRelatedSym=["); + NoRelatedSymDecoder noRelatedSym = noRelatedSym(); + if (noRelatedSym.count() > 0) + { + while (noRelatedSym.hasNext()) + { + noRelatedSym.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + + limit(originalLimit); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/QuoteRequest39Encoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/QuoteRequest39Encoder.java new file mode 100644 index 0000000..509a98e --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/QuoteRequest39Encoder.java @@ -0,0 +1,493 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.QuoteRequest39Encoder"}) +@SuppressWarnings("all") +public class QuoteRequest39Encoder +{ + public static final int BLOCK_LENGTH = 35; + public static final int TEMPLATE_ID = 39; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final QuoteRequest39Encoder parentMessage = this; + private MutableDirectBuffer buffer; + protected int offset; + protected int limit; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "R"; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public QuoteRequest39Encoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + limit(offset + BLOCK_LENGTH); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int transactTimeEncodingOffset() + { + return 0; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public QuoteRequest39Encoder transactTime(final long value) + { + buffer.putLong(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int quoteReqIDEncodingOffset() + { + return 8; + } + + public static int quoteReqIDEncodingLength() + { + return 23; + } + + public static byte quoteReqIDNullValue() + { + return (byte)0; + } + + public static byte quoteReqIDMinValue() + { + return (byte)32; + } + + public static byte quoteReqIDMaxValue() + { + return (byte)126; + } + + public static int quoteReqIDLength() + { + return 23; + } + + public void quoteReqID(final int index, final byte value) + { + if (index < 0 || index >= 23) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 8 + (index * 1); + buffer.putByte(pos, value); + } + + public static String quoteReqIDCharacterEncoding() + { + return "UTF-8"; + } + + public QuoteRequest39Encoder putQuoteReqID(final byte[] src, final int srcOffset) + { + final int length = 23; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 8, src, srcOffset, length); + + return this; + } + + public QuoteRequest39Encoder quoteReqID(final String src) + { + final int length = 23; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 8, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 8 + start, (byte)0); + } + + return this; + } + + public static int matchEventIndicatorEncodingOffset() + { + return 31; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + private final MatchEventIndicatorEncoder matchEventIndicator = new MatchEventIndicatorEncoder(); + + public MatchEventIndicatorEncoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 31); + return matchEventIndicator; + } + + private final NoRelatedSymEncoder noRelatedSym = new NoRelatedSymEncoder(); + + public static long noRelatedSymId() + { + return 146; + } + + public NoRelatedSymEncoder noRelatedSymCount(final int count) + { + noRelatedSym.wrap(parentMessage, buffer, count); + return noRelatedSym; + } + + public static class NoRelatedSymEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private QuoteRequest39Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final QuoteRequest39Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)32); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 32; + } + + public NoRelatedSymEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int symbolEncodingOffset() + { + return 0; + } + + public static int symbolEncodingLength() + { + return 20; + } + + public static byte symbolNullValue() + { + return (byte)0; + } + + public static byte symbolMinValue() + { + return (byte)32; + } + + public static byte symbolMaxValue() + { + return (byte)126; + } + + public static int symbolLength() + { + return 20; + } + + public void symbol(final int index, final byte value) + { + if (index < 0 || index >= 20) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 0 + (index * 1); + buffer.putByte(pos, value); + } + + public static String symbolCharacterEncoding() + { + return "UTF-8"; + } + + public NoRelatedSymEncoder putSymbol(final byte[] src, final int srcOffset) + { + final int length = 20; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 0, src, srcOffset, length); + + return this; + } + + public NoRelatedSymEncoder symbol(final String src) + { + final int length = 20; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 0, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 0 + start, (byte)0); + } + + return this; + } + + public static int securityIDEncodingOffset() + { + return 20; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public NoRelatedSymEncoder securityID(final int value) + { + buffer.putInt(offset + 20, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int orderQtyEncodingOffset() + { + return 24; + } + + public static int orderQtyEncodingLength() + { + return 4; + } + + public static int orderQtyNullValue() + { + return 2147483647; + } + + public static int orderQtyMinValue() + { + return -2147483647; + } + + public static int orderQtyMaxValue() + { + return 2147483647; + } + + public NoRelatedSymEncoder orderQty(final int value) + { + buffer.putInt(offset + 24, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int quoteTypeEncodingOffset() + { + return 28; + } + + public static int quoteTypeEncodingLength() + { + return 1; + } + + public static byte quoteTypeNullValue() + { + return (byte)-128; + } + + public static byte quoteTypeMinValue() + { + return (byte)-127; + } + + public static byte quoteTypeMaxValue() + { + return (byte)127; + } + + public NoRelatedSymEncoder quoteType(final byte value) + { + buffer.putByte(offset + 28, value); + return this; + } + + + public static int sideEncodingOffset() + { + return 29; + } + + public static int sideEncodingLength() + { + return 1; + } + + public static byte sideNullValue() + { + return (byte)127; + } + + public static byte sideMinValue() + { + return (byte)-127; + } + + public static byte sideMaxValue() + { + return (byte)127; + } + + public NoRelatedSymEncoder side(final byte value) + { + buffer.putByte(offset + 29, value); + return this; + } + + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + QuoteRequest39Decoder writer = new QuoteRequest39Decoder(); + writer.wrap(buffer, offset, BLOCK_LENGTH, SCHEMA_VERSION); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SecurityStatus30Decoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SecurityStatus30Decoder.java new file mode 100644 index 0000000..f0064ef --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SecurityStatus30Decoder.java @@ -0,0 +1,672 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.SecurityStatus30Decoder"}) +@SuppressWarnings("all") +public class SecurityStatus30Decoder +{ + public static final int BLOCK_LENGTH = 30; + public static final int TEMPLATE_ID = 30; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final SecurityStatus30Decoder parentMessage = this; + private DirectBuffer buffer; + protected int offset; + protected int limit; + protected int actingBlockLength; + protected int actingVersion; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "f"; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public SecurityStatus30Decoder wrap( + final DirectBuffer buffer, final int offset, final int actingBlockLength, final int actingVersion) + { + this.buffer = buffer; + this.offset = offset; + this.actingBlockLength = actingBlockLength; + this.actingVersion = actingVersion; + limit(offset + actingBlockLength); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int transactTimeId() + { + return 60; + } + + public static int transactTimeSinceVersion() + { + return 0; + } + + public static int transactTimeEncodingOffset() + { + return 0; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static String transactTimeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "UTCTimestamp"; + } + + return ""; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long transactTime() + { + return buffer.getLong(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int securityGroupId() + { + return 1151; + } + + public static int securityGroupSinceVersion() + { + return 0; + } + + public static int securityGroupEncodingOffset() + { + return 8; + } + + public static int securityGroupEncodingLength() + { + return 6; + } + + public static String securityGroupMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte securityGroupNullValue() + { + return (byte)0; + } + + public static byte securityGroupMinValue() + { + return (byte)32; + } + + public static byte securityGroupMaxValue() + { + return (byte)126; + } + + public static int securityGroupLength() + { + return 6; + } + + public byte securityGroup(final int index) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 8 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String securityGroupCharacterEncoding() + { + return "UTF-8"; + } + + public int getSecurityGroup(final byte[] dst, final int dstOffset) + { + final int length = 6; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 8, dst, dstOffset, length); + + return length; + } + + public String securityGroup() + { + final byte[] dst = new byte[6]; + buffer.getBytes(this.offset + 8, dst, 0, 6); + + int end = 0; + for (; end < 6 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int assetId() + { + return 6937; + } + + public static int assetSinceVersion() + { + return 0; + } + + public static int assetEncodingOffset() + { + return 14; + } + + public static int assetEncodingLength() + { + return 6; + } + + public static String assetMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static byte assetNullValue() + { + return (byte)0; + } + + public static byte assetMinValue() + { + return (byte)32; + } + + public static byte assetMaxValue() + { + return (byte)126; + } + + public static int assetLength() + { + return 6; + } + + public byte asset(final int index) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 14 + (index * 1); + + return buffer.getByte(pos); + } + + + public static String assetCharacterEncoding() + { + return "UTF-8"; + } + + public int getAsset(final byte[] dst, final int dstOffset) + { + final int length = 6; + if (dstOffset < 0 || dstOffset > (dst.length - length)) + { + throw new IndexOutOfBoundsException("dstOffset out of range for copy: offset=" + dstOffset); + } + + buffer.getBytes(this.offset + 14, dst, dstOffset, length); + + return length; + } + + public String asset() + { + final byte[] dst = new byte[6]; + buffer.getBytes(this.offset + 14, dst, 0, 6); + + int end = 0; + for (; end < 6 && dst[end] != 0; ++end); + + return new String(dst, 0, end, java.nio.charset.StandardCharsets.UTF_8); + } + + + public static int securityIDId() + { + return 48; + } + + public static int securityIDSinceVersion() + { + return 0; + } + + public static int securityIDEncodingOffset() + { + return 20; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static String securityIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int securityIDNullValue() + { + return 2147483647; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public int securityID() + { + return buffer.getInt(offset + 20, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int tradeDateId() + { + return 75; + } + + public static int tradeDateSinceVersion() + { + return 0; + } + + public static int tradeDateEncodingOffset() + { + return 24; + } + + public static int tradeDateEncodingLength() + { + return 2; + } + + public static String tradeDateMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "LocalMktDate"; + } + + return ""; + } + + public static int tradeDateNullValue() + { + return 65535; + } + + public static int tradeDateMinValue() + { + return 0; + } + + public static int tradeDateMaxValue() + { + return 65534; + } + + public int tradeDate() + { + return (buffer.getShort(offset + 24, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); + } + + + public static int matchEventIndicatorId() + { + return 5799; + } + + public static int matchEventIndicatorSinceVersion() + { + return 0; + } + + public static int matchEventIndicatorEncodingOffset() + { + return 26; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + public static String matchEventIndicatorMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MultipleCharValue"; + } + + return ""; + } + + private final MatchEventIndicatorDecoder matchEventIndicator = new MatchEventIndicatorDecoder(); + + public MatchEventIndicatorDecoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 26); + return matchEventIndicator; + } + + public static int securityTradingStatusId() + { + return 326; + } + + public static int securityTradingStatusSinceVersion() + { + return 0; + } + + public static int securityTradingStatusEncodingOffset() + { + return 27; + } + + public static int securityTradingStatusEncodingLength() + { + return 1; + } + + public static String securityTradingStatusMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public SecurityTradingStatus securityTradingStatus() + { + return SecurityTradingStatus.get(((short)(buffer.getByte(offset + 27) & 0xFF))); + } + + + public static int haltReasonId() + { + return 327; + } + + public static int haltReasonSinceVersion() + { + return 0; + } + + public static int haltReasonEncodingOffset() + { + return 28; + } + + public static int haltReasonEncodingLength() + { + return 1; + } + + public static String haltReasonMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public HaltReason haltReason() + { + return HaltReason.get(((short)(buffer.getByte(offset + 28) & 0xFF))); + } + + + public static int securityTradingEventId() + { + return 1174; + } + + public static int securityTradingEventSinceVersion() + { + return 0; + } + + public static int securityTradingEventEncodingOffset() + { + return 29; + } + + public static int securityTradingEventEncodingLength() + { + return 1; + } + + public static String securityTradingEventMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public SecurityTradingEvent securityTradingEvent() + { + return SecurityTradingEvent.get(((short)(buffer.getByte(offset + 29) & 0xFF))); + } + + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + final int originalLimit = limit(); + limit(offset + actingBlockLength); + builder.append("[SecurityStatus30](sbeTemplateId="); + builder.append(TEMPLATE_ID); + builder.append("|sbeSchemaId="); + builder.append(SCHEMA_ID); + builder.append("|sbeSchemaVersion="); + if (parentMessage.actingVersion != SCHEMA_VERSION) + { + builder.append(parentMessage.actingVersion); + builder.append('/'); + } + builder.append(SCHEMA_VERSION); + builder.append("|sbeBlockLength="); + if (actingBlockLength != BLOCK_LENGTH) + { + builder.append(actingBlockLength); + builder.append('/'); + } + builder.append(BLOCK_LENGTH); + builder.append("):"); + //Token{signal=BEGIN_FIELD, name='TransactTime', referencedName='null', description='Start of event processing time in number of nanoseconds since Unix epoch.', id=60, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + //Token{signal=ENCODING, name='uInt64', referencedName='null', description='Start of event processing time in number of nanoseconds since Unix epoch.', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + builder.append("transactTime="); + builder.append(transactTime()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityGroup', referencedName='null', description='Security Group', id=1151, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='SecurityGroup', referencedName='null', description='Security Group', id=-1, version=0, deprecated=0, encodedLength=6, offset=8, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("securityGroup="); + for (int i = 0; i < securityGroupLength() && securityGroup(i) > 0; i++) + { + builder.append((char)securityGroup(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='Asset', referencedName='null', description='Product Code within Security Group specified', id=6937, version=0, deprecated=0, encodedLength=0, offset=14, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='Asset', referencedName='null', description='Product Code within Security Group specified', id=-1, version=0, deprecated=0, encodedLength=6, offset=14, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("asset="); + for (int i = 0; i < assetLength() && asset(i) > 0; i++) + { + builder.append((char)asset(i)); + } + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityID', referencedName='null', description='If this tag is present, 35=f message is sent for the instrument', id=48, version=0, deprecated=0, encodedLength=0, offset=20, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32NULL', referencedName='null', description='If this tag is present, 35=f message is sent for the instrument', id=-1, version=0, deprecated=0, encodedLength=4, offset=20, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=2147483647, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("securityID="); + builder.append(securityID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='TradeDate', referencedName='null', description='Trade Session Date', id=75, version=0, deprecated=0, encodedLength=0, offset=24, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='LocalMktDate'}} + //Token{signal=ENCODING, name='LocalMktDate', referencedName='null', description='Trade Session Date', id=-1, version=0, deprecated=0, encodedLength=2, offset=24, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT16, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=65535, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='LocalMktDate'}} + builder.append("tradeDate="); + builder.append(tradeDate()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=5799, version=0, deprecated=0, encodedLength=0, offset=26, componentTokenCount=12, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MultipleCharValue'}} + //Token{signal=BEGIN_SET, name='MatchEventIndicator', referencedName='null', description='Bitmap field of eight Boolean type indicators reflecting the end of updates for a given Globex event', id=-1, version=0, deprecated=0, encodedLength=1, offset=26, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MultipleCharValue'}} + builder.append("matchEventIndicator="); + builder.append(matchEventIndicator()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityTradingStatus', referencedName='null', description='Identifies the trading status applicable to the instrument or Security Group', id=326, version=0, deprecated=0, encodedLength=0, offset=27, componentTokenCount=15, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='SecurityTradingStatus', referencedName='null', description='Identifies the trading status applicable to the instrument or Security Group', id=-1, version=0, deprecated=0, encodedLength=1, offset=27, componentTokenCount=13, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("securityTradingStatus="); + builder.append(securityTradingStatus()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='HaltReason', referencedName='null', description='Identifies the reason for the status change', id=327, version=0, deprecated=0, encodedLength=0, offset=28, componentTokenCount=11, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='HaltReason', referencedName='null', description='Identifies the reason for the status change', id=-1, version=0, deprecated=0, encodedLength=1, offset=28, componentTokenCount=9, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("haltReason="); + builder.append(haltReason()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityTradingEvent', referencedName='null', description='Identifies an additional event or a rule related to the status', id=1174, version=0, deprecated=0, encodedLength=0, offset=29, componentTokenCount=9, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='SecurityTradingEvent', referencedName='null', description='Identifies an additional event or a rule related to the status', id=-1, version=0, deprecated=0, encodedLength=1, offset=29, componentTokenCount=7, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("securityTradingEvent="); + builder.append(securityTradingEvent()); + + limit(originalLimit); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SecurityStatus30Encoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SecurityStatus30Encoder.java new file mode 100644 index 0000000..9220dd2 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SecurityStatus30Encoder.java @@ -0,0 +1,411 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.SecurityStatus30Encoder"}) +@SuppressWarnings("all") +public class SecurityStatus30Encoder +{ + public static final int BLOCK_LENGTH = 30; + public static final int TEMPLATE_ID = 30; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final SecurityStatus30Encoder parentMessage = this; + private MutableDirectBuffer buffer; + protected int offset; + protected int limit; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "f"; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public SecurityStatus30Encoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + limit(offset + BLOCK_LENGTH); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int transactTimeEncodingOffset() + { + return 0; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public SecurityStatus30Encoder transactTime(final long value) + { + buffer.putLong(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int securityGroupEncodingOffset() + { + return 8; + } + + public static int securityGroupEncodingLength() + { + return 6; + } + + public static byte securityGroupNullValue() + { + return (byte)0; + } + + public static byte securityGroupMinValue() + { + return (byte)32; + } + + public static byte securityGroupMaxValue() + { + return (byte)126; + } + + public static int securityGroupLength() + { + return 6; + } + + public void securityGroup(final int index, final byte value) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 8 + (index * 1); + buffer.putByte(pos, value); + } + + public static String securityGroupCharacterEncoding() + { + return "UTF-8"; + } + + public SecurityStatus30Encoder putSecurityGroup(final byte[] src, final int srcOffset) + { + final int length = 6; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 8, src, srcOffset, length); + + return this; + } + + public SecurityStatus30Encoder securityGroup(final String src) + { + final int length = 6; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 8, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 8 + start, (byte)0); + } + + return this; + } + + public static int assetEncodingOffset() + { + return 14; + } + + public static int assetEncodingLength() + { + return 6; + } + + public static byte assetNullValue() + { + return (byte)0; + } + + public static byte assetMinValue() + { + return (byte)32; + } + + public static byte assetMaxValue() + { + return (byte)126; + } + + public static int assetLength() + { + return 6; + } + + public void asset(final int index, final byte value) + { + if (index < 0 || index >= 6) + { + throw new IndexOutOfBoundsException("index out of range: index=" + index); + } + + final int pos = this.offset + 14 + (index * 1); + buffer.putByte(pos, value); + } + + public static String assetCharacterEncoding() + { + return "UTF-8"; + } + + public SecurityStatus30Encoder putAsset(final byte[] src, final int srcOffset) + { + final int length = 6; + if (srcOffset < 0 || srcOffset > (src.length - length)) + { + throw new IndexOutOfBoundsException("srcOffset out of range for copy: offset=" + srcOffset); + } + + buffer.putBytes(this.offset + 14, src, srcOffset, length); + + return this; + } + + public SecurityStatus30Encoder asset(final String src) + { + final int length = 6; + final byte[] bytes = src.getBytes(java.nio.charset.StandardCharsets.UTF_8); + if (bytes.length > length) + { + throw new IndexOutOfBoundsException("String too large for copy: byte length=" + bytes.length); + } + + buffer.putBytes(this.offset + 14, bytes, 0, bytes.length); + + for (int start = bytes.length; start < length; ++start) + { + buffer.putByte(this.offset + 14 + start, (byte)0); + } + + return this; + } + + public static int securityIDEncodingOffset() + { + return 20; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static int securityIDNullValue() + { + return 2147483647; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public SecurityStatus30Encoder securityID(final int value) + { + buffer.putInt(offset + 20, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int tradeDateEncodingOffset() + { + return 24; + } + + public static int tradeDateEncodingLength() + { + return 2; + } + + public static int tradeDateNullValue() + { + return 65535; + } + + public static int tradeDateMinValue() + { + return 0; + } + + public static int tradeDateMaxValue() + { + return 65534; + } + + public SecurityStatus30Encoder tradeDate(final int value) + { + buffer.putShort(offset + 24, (short)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int matchEventIndicatorEncodingOffset() + { + return 26; + } + + public static int matchEventIndicatorEncodingLength() + { + return 1; + } + + private final MatchEventIndicatorEncoder matchEventIndicator = new MatchEventIndicatorEncoder(); + + public MatchEventIndicatorEncoder matchEventIndicator() + { + matchEventIndicator.wrap(buffer, offset + 26); + return matchEventIndicator; + } + + public static int securityTradingStatusEncodingOffset() + { + return 27; + } + + public static int securityTradingStatusEncodingLength() + { + return 1; + } + + public SecurityStatus30Encoder securityTradingStatus(final SecurityTradingStatus value) + { + buffer.putByte(offset + 27, (byte)value.value()); + return this; + } + + public static int haltReasonEncodingOffset() + { + return 28; + } + + public static int haltReasonEncodingLength() + { + return 1; + } + + public SecurityStatus30Encoder haltReason(final HaltReason value) + { + buffer.putByte(offset + 28, (byte)value.value()); + return this; + } + + public static int securityTradingEventEncodingOffset() + { + return 29; + } + + public static int securityTradingEventEncodingLength() + { + return 1; + } + + public SecurityStatus30Encoder securityTradingEvent(final SecurityTradingEvent value) + { + buffer.putByte(offset + 29, (byte)value.value()); + return this; + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + SecurityStatus30Decoder writer = new SecurityStatus30Decoder(); + writer.wrap(buffer, offset, BLOCK_LENGTH, SCHEMA_VERSION); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SecurityTradingEvent.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SecurityTradingEvent.java new file mode 100644 index 0000000..05e5e39 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SecurityTradingEvent.java @@ -0,0 +1,44 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.SecurityTradingEvent"}) +public enum SecurityTradingEvent +{ + NoEvent((short)0), + NoCancel((short)1), + ResetStatistics((short)4), + ImpliedMatchingON((short)5), + ImpliedMatchingOFF((short)6), + NULL_VAL((short)255); + + private final short value; + + SecurityTradingEvent(final short value) + { + this.value = value; + } + + public short value() + { + return value; + } + + public static SecurityTradingEvent get(final short value) + { + switch (value) + { + case 0: return NoEvent; + case 1: return NoCancel; + case 4: return ResetStatistics; + case 5: return ImpliedMatchingON; + case 6: return ImpliedMatchingOFF; + } + + if ((short)255 == value) + { + return NULL_VAL; + } + + throw new IllegalArgumentException("Unknown value: " + value); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SecurityTradingStatus.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SecurityTradingStatus.java new file mode 100644 index 0000000..36da2dd --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SecurityTradingStatus.java @@ -0,0 +1,56 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.SecurityTradingStatus"}) +public enum SecurityTradingStatus +{ + TradingHalt((short)2), + Close((short)4), + NewPriceIndication((short)15), + ReadyToTrade((short)17), + NotAvailableForTrading((short)18), + UnknownorInvalid((short)20), + PreOpen((short)21), + PreCross((short)24), + Cross((short)25), + PostClose((short)26), + NoChange((short)103), + NULL_VAL((short)255); + + private final short value; + + SecurityTradingStatus(final short value) + { + this.value = value; + } + + public short value() + { + return value; + } + + public static SecurityTradingStatus get(final short value) + { + switch (value) + { + case 2: return TradingHalt; + case 4: return Close; + case 15: return NewPriceIndication; + case 17: return ReadyToTrade; + case 18: return NotAvailableForTrading; + case 20: return UnknownorInvalid; + case 21: return PreOpen; + case 24: return PreCross; + case 25: return Cross; + case 26: return PostClose; + case 103: return NoChange; + } + + if ((short)255 == value) + { + return NULL_VAL; + } + + throw new IllegalArgumentException("Unknown value: " + value); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SecurityUpdateAction.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SecurityUpdateAction.java new file mode 100644 index 0000000..de586df --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SecurityUpdateAction.java @@ -0,0 +1,40 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.SecurityUpdateAction"}) +public enum SecurityUpdateAction +{ + Add((byte)65), + Delete((byte)68), + Modify((byte)77), + NULL_VAL((byte)0); + + private final byte value; + + SecurityUpdateAction(final byte value) + { + this.value = value; + } + + public byte value() + { + return value; + } + + public static SecurityUpdateAction get(final byte value) + { + switch (value) + { + case 65: return Add; + case 68: return Delete; + case 77: return Modify; + } + + if ((byte)0 == value) + { + return NULL_VAL; + } + + throw new IllegalArgumentException("Unknown value: " + value); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SettlPriceTypeDecoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SettlPriceTypeDecoder.java new file mode 100644 index 0000000..00a9362 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SettlPriceTypeDecoder.java @@ -0,0 +1,134 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.SettlPriceTypeDecoder"}) +@SuppressWarnings("all") +public class SettlPriceTypeDecoder +{ + public static final int ENCODED_LENGTH = 1; + private DirectBuffer buffer; + private int offset; + + public SettlPriceTypeDecoder wrap(final DirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + + return this; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public int encodedLength() + { + return ENCODED_LENGTH; + } + + public boolean final1() + { + return 0 != (buffer.getByte(offset) & (1 << 0)); + } + + public boolean actual() + { + return 0 != (buffer.getByte(offset) & (1 << 1)); + } + + public boolean rounded() + { + return 0 != (buffer.getByte(offset) & (1 << 2)); + } + + public boolean intraday() + { + return 0 != (buffer.getByte(offset) & (1 << 3)); + } + + public boolean reservedBits() + { + return 0 != (buffer.getByte(offset) & (1 << 4)); + } + + public boolean nullValue() + { + return 0 != (buffer.getByte(offset) & (1 << 7)); + } + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('{'); + boolean atLeastOne = false; + if (final1()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("final1"); + atLeastOne = true; + } + if (actual()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("actual"); + atLeastOne = true; + } + if (rounded()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("rounded"); + atLeastOne = true; + } + if (intraday()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("intraday"); + atLeastOne = true; + } + if (reservedBits()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("reservedBits"); + atLeastOne = true; + } + if (nullValue()) + { + if (atLeastOne) + { + builder.append(','); + } + builder.append("nullValue"); + atLeastOne = true; + } + builder.append('}'); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SettlPriceTypeEncoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SettlPriceTypeEncoder.java new file mode 100644 index 0000000..caf3b7e --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SettlPriceTypeEncoder.java @@ -0,0 +1,90 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.SettlPriceTypeEncoder"}) +@SuppressWarnings("all") +public class SettlPriceTypeEncoder +{ + public static final int ENCODED_LENGTH = 1; + private MutableDirectBuffer buffer; + private int offset; + + public SettlPriceTypeEncoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + + return this; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public int encodedLength() + { + return ENCODED_LENGTH; + } + + public SettlPriceTypeEncoder clear() + { + buffer.putByte(offset, (byte)(short)0); + return this; + } + + public SettlPriceTypeEncoder final1(final boolean value) + { + byte bits = buffer.getByte(offset); + bits = (byte)(value ? bits | (1 << 0) : bits & ~(1 << 0)); + buffer.putByte(offset, bits); + return this; + } + + public SettlPriceTypeEncoder actual(final boolean value) + { + byte bits = buffer.getByte(offset); + bits = (byte)(value ? bits | (1 << 1) : bits & ~(1 << 1)); + buffer.putByte(offset, bits); + return this; + } + + public SettlPriceTypeEncoder rounded(final boolean value) + { + byte bits = buffer.getByte(offset); + bits = (byte)(value ? bits | (1 << 2) : bits & ~(1 << 2)); + buffer.putByte(offset, bits); + return this; + } + + public SettlPriceTypeEncoder intraday(final boolean value) + { + byte bits = buffer.getByte(offset); + bits = (byte)(value ? bits | (1 << 3) : bits & ~(1 << 3)); + buffer.putByte(offset, bits); + return this; + } + + public SettlPriceTypeEncoder reservedBits(final boolean value) + { + byte bits = buffer.getByte(offset); + bits = (byte)(value ? bits | (1 << 4) : bits & ~(1 << 4)); + buffer.putByte(offset, bits); + return this; + } + + public SettlPriceTypeEncoder nullValue(final boolean value) + { + byte bits = buffer.getByte(offset); + bits = (byte)(value ? bits | (1 << 7) : bits & ~(1 << 7)); + buffer.putByte(offset, bits); + return this; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SnapshotFullRefresh38Decoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SnapshotFullRefresh38Decoder.java new file mode 100644 index 0000000..a1f7bba --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SnapshotFullRefresh38Decoder.java @@ -0,0 +1,1228 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.SnapshotFullRefresh38Decoder"}) +@SuppressWarnings("all") +public class SnapshotFullRefresh38Decoder +{ + public static final int BLOCK_LENGTH = 59; + public static final int TEMPLATE_ID = 38; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final SnapshotFullRefresh38Decoder parentMessage = this; + private DirectBuffer buffer; + protected int offset; + protected int limit; + protected int actingBlockLength; + protected int actingVersion; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "W"; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public SnapshotFullRefresh38Decoder wrap( + final DirectBuffer buffer, final int offset, final int actingBlockLength, final int actingVersion) + { + this.buffer = buffer; + this.offset = offset; + this.actingBlockLength = actingBlockLength; + this.actingVersion = actingVersion; + limit(offset + actingBlockLength); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int lastMsgSeqNumProcessedId() + { + return 369; + } + + public static int lastMsgSeqNumProcessedSinceVersion() + { + return 0; + } + + public static int lastMsgSeqNumProcessedEncodingOffset() + { + return 0; + } + + public static int lastMsgSeqNumProcessedEncodingLength() + { + return 4; + } + + public static String lastMsgSeqNumProcessedMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "SeqNum"; + } + + return ""; + } + + public static long lastMsgSeqNumProcessedNullValue() + { + return 4294967294L; + } + + public static long lastMsgSeqNumProcessedMinValue() + { + return 0L; + } + + public static long lastMsgSeqNumProcessedMaxValue() + { + return 4294967293L; + } + + public long lastMsgSeqNumProcessed() + { + return (buffer.getInt(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + public static int totNumReportsId() + { + return 911; + } + + public static int totNumReportsSinceVersion() + { + return 0; + } + + public static int totNumReportsEncodingOffset() + { + return 4; + } + + public static int totNumReportsEncodingLength() + { + return 4; + } + + public static String totNumReportsMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static long totNumReportsNullValue() + { + return 4294967294L; + } + + public static long totNumReportsMinValue() + { + return 0L; + } + + public static long totNumReportsMaxValue() + { + return 4294967293L; + } + + public long totNumReports() + { + return (buffer.getInt(offset + 4, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + public static int securityIDId() + { + return 48; + } + + public static int securityIDSinceVersion() + { + return 0; + } + + public static int securityIDEncodingOffset() + { + return 8; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static String securityIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public int securityID() + { + return buffer.getInt(offset + 8, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int rptSeqId() + { + return 83; + } + + public static int rptSeqSinceVersion() + { + return 0; + } + + public static int rptSeqEncodingOffset() + { + return 12; + } + + public static int rptSeqEncodingLength() + { + return 4; + } + + public static String rptSeqMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "SeqNum"; + } + + return ""; + } + + public static long rptSeqNullValue() + { + return 4294967294L; + } + + public static long rptSeqMinValue() + { + return 0L; + } + + public static long rptSeqMaxValue() + { + return 4294967293L; + } + + public long rptSeq() + { + return (buffer.getInt(offset + 12, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + public static int transactTimeId() + { + return 60; + } + + public static int transactTimeSinceVersion() + { + return 0; + } + + public static int transactTimeEncodingOffset() + { + return 16; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static String transactTimeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "UTCTimestamp"; + } + + return ""; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long transactTime() + { + return buffer.getLong(offset + 16, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int lastUpdateTimeId() + { + return 779; + } + + public static int lastUpdateTimeSinceVersion() + { + return 0; + } + + public static int lastUpdateTimeEncodingOffset() + { + return 24; + } + + public static int lastUpdateTimeEncodingLength() + { + return 8; + } + + public static String lastUpdateTimeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "UTCTimestamp"; + } + + return ""; + } + + public static long lastUpdateTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long lastUpdateTimeMinValue() + { + return 0x0L; + } + + public static long lastUpdateTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long lastUpdateTime() + { + return buffer.getLong(offset + 24, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int tradeDateId() + { + return 75; + } + + public static int tradeDateSinceVersion() + { + return 0; + } + + public static int tradeDateEncodingOffset() + { + return 32; + } + + public static int tradeDateEncodingLength() + { + return 2; + } + + public static String tradeDateMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "LocalMktDate"; + } + + return ""; + } + + public static int tradeDateNullValue() + { + return 65535; + } + + public static int tradeDateMinValue() + { + return 0; + } + + public static int tradeDateMaxValue() + { + return 65534; + } + + public int tradeDate() + { + return (buffer.getShort(offset + 32, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); + } + + + public static int mDSecurityTradingStatusId() + { + return 1682; + } + + public static int mDSecurityTradingStatusSinceVersion() + { + return 0; + } + + public static int mDSecurityTradingStatusEncodingOffset() + { + return 34; + } + + public static int mDSecurityTradingStatusEncodingLength() + { + return 1; + } + + public static String mDSecurityTradingStatusMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public SecurityTradingStatus mDSecurityTradingStatus() + { + return SecurityTradingStatus.get(((short)(buffer.getByte(offset + 34) & 0xFF))); + } + + + public static int highLimitPriceId() + { + return 1149; + } + + public static int highLimitPriceSinceVersion() + { + return 0; + } + + public static int highLimitPriceEncodingOffset() + { + return 35; + } + + public static int highLimitPriceEncodingLength() + { + return 8; + } + + public static String highLimitPriceMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder highLimitPrice = new PRICENULLDecoder(); + + public PRICENULLDecoder highLimitPrice() + { + highLimitPrice.wrap(buffer, offset + 35); + return highLimitPrice; + } + + public static int lowLimitPriceId() + { + return 1148; + } + + public static int lowLimitPriceSinceVersion() + { + return 0; + } + + public static int lowLimitPriceEncodingOffset() + { + return 43; + } + + public static int lowLimitPriceEncodingLength() + { + return 8; + } + + public static String lowLimitPriceMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder lowLimitPrice = new PRICENULLDecoder(); + + public PRICENULLDecoder lowLimitPrice() + { + lowLimitPrice.wrap(buffer, offset + 43); + return lowLimitPrice; + } + + public static int maxPriceVariationId() + { + return 1143; + } + + public static int maxPriceVariationSinceVersion() + { + return 0; + } + + public static int maxPriceVariationEncodingOffset() + { + return 51; + } + + public static int maxPriceVariationEncodingLength() + { + return 8; + } + + public static String maxPriceVariationMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder maxPriceVariation = new PRICENULLDecoder(); + + public PRICENULLDecoder maxPriceVariation() + { + maxPriceVariation.wrap(buffer, offset + 51); + return maxPriceVariation; + } + + private final NoMDEntriesDecoder noMDEntries = new NoMDEntriesDecoder(); + + public static long noMDEntriesDecoderId() + { + return 268; + } + + public static int noMDEntriesDecoderSinceVersion() + { + return 0; + } + + public NoMDEntriesDecoder noMDEntries() + { + noMDEntries.wrap(parentMessage, buffer); + return noMDEntries; + } + + public static class NoMDEntriesDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private SnapshotFullRefresh38Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final SnapshotFullRefresh38Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 22; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoMDEntriesDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int mDEntryPxId() + { + return 270; + } + + public static int mDEntryPxSinceVersion() + { + return 0; + } + + public static int mDEntryPxEncodingOffset() + { + return 0; + } + + public static int mDEntryPxEncodingLength() + { + return 8; + } + + public static String mDEntryPxMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICENULLDecoder mDEntryPx = new PRICENULLDecoder(); + + public PRICENULLDecoder mDEntryPx() + { + mDEntryPx.wrap(buffer, offset + 0); + return mDEntryPx; + } + + public static int mDEntrySizeId() + { + return 271; + } + + public static int mDEntrySizeSinceVersion() + { + return 0; + } + + public static int mDEntrySizeEncodingOffset() + { + return 8; + } + + public static int mDEntrySizeEncodingLength() + { + return 4; + } + + public static String mDEntrySizeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static int mDEntrySizeNullValue() + { + return 2147483647; + } + + public static int mDEntrySizeMinValue() + { + return -2147483647; + } + + public static int mDEntrySizeMaxValue() + { + return 2147483647; + } + + public int mDEntrySize() + { + return buffer.getInt(offset + 8, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int numberOfOrdersId() + { + return 346; + } + + public static int numberOfOrdersSinceVersion() + { + return 0; + } + + public static int numberOfOrdersEncodingOffset() + { + return 12; + } + + public static int numberOfOrdersEncodingLength() + { + return 4; + } + + public static String numberOfOrdersMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static int numberOfOrdersNullValue() + { + return 2147483647; + } + + public static int numberOfOrdersMinValue() + { + return -2147483647; + } + + public static int numberOfOrdersMaxValue() + { + return 2147483647; + } + + public int numberOfOrders() + { + return buffer.getInt(offset + 12, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int mDPriceLevelId() + { + return 1023; + } + + public static int mDPriceLevelSinceVersion() + { + return 0; + } + + public static int mDPriceLevelEncodingOffset() + { + return 16; + } + + public static int mDPriceLevelEncodingLength() + { + return 1; + } + + public static String mDPriceLevelMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static byte mDPriceLevelNullValue() + { + return (byte)127; + } + + public static byte mDPriceLevelMinValue() + { + return (byte)-127; + } + + public static byte mDPriceLevelMaxValue() + { + return (byte)127; + } + + public byte mDPriceLevel() + { + return buffer.getByte(offset + 16); + } + + + public static int tradingReferenceDateId() + { + return 5796; + } + + public static int tradingReferenceDateSinceVersion() + { + return 0; + } + + public static int tradingReferenceDateEncodingOffset() + { + return 17; + } + + public static int tradingReferenceDateEncodingLength() + { + return 2; + } + + public static String tradingReferenceDateMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "LocalMktDate"; + } + + return ""; + } + + public static int tradingReferenceDateNullValue() + { + return 65535; + } + + public static int tradingReferenceDateMinValue() + { + return 0; + } + + public static int tradingReferenceDateMaxValue() + { + return 65534; + } + + public int tradingReferenceDate() + { + return (buffer.getShort(offset + 17, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF); + } + + + public static int openCloseSettlFlagId() + { + return 286; + } + + public static int openCloseSettlFlagSinceVersion() + { + return 0; + } + + public static int openCloseSettlFlagEncodingOffset() + { + return 19; + } + + public static int openCloseSettlFlagEncodingLength() + { + return 1; + } + + public static String openCloseSettlFlagMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public OpenCloseSettlFlag openCloseSettlFlag() + { + return OpenCloseSettlFlag.get(((short)(buffer.getByte(offset + 19) & 0xFF))); + } + + + public static int settlPriceTypeId() + { + return 731; + } + + public static int settlPriceTypeSinceVersion() + { + return 0; + } + + public static int settlPriceTypeEncodingOffset() + { + return 20; + } + + public static int settlPriceTypeEncodingLength() + { + return 1; + } + + public static String settlPriceTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "MultipleCharValue"; + } + + return ""; + } + + private final SettlPriceTypeDecoder settlPriceType = new SettlPriceTypeDecoder(); + + public SettlPriceTypeDecoder settlPriceType() + { + settlPriceType.wrap(buffer, offset + 20); + return settlPriceType; + } + + public static int mDEntryTypeId() + { + return 269; + } + + public static int mDEntryTypeSinceVersion() + { + return 0; + } + + public static int mDEntryTypeEncodingOffset() + { + return 21; + } + + public static int mDEntryTypeEncodingLength() + { + return 1; + } + + public static String mDEntryTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public MDEntryType mDEntryType() + { + return MDEntryType.get(buffer.getByte(offset + 21)); + } + + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='MDEntryPx', referencedName='null', description='Market Data entry price', id=270, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Market Data entry price', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("mDEntryPx="); + mDEntryPx().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDEntrySize', referencedName='null', description='Market Data entry quantity', id=271, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='Int32NULL', referencedName='null', description='Market Data entry quantity', id=-1, version=0, deprecated=0, encodedLength=4, offset=8, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=2147483647, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("mDEntrySize="); + builder.append(mDEntrySize()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='NumberOfOrders', referencedName='null', description='Aggregate number of orders at the given price level', id=346, version=0, deprecated=0, encodedLength=0, offset=12, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32NULL', referencedName='null', description='Aggregate number of orders at the given price level', id=-1, version=0, deprecated=0, encodedLength=4, offset=12, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=2147483647, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("numberOfOrders="); + builder.append(numberOfOrders()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDPriceLevel', referencedName='null', description='Aggregate book position', id=1023, version=0, deprecated=0, encodedLength=0, offset=16, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int8NULL', referencedName='null', description='Aggregate book position', id=-1, version=0, deprecated=0, encodedLength=1, offset=16, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=INT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=127, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("mDPriceLevel="); + builder.append(mDPriceLevel()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='TradingReferenceDate', referencedName='null', description='Indicates the date of trade session corresponding to a statistic entry', id=5796, version=0, deprecated=0, encodedLength=0, offset=17, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='LocalMktDate'}} + //Token{signal=ENCODING, name='LocalMktDate', referencedName='null', description='Indicates the date of trade session corresponding to a statistic entry', id=-1, version=0, deprecated=0, encodedLength=2, offset=17, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT16, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=65535, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='LocalMktDate'}} + builder.append("tradingReferenceDate="); + builder.append(tradingReferenceDate()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='OpenCloseSettlFlag', referencedName='null', description='Flag describing Open Price entry', id=286, version=0, deprecated=0, encodedLength=0, offset=19, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='OpenCloseSettlFlag', referencedName='null', description='Flag describing Open Price entry', id=-1, version=0, deprecated=0, encodedLength=1, offset=19, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("openCloseSettlFlag="); + builder.append(openCloseSettlFlag()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SettlPriceType', referencedName='null', description='Bitmap field of eight Boolean type indicators representing settlement price type', id=731, version=0, deprecated=0, encodedLength=0, offset=20, componentTokenCount=10, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='MultipleCharValue'}} + //Token{signal=BEGIN_SET, name='SettlPriceType', referencedName='null', description='Bitmap field of eight Boolean type indicators representing settlement price type', id=-1, version=0, deprecated=0, encodedLength=1, offset=20, componentTokenCount=8, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='MultipleCharValue'}} + builder.append("settlPriceType="); + builder.append(settlPriceType()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDEntryType', referencedName='null', description='Market Data entry type', id=269, version=0, deprecated=0, encodedLength=0, offset=21, componentTokenCount=21, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=BEGIN_ENUM, name='MDEntryType', referencedName='null', description='Market Data entry type', id=-1, version=0, deprecated=0, encodedLength=1, offset=21, componentTokenCount=19, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='char'}} + builder.append("mDEntryType="); + builder.append(mDEntryType()); + builder.append(')'); + return builder; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + final int originalLimit = limit(); + limit(offset + actingBlockLength); + builder.append("[SnapshotFullRefresh38](sbeTemplateId="); + builder.append(TEMPLATE_ID); + builder.append("|sbeSchemaId="); + builder.append(SCHEMA_ID); + builder.append("|sbeSchemaVersion="); + if (parentMessage.actingVersion != SCHEMA_VERSION) + { + builder.append(parentMessage.actingVersion); + builder.append('/'); + } + builder.append(SCHEMA_VERSION); + builder.append("|sbeBlockLength="); + if (actingBlockLength != BLOCK_LENGTH) + { + builder.append(actingBlockLength); + builder.append('/'); + } + builder.append(BLOCK_LENGTH); + builder.append("):"); + //Token{signal=BEGIN_FIELD, name='LastMsgSeqNumProcessed', referencedName='null', description='Sequence number of the last Incremental feed packet processed. This value is used to synchronize the snapshot loop with the real-time feed', id=369, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='SeqNum'}} + //Token{signal=ENCODING, name='uInt32', referencedName='null', description='Sequence number of the last Incremental feed packet processed. This value is used to synchronize the snapshot loop with the real-time feed', id=-1, version=0, deprecated=0, encodedLength=4, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='SeqNum'}} + builder.append("lastMsgSeqNumProcessed="); + builder.append(lastMsgSeqNumProcessed()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='TotNumReports', referencedName='null', description='Total number of messages replayed in the loop', id=911, version=0, deprecated=0, encodedLength=0, offset=4, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt32', referencedName='null', description='Total number of messages replayed in the loop', id=-1, version=0, deprecated=0, encodedLength=4, offset=4, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("totNumReports="); + builder.append(totNumReports()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityID', referencedName='null', description='Security ID', id=48, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='Int32', referencedName='null', description='Security ID', id=-1, version=0, deprecated=0, encodedLength=4, offset=8, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("securityID="); + builder.append(securityID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='RptSeq', referencedName='null', description='Sequence number of the last Market Data entry processed for the instrument', id=83, version=0, deprecated=0, encodedLength=0, offset=12, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='SeqNum'}} + //Token{signal=ENCODING, name='uInt32', referencedName='null', description='Sequence number of the last Market Data entry processed for the instrument', id=-1, version=0, deprecated=0, encodedLength=4, offset=12, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='SeqNum'}} + builder.append("rptSeq="); + builder.append(rptSeq()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='TransactTime', referencedName='null', description='Timestamp of the last event security participated in, sent as number of nanoseconds since Unix epoch', id=60, version=0, deprecated=0, encodedLength=0, offset=16, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + //Token{signal=ENCODING, name='uInt64', referencedName='null', description='Timestamp of the last event security participated in, sent as number of nanoseconds since Unix epoch', id=-1, version=0, deprecated=0, encodedLength=8, offset=16, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + builder.append("transactTime="); + builder.append(transactTime()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='LastUpdateTime', referencedName='null', description='UTC Date and time of last Security Definition add, update or delete on a given Market Data channel', id=779, version=0, deprecated=0, encodedLength=0, offset=24, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + //Token{signal=ENCODING, name='uInt64', referencedName='null', description='UTC Date and time of last Security Definition add, update or delete on a given Market Data channel', id=-1, version=0, deprecated=0, encodedLength=8, offset=24, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + builder.append("lastUpdateTime="); + builder.append(lastUpdateTime()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='TradeDate', referencedName='null', description='Trade session date sent as number of days since Unix epoch', id=75, version=0, deprecated=0, encodedLength=0, offset=32, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='LocalMktDate'}} + //Token{signal=ENCODING, name='LocalMktDate', referencedName='null', description='Trade session date sent as number of days since Unix epoch', id=-1, version=0, deprecated=0, encodedLength=2, offset=32, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT16, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=65535, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='LocalMktDate'}} + builder.append("tradeDate="); + builder.append(tradeDate()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDSecurityTradingStatus', referencedName='null', description='Identifies the current trading state of the instrument', id=1682, version=0, deprecated=0, encodedLength=0, offset=34, componentTokenCount=15, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=BEGIN_ENUM, name='SecurityTradingStatus', referencedName='null', description='Identifies the current trading state of the instrument', id=-1, version=0, deprecated=0, encodedLength=1, offset=34, componentTokenCount=13, encoding=Encoding{presence=REQUIRED, primitiveType=UINT8, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='int'}} + builder.append("mDSecurityTradingStatus="); + builder.append(mDSecurityTradingStatus()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='HighLimitPrice', referencedName='null', description='Upper price threshold for the instrument', id=1149, version=0, deprecated=0, encodedLength=0, offset=35, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Upper price threshold for the instrument', id=-1, version=0, deprecated=0, encodedLength=8, offset=35, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("highLimitPrice="); + highLimitPrice().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='LowLimitPrice', referencedName='null', description='Lower price threshold for the instrument', id=1148, version=0, deprecated=0, encodedLength=0, offset=43, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Lower price threshold for the instrument', id=-1, version=0, deprecated=0, encodedLength=8, offset=43, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("lowLimitPrice="); + lowLimitPrice().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MaxPriceVariation', referencedName='null', description='Differential value for price banding', id=1143, version=0, deprecated=0, encodedLength=0, offset=51, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICENULL', referencedName='null', description='Differential value for price banding', id=-1, version=0, deprecated=0, encodedLength=8, offset=51, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("maxPriceVariation="); + maxPriceVariation().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoMDEntries', referencedName='null', description='Number of entries in Market Data message', id=268, version=0, deprecated=0, encodedLength=22, offset=59, componentTokenCount=61, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noMDEntries=["); + NoMDEntriesDecoder noMDEntries = noMDEntries(); + if (noMDEntries.count() > 0) + { + while (noMDEntries.hasNext()) + { + noMDEntries.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + + limit(originalLimit); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SnapshotFullRefresh38Encoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SnapshotFullRefresh38Encoder.java new file mode 100644 index 0000000..9f45690 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SnapshotFullRefresh38Encoder.java @@ -0,0 +1,649 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.SnapshotFullRefresh38Encoder"}) +@SuppressWarnings("all") +public class SnapshotFullRefresh38Encoder +{ + public static final int BLOCK_LENGTH = 59; + public static final int TEMPLATE_ID = 38; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final SnapshotFullRefresh38Encoder parentMessage = this; + private MutableDirectBuffer buffer; + protected int offset; + protected int limit; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "W"; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public SnapshotFullRefresh38Encoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + limit(offset + BLOCK_LENGTH); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int lastMsgSeqNumProcessedEncodingOffset() + { + return 0; + } + + public static int lastMsgSeqNumProcessedEncodingLength() + { + return 4; + } + + public static long lastMsgSeqNumProcessedNullValue() + { + return 4294967294L; + } + + public static long lastMsgSeqNumProcessedMinValue() + { + return 0L; + } + + public static long lastMsgSeqNumProcessedMaxValue() + { + return 4294967293L; + } + + public SnapshotFullRefresh38Encoder lastMsgSeqNumProcessed(final long value) + { + buffer.putInt(offset + 0, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int totNumReportsEncodingOffset() + { + return 4; + } + + public static int totNumReportsEncodingLength() + { + return 4; + } + + public static long totNumReportsNullValue() + { + return 4294967294L; + } + + public static long totNumReportsMinValue() + { + return 0L; + } + + public static long totNumReportsMaxValue() + { + return 4294967293L; + } + + public SnapshotFullRefresh38Encoder totNumReports(final long value) + { + buffer.putInt(offset + 4, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int securityIDEncodingOffset() + { + return 8; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public SnapshotFullRefresh38Encoder securityID(final int value) + { + buffer.putInt(offset + 8, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int rptSeqEncodingOffset() + { + return 12; + } + + public static int rptSeqEncodingLength() + { + return 4; + } + + public static long rptSeqNullValue() + { + return 4294967294L; + } + + public static long rptSeqMinValue() + { + return 0L; + } + + public static long rptSeqMaxValue() + { + return 4294967293L; + } + + public SnapshotFullRefresh38Encoder rptSeq(final long value) + { + buffer.putInt(offset + 12, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int transactTimeEncodingOffset() + { + return 16; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public SnapshotFullRefresh38Encoder transactTime(final long value) + { + buffer.putLong(offset + 16, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int lastUpdateTimeEncodingOffset() + { + return 24; + } + + public static int lastUpdateTimeEncodingLength() + { + return 8; + } + + public static long lastUpdateTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long lastUpdateTimeMinValue() + { + return 0x0L; + } + + public static long lastUpdateTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public SnapshotFullRefresh38Encoder lastUpdateTime(final long value) + { + buffer.putLong(offset + 24, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int tradeDateEncodingOffset() + { + return 32; + } + + public static int tradeDateEncodingLength() + { + return 2; + } + + public static int tradeDateNullValue() + { + return 65535; + } + + public static int tradeDateMinValue() + { + return 0; + } + + public static int tradeDateMaxValue() + { + return 65534; + } + + public SnapshotFullRefresh38Encoder tradeDate(final int value) + { + buffer.putShort(offset + 32, (short)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int mDSecurityTradingStatusEncodingOffset() + { + return 34; + } + + public static int mDSecurityTradingStatusEncodingLength() + { + return 1; + } + + public SnapshotFullRefresh38Encoder mDSecurityTradingStatus(final SecurityTradingStatus value) + { + buffer.putByte(offset + 34, (byte)value.value()); + return this; + } + + public static int highLimitPriceEncodingOffset() + { + return 35; + } + + public static int highLimitPriceEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder highLimitPrice = new PRICENULLEncoder(); + + public PRICENULLEncoder highLimitPrice() + { + highLimitPrice.wrap(buffer, offset + 35); + return highLimitPrice; + } + + public static int lowLimitPriceEncodingOffset() + { + return 43; + } + + public static int lowLimitPriceEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder lowLimitPrice = new PRICENULLEncoder(); + + public PRICENULLEncoder lowLimitPrice() + { + lowLimitPrice.wrap(buffer, offset + 43); + return lowLimitPrice; + } + + public static int maxPriceVariationEncodingOffset() + { + return 51; + } + + public static int maxPriceVariationEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder maxPriceVariation = new PRICENULLEncoder(); + + public PRICENULLEncoder maxPriceVariation() + { + maxPriceVariation.wrap(buffer, offset + 51); + return maxPriceVariation; + } + + private final NoMDEntriesEncoder noMDEntries = new NoMDEntriesEncoder(); + + public static long noMDEntriesId() + { + return 268; + } + + public NoMDEntriesEncoder noMDEntriesCount(final int count) + { + noMDEntries.wrap(parentMessage, buffer, count); + return noMDEntries; + } + + public static class NoMDEntriesEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private SnapshotFullRefresh38Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final SnapshotFullRefresh38Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)22); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 22; + } + + public NoMDEntriesEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int mDEntryPxEncodingOffset() + { + return 0; + } + + public static int mDEntryPxEncodingLength() + { + return 8; + } + + private final PRICENULLEncoder mDEntryPx = new PRICENULLEncoder(); + + public PRICENULLEncoder mDEntryPx() + { + mDEntryPx.wrap(buffer, offset + 0); + return mDEntryPx; + } + + public static int mDEntrySizeEncodingOffset() + { + return 8; + } + + public static int mDEntrySizeEncodingLength() + { + return 4; + } + + public static int mDEntrySizeNullValue() + { + return 2147483647; + } + + public static int mDEntrySizeMinValue() + { + return -2147483647; + } + + public static int mDEntrySizeMaxValue() + { + return 2147483647; + } + + public NoMDEntriesEncoder mDEntrySize(final int value) + { + buffer.putInt(offset + 8, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int numberOfOrdersEncodingOffset() + { + return 12; + } + + public static int numberOfOrdersEncodingLength() + { + return 4; + } + + public static int numberOfOrdersNullValue() + { + return 2147483647; + } + + public static int numberOfOrdersMinValue() + { + return -2147483647; + } + + public static int numberOfOrdersMaxValue() + { + return 2147483647; + } + + public NoMDEntriesEncoder numberOfOrders(final int value) + { + buffer.putInt(offset + 12, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int mDPriceLevelEncodingOffset() + { + return 16; + } + + public static int mDPriceLevelEncodingLength() + { + return 1; + } + + public static byte mDPriceLevelNullValue() + { + return (byte)127; + } + + public static byte mDPriceLevelMinValue() + { + return (byte)-127; + } + + public static byte mDPriceLevelMaxValue() + { + return (byte)127; + } + + public NoMDEntriesEncoder mDPriceLevel(final byte value) + { + buffer.putByte(offset + 16, value); + return this; + } + + + public static int tradingReferenceDateEncodingOffset() + { + return 17; + } + + public static int tradingReferenceDateEncodingLength() + { + return 2; + } + + public static int tradingReferenceDateNullValue() + { + return 65535; + } + + public static int tradingReferenceDateMinValue() + { + return 0; + } + + public static int tradingReferenceDateMaxValue() + { + return 65534; + } + + public NoMDEntriesEncoder tradingReferenceDate(final int value) + { + buffer.putShort(offset + 17, (short)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int openCloseSettlFlagEncodingOffset() + { + return 19; + } + + public static int openCloseSettlFlagEncodingLength() + { + return 1; + } + + public NoMDEntriesEncoder openCloseSettlFlag(final OpenCloseSettlFlag value) + { + buffer.putByte(offset + 19, (byte)value.value()); + return this; + } + + public static int settlPriceTypeEncodingOffset() + { + return 20; + } + + public static int settlPriceTypeEncodingLength() + { + return 1; + } + + private final SettlPriceTypeEncoder settlPriceType = new SettlPriceTypeEncoder(); + + public SettlPriceTypeEncoder settlPriceType() + { + settlPriceType.wrap(buffer, offset + 20); + return settlPriceType; + } + + public static int mDEntryTypeEncodingOffset() + { + return 21; + } + + public static int mDEntryTypeEncodingLength() + { + return 1; + } + + public NoMDEntriesEncoder mDEntryType(final MDEntryType value) + { + buffer.putByte(offset + 21, value.value()); + return this; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + SnapshotFullRefresh38Decoder writer = new SnapshotFullRefresh38Decoder(); + writer.wrap(buffer, offset, BLOCK_LENGTH, SCHEMA_VERSION); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SnapshotFullRefreshOrderBook44Decoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SnapshotFullRefreshOrderBook44Decoder.java new file mode 100644 index 0000000..85e9e82 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SnapshotFullRefreshOrderBook44Decoder.java @@ -0,0 +1,846 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.SnapshotFullRefreshOrderBook44Decoder"}) +@SuppressWarnings("all") +public class SnapshotFullRefreshOrderBook44Decoder +{ + public static final int BLOCK_LENGTH = 28; + public static final int TEMPLATE_ID = 44; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final SnapshotFullRefreshOrderBook44Decoder parentMessage = this; + private DirectBuffer buffer; + protected int offset; + protected int limit; + protected int actingBlockLength; + protected int actingVersion; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "W"; + } + + public DirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public SnapshotFullRefreshOrderBook44Decoder wrap( + final DirectBuffer buffer, final int offset, final int actingBlockLength, final int actingVersion) + { + this.buffer = buffer; + this.offset = offset; + this.actingBlockLength = actingBlockLength; + this.actingVersion = actingVersion; + limit(offset + actingBlockLength); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int lastMsgSeqNumProcessedId() + { + return 369; + } + + public static int lastMsgSeqNumProcessedSinceVersion() + { + return 0; + } + + public static int lastMsgSeqNumProcessedEncodingOffset() + { + return 0; + } + + public static int lastMsgSeqNumProcessedEncodingLength() + { + return 4; + } + + public static String lastMsgSeqNumProcessedMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "SeqNum"; + } + + return ""; + } + + public static long lastMsgSeqNumProcessedNullValue() + { + return 4294967294L; + } + + public static long lastMsgSeqNumProcessedMinValue() + { + return 0L; + } + + public static long lastMsgSeqNumProcessedMaxValue() + { + return 4294967293L; + } + + public long lastMsgSeqNumProcessed() + { + return (buffer.getInt(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + public static int totNumReportsId() + { + return 911; + } + + public static int totNumReportsSinceVersion() + { + return 0; + } + + public static int totNumReportsEncodingOffset() + { + return 4; + } + + public static int totNumReportsEncodingLength() + { + return 4; + } + + public static String totNumReportsMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static long totNumReportsNullValue() + { + return 4294967294L; + } + + public static long totNumReportsMinValue() + { + return 0L; + } + + public static long totNumReportsMaxValue() + { + return 4294967293L; + } + + public long totNumReports() + { + return (buffer.getInt(offset + 4, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + public static int securityIDId() + { + return 48; + } + + public static int securityIDSinceVersion() + { + return 0; + } + + public static int securityIDEncodingOffset() + { + return 8; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static String securityIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "String"; + } + + return ""; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public int securityID() + { + return buffer.getInt(offset + 8, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int noChunksId() + { + return 37709; + } + + public static int noChunksSinceVersion() + { + return 0; + } + + public static int noChunksEncodingOffset() + { + return 12; + } + + public static int noChunksEncodingLength() + { + return 4; + } + + public static String noChunksMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static long noChunksNullValue() + { + return 4294967294L; + } + + public static long noChunksMinValue() + { + return 0L; + } + + public static long noChunksMaxValue() + { + return 4294967293L; + } + + public long noChunks() + { + return (buffer.getInt(offset + 12, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + public static int currentChunkId() + { + return 37710; + } + + public static int currentChunkSinceVersion() + { + return 0; + } + + public static int currentChunkEncodingOffset() + { + return 16; + } + + public static int currentChunkEncodingLength() + { + return 4; + } + + public static String currentChunkMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static long currentChunkNullValue() + { + return 4294967294L; + } + + public static long currentChunkMinValue() + { + return 0L; + } + + public static long currentChunkMaxValue() + { + return 4294967293L; + } + + public long currentChunk() + { + return (buffer.getInt(offset + 16, java.nio.ByteOrder.LITTLE_ENDIAN) & 0xFFFF_FFFFL); + } + + + public static int transactTimeId() + { + return 60; + } + + public static int transactTimeSinceVersion() + { + return 0; + } + + public static int transactTimeEncodingOffset() + { + return 20; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static String transactTimeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "UTCTimestamp"; + } + + return ""; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long transactTime() + { + return buffer.getLong(offset + 20, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + private final NoMDEntriesDecoder noMDEntries = new NoMDEntriesDecoder(); + + public static long noMDEntriesDecoderId() + { + return 268; + } + + public static int noMDEntriesDecoderSinceVersion() + { + return 0; + } + + public NoMDEntriesDecoder noMDEntries() + { + noMDEntries.wrap(parentMessage, buffer); + return noMDEntries; + } + + public static class NoMDEntriesDecoder + implements Iterable, java.util.Iterator + { + private static final int HEADER_SIZE = 3; + private final GroupSizeDecoder dimensions = new GroupSizeDecoder(); + private SnapshotFullRefreshOrderBook44Decoder parentMessage; + private DirectBuffer buffer; + private int count; + private int index; + private int offset; + private int blockLength; + + public void wrap( + final SnapshotFullRefreshOrderBook44Decoder parentMessage, final DirectBuffer buffer) + { + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + blockLength = dimensions.blockLength(); + count = dimensions.numInGroup(); + index = -1; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 29; + } + + public int actingBlockLength() + { + return blockLength; + } + + public int count() + { + return count; + } + + public java.util.Iterator iterator() + { + return this; + } + + public void remove() + { + throw new UnsupportedOperationException(); + } + + public boolean hasNext() + { + return (index + 1) < count; + } + + public NoMDEntriesDecoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + blockLength); + ++index; + + return this; + } + + public static int orderIDId() + { + return 37; + } + + public static int orderIDSinceVersion() + { + return 0; + } + + public static int orderIDEncodingOffset() + { + return 0; + } + + public static int orderIDEncodingLength() + { + return 8; + } + + public static String orderIDMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static long orderIDNullValue() + { + return 0xffffffffffffffffL; + } + + public static long orderIDMinValue() + { + return 0x0L; + } + + public static long orderIDMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long orderID() + { + return buffer.getLong(offset + 0, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int mDOrderPriorityId() + { + return 37707; + } + + public static int mDOrderPrioritySinceVersion() + { + return 0; + } + + public static int mDOrderPriorityEncodingOffset() + { + return 8; + } + + public static int mDOrderPriorityEncodingLength() + { + return 8; + } + + public static String mDOrderPriorityMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "int"; + } + + return ""; + } + + public static long mDOrderPriorityNullValue() + { + return 0xffffffffffffffffL; + } + + public static long mDOrderPriorityMinValue() + { + return 0x0L; + } + + public static long mDOrderPriorityMaxValue() + { + return 0xfffffffffffffffeL; + } + + public long mDOrderPriority() + { + return buffer.getLong(offset + 8, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int mDEntryPxId() + { + return 270; + } + + public static int mDEntryPxSinceVersion() + { + return 0; + } + + public static int mDEntryPxEncodingOffset() + { + return 16; + } + + public static int mDEntryPxEncodingLength() + { + return 8; + } + + public static String mDEntryPxMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Price"; + } + + return ""; + } + + private final PRICEDecoder mDEntryPx = new PRICEDecoder(); + + public PRICEDecoder mDEntryPx() + { + mDEntryPx.wrap(buffer, offset + 16); + return mDEntryPx; + } + + public static int mDDisplayQtyId() + { + return 37706; + } + + public static int mDDisplayQtySinceVersion() + { + return 0; + } + + public static int mDDisplayQtyEncodingOffset() + { + return 24; + } + + public static int mDDisplayQtyEncodingLength() + { + return 4; + } + + public static String mDDisplayQtyMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "Qty"; + } + + return ""; + } + + public static int mDDisplayQtyNullValue() + { + return -2147483648; + } + + public static int mDDisplayQtyMinValue() + { + return -2147483647; + } + + public static int mDDisplayQtyMaxValue() + { + return 2147483647; + } + + public int mDDisplayQty() + { + return buffer.getInt(offset + 24, java.nio.ByteOrder.LITTLE_ENDIAN); + } + + + public static int mDEntryTypeId() + { + return 269; + } + + public static int mDEntryTypeSinceVersion() + { + return 0; + } + + public static int mDEntryTypeEncodingOffset() + { + return 28; + } + + public static int mDEntryTypeEncodingLength() + { + return 1; + } + + public static String mDEntryTypeMetaAttribute(final MetaAttribute metaAttribute) + { + switch (metaAttribute) + { + case EPOCH: return "unix"; + case TIME_UNIT: return "nanosecond"; + case SEMANTIC_TYPE: return "char"; + } + + return ""; + } + + public MDEntryTypeBook mDEntryType() + { + return MDEntryTypeBook.get(buffer.getByte(offset + 28)); + } + + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + builder.append('('); + //Token{signal=BEGIN_FIELD, name='OrderID', referencedName='null', description='Unique Order ID', id=37, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt64', referencedName='null', description='Unique Order ID', id=-1, version=0, deprecated=0, encodedLength=8, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("orderID="); + builder.append(orderID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDOrderPriority', referencedName='null', description='Order priority for execution on the order book', id=37707, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt64NULL', referencedName='null', description='Order priority for execution on the order book', id=-1, version=0, deprecated=0, encodedLength=8, offset=8, componentTokenCount=1, encoding=Encoding{presence=OPTIONAL, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=-1, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("mDOrderPriority="); + builder.append(mDOrderPriority()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDEntryPx', referencedName='null', description='Order Price', id=270, version=0, deprecated=0, encodedLength=0, offset=16, componentTokenCount=6, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Price'}} + //Token{signal=BEGIN_COMPOSITE, name='PRICE', referencedName='null', description='Order Price', id=-1, version=0, deprecated=0, encodedLength=8, offset=16, componentTokenCount=4, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='Price'}} + builder.append("mDEntryPx="); + mDEntryPx().appendTo(builder); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDDisplayQty', referencedName='null', description='Visible order qty', id=37706, version=0, deprecated=0, encodedLength=0, offset=24, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + //Token{signal=ENCODING, name='Int32', referencedName='null', description='Visible order qty', id=-1, version=0, deprecated=0, encodedLength=4, offset=24, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='Qty'}} + builder.append("mDDisplayQty="); + builder.append(mDDisplayQty()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='MDEntryType', referencedName='null', description='Market Data entry type', id=269, version=0, deprecated=0, encodedLength=0, offset=28, componentTokenCount=9, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='char'}} + //Token{signal=BEGIN_ENUM, name='MDEntryTypeBook', referencedName='null', description='Market Data entry type', id=-1, version=0, deprecated=0, encodedLength=1, offset=28, componentTokenCount=7, encoding=Encoding{presence=REQUIRED, primitiveType=CHAR, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='char'}} + builder.append("mDEntryType="); + builder.append(mDEntryType()); + builder.append(')'); + return builder; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + final int originalLimit = limit(); + limit(offset + actingBlockLength); + builder.append("[SnapshotFullRefreshOrderBook44](sbeTemplateId="); + builder.append(TEMPLATE_ID); + builder.append("|sbeSchemaId="); + builder.append(SCHEMA_ID); + builder.append("|sbeSchemaVersion="); + if (parentMessage.actingVersion != SCHEMA_VERSION) + { + builder.append(parentMessage.actingVersion); + builder.append('/'); + } + builder.append(SCHEMA_VERSION); + builder.append("|sbeBlockLength="); + if (actingBlockLength != BLOCK_LENGTH) + { + builder.append(actingBlockLength); + builder.append('/'); + } + builder.append(BLOCK_LENGTH); + builder.append("):"); + //Token{signal=BEGIN_FIELD, name='LastMsgSeqNumProcessed', referencedName='null', description='Sequence number of the last Incremental feed packet processed. This value is used to synchronize the snapshot loop with the real-time feed', id=369, version=0, deprecated=0, encodedLength=0, offset=0, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='SeqNum'}} + //Token{signal=ENCODING, name='uInt32', referencedName='null', description='Sequence number of the last Incremental feed packet processed. This value is used to synchronize the snapshot loop with the real-time feed', id=-1, version=0, deprecated=0, encodedLength=4, offset=0, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='SeqNum'}} + builder.append("lastMsgSeqNumProcessed="); + builder.append(lastMsgSeqNumProcessed()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='TotNumReports', referencedName='null', description='Total number of instruments in the replayed loop', id=911, version=0, deprecated=0, encodedLength=0, offset=4, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt32', referencedName='null', description='Total number of instruments in the replayed loop', id=-1, version=0, deprecated=0, encodedLength=4, offset=4, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("totNumReports="); + builder.append(totNumReports()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='SecurityID', referencedName='null', description='Security ID', id=48, version=0, deprecated=0, encodedLength=0, offset=8, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + //Token{signal=ENCODING, name='Int32', referencedName='null', description='Security ID', id=-1, version=0, deprecated=0, encodedLength=4, offset=8, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=INT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='String'}} + builder.append("securityID="); + builder.append(securityID()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='NoChunks', referencedName='null', description='Total number of packets that constitutes a single instrument order book', id=37709, version=0, deprecated=0, encodedLength=0, offset=12, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt32', referencedName='null', description='Total number of packets that constitutes a single instrument order book', id=-1, version=0, deprecated=0, encodedLength=4, offset=12, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("noChunks="); + builder.append(noChunks()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='CurrentChunk', referencedName='null', description='Chunk sequence', id=37710, version=0, deprecated=0, encodedLength=0, offset=16, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + //Token{signal=ENCODING, name='uInt32', referencedName='null', description='Chunk sequence', id=-1, version=0, deprecated=0, encodedLength=4, offset=16, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT32, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='int'}} + builder.append("currentChunk="); + builder.append(currentChunk()); + builder.append('|'); + //Token{signal=BEGIN_FIELD, name='TransactTime', referencedName='null', description='Timestamp of the last event security participated in, sent as number of nanoseconds since Unix epoch', id=60, version=0, deprecated=0, encodedLength=0, offset=20, componentTokenCount=3, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + //Token{signal=ENCODING, name='uInt64', referencedName='null', description='Timestamp of the last event security participated in, sent as number of nanoseconds since Unix epoch', id=-1, version=0, deprecated=0, encodedLength=8, offset=20, componentTokenCount=1, encoding=Encoding{presence=REQUIRED, primitiveType=UINT64, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='UTF-8', epoch='unix', timeUnit=nanosecond, semanticType='UTCTimestamp'}} + builder.append("transactTime="); + builder.append(transactTime()); + builder.append('|'); + //Token{signal=BEGIN_GROUP, name='NoMDEntries', referencedName='null', description='Number of entries in Market Data message', id=268, version=0, deprecated=0, encodedLength=29, offset=28, componentTokenCount=30, encoding=Encoding{presence=REQUIRED, primitiveType=null, byteOrder=LITTLE_ENDIAN, minValue=null, maxValue=null, nullValue=null, constValue=null, characterEncoding='null', epoch='null', timeUnit=null, semanticType='null'}} + builder.append("noMDEntries=["); + NoMDEntriesDecoder noMDEntries = noMDEntries(); + if (noMDEntries.count() > 0) + { + while (noMDEntries.hasNext()) + { + noMDEntries.next().appendTo(builder); + builder.append(','); + } + builder.setLength(builder.length() - 1); + } + builder.append(']'); + + limit(originalLimit); + + return builder; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SnapshotFullRefreshOrderBook44Encoder.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SnapshotFullRefreshOrderBook44Encoder.java new file mode 100644 index 0000000..e95ffff --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/gen/SnapshotFullRefreshOrderBook44Encoder.java @@ -0,0 +1,481 @@ +/* Generated SBE (Simple Binary Encoding) message codec */ +package com.epam.cme.mdp3.test.gen; + +import org.agrona.MutableDirectBuffer; +import org.agrona.DirectBuffer; + +@javax.annotation.Generated(value = {"com.epam.cme.mdp3.test.gen.SnapshotFullRefreshOrderBook44Encoder"}) +@SuppressWarnings("all") +public class SnapshotFullRefreshOrderBook44Encoder +{ + public static final int BLOCK_LENGTH = 28; + public static final int TEMPLATE_ID = 44; + public static final int SCHEMA_ID = 1; + public static final int SCHEMA_VERSION = 8; + + private final SnapshotFullRefreshOrderBook44Encoder parentMessage = this; + private MutableDirectBuffer buffer; + protected int offset; + protected int limit; + + public int sbeBlockLength() + { + return BLOCK_LENGTH; + } + + public int sbeTemplateId() + { + return TEMPLATE_ID; + } + + public int sbeSchemaId() + { + return SCHEMA_ID; + } + + public int sbeSchemaVersion() + { + return SCHEMA_VERSION; + } + + public String sbeSemanticType() + { + return "W"; + } + + public MutableDirectBuffer buffer() + { + return buffer; + } + + public int offset() + { + return offset; + } + + public SnapshotFullRefreshOrderBook44Encoder wrap(final MutableDirectBuffer buffer, final int offset) + { + this.buffer = buffer; + this.offset = offset; + limit(offset + BLOCK_LENGTH); + + return this; + } + + public int encodedLength() + { + return limit - offset; + } + + public int limit() + { + return limit; + } + + public void limit(final int limit) + { + this.limit = limit; + } + + public static int lastMsgSeqNumProcessedEncodingOffset() + { + return 0; + } + + public static int lastMsgSeqNumProcessedEncodingLength() + { + return 4; + } + + public static long lastMsgSeqNumProcessedNullValue() + { + return 4294967294L; + } + + public static long lastMsgSeqNumProcessedMinValue() + { + return 0L; + } + + public static long lastMsgSeqNumProcessedMaxValue() + { + return 4294967293L; + } + + public SnapshotFullRefreshOrderBook44Encoder lastMsgSeqNumProcessed(final long value) + { + buffer.putInt(offset + 0, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int totNumReportsEncodingOffset() + { + return 4; + } + + public static int totNumReportsEncodingLength() + { + return 4; + } + + public static long totNumReportsNullValue() + { + return 4294967294L; + } + + public static long totNumReportsMinValue() + { + return 0L; + } + + public static long totNumReportsMaxValue() + { + return 4294967293L; + } + + public SnapshotFullRefreshOrderBook44Encoder totNumReports(final long value) + { + buffer.putInt(offset + 4, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int securityIDEncodingOffset() + { + return 8; + } + + public static int securityIDEncodingLength() + { + return 4; + } + + public static int securityIDNullValue() + { + return -2147483648; + } + + public static int securityIDMinValue() + { + return -2147483647; + } + + public static int securityIDMaxValue() + { + return 2147483647; + } + + public SnapshotFullRefreshOrderBook44Encoder securityID(final int value) + { + buffer.putInt(offset + 8, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int noChunksEncodingOffset() + { + return 12; + } + + public static int noChunksEncodingLength() + { + return 4; + } + + public static long noChunksNullValue() + { + return 4294967294L; + } + + public static long noChunksMinValue() + { + return 0L; + } + + public static long noChunksMaxValue() + { + return 4294967293L; + } + + public SnapshotFullRefreshOrderBook44Encoder noChunks(final long value) + { + buffer.putInt(offset + 12, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int currentChunkEncodingOffset() + { + return 16; + } + + public static int currentChunkEncodingLength() + { + return 4; + } + + public static long currentChunkNullValue() + { + return 4294967294L; + } + + public static long currentChunkMinValue() + { + return 0L; + } + + public static long currentChunkMaxValue() + { + return 4294967293L; + } + + public SnapshotFullRefreshOrderBook44Encoder currentChunk(final long value) + { + buffer.putInt(offset + 16, (int)value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int transactTimeEncodingOffset() + { + return 20; + } + + public static int transactTimeEncodingLength() + { + return 8; + } + + public static long transactTimeNullValue() + { + return 0xffffffffffffffffL; + } + + public static long transactTimeMinValue() + { + return 0x0L; + } + + public static long transactTimeMaxValue() + { + return 0xfffffffffffffffeL; + } + + public SnapshotFullRefreshOrderBook44Encoder transactTime(final long value) + { + buffer.putLong(offset + 20, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + private final NoMDEntriesEncoder noMDEntries = new NoMDEntriesEncoder(); + + public static long noMDEntriesId() + { + return 268; + } + + public NoMDEntriesEncoder noMDEntriesCount(final int count) + { + noMDEntries.wrap(parentMessage, buffer, count); + return noMDEntries; + } + + public static class NoMDEntriesEncoder + { + private static final int HEADER_SIZE = 3; + private final GroupSizeEncoder dimensions = new GroupSizeEncoder(); + private SnapshotFullRefreshOrderBook44Encoder parentMessage; + private MutableDirectBuffer buffer; + private int count; + private int index; + private int offset; + + public void wrap( + final SnapshotFullRefreshOrderBook44Encoder parentMessage, final MutableDirectBuffer buffer, final int count) + { + if (count < 0 || count > 254) + { + throw new IllegalArgumentException("count outside allowed range: count=" + count); + } + + this.parentMessage = parentMessage; + this.buffer = buffer; + dimensions.wrap(buffer, parentMessage.limit()); + dimensions.blockLength((int)29); + dimensions.numInGroup((short)count); + index = -1; + this.count = count; + parentMessage.limit(parentMessage.limit() + HEADER_SIZE); + } + + public static int sbeHeaderSize() + { + return HEADER_SIZE; + } + + public static int sbeBlockLength() + { + return 29; + } + + public NoMDEntriesEncoder next() + { + if (index + 1 >= count) + { + throw new java.util.NoSuchElementException(); + } + + offset = parentMessage.limit(); + parentMessage.limit(offset + sbeBlockLength()); + ++index; + + return this; + } + + public static int orderIDEncodingOffset() + { + return 0; + } + + public static int orderIDEncodingLength() + { + return 8; + } + + public static long orderIDNullValue() + { + return 0xffffffffffffffffL; + } + + public static long orderIDMinValue() + { + return 0x0L; + } + + public static long orderIDMaxValue() + { + return 0xfffffffffffffffeL; + } + + public NoMDEntriesEncoder orderID(final long value) + { + buffer.putLong(offset + 0, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int mDOrderPriorityEncodingOffset() + { + return 8; + } + + public static int mDOrderPriorityEncodingLength() + { + return 8; + } + + public static long mDOrderPriorityNullValue() + { + return 0xffffffffffffffffL; + } + + public static long mDOrderPriorityMinValue() + { + return 0x0L; + } + + public static long mDOrderPriorityMaxValue() + { + return 0xfffffffffffffffeL; + } + + public NoMDEntriesEncoder mDOrderPriority(final long value) + { + buffer.putLong(offset + 8, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int mDEntryPxEncodingOffset() + { + return 16; + } + + public static int mDEntryPxEncodingLength() + { + return 8; + } + + private final PRICEEncoder mDEntryPx = new PRICEEncoder(); + + public PRICEEncoder mDEntryPx() + { + mDEntryPx.wrap(buffer, offset + 16); + return mDEntryPx; + } + + public static int mDDisplayQtyEncodingOffset() + { + return 24; + } + + public static int mDDisplayQtyEncodingLength() + { + return 4; + } + + public static int mDDisplayQtyNullValue() + { + return -2147483648; + } + + public static int mDDisplayQtyMinValue() + { + return -2147483647; + } + + public static int mDDisplayQtyMaxValue() + { + return 2147483647; + } + + public NoMDEntriesEncoder mDDisplayQty(final int value) + { + buffer.putInt(offset + 24, value, java.nio.ByteOrder.LITTLE_ENDIAN); + return this; + } + + + public static int mDEntryTypeEncodingOffset() + { + return 28; + } + + public static int mDEntryTypeEncodingLength() + { + return 1; + } + + public NoMDEntriesEncoder mDEntryType(final MDEntryTypeBook value) + { + buffer.putByte(offset + 28, value.value()); + return this; + } + } + + + public String toString() + { + return appendTo(new StringBuilder(100)).toString(); + } + + public StringBuilder appendTo(final StringBuilder builder) + { + SnapshotFullRefreshOrderBook44Decoder writer = new SnapshotFullRefreshOrderBook44Decoder(); + writer.wrap(buffer, offset, BLOCK_LENGTH, SCHEMA_VERSION); + + return writer.appendTo(builder); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/AbstractMktDataHandler.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/AbstractMktDataHandler.java new file mode 100644 index 0000000..db13feb --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/AbstractMktDataHandler.java @@ -0,0 +1,50 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.test.mbpbook; + + +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + +public abstract class AbstractMktDataHandler { + protected int securityId; + protected int subscriptionFlags; + private Lock lock = new ReentrantLock(); + + public AbstractMktDataHandler(final int securityId, final int subscriptionFlags) { + this.securityId = securityId; + this.subscriptionFlags = subscriptionFlags; + } + + public abstract void clear(); + + public void lock() { + this.lock.lock(); + } + + public void unlock() { + this.lock.unlock(); + } + + public int getSecurityId() { + return securityId; + } + + public int getSubscriptionFlags() { + return subscriptionFlags; + } + + public void setSubscriptionFlags(int subscriptionFlags) { + this.subscriptionFlags = subscriptionFlags; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/AbstractOrderBookHandler.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/AbstractOrderBookHandler.java new file mode 100644 index 0000000..0162899 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/AbstractOrderBookHandler.java @@ -0,0 +1,76 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.test.mbpbook; + +import com.epam.cme.mdp3.FieldSet; +import com.epam.cme.mdp3.mktdata.enums.MDUpdateAction; + +abstract class AbstractOrderBookHandler extends AbstractMktDataHandler { +// boolean refreshedTop = false; +// boolean refreshedBook = false; + + AbstractOrderBookHandler(final int securityId, final int subscriptionFlags) { + super(securityId, subscriptionFlags); + } + + @Override + abstract public void clear(); + +// public boolean isRefreshedTop() { +// return refreshedTop; +// } +// +// public void logRefreshedTop() { +// this.refreshedTop = true; +// } +// +// public void resetTransaction() { +// this.refreshedTop = false; +// } + + protected abstract void modifyEntry(final T[] levelEntries, final int level, final FieldSet fieldSet); + + protected abstract void deleteEntry(final T[] levelEntries, final int level); + + protected abstract void deleteFrom(final T[] levelEntries, final int n); + + protected abstract void deleteThru(final T[] levelEntries); + + protected abstract void insertEntry(final T[] levelEntries, final int level, final FieldSet fieldSet); + + + protected void handleIncrementRefresh(final T[] levelEntries, final int level, + final MDUpdateAction updateAction, final FieldSet incrementEntry) { + switch (updateAction) { + case Overlay: + case Change: + modifyEntry(levelEntries, level, incrementEntry); + break; + case New: + insertEntry(levelEntries, level, incrementEntry); + break; + case Delete: + deleteEntry(levelEntries, level); + break; + case DeleteFrom: + deleteFrom(levelEntries, level); + break; + case DeleteThru: + deleteThru(levelEntries); + break; + default: + throw new IllegalStateException(); + } + } + +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/ImpliedBookPriceEntry.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/ImpliedBookPriceEntry.java new file mode 100644 index 0000000..76d7ce5 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/ImpliedBookPriceEntry.java @@ -0,0 +1,45 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.test.mbpbook; + +import com.epam.cme.mdp3.FieldSet; + +public class ImpliedBookPriceEntry implements ImpliedBookPriceLevel { + protected int qty; + protected final Price price = new Price(); + + @Override + public int getQuantity() { + return qty; + } + + @Override + public Price getPrice() { + return price; + } + + public void clear() { + qty = 0; + price.setNull(); + } + + public void refreshFromAnotherEntry(final ImpliedBookPriceEntry bookEntry) { + this.qty = bookEntry.qty; + this.price.setMantissa(bookEntry.getPrice().getMantissa()); + } + + public void refreshFromMessage(final FieldSet fieldSet) { + this.qty = fieldSet.getInt32(271); + this.price.setMantissa(fieldSet.getInt64(270)); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/ImpliedBookPriceLevel.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/ImpliedBookPriceLevel.java new file mode 100644 index 0000000..a592517 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/ImpliedBookPriceLevel.java @@ -0,0 +1,19 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.test.mbpbook; + +public interface ImpliedBookPriceLevel { + int getQuantity(); + + Price getPrice(); +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/MultipleDepthBookHandler.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/MultipleDepthBookHandler.java new file mode 100644 index 0000000..83c5a73 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/MultipleDepthBookHandler.java @@ -0,0 +1,137 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.test.mbpbook; + +import com.epam.cme.mdp3.FieldSet; +import com.epam.cme.mdp3.MdEventFlags; +import com.epam.cme.mdp3.MdpGroup; +import com.epam.cme.mdp3.mktdata.enums.MDUpdateAction; + +public class MultipleDepthBookHandler extends AbstractOrderBookHandler implements OrderBook { +// private boolean subscribedToTop = false; +// private boolean subscribedToEntireBook = false; + private final OrderBookPriceEntry[] bidLevels; + private final OrderBookPriceEntry[] offerLevels; + private final byte depth; + + public MultipleDepthBookHandler(final int securityId, final int subscriptionFlags, final byte depth) { + super(securityId, subscriptionFlags); + setSubscriptionFlags(subscriptionFlags); + this.depth = depth; + bidLevels = new OrderBookPriceEntry[depth]; + offerLevels = new OrderBookPriceEntry[depth]; + init(); + } + + private void init() { + for (int i = 0; i < depth; i++) { + bidLevels[i] = new OrderBookPriceEntry(); + offerLevels[i] = new OrderBookPriceEntry(); + } + } + + @Override + public void clear() { + for (int i = 0; i < depth; i++) { + bidLevels[i].clear(); + offerLevels[i].clear(); + } +// refreshedTop = false; +// refreshedBook = false; + } + + @Override + public void setSubscriptionFlags(final int subscriptionFlags) { + super.setSubscriptionFlags(subscriptionFlags); +// this.subscribedToEntireBook = MdEventFlags.hasBook(this.subscriptionFlags); +// this.subscribedToTop = MdEventFlags.hasTop(this.subscriptionFlags); + } + + public void handleSnapshotBidEntry(final MdpGroup snptGroup) { + byte level = snptGroup.getInt8(1023); + if (level > depth) return; + final OrderBookPriceEntry bookPriceLevel = (OrderBookPriceEntry) getBid(level); + bookPriceLevel.refreshBookFromMessage(snptGroup); + } + + public void handleSnapshotOfferEntry(final MdpGroup snptGroup) { + byte level = snptGroup.getInt8(1023); + if (level > depth) return; + final OrderBookPriceEntry bookPriceLevel = (OrderBookPriceEntry) getOffer(level); + bookPriceLevel.refreshBookFromMessage(snptGroup); + } + + public void handleIncrementBidEntry(final FieldSet incrementEntry) { + final byte level = (byte) incrementEntry.getUInt8(1023); + if (level > depth) return; + final MDUpdateAction updateAction = MDUpdateAction.fromFIX(incrementEntry.getUInt8(279)); + handleIncrementRefresh(bidLevels, level, updateAction, incrementEntry); + } + + public void handleIncrementOfferEntry(final FieldSet incrementEntry) { + final byte level = (byte) incrementEntry.getUInt8(1023); + if (level > depth) return; + final MDUpdateAction updateAction = MDUpdateAction.fromFIX(incrementEntry.getUInt8(279)); + handleIncrementRefresh(offerLevels, level, updateAction, incrementEntry); + } + + protected void deleteEntry(final OrderBookPriceEntry[] levelEntries, final int level) { + for (int i = level - 1; i < depth - 1; i++) { + levelEntries[i].refreshFromAnotherEntry(levelEntries[i + 1]); + } + levelEntries[depth - 1].clear(); + } + + protected void deleteFrom(final OrderBookPriceEntry[] levelEntries, final int n) { + if (n >= depth) deleteThru(levelEntries); + for (int i = n; i < depth; i++) { + levelEntries[i - n].refreshFromAnotherEntry(levelEntries[i]); + } + for (int i = depth - n; i < depth; i++) { + levelEntries[i].clear(); + } + } + + protected void deleteThru(final OrderBookPriceEntry[] levelEntries) { + for (int i = 0; i < depth; i++) { + levelEntries[i].clear(); + } + } + + protected void insertEntry(final OrderBookPriceEntry[] levelEntries, final int level, final FieldSet fieldSet) { + for (int i = depth - 1; i > level - 1; i--) { + levelEntries[i].refreshFromAnotherEntry(levelEntries[i - 1]); + } + levelEntries[level - 1].refreshBookFromMessage(fieldSet); + } + + @Override + protected void modifyEntry(OrderBookPriceEntry[] levelEntries, int level, FieldSet fieldSet) { + levelEntries[level - 1].refreshBookFromMessage(fieldSet); + } + + @Override + public byte getDepth() { + return this.depth; + } + + @Override + public OrderBookPriceLevel getBid(final byte level) { + return bidLevels[level - 1]; + } + + @Override + public OrderBookPriceLevel getOffer(final byte level) { + return offerLevels[level - 1]; + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/OrderBook.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/OrderBook.java new file mode 100644 index 0000000..48d58a0 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/OrderBook.java @@ -0,0 +1,23 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.test.mbpbook; + +public interface OrderBook { + int getSecurityId(); + + byte getDepth(); + + OrderBookPriceLevel getBid(byte level); + + OrderBookPriceLevel getOffer(byte level); +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/OrderBookPriceEntry.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/OrderBookPriceEntry.java new file mode 100644 index 0000000..53dbaad --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/OrderBookPriceEntry.java @@ -0,0 +1,41 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.test.mbpbook; + +import com.epam.cme.mdp3.FieldSet; + +public class OrderBookPriceEntry extends ImpliedBookPriceEntry implements OrderBookPriceLevel { + private int orderCount; + + @Override + public int getOrderCount() { + return orderCount; + } + + @Override + public void clear() { + super.clear(); + orderCount = 0; + } + + public void refreshFromAnotherEntry(final OrderBookPriceEntry bookEntry) { + super.refreshFromAnotherEntry(bookEntry); + this.orderCount = bookEntry.getOrderCount(); + } + + @Override + public void refreshBookFromMessage(final FieldSet fieldSet) { + super.refreshFromMessage(fieldSet); + this.orderCount = fieldSet.getInt32(346); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/OrderBookPriceLevel.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/OrderBookPriceLevel.java new file mode 100644 index 0000000..5f529c9 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/OrderBookPriceLevel.java @@ -0,0 +1,21 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.test.mbpbook; + +import com.epam.cme.mdp3.FieldSet; + +public interface OrderBookPriceLevel extends ImpliedBookPriceLevel { + int getOrderCount(); + + void refreshBookFromMessage(final FieldSet fieldSet); +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/Price.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/Price.java new file mode 100644 index 0000000..cf733d6 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/mbpbook/Price.java @@ -0,0 +1,62 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.test.mbpbook; + +import com.epam.cme.mdp3.sbe.message.meta.SbePrimitiveType; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; + +public class Price { + private long mantissa; + private byte exponent = -7; + + public long getMantissa() { + return mantissa; + } + + public void setMantissa(long mantissa) { + this.mantissa = mantissa; + } + + public boolean isNull() { + return this.mantissa == SbePrimitiveType.Int64.getNullValue(); + } + + public void setNull() { + this.mantissa = SbePrimitiveType.Int64.getNullValue(); + } + + public double asDouble() { + return getMantissa() * Math.pow(10, exponent); + } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + + if (o == null || getClass() != o.getClass()) return false; + + Price price = (Price) o; + + return new EqualsBuilder() + .append(mantissa, price.mantissa) + .isEquals(); + } + + @Override + public int hashCode() { + return new HashCodeBuilder(17, 37) + .append(mantissa) + .toHashCode(); + } +} diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/sbe/message/SbeGroupTest.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/sbe/message/SbeGroupTest.java new file mode 100644 index 0000000..3f2e25f --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/sbe/message/SbeGroupTest.java @@ -0,0 +1,58 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.test.sbe.message; + +import com.epam.cme.mdp3.MdpGroup; +import com.epam.cme.mdp3.MdpGroupEntry; +import com.epam.cme.mdp3.MdpPacket; +import com.epam.cme.mdp3.sbe.message.SbeGroup; +import com.epam.cme.mdp3.sbe.message.SbeGroupEntry; +import com.epam.cme.mdp3.sbe.message.meta.MdpMessageType; +import com.epam.cme.mdp3.sbe.schema.MdpMessageTypes; +import com.epam.cme.mdp3.test.ModelUtils; +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import java.nio.ByteBuffer; + +import static com.epam.cme.mdp3.test.Constants.TEMPLATE_NAME; + +public class SbeGroupTest { + private MdpMessageTypes mdpMessageTypes; + + @Before + public void init() throws Exception { + ClassLoader classLoader = getClass().getClassLoader(); + mdpMessageTypes = new MdpMessageTypes(classLoader.getResource(TEMPLATE_NAME).toURI()); + } + + @Test + public void groupEntryByEntryNum(){ + MdpPacket packet = new MdpPacket(); + MdpGroup mdpGroup = SbeGroup.instance(); + MdpGroupEntry groupEntry = SbeGroupEntry.instance(); + ByteBuffer mbpWithMBOIncrementTestMessage = ModelUtils.getMBPWithMBOIncrementTestMessage(1, new int[]{1, 3, 6}, null); + packet.wrapFromBuffer(mbpWithMBOIncrementTestMessage); + packet.forEach(mdpMessage -> { + int schemaId = mdpMessage.getSchemaId(); + MdpMessageType messageType = mdpMessageTypes.getMessageType(schemaId); + mdpMessage.setMessageType(messageType); + mdpMessage.getGroup(268, mdpGroup); + mdpGroup.getEntry(2, groupEntry); + int securityId = groupEntry.getInt32(48); + Assert.assertEquals(3, securityId); + }); + } + +} \ No newline at end of file diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/tcp/TCPMessageRequesterTest.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/tcp/TCPMessageRequesterTest.java new file mode 100644 index 0000000..8cc400e --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/tcp/TCPMessageRequesterTest.java @@ -0,0 +1,86 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.test.tcp; + +import com.epam.cme.mdp3.MdpPacket; +import com.epam.cme.mdp3.core.channel.CoreChannelListener; +import com.epam.cme.mdp3.core.channel.MdpFeedContext; +import com.epam.cme.mdp3.core.channel.tcp.MdpTCPMessageRequester; +import com.epam.cme.mdp3.core.channel.tcp.TCPMessageRequester; +import com.epam.cme.mdp3.core.channel.tcp.TCPPacketListener; +import com.epam.cme.mdp3.test.ModelUtils; +import org.junit.Before; +import org.junit.Test; + +import java.nio.ByteBuffer; +import java.util.Collections; +import java.util.List; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; + +import static org.junit.Assert.*; + + +public class TCPMessageRequesterTest { + private TCPMessageRequester messageRequester; + private TestTCPPacketListener testTCPPacketListener = new TestTCPPacketListener(); + private TestTCPChannel tcpChannel; + + + @Before + public void init(){ + tcpChannel = new TestTCPChannel(); + String channelId1 = "1"; + List mboListeners = Collections.emptyList(); + + messageRequester = new MdpTCPMessageRequester<>(channelId1, mboListeners, null, tcpChannel, MdpTCPMessageRequester.DEFAULT_USERNAME, + MdpTCPMessageRequester.DEFAULT_PASSWORD); + } + + @Test + public void lostMessagesShouldBeReceivedFromListener() throws InterruptedException { + long beginSeqNo = 1; + long endSeqNo = 3; + new Thread(() -> messageRequester.askForLostMessages(beginSeqNo, endSeqNo, testTCPPacketListener)).start(); + tcpChannel.setNextMessageForReceiving(ModelUtils.getLogin(1)); + assertNotNull(nextPacket()); + for(long i = beginSeqNo; i <= endSeqNo; i++) { + tcpChannel.setNextMessageForReceiving(ModelUtils.getMBOIncrementTestMessage(i)); + MdpPacket mdpPacket = testTCPPacketListener.nextPacket(); + assertNotNull(mdpPacket); + assertEquals(i, mdpPacket.getMsgSeqNum()); + } + } + + private MdpPacket nextPacket(){ + ByteBuffer nextMessage = tcpChannel.nextMessage(); + MdpPacket mdpPacket = MdpPacket.instance(); + mdpPacket.wrapFromBuffer(nextMessage); + return mdpPacket; + } + + private class TestTCPPacketListener implements TCPPacketListener { + public static final int WAITING_TIMEOUT_IN_SEC = 5; + private final BlockingQueue mdpPacketQueue = new LinkedBlockingQueue<>(); + + @Override + public void onPacket(MdpFeedContext feedContext, MdpPacket mdpPacket) { + mdpPacketQueue.add(mdpPacket); + } + + public MdpPacket nextPacket() throws InterruptedException { + return mdpPacketQueue.poll(WAITING_TIMEOUT_IN_SEC, TimeUnit.SECONDS); + } + } +} \ No newline at end of file diff --git a/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/tcp/TestTCPChannel.java b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/tcp/TestTCPChannel.java new file mode 100644 index 0000000..2b8a482 --- /dev/null +++ b/mbp-with-mbo/src/test/java/com/epam/cme/mdp3/test/tcp/TestTCPChannel.java @@ -0,0 +1,81 @@ +/* + * Copyright 2004-2016 EPAM Systems + * This file is part of Java Market Data Handler for CME Market Data (MDP 3.0). + * Java Market Data Handler for CME Market Data (MDP 3.0) is free software: you can redistribute it and/or modify it under the terms of the + * GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + * Java Market Data Handler for CME Market Data (MDP 3.0) is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + * See the GNU General Public License for more details. + * You should have received a copy of the GNU General Public License along with Java Market Data Handler for CME Market Data (MDP 3.0). + * If not, see . + */ + +package com.epam.cme.mdp3.test.tcp; + +import com.epam.cme.mdp3.Feed; +import com.epam.cme.mdp3.FeedType; +import com.epam.cme.mdp3.core.channel.MdpFeedContext; +import com.epam.cme.mdp3.core.channel.tcp.MdpTCPMessageRequester; +import com.epam.cme.mdp3.core.channel.tcp.TCPChannel; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.TimeUnit; + +public class TestTCPChannel implements TCPChannel { + public static final int WAITING_MESSAGE_TIMEOUT_IN_SEC = 5; + private BlockingQueue outQueue = new LinkedBlockingQueue<>(); + private BlockingQueue inQueue = new LinkedBlockingQueue<>(); + private MdpFeedContext mdpFeedContext = new MdpFeedContext(Feed.A, FeedType.H); + + @Override + public boolean connect() { + return true; + } + + @Override + public void disconnect() { + + } + + @Override + public void send(ByteBuffer bb) throws IOException { + inQueue.add(bb); + } + + @Override + public int receive(ByteBuffer bb) throws IOException { + try { + ByteBuffer nextMessage = outQueue.poll(WAITING_MESSAGE_TIMEOUT_IN_SEC, TimeUnit.SECONDS); + if(bb.limit() == MdpTCPMessageRequester.NUMBER_OF_SIZE_BYTES) { + bb.putChar((char)nextMessage.limit()); + outQueue.add(nextMessage); + return MdpTCPMessageRequester.NUMBER_OF_SIZE_BYTES; + } else { + bb.put(nextMessage); + } + return nextMessage.limit(); + } catch (InterruptedException e) { + return 0; + } + } + + @Override + public MdpFeedContext getFeedContext() { + return mdpFeedContext; + } + + public void setNextMessageForReceiving(ByteBuffer bb){ + outQueue.add(bb); + } + + public ByteBuffer nextMessage(){ + try { + return inQueue.poll(WAITING_MESSAGE_TIMEOUT_IN_SEC, TimeUnit.SECONDS); + } catch (InterruptedException e) { + return null; + } + } +} diff --git a/src/test/resources/config.xml b/mbp-with-mbo/src/test/resources/config.xml similarity index 50% rename from src/test/resources/config.xml rename to mbp-with-mbo/src/test/resources/config.xml index 3e1a679..1d66bed 100644 --- a/src/test/resources/config.xml +++ b/mbp-with-mbo/src/test/resources/config.xml @@ -1,89 +1,125 @@ - + + + + - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.1 - 69.50.112.90 - 14310 - A - - - Incremental - UDP/IP - 224.0.28.128 - 69.50.112.90 - 15310 - B - - - Instrument Replay - UDP/IP - 224.0.28.85 - 69.50.112.83 - 6310 - A - - - Instrument Replay - UDP/IP - 224.0.28.212 - 69.50.112.83 - 7310 - B - - - Snapshot - UDP/IP - 224.0.28.43 - 69.50.112.79 - 6310 - A - - - Snapshot - UDP/IP - 224.0.28.170 - 69.50.112.79 - 7310 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.1 - 69.50.112.126 - 21310 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.128 - 69.50.112.126 - 22310 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.1 + 205.209.223.70 + 205.209.221.70 + 14310 + A + + + Incremental + UDP/IP + 224.0.32.1 + 205.209.212.70 + 205.209.211.70 + 15310 + B + + + Instrument Replay + UDP/IP + 224.0.31.43 + 205.209.222.85 + 205.209.222.73 + 14310 + A + + + Instrument Replay + UDP/IP + 224.0.32.43 + 205.209.214.48 + 205.209.213.48 + 15310 + B + + + Snapshot + UDP/IP + 224.0.31.22 + 205.209.222.87 + 205.209.222.77 + 14310 + A + + + Snapshot + UDP/IP + 224.0.32.22 + 205.209.213.52 + 205.209.214.52 + 15310 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.1 + 205.209.222.108 + 205.209.222.109 + 23310 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.64 + 205.209.214.64 + 205.209.213.64 + 22310 + B + + - + + + + + + + + + + + + + + + + + + + + + + + + + @@ -93,14 +129,17 @@ - + - + + + + @@ -110,86 +149,104 @@ + + + + + + - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.2 - 69.50.112.95 - 14311 - A - - - Incremental - UDP/IP - 224.0.28.129 - 69.50.112.95 - 15311 - B - - - Instrument Replay - UDP/IP - 224.0.28.86 - 69.50.112.82 - 6311 - A - - - Instrument Replay - UDP/IP - 224.0.28.213 - 69.50.112.82 - 7311 - B - - - Snapshot - UDP/IP - 224.0.28.44 - 69.50.112.78 - 6311 - A - - - Snapshot - UDP/IP - 224.0.28.171 - 69.50.112.78 - 7311 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.2 - 69.50.112.125 - 21311 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.133 - 69.50.112.125 - 22311 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.2 + 205.209.221.70 + 205.209.223.70 + 14311 + A + + + Incremental + UDP/IP + 224.0.32.2 + 205.209.211.70 + 205.209.212.70 + 15311 + B + + + Instrument Replay + UDP/IP + 224.0.31.44 + 205.209.222.76 + 205.209.222.82 + 14311 + A + + + Instrument Replay + UDP/IP + 224.0.32.44 + 205.209.214.51 + 205.209.213.51 + 15311 + B + + + Snapshot + UDP/IP + 224.0.31.23 + 205.209.222.80 + 205.209.222.84 + 14311 + A + + + Snapshot + UDP/IP + 224.0.32.23 + 205.209.213.55 + 205.209.214.55 + 15311 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.2 + 205.209.222.114 + 205.209.222.115 + 23311 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.65 + 205.209.214.67 + 205.209.213.67 + 22311 + B + + + + + @@ -212,82 +269,94 @@ - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.3 - 69.50.112.92 - 14312 - A - - - Incremental - UDP/IP - 224.0.28.130 - 69.50.112.92 - 15312 - B - - - Instrument Replay - UDP/IP - 224.0.28.87 - 69.50.112.85 - 6312 - A - - - Instrument Replay - UDP/IP - 224.0.28.214 - 69.50.112.85 - 7312 - B - - - Snapshot - UDP/IP - 224.0.28.45 - 69.50.112.81 - 6312 - A - - - Snapshot - UDP/IP - 224.0.28.172 - 69.50.112.81 - 7312 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.3 - 69.50.112.29 - 21312 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.134 - 69.50.112.29 - 22312 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.3 + 205.209.221.80 + 205.209.223.80 + 14312 + A + + + Incremental + UDP/IP + 224.0.32.3 + 205.209.211.80 + 205.209.212.80 + 15312 + B + + + Instrument Replay + UDP/IP + 224.0.31.45 + 205.209.222.76 + 205.209.222.82 + 14312 + A + + + Instrument Replay + UDP/IP + 224.0.32.45 + 205.209.214.51 + 205.209.213.51 + 15312 + B + + + Snapshot + UDP/IP + 224.0.31.24 + 205.209.222.80 + 205.209.222.84 + 14312 + A + + + Snapshot + UDP/IP + 224.0.32.24 + 205.209.213.55 + 205.209.214.55 + 15312 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.3 + 205.209.222.114 + 205.209.222.115 + 23312 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.66 + 205.209.214.67 + 205.209.213.67 + 22312 + B + + + + + @@ -297,35 +366,47 @@ - + + + + - + + + + - + - - + + + + + + + + - + - + - + - + @@ -333,89 +414,98 @@ - - - - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.4 - 69.50.112.93 - 14313 - A - - - Incremental - UDP/IP - 224.0.28.131 - 69.50.112.93 - 15313 - B - - - Instrument Replay - UDP/IP - 224.0.28.88 - 69.50.112.85 - 6313 - A - - - Instrument Replay - UDP/IP - 224.0.28.215 - 69.50.112.85 - 7313 - B - - - Snapshot - UDP/IP - 224.0.28.46 - 69.50.112.81 - 6313 - A - - - Snapshot - UDP/IP - 224.0.28.173 - 69.50.112.81 - 7313 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.4 - 69.50.112.29 - 21313 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.135 - 69.50.112.29 - 22313 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.4 + 205.209.223.79 + 205.209.221.79 + 14313 + A + + + Incremental + UDP/IP + 224.0.32.4 + 205.209.212.79 + 205.209.211.79 + 15313 + B + + + Instrument Replay + UDP/IP + 224.0.31.46 + 205.209.222.76 + 205.209.222.82 + 14313 + A + + + Instrument Replay + UDP/IP + 224.0.32.46 + 205.209.214.51 + 205.209.213.51 + 15313 + B + + + Snapshot + UDP/IP + 224.0.31.25 + 205.209.222.80 + 205.209.222.84 + 14313 + A + + + Snapshot + UDP/IP + 224.0.32.25 + 205.209.213.55 + 205.209.214.55 + 15313 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.4 + 205.209.222.114 + 205.209.222.115 + 23313 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.67 + 205.209.214.67 + 205.209.213.67 + 22313 + B + + + + + @@ -474,82 +564,97 @@ - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.5 - 69.50.112.91 - 14314 - A - - - Incremental - UDP/IP - 224.0.28.132 - 69.50.112.91 - 15314 - B - - - Instrument Replay - UDP/IP - 224.0.28.89 - 69.50.112.85 - 6314 - A - - - Instrument Replay - UDP/IP - 224.0.28.216 - 69.50.112.85 - 7314 - B - - - Snapshot - UDP/IP - 224.0.28.47 - 69.50.112.81 - 6314 - A - - - Snapshot - UDP/IP - 224.0.28.174 - 69.50.112.81 - 7314 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.5 - 69.50.112.29 - 21314 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.136 - 69.50.112.29 - 22314 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.5 + 205.209.221.53 + 205.209.223.54 + 14314 + A + + + Incremental + UDP/IP + 224.0.32.5 + 205.209.212.51 + 205.209.211.52 + 15314 + B + + + Instrument Replay + UDP/IP + 224.0.31.47 + 205.209.222.81 + 205.209.222.75 + 14314 + A + + + Instrument Replay + UDP/IP + 224.0.32.47 + 205.209.213.50 + 205.209.214.50 + 15314 + B + + + Snapshot + UDP/IP + 224.0.31.26 + 205.209.222.79 + 205.209.222.83 + 14314 + A + + + Snapshot + UDP/IP + 224.0.32.26 + 205.209.213.54 + 205.209.214.54 + 15314 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.5 + 205.209.222.113 + 205.209.222.112 + 23314 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.68 + 205.209.214.66 + 205.209.213.66 + 22314 + B + + + + + + + + @@ -559,6 +664,9 @@ + + + @@ -574,6 +682,9 @@ + + + @@ -583,45 +694,66 @@ + + + + + + + + + - - + + - - + + - + - - + + - - + + - - + + + + + + + + + + + + + + @@ -634,34 +766,52 @@ + + + + + + - + - + + + + - + - + + + + + + + - + + + + @@ -670,27 +820,57 @@ - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -712,6 +892,9 @@ + + + @@ -727,6 +910,9 @@ + + + @@ -742,91 +928,97 @@ + + + - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.6 - 69.50.112.94 - 14315 - A - - - Incremental - UDP/IP - 224.0.28.133 - 69.50.112.94 - 15315 - B - - - Instrument Replay - UDP/IP - 224.0.28.90 - 69.50.112.84 - 6315 - A - - - Instrument Replay - UDP/IP - 224.0.28.217 - 69.50.112.84 - 7315 - B - - - Snapshot - UDP/IP - 224.0.28.48 - 69.50.112.80 - 6315 - A - - - Snapshot - UDP/IP - 224.0.28.175 - 69.50.112.80 - 7315 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.6 - 69.50.112.28 - 21315 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.137 - 69.50.112.28 - 22315 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.6 + 205.209.223.54 + 205.209.221.53 + 14315 + A + + + Incremental + UDP/IP + 224.0.32.6 + 205.209.211.52 + 205.209.212.51 + 15315 + B + + + Instrument Replay + UDP/IP + 224.0.31.48 + 205.209.222.85 + 205.209.222.73 + 14315 + A + + + Instrument Replay + UDP/IP + 224.0.32.48 + 205.209.213.48 + 205.209.214.48 + 15315 + B + + + Snapshot + UDP/IP + 224.0.31.27 + 205.209.222.77 + 205.209.222.87 + 14315 + A + + + Snapshot + UDP/IP + 224.0.32.27 + 205.209.213.52 + 205.209.214.52 + 15315 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.6 + 205.209.222.109 + 205.209.222.108 + 23315 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.69 + 205.209.214.64 + 205.209.213.64 + 22315 + B + + - - - - - - - - + + @@ -864,9 +1056,6 @@ - - - @@ -885,9 +1074,6 @@ - - - @@ -897,12 +1083,6 @@ - - - - - - @@ -1084,11 +1264,14 @@ - + + + + @@ -1123,112 +1306,148 @@ - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.7 - 69.50.112.88 - 14316 - A - - - Incremental - UDP/IP - 224.0.28.134 - 69.50.112.88 - 15316 - B - - - Instrument Replay - UDP/IP - 224.0.28.91 - 69.50.112.83 - 6316 - A - - - Instrument Replay - UDP/IP - 224.0.28.218 - 69.50.112.83 - 7316 - B - - - Snapshot - UDP/IP - 224.0.28.49 - 69.50.112.79 - 6316 - A - - - Snapshot - UDP/IP - 224.0.28.176 - 69.50.112.79 - 7316 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.7 - 69.50.112.126 - 21316 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.138 - 69.50.112.126 - 22316 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.7 + 205.209.221.71 + 205.209.223.71 + 14316 + A + + + Incremental + UDP/IP + 224.0.32.7 + 205.209.211.71 + 205.209.212.71 + 15316 + B + + + Instrument Replay + UDP/IP + 224.0.31.49 + 205.209.222.74 + 205.209.222.86 + 14316 + A + + + Instrument Replay + UDP/IP + 224.0.32.49 + 205.209.214.49 + 205.209.213.49 + 15316 + B + + + Snapshot + UDP/IP + 224.0.31.28 + 205.209.222.78 + 205.209.222.88 + 14316 + A + + + Snapshot + UDP/IP + 224.0.32.28 + 205.209.213.53 + 205.209.214.53 + 15316 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.7 + 205.209.222.110 + 205.209.222.111 + 23316 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.70 + 205.209.214.65 + 205.209.213.65 + 22316 + B + + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + @@ -1247,6 +1466,15 @@ + + + + + + + + + @@ -1254,10 +1482,13 @@ - + - + + + + @@ -1265,86 +1496,113 @@ + + + + + + + + + - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.8 - 69.50.112.94 - 14317 - A - - - Incremental - UDP/IP - 224.0.28.135 - 69.50.112.94 - 15317 - B - - - Instrument Replay - UDP/IP - 224.0.28.92 - 69.50.112.82 - 6317 - A - - - Instrument Replay - UDP/IP - 224.0.28.219 - 69.50.112.82 - 7317 - B - - - Snapshot - UDP/IP - 224.0.28.50 - 69.50.112.78 - 6317 - A - - - Snapshot - UDP/IP - 224.0.28.177 - 69.50.112.78 - 7317 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.8 - 69.50.112.125 - 21317 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.139 - 69.50.112.125 - 22317 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.8 + 205.209.221.74 + 205.209.223.74 + 14317 + A + + + Incremental + UDP/IP + 224.0.32.8 + 205.209.211.74 + 205.209.212.74 + 15317 + B + + + Instrument Replay + UDP/IP + 224.0.31.50 + 205.209.222.85 + 205.209.222.73 + 14317 + A + + + Instrument Replay + UDP/IP + 224.0.32.50 + 205.209.214.48 + 205.209.213.48 + 15317 + B + + + Snapshot + UDP/IP + 224.0.31.29 + 205.209.222.77 + 205.209.222.87 + 14317 + A + + + Snapshot + UDP/IP + 224.0.32.29 + 205.209.213.52 + 205.209.214.52 + 15317 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.8 + 205.209.222.109 + 205.209.222.108 + 23317 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.71 + 205.209.214.64 + 205.209.213.64 + 22317 + B + + + + + + + + + + + @@ -1423,9 +1681,18 @@ + + + + + + + + + @@ -1435,6 +1702,9 @@ + + + @@ -1496,82 +1766,94 @@ - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.9 - 69.50.112.91 - 14318 - A - - - Incremental - UDP/IP - 224.0.28.136 - 69.50.112.91 - 15318 - B - - - Instrument Replay - UDP/IP - 224.0.28.93 - 69.50.112.83 - 6318 - A - - - Instrument Replay - UDP/IP - 224.0.28.220 - 69.50.112.83 - 7318 - B - - - Snapshot - UDP/IP - 224.0.28.51 - 69.50.112.79 - 6318 - A - - - Snapshot - UDP/IP - 224.0.28.178 - 69.50.112.79 - 7318 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.9 - 69.50.112.126 - 21318 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.140 - 69.50.112.126 - 22318 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.9 + 205.209.221.75 + 205.209.223.75 + 14318 + A + + + Incremental + UDP/IP + 224.0.32.9 + 205.209.212.75 + 205.209.211.75 + 15318 + B + + + Instrument Replay + UDP/IP + 224.0.31.51 + 205.209.222.75 + 205.209.222.81 + 14318 + A + + + Instrument Replay + UDP/IP + 224.0.32.51 + 205.209.214.50 + 205.209.213.50 + 15318 + B + + + Snapshot + UDP/IP + 224.0.31.30 + 205.209.222.83 + 205.209.222.79 + 14318 + A + + + Snapshot + UDP/IP + 224.0.32.30 + 205.209.213.54 + 205.209.214.54 + 15318 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.9 + 205.209.222.112 + 205.209.222.113 + 23318 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.72 + 205.209.214.66 + 205.209.213.66 + 22318 + B + + + + + @@ -1597,27 +1879,51 @@ - + + + + + + + + + + + + + - + + + + + + + + + + + + + @@ -1627,82 +1933,94 @@ - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.10 - 69.50.112.95 - 14319 - A - - - Incremental - UDP/IP - 224.0.28.137 - 69.50.112.95 - 15319 - B - - - Instrument Replay - UDP/IP - 224.0.28.94 - 69.50.112.82 - 6319 - A - - - Instrument Replay - UDP/IP - 224.0.28.221 - 69.50.112.82 - 7319 - B - - - Snapshot - UDP/IP - 224.0.28.52 - 69.50.112.78 - 6319 - A - - - Snapshot - UDP/IP - 224.0.28.179 - 69.50.112.78 - 7319 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.10 - 69.50.112.125 - 21319 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.141 - 69.50.112.125 - 22319 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.10 + 205.209.223.70 + 205.209.221.70 + 14319 + A + + + Incremental + UDP/IP + 224.0.32.10 + 205.209.212.70 + 205.209.211.70 + 15319 + B + + + Instrument Replay + UDP/IP + 224.0.31.52 + 205.209.222.82 + 205.209.222.76 + 14319 + A + + + Instrument Replay + UDP/IP + 224.0.32.52 + 205.209.213.51 + 205.209.214.51 + 15319 + B + + + Snapshot + UDP/IP + 224.0.31.31 + 205.209.222.84 + 205.209.222.80 + 14319 + A + + + Snapshot + UDP/IP + 224.0.32.31 + 205.209.214.55 + 205.209.213.55 + 15319 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.10 + 205.209.222.115 + 205.209.222.114 + 23319 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.73 + 205.209.213.67 + 205.209.214.67 + 22319 + B + + + + + @@ -1818,82 +2136,97 @@ - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.11 - 69.50.112.91 - 14320 - A - - - Incremental - UDP/IP - 224.0.28.138 - 69.50.112.91 - 15320 - B - - - Instrument Replay - UDP/IP - 224.0.28.95 - 69.50.112.85 - 6320 - A - - - Instrument Replay - UDP/IP - 224.0.28.222 - 69.50.112.85 - 7320 - B - - - Snapshot - UDP/IP - 224.0.28.53 - 69.50.112.81 - 6320 - A - - - Snapshot - UDP/IP - 224.0.28.180 - 69.50.112.81 - 7320 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.11 - 69.50.112.29 - 21320 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.142 - 69.50.112.29 - 22320 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.11 + 205.209.223.72 + 205.209.221.72 + 14320 + A + + + Incremental + UDP/IP + 224.0.32.11 + 205.209.211.72 + 205.209.212.72 + 15320 + B + + + Instrument Replay + UDP/IP + 224.0.31.53 + 205.209.222.73 + 205.209.222.85 + 14320 + A + + + Instrument Replay + UDP/IP + 224.0.32.53 + 205.209.214.48 + 205.209.213.48 + 15320 + B + + + Snapshot + UDP/IP + 224.0.31.32 + 205.209.222.87 + 205.209.222.77 + 14320 + A + + + Snapshot + UDP/IP + 224.0.32.32 + 205.209.213.52 + 205.209.214.52 + 15320 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.26 + 205.209.222.109 + 205.209.222.108 + 23320 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.89 + 205.209.213.64 + 205.209.214.64 + 22320 + B + + + + + + + + @@ -1954,9 +2287,15 @@ + + + + + + @@ -1978,36 +2317,57 @@ - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + - + - + + + + + + + @@ -2026,6 +2386,9 @@ + + + @@ -2041,18 +2404,30 @@ - - + + + + + - - + + - + + + + + + + + + + @@ -2071,86 +2446,104 @@ + + + + + + - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.12 - 69.50.112.94 - 14321 - A - - - Incremental - UDP/IP - 224.0.28.139 - 69.50.112.94 - 15321 - B - - - Instrument Replay - UDP/IP - 224.0.28.96 - 69.50.112.85 - 6321 - A - - - Instrument Replay - UDP/IP - 224.0.28.223 - 69.50.112.85 - 7321 - B - - - Snapshot - UDP/IP - 224.0.28.54 - 69.50.112.81 - 6321 - A - - - Snapshot - UDP/IP - 224.0.28.181 - 69.50.112.81 - 7321 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.12 - 69.50.112.29 - 21321 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.143 - 69.50.112.29 - 22321 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.12 + 205.209.223.72 + 205.209.221.72 + 14321 + A + + + Incremental + UDP/IP + 224.0.32.12 + 205.209.212.72 + 205.209.211.72 + 15321 + B + + + Instrument Replay + UDP/IP + 224.0.31.54 + 205.209.222.74 + 205.209.222.86 + 14321 + A + + + Instrument Replay + UDP/IP + 224.0.32.54 + 205.209.213.49 + 205.209.214.49 + 15321 + B + + + Snapshot + UDP/IP + 224.0.31.33 + 205.209.222.88 + 205.209.222.78 + 14321 + A + + + Snapshot + UDP/IP + 224.0.32.33 + 205.209.213.53 + 205.209.214.53 + 15321 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.27 + 205.209.222.111 + 205.209.222.110 + 23321 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.90 + 205.209.214.65 + 205.209.213.65 + 22321 + B + + + + + @@ -2220,6 +2613,9 @@ + + + @@ -2254,82 +2650,94 @@ - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.13 - 69.50.112.88 - 14340 - A - - - Incremental - UDP/IP - 224.0.28.140 - 69.50.112.88 - 15340 - B - - - Instrument Replay - UDP/IP - 224.0.28.81 - 69.50.112.84 - 6340 - A - - - Instrument Replay - UDP/IP - 224.0.28.224 - 69.50.112.84 - 7340 - B - - - Snapshot - UDP/IP - 224.0.28.55 - 69.50.112.80 - 6340 - A - - - Snapshot - UDP/IP - 224.0.28.182 - 69.50.112.80 - 7340 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.13 - 69.50.112.28 - 21340 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.144 - 69.50.112.28 - 22340 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.64 + 205.209.223.71 + 205.209.221.71 + 14340 + A + + + Incremental + UDP/IP + 224.0.32.64 + 205.209.211.71 + 205.209.212.71 + 15340 + B + + + Instrument Replay + UDP/IP + 224.0.31.106 + 205.209.222.86 + 205.209.222.74 + 14340 + A + + + Instrument Replay + UDP/IP + 224.0.32.106 + 205.209.213.49 + 205.209.214.49 + 15340 + B + + + Snapshot + UDP/IP + 224.0.31.85 + 205.209.222.88 + 205.209.222.78 + 14340 + A + + + Snapshot + UDP/IP + 224.0.32.85 + 205.209.213.53 + 205.209.214.53 + 15340 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.29 + 205.209.222.110 + 205.209.222.111 + 23340 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.92 + 205.209.214.65 + 205.209.213.65 + 22340 + B + + + + + @@ -2426,10 +2834,16 @@ + + + + + + - + @@ -2438,6 +2852,9 @@ + + + @@ -2447,18 +2864,30 @@ + + + + + + + + + + + + @@ -2480,6 +2909,12 @@ + + + + + + @@ -2501,12 +2936,18 @@ + + + + + + @@ -2519,116 +2960,143 @@ + + + - + + + + - + + + + - + + + + - + + + + - + - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.14 - 69.50.112.88 - 14341 - A - - - Incremental - UDP/IP - 224.0.28.141 - 69.50.112.88 - 15341 - B - - - Instrument Replay - UDP/IP - 224.0.28.98 - 69.50.112.85 - 6341 - A - - - Instrument Replay - UDP/IP - 224.0.28.225 - 69.50.112.85 - 7341 - B - - - Snapshot - UDP/IP - 224.0.28.56 - 69.50.112.81 - 6341 - A - - - Snapshot - UDP/IP - 224.0.28.183 - 69.50.112.81 - 7341 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.14 - 69.50.112.29 - 21341 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.145 - 69.50.112.29 - 22341 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.65 + 205.209.223.74 + 205.209.221.74 + 14341 + A + + + Incremental + UDP/IP + 224.0.32.65 + 205.209.211.74 + 205.209.212.74 + 15341 + B + + + Instrument Replay + UDP/IP + 224.0.31.107 + 205.209.222.81 + 205.209.222.75 + 14341 + A + + + Instrument Replay + UDP/IP + 224.0.32.107 + 205.209.213.50 + 205.209.214.50 + 15341 + B + + + Snapshot + UDP/IP + 224.0.31.86 + 205.209.222.79 + 205.209.222.83 + 14341 + A + + + Snapshot + UDP/IP + 224.0.32.86 + 205.209.213.54 + 205.209.214.54 + 15341 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.30 + 205.209.222.112 + 205.209.222.113 + 23341 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.93 + 205.209.214.66 + 205.209.213.66 + 22341 + B + + + + + @@ -2639,177 +3107,210 @@ - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.15 - 69.50.112.90 - 14342 - A - - - Incremental - UDP/IP - 224.0.28.142 - 69.50.112.90 - 15342 - B - - - Instrument Replay - UDP/IP - 224.0.28.99 - 69.50.112.82 - 6342 - A - - - Instrument Replay - UDP/IP - 224.0.28.226 - 69.50.112.82 - 7342 - B - - - Snapshot - UDP/IP - 224.0.28.57 - 69.50.112.78 - 6342 - A - - - Snapshot - UDP/IP - 224.0.28.184 - 69.50.112.78 - 7342 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.15 - 69.50.112.125 - 21342 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.146 - 69.50.112.125 - 22342 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.66 + 205.209.221.76 + 205.209.223.76 + 14342 + A + + + Incremental + UDP/IP + 224.0.32.66 + 205.209.211.76 + 205.209.212.76 + 15342 + B + + + Instrument Replay + UDP/IP + 224.0.31.108 + 205.209.222.85 + 205.209.222.73 + 14342 + A + + + Instrument Replay + UDP/IP + 224.0.32.108 + 205.209.213.48 + 205.209.214.48 + 15342 + B + + + Snapshot + UDP/IP + 224.0.31.87 + 205.209.222.87 + 205.209.222.77 + 14342 + A + + + Snapshot + UDP/IP + 224.0.32.87 + 205.209.213.52 + 205.209.214.52 + 15342 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.31 + 205.209.222.108 + 205.209.222.109 + 23342 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.94 + 205.209.214.64 + 205.209.213.64 + 22342 + B + + + + + - + + + + + + + - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.16 - 69.50.112.88 - 14343 - A - - - Incremental - UDP/IP - 224.0.28.143 - 69.50.112.88 - 15343 - B - - - Instrument Replay - UDP/IP - 224.0.28.100 - 69.50.112.83 - 6343 - A - - - Instrument Replay - UDP/IP - 224.0.28.227 - 69.50.112.83 - 7343 - B - - - Snapshot - UDP/IP - 224.0.28.58 - 69.50.112.79 - 6343 - A - - - Snapshot - UDP/IP - 224.0.28.185 - 69.50.112.79 - 7343 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.16 - 69.50.112.126 - 21343 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.147 - 69.50.112.126 - 22343 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.67 + 205.209.221.74 + 205.209.223.74 + 14343 + A + + + Incremental + UDP/IP + 224.0.32.67 + 205.209.212.74 + 205.209.211.74 + 15343 + B + + + Instrument Replay + UDP/IP + 224.0.31.109 + 205.209.222.85 + 205.209.222.73 + 14343 + A + + + Instrument Replay + UDP/IP + 224.0.32.109 + 205.209.214.48 + 205.209.213.48 + 15343 + B + + + Snapshot + UDP/IP + 224.0.31.88 + 205.209.222.77 + 205.209.222.87 + 14343 + A + + + Snapshot + UDP/IP + 224.0.32.88 + 205.209.214.52 + 205.209.213.52 + 15343 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.32 + 205.209.222.109 + 205.209.222.108 + 23343 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.95 + 205.209.214.64 + 205.209.213.64 + 22343 + B + + + + + + + + @@ -2834,6 +3335,9 @@ + + + @@ -2841,10 +3345,10 @@ - + - + @@ -2951,6 +3455,9 @@ + + + @@ -2960,14 +3467,20 @@ + + + - + - + + + + @@ -2988,149 +3501,245 @@ - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.17 - 69.50.112.92 - 14344 - A - - - Incremental - UDP/IP - 224.0.28.144 - 69.50.112.92 - 15344 - B - - - Instrument Replay - UDP/IP - 224.0.28.101 - 69.50.112.82 - 6344 - A - - - Instrument Replay - UDP/IP - 224.0.28.228 - 69.50.112.82 - 7344 - B - - - Snapshot - UDP/IP - 224.0.28.59 - 69.50.112.78 - 6344 - A - - - Snapshot - UDP/IP - 224.0.28.186 - 69.50.112.78 - 7344 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.17 - 69.50.112.125 - 21344 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.148 - 69.50.112.125 - 22344 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.68 + 205.209.223.81 + 205.209.221.81 + 14344 + A + + + Incremental + UDP/IP + 224.0.32.68 + 205.209.211.81 + 205.209.212.81 + 15344 + B + + + Instrument Replay + UDP/IP + 224.0.31.110 + 205.209.222.81 + 205.209.222.75 + 14344 + A + + + Instrument Replay + UDP/IP + 224.0.32.110 + 205.209.214.50 + 205.209.213.50 + 15344 + B + + + Snapshot + UDP/IP + 224.0.31.89 + 205.209.222.79 + 205.209.222.83 + 14344 + A + + + Snapshot + UDP/IP + 224.0.32.89 + 205.209.214.54 + 205.209.213.54 + 15344 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.33 + 205.209.222.113 + 205.209.222.112 + 23344 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.96 + 205.209.214.66 + 205.209.213.66 + 22344 + B + + + + + + + + - - - - + - - + + - + + + + + + + - + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + - + - + + + + + + + - + + + + @@ -3139,89 +3748,110 @@ + + + + + + - + + + + - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.18 - 69.50.112.89 - 14345 - A - - - Incremental - UDP/IP - 224.0.28.145 - 69.50.112.89 - 15345 - B - - - Instrument Replay - UDP/IP - 224.0.28.102 - 69.50.112.82 - 6345 - A - - - Instrument Replay - UDP/IP - 224.0.28.229 - 69.50.112.82 - 7345 - B - - - Snapshot - UDP/IP - 224.0.28.60 - 69.50.112.78 - 6345 - A - - - Snapshot - UDP/IP - 224.0.28.187 - 69.50.112.78 - 7345 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.18 - 69.50.112.125 - 21345 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.149 - 69.50.112.125 - 22345 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.69 + 205.209.223.76 + 205.209.221.76 + 14345 + A + + + Incremental + UDP/IP + 224.0.32.69 + 205.209.211.76 + 205.209.212.76 + 15345 + B + + + Instrument Replay + UDP/IP + 224.0.31.111 + 205.209.222.81 + 205.209.222.75 + 14345 + A + + + Instrument Replay + UDP/IP + 224.0.32.111 + 205.209.213.50 + 205.209.214.50 + 15345 + B + + + Snapshot + UDP/IP + 224.0.31.90 + 205.209.222.83 + 205.209.222.79 + 14345 + A + + + Snapshot + UDP/IP + 224.0.32.90 + 205.209.213.54 + 205.209.214.54 + 15345 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.34 + 205.209.222.113 + 205.209.222.112 + 23345 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.97 + 205.209.214.66 + 205.209.213.66 + 22345 + B + + + + + @@ -3282,6 +3912,9 @@ + + + @@ -3328,82 +3961,94 @@ - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.84 - 69.50.112.89 - 14346 - A - - - Incremental - UDP/IP - 224.0.28.80 - 69.50.112.89 - 15346 - B - - - Instrument Replay - UDP/IP - 224.0.28.97 - 69.50.112.84 - 6346 - A - - - Instrument Replay - UDP/IP - 224.0.28.251 - 69.50.112.84 - 7346 - B - - - Snapshot - UDP/IP - 224.0.28.82 - 69.50.112.80 - 6346 - A - - - Snapshot - UDP/IP - 224.0.28.83 - 69.50.112.80 - 7346 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.37 - 69.50.112.28 - 21346 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.164 - 69.50.112.28 - 22346 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.70 + 205.209.221.75 + 205.209.223.75 + 14346 + A + + + Incremental + UDP/IP + 224.0.32.70 + 205.209.212.75 + 205.209.211.75 + 15346 + B + + + Instrument Replay + UDP/IP + 224.0.31.112 + 205.209.222.81 + 205.209.222.75 + 14346 + A + + + Instrument Replay + UDP/IP + 224.0.32.112 + 205.209.213.50 + 205.209.214.50 + 15346 + B + + + Snapshot + UDP/IP + 224.0.31.91 + 205.209.222.83 + 205.209.222.79 + 14346 + A + + + Snapshot + UDP/IP + 224.0.32.91 + 205.209.213.54 + 205.209.214.54 + 15346 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.35 + 205.209.222.113 + 205.209.222.112 + 23346 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.98 + 205.209.214.66 + 205.209.213.66 + 22346 + B + + + + + @@ -3417,7 +4062,7 @@ - + @@ -3428,6 +4073,9 @@ + + + @@ -3437,6 +4085,9 @@ + + + @@ -3470,6 +4121,9 @@ + + + @@ -3479,194 +4133,257 @@ + + + - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.19 - 69.50.112.94 - 14360 - A - - - Incremental - UDP/IP - 224.0.28.146 - 69.50.112.94 - 15360 - B - - - Instrument Replay - UDP/IP - 224.0.28.103 - 69.50.112.84 - 6360 - A - - - Instrument Replay - UDP/IP - 224.0.28.230 - 69.50.112.84 - 7360 - B - - - Snapshot - UDP/IP - 224.0.28.61 - 69.50.112.80 - 6360 - A - - - Snapshot - UDP/IP - 224.0.28.188 - 69.50.112.80 - 7360 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.19 - 69.50.112.28 - 21360 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.150 - 69.50.112.28 - 22360 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.192 + 205.209.223.79 + 205.209.221.79 + 14360 + A + + + Incremental + UDP/IP + 224.0.32.192 + 205.209.211.79 + 205.209.212.79 + 15360 + B + + + Instrument Replay + UDP/IP + 224.0.31.212 + 205.209.222.86 + 205.209.222.74 + 14360 + A + + + Instrument Replay + UDP/IP + 224.0.32.212 + 205.209.214.49 + 205.209.213.49 + 15360 + B + + + Snapshot + UDP/IP + 224.0.31.202 + 205.209.222.88 + 205.209.222.78 + 14360 + A + + + Snapshot + UDP/IP + 224.0.32.202 + 205.209.214.53 + 205.209.213.53 + 15360 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.21 + 205.209.222.111 + 205.209.222.110 + 23360 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.84 + 205.209.214.65 + 205.209.213.65 + 22360 + B + + - + + + + - + + + + + + + - + - + + + + + + + + + + + + + + + + + + + - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.20 - 69.50.112.95 - 14361 - A - - - Incremental - UDP/IP - 224.0.28.147 - 69.50.112.95 - 15361 - B - - - Instrument Replay - UDP/IP - 224.0.28.104 - 69.50.112.85 - 6361 - A - - - Instrument Replay - UDP/IP - 224.0.28.231 - 69.50.112.85 - 7361 - B - - - Snapshot - UDP/IP - 224.0.28.62 - 69.50.112.81 - 6361 - A - - - Snapshot - UDP/IP - 224.0.28.189 - 69.50.112.81 - 7361 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.20 - 69.50.112.29 - 21361 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.151 - 69.50.112.29 - 22361 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.193 + 205.209.221.77 + 205.209.223.77 + 14361 + A + + + Incremental + UDP/IP + 224.0.32.193 + 205.209.212.77 + 205.209.211.77 + 15361 + B + + + Instrument Replay + UDP/IP + 224.0.31.213 + 205.209.222.74 + 205.209.222.86 + 14361 + A + + + Instrument Replay + UDP/IP + 224.0.32.213 + 205.209.213.49 + 205.209.214.49 + 15361 + B + + + Snapshot + UDP/IP + 224.0.31.203 + 205.209.222.88 + 205.209.222.78 + 14361 + A + + + Snapshot + UDP/IP + 224.0.32.203 + 205.209.213.53 + 205.209.214.53 + 15361 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.25 + 205.209.222.110 + 205.209.222.111 + 23361 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.88 + 205.209.214.65 + 205.209.213.65 + 22361 + B + + - + + + + + + + + + + + + + + + + @@ -3679,168 +4396,183 @@ - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.21 - 69.50.112.95 - 14380 - A - - - Incremental - UDP/IP - 224.0.28.148 - 69.50.112.95 - 15380 - B - - - Instrument Replay - UDP/IP - 224.0.28.105 - 69.50.112.85 - 6380 - A - - - Instrument Replay - UDP/IP - 224.0.28.232 - 69.50.112.85 - 7380 - B - - - Snapshot - UDP/IP - 224.0.28.63 - 69.50.112.81 - 6380 - A - - - Snapshot - UDP/IP - 224.0.28.190 - 69.50.112.81 - 7380 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.21 - 69.50.112.29 - 21380 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.152 - 69.50.112.29 - 22380 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.128 + 205.209.221.77 + 205.209.223.77 + 14380 + A + + + Incremental + UDP/IP + 224.0.32.128 + 205.209.212.77 + 205.209.211.77 + 15380 + B + + + Instrument Replay + UDP/IP + 224.0.31.170 + 205.209.222.76 + 205.209.222.82 + 14380 + A + + + Instrument Replay + UDP/IP + 224.0.32.170 + 205.209.213.51 + 205.209.214.51 + 15380 + B + + + Snapshot + UDP/IP + 224.0.31.149 + 205.209.222.80 + 205.209.222.84 + 14380 + A + + + Snapshot + UDP/IP + 224.0.32.149 + 205.209.214.55 + 205.209.213.55 + 15380 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.11 + 205.209.222.115 + 205.209.222.114 + 23380 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.74 + 205.209.213.67 + 205.209.214.67 + 22380 + B + + - - + + - + - - - - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.22 - 69.50.112.95 - 14381 - A - - - Incremental - UDP/IP - 224.0.28.149 - 69.50.112.95 - 15381 - B - - - Instrument Replay - UDP/IP - 224.0.28.106 - 69.50.112.85 - 6381 - A - - - Instrument Replay - UDP/IP - 224.0.28.233 - 69.50.112.85 - 7381 - B - - - Snapshot - UDP/IP - 224.0.28.64 - 69.50.112.81 - 6381 - A - - - Snapshot - UDP/IP - 224.0.28.191 - 69.50.112.81 - 7381 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.22 - 69.50.112.29 - 21381 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.153 - 69.50.112.29 - 22381 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.129 + 205.209.223.77 + 205.209.221.77 + 14381 + A + + + Incremental + UDP/IP + 224.0.32.129 + 205.209.212.77 + 205.209.211.77 + 15381 + B + + + Instrument Replay + UDP/IP + 224.0.31.171 + 205.209.222.76 + 205.209.222.82 + 14381 + A + + + Instrument Replay + UDP/IP + 224.0.32.171 + 205.209.214.51 + 205.209.213.51 + 15381 + B + + + Snapshot + UDP/IP + 224.0.31.150 + 205.209.222.80 + 205.209.222.84 + 14381 + A + + + Snapshot + UDP/IP + 224.0.32.150 + 205.209.214.55 + 205.209.213.55 + 15381 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.12 + 205.209.222.114 + 205.209.222.115 + 23381 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.75 + 205.209.213.67 + 205.209.214.67 + 22381 + B + + @@ -3853,6 +4585,9 @@ + + + @@ -3913,6 +4648,9 @@ + + + @@ -3928,6 +4666,9 @@ + + + @@ -3967,6 +4708,12 @@ + + + + + + @@ -3979,6 +4726,12 @@ + + + + + + @@ -4057,9 +4810,15 @@ + + + + + + @@ -4360,6 +5119,9 @@ + + + @@ -4459,15 +5221,15 @@ - - - + + + @@ -4477,6 +5239,12 @@ + + + + + + @@ -4495,14 +5263,11 @@ - - - - + @@ -4522,18 +5287,9 @@ - - - - - - - - - @@ -4579,6 +5335,12 @@ + + + + + + @@ -4630,9 +5392,6 @@ - - - @@ -4708,6 +5467,9 @@ + + + @@ -4738,14 +5500,11 @@ - - - - + - + @@ -4789,6 +5548,9 @@ + + + @@ -4801,6 +5563,9 @@ + + + @@ -4841,10 +5606,10 @@ - + - + @@ -4916,10 +5681,10 @@ - + - + @@ -5056,21 +5821,6 @@ - - - - - - - - - - - - - - - @@ -5098,9 +5848,6 @@ - - - @@ -5110,6 +5857,9 @@ + + + @@ -5182,6 +5932,9 @@ + + + @@ -5221,6 +5974,9 @@ + + + @@ -5237,103 +5993,97 @@ - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.23 - 69.50.112.95 - 14382 - A - - - Incremental - UDP/IP - 224.0.28.150 - 69.50.112.95 - 15382 - B - - - Instrument Replay - UDP/IP - 224.0.28.107 - 69.50.112.83 - 6382 - A - - - Instrument Replay - UDP/IP - 224.0.28.234 - 69.50.112.83 - 7382 - B - - - Snapshot - UDP/IP - 224.0.28.65 - 69.50.112.79 - 6382 - A - - - Snapshot - UDP/IP - 224.0.28.192 - 69.50.112.79 - 7382 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.23 - 69.50.112.126 - 21382 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.154 - 69.50.112.126 - 22382 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.130 + 205.209.223.78 + 205.209.221.78 + 14382 + A + + + Incremental + UDP/IP + 224.0.32.130 + 205.209.212.78 + 205.209.211.78 + 15382 + B + + + Instrument Replay + UDP/IP + 224.0.31.172 + 205.209.222.82 + 205.209.222.76 + 14382 + A + + + Instrument Replay + UDP/IP + 224.0.32.172 + 205.209.213.51 + 205.209.214.51 + 15382 + B + + + Snapshot + UDP/IP + 224.0.31.151 + 205.209.222.80 + 205.209.222.84 + 14382 + A + + + Snapshot + UDP/IP + 224.0.32.151 + 205.209.214.55 + 205.209.213.55 + 15382 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.18 + 205.209.222.115 + 205.209.222.114 + 23382 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.81 + 205.209.213.67 + 205.209.214.67 + 22382 + B + + - - - - - - - - + + - - - - - - - - - @@ -5355,47 +6105,53 @@ - - - - + - + - + - + + + + + + + + + + - + + + + - - - - - + + - - + + @@ -5421,20 +6177,32 @@ + + + - + + + + + + + - - + + + + + @@ -5442,98 +6210,101 @@ - - - - - - - - - - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.24 - 69.50.112.95 - 14383 - A - - - Incremental - UDP/IP - 224.0.28.151 - 69.50.112.95 - 15383 - B - - - Instrument Replay - UDP/IP - 224.0.28.108 - 69.50.112.83 - 6383 - A - - - Instrument Replay - UDP/IP - 224.0.28.235 - 69.50.112.83 - 7383 - B - - - Snapshot - UDP/IP - 224.0.28.66 - 69.50.112.79 - 6383 - A - - - Snapshot - UDP/IP - 224.0.28.193 - 69.50.112.79 - 7383 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.24 - 69.50.112.126 - 21383 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.155 - 69.50.112.126 - 22383 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.131 + 205.209.221.77 + 205.209.223.77 + 14383 + A + + + Incremental + UDP/IP + 224.0.32.131 + 205.209.212.77 + 205.209.211.77 + 15383 + B + + + Instrument Replay + UDP/IP + 224.0.31.173 + 205.209.222.85 + 205.209.222.73 + 14383 + A + + + Instrument Replay + UDP/IP + 224.0.32.173 + 205.209.214.48 + 205.209.213.48 + 15383 + B + + + Snapshot + UDP/IP + 224.0.31.152 + 205.209.222.87 + 205.209.222.77 + 14383 + A + + + Snapshot + UDP/IP + 224.0.32.152 + 205.209.214.52 + 205.209.213.52 + 15383 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.22 + 205.209.222.108 + 205.209.222.109 + 23383 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.85 + 205.209.213.64 + 205.209.214.64 + 22383 + B + + + + + @@ -5544,14 +6315,11 @@ - + - - - @@ -5561,17 +6329,17 @@ + + + - - - - + @@ -5580,87 +6348,102 @@ - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.25 - 69.50.112.94 - 14384 - A - - - Incremental - UDP/IP - 224.0.28.152 - 69.50.112.94 - 15384 - B - - - Instrument Replay - UDP/IP - 224.0.28.109 - 69.50.112.83 - 6384 - A - - - Instrument Replay - UDP/IP - 224.0.28.236 - 69.50.112.83 - 7384 - B - - - Snapshot - UDP/IP - 224.0.28.67 - 69.50.112.79 - 6384 - A - - - Snapshot - UDP/IP - 224.0.28.194 - 69.50.112.79 - 7384 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.25 - 69.50.112.126 - 21384 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.156 - 69.50.112.126 - 22384 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.132 + 205.209.223.79 + 205.209.221.79 + 14384 + A + + + Incremental + UDP/IP + 224.0.32.132 + 205.209.211.79 + 205.209.212.79 + 15384 + B + + + Instrument Replay + UDP/IP + 224.0.31.174 + 205.209.222.76 + 205.209.222.82 + 14384 + A + + + Instrument Replay + UDP/IP + 224.0.32.174 + 205.209.214.51 + 205.209.213.51 + 15384 + B + + + Snapshot + UDP/IP + 224.0.31.153 + 205.209.222.80 + 205.209.222.84 + 14384 + A + + + Snapshot + UDP/IP + 224.0.32.153 + 205.209.214.55 + 205.209.213.55 + 15384 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.20 + 205.209.222.115 + 205.209.222.114 + 23384 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.83 + 205.209.214.67 + 205.209.213.67 + 22384 + B + + + + + + + + - + @@ -5669,82 +6452,94 @@ - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.26 - 69.50.112.95 - 14385 - A - - - Incremental - UDP/IP - 224.0.28.153 - 69.50.112.95 - 15385 - B - - - Instrument Replay - UDP/IP - 224.0.28.110 - 69.50.112.82 - 6385 - A - - - Instrument Replay - UDP/IP - 224.0.28.237 - 69.50.112.82 - 7385 - B - - - Snapshot - UDP/IP - 224.0.28.68 - 69.50.112.78 - 6385 - A - - - Snapshot - UDP/IP - 224.0.28.195 - 69.50.112.78 - 7385 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.26 - 69.50.112.125 - 21385 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.157 - 69.50.112.125 - 22385 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.133 + 205.209.221.77 + 205.209.223.77 + 14385 + A + + + Incremental + UDP/IP + 224.0.32.133 + 205.209.212.77 + 205.209.211.77 + 15385 + B + + + Instrument Replay + UDP/IP + 224.0.31.175 + 205.209.222.81 + 205.209.222.75 + 14385 + A + + + Instrument Replay + UDP/IP + 224.0.32.175 + 205.209.213.50 + 205.209.214.50 + 15385 + B + + + Snapshot + UDP/IP + 224.0.31.154 + 205.209.222.83 + 205.209.222.79 + 14385 + A + + + Snapshot + UDP/IP + 224.0.32.154 + 205.209.213.54 + 205.209.214.54 + 15385 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.24 + 205.209.222.113 + 205.209.222.112 + 23385 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.87 + 205.209.213.66 + 205.209.214.66 + 22385 + B + + + + + @@ -6030,18 +6825,6 @@ - - - - - - - - - - - - @@ -6171,9 +6954,6 @@ - - - @@ -6252,9 +7032,6 @@ - - - @@ -6321,6 +7098,12 @@ + + + + + + @@ -6426,21 +7209,24 @@ - - - + + + + + + @@ -6468,15 +7254,18 @@ - - - + + + + + + @@ -6546,6 +7335,12 @@ + + + + + + @@ -6714,6 +7509,9 @@ + + + @@ -6753,9 +7551,15 @@ + + + + + + @@ -6900,6 +7704,9 @@ + + + @@ -7122,9 +7929,6 @@ - - - @@ -7152,6 +7956,9 @@ + + + @@ -7179,6 +7986,9 @@ + + + @@ -7200,31 +8010,37 @@ - + + + + - + - + - + - + - + - + - + - + + + + @@ -7254,8 +8070,8 @@ - - + + @@ -7272,6 +8088,15 @@ + + + + + + + + + @@ -7299,6 +8124,9 @@ + + + @@ -7480,99 +8308,93 @@ - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.27 - 69.50.112.94 - 14386 - A - - - Incremental - UDP/IP - 224.0.28.154 - 69.50.112.94 - 15386 - B - - - Instrument Replay - UDP/IP - 224.0.28.111 - 69.50.112.84 - 6386 - A - - - Instrument Replay - UDP/IP - 224.0.28.238 - 69.50.112.84 - 7386 - B - - - Snapshot - UDP/IP - 224.0.28.69 - 69.50.112.80 - 6386 - A - - - Snapshot - UDP/IP - 224.0.28.196 - 69.50.112.80 - 7386 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.27 - 69.50.112.28 - 21386 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.158 - 69.50.112.28 - 22386 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.134 + 205.209.223.77 + 205.209.221.77 + 14386 + A + + + Incremental + UDP/IP + 224.0.32.134 + 205.209.212.77 + 205.209.211.77 + 15386 + B + + + Instrument Replay + UDP/IP + 224.0.31.176 + 205.209.222.81 + 205.209.222.75 + 14386 + A + + + Instrument Replay + UDP/IP + 224.0.32.176 + 205.209.214.50 + 205.209.213.50 + 15386 + B + + + Snapshot + UDP/IP + 224.0.31.155 + 205.209.222.79 + 205.209.222.83 + 14386 + A + + + Snapshot + UDP/IP + 224.0.32.155 + 205.209.214.54 + 205.209.213.54 + 15386 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.19 + 205.209.222.113 + 205.209.222.112 + 23386 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.82 + 205.209.213.66 + 205.209.214.66 + 22386 + B + + - - - - - - - - - - - - - - - - - + + @@ -7580,15 +8402,6 @@ - - - - - - - - - @@ -7598,954 +8411,458 @@ - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - + - + - - + + - - - - - - - - - - - - - - - - - - - - - - + - + - - + + - + - - - - - - - - + + - + - + - + - - - + + + + + + + + + + + + - - - - + - + - + - + - - - - - + + - - - - - - - - - - - - - - + + - - + + - - + + - + + + + + + + - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.28 - 69.50.112.95 - 14387 - A - - - Incremental - UDP/IP - 224.0.28.155 - 69.50.112.95 - 15387 - B - - - Instrument Replay - UDP/IP - 224.0.28.112 - 69.50.112.84 - 6387 - A - - - Instrument Replay - UDP/IP - 224.0.28.239 - 69.50.112.84 - 7387 - B - - - Snapshot - UDP/IP - 224.0.28.70 - 69.50.112.80 - 6387 - A - - - Snapshot - UDP/IP - 224.0.28.197 - 69.50.112.80 - 7387 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.28 - 69.50.112.28 - 21387 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.159 - 69.50.112.28 - 22387 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.31.135 + 205.209.223.77 + 205.209.221.77 + 14387 + A + + + Incremental + UDP/IP + 224.0.32.135 + 205.209.211.77 + 205.209.212.77 + 15387 + B + + + Instrument Replay + UDP/IP + 224.0.31.177 + 205.209.222.74 + 205.209.222.86 + 14387 + A + + + Instrument Replay + UDP/IP + 224.0.32.177 + 205.209.213.49 + 205.209.214.49 + 15387 + B + + + Snapshot + UDP/IP + 224.0.31.156 + 205.209.222.88 + 205.209.222.78 + 14387 + A + + + Snapshot + UDP/IP + 224.0.32.156 + 205.209.213.53 + 205.209.214.53 + 15387 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.23 + 205.209.222.110 + 205.209.222.111 + 23387 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.86 + 205.209.214.65 + 205.209.213.65 + 22387 + B + + - - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.29 - 69.50.112.93 - 14410 - A - - - Incremental - UDP/IP - 224.0.28.156 - 69.50.112.93 - 15410 - B - - - Instrument Replay - UDP/IP - 224.0.28.113 - 69.50.112.85 - 6410 - A - - - Instrument Replay - UDP/IP - 224.0.28.240 - 69.50.112.85 - 7410 - B - - - Snapshot - UDP/IP - 224.0.28.71 - 69.50.112.81 - 6410 - A - - - Snapshot - UDP/IP - 224.0.28.198 - 69.50.112.81 - 7410 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.29 - 69.50.112.29 - 21410 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.160 - 69.50.112.29 - 22410 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.33.1 + 205.209.221.73 + 205.209.223.73 + 14410 + A + + + Incremental + UDP/IP + 224.0.34.1 + 205.209.211.73 + 205.209.212.73 + 15410 + B + + + Instrument Replay + UDP/IP + 224.0.33.43 + 205.209.222.85 + 205.209.222.73 + 14410 + A + + + Instrument Replay + UDP/IP + 224.0.34.43 + 205.209.214.48 + 205.209.213.48 + 15410 + B + + + Snapshot + UDP/IP + 224.0.33.22 + 205.209.222.87 + 205.209.222.77 + 14410 + A + + + Snapshot + UDP/IP + 224.0.34.22 + 205.209.213.52 + 205.209.214.52 + 15410 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.28 + 205.209.222.109 + 205.209.222.108 + 23410 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.91 + 205.209.213.64 + 205.209.214.64 + 22410 + B + + - - - - - - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 233.72.75.156 - 69.50.112.93 - 14411 - A - - - Incremental - UDP/IP - 233.72.75.157 - 69.50.112.93 - 15411 - B - - - Instrument Replay - UDP/IP - 233.72.75.160 - 69.50.112.85 - 6411 - A - - - Instrument Replay - UDP/IP - 233.72.75.161 - 69.50.112.85 - 7411 - B - - - Snapshot - UDP/IP - 233.72.75.158 - 69.50.112.81 - 6411 - A - - - Snapshot - UDP/IP - 233.72.75.159 - 69.50.112.81 - 7411 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.38 - 69.50.112.29 - 21411 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.165 - 69.50.112.29 - 22411 - B - - + + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.33.2 + 205.209.221.73 + 205.209.223.73 + 14411 + A + + + Incremental + UDP/IP + 224.0.34.2 + 205.209.212.73 + 205.209.211.73 + 15411 + B + + + Instrument Replay + UDP/IP + 224.0.33.44 + 205.209.222.73 + 205.209.222.85 + 14411 + A + + + Instrument Replay + UDP/IP + 224.0.34.44 + 205.209.213.48 + 205.209.214.48 + 15411 + B + + + Snapshot + UDP/IP + 224.0.33.23 + 205.209.222.77 + 205.209.222.87 + 14411 + A + + + Snapshot + UDP/IP + 224.0.34.23 + 205.209.214.52 + 205.209.213.52 + 15411 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.38 + 205.209.222.109 + 205.209.222.108 + 23411 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.101 + 205.209.214.64 + 205.209.213.64 + 22411 + B + + @@ -8564,9 +8881,6 @@ - - - @@ -8597,9 +8911,6 @@ - - - @@ -8610,79 +8921,88 @@ - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.30 - 69.50.112.95 - 14430 - A - - - Incremental - UDP/IP - 224.0.28.157 - 69.50.112.95 - 15430 - B - - - Instrument Replay - UDP/IP - 224.0.28.114 - 69.50.112.85 - 6430 - A - - - Instrument Replay - UDP/IP - 224.0.28.241 - 69.50.112.85 - 7430 - B - - - Snapshot - UDP/IP - 224.0.28.72 - 69.50.112.81 - 6430 - A - - - Snapshot - UDP/IP - 224.0.28.199 - 69.50.112.81 - 7430 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.30 - 69.50.112.29 - 21430 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.161 - 69.50.112.29 - 22430 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.33.64 + 205.209.223.74 + 205.209.221.74 + 14430 + A + + + Incremental + UDP/IP + 224.0.34.64 + 205.209.211.74 + 205.209.212.74 + 15430 + B + + + Instrument Replay + UDP/IP + 224.0.33.74 + 205.209.222.86 + 205.209.222.74 + 14430 + A + + + Instrument Replay + UDP/IP + 224.0.34.74 + 205.209.213.49 + 205.209.214.49 + 15430 + B + + + Snapshot + UDP/IP + 224.0.33.69 + 205.209.222.78 + 205.209.222.88 + 14430 + A + + + Snapshot + UDP/IP + 224.0.34.69 + 205.209.214.53 + 205.209.213.53 + 15430 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.14 + 205.209.222.110 + 205.209.222.111 + 23430 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.77 + 205.209.213.65 + 205.209.214.65 + 22430 + B + + @@ -8693,79 +9013,88 @@ - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.31 - 69.50.112.95 - 14431 - A - - - Incremental - UDP/IP - 224.0.28.158 - 69.50.112.95 - 15431 - B - - - Instrument Replay - UDP/IP - 224.0.28.115 - 69.50.112.82 - 6431 - A - - - Instrument Replay - UDP/IP - 224.0.28.242 - 69.50.112.82 - 7431 - B - - - Snapshot - UDP/IP - 224.0.28.73 - 69.50.112.78 - 6431 - A - - - Snapshot - UDP/IP - 224.0.28.200 - 69.50.112.78 - 7431 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.31 - 69.50.112.125 - 21431 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.162 - 69.50.112.125 - 22431 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.33.65 + 205.209.223.74 + 205.209.221.74 + 14431 + A + + + Incremental + UDP/IP + 224.0.34.65 + 205.209.211.74 + 205.209.212.74 + 15431 + B + + + Instrument Replay + UDP/IP + 224.0.33.75 + 205.209.222.86 + 205.209.222.74 + 14431 + A + + + Instrument Replay + UDP/IP + 224.0.34.75 + 205.209.214.49 + 205.209.213.49 + 15431 + B + + + Snapshot + UDP/IP + 224.0.33.70 + 205.209.222.88 + 205.209.222.78 + 14431 + A + + + Snapshot + UDP/IP + 224.0.34.70 + 205.209.214.53 + 205.209.213.53 + 15431 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.15 + 205.209.222.110 + 205.209.222.111 + 23431 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.78 + 205.209.214.65 + 205.209.213.65 + 22431 + B + + @@ -8805,12 +9134,21 @@ + + + + + + + + + @@ -8824,162 +9162,177 @@ - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.32 - 69.50.112.95 - 14440 - A - - - Incremental - UDP/IP - 224.0.28.159 - 69.50.112.95 - 15440 - B - - - Instrument Replay - UDP/IP - 224.0.28.116 - 69.50.112.83 - 6440 - A - - - Instrument Replay - UDP/IP - 224.0.28.243 - 69.50.112.83 - 7440 - B - - - Snapshot - UDP/IP - 224.0.28.74 - 69.50.112.79 - 6440 - A - - - Snapshot - UDP/IP - 224.0.28.201 - 69.50.112.79 - 7440 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.32 - 69.50.112.126 - 21440 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.163 - 69.50.112.126 - 22440 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.33.80 + 205.209.221.78 + 205.209.223.78 + 14440 + A + + + Incremental + UDP/IP + 224.0.34.80 + 205.209.212.78 + 205.209.211.78 + 15440 + B + + + Instrument Replay + UDP/IP + 224.0.33.90 + 205.209.222.75 + 205.209.222.81 + 14440 + A + + + Instrument Replay + UDP/IP + 224.0.34.90 + 205.209.214.50 + 205.209.213.50 + 15440 + B + + + Snapshot + UDP/IP + 224.0.33.85 + 205.209.222.79 + 205.209.222.83 + 14440 + A + + + Snapshot + UDP/IP + 224.0.34.85 + 205.209.214.54 + 205.209.213.54 + 15440 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.16 + 205.209.222.112 + 205.209.222.113 + 23440 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.79 + 205.209.214.66 + 205.209.213.66 + 22440 + B + + - - - - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.33 - 69.50.112.95 - 14441 - A - - - Incremental - UDP/IP - 224.0.28.160 - 69.50.112.95 - 15441 - B - - - Instrument Replay - UDP/IP - 224.0.28.117 - 69.50.112.82 - 6441 - A - - - Instrument Replay - UDP/IP - 224.0.28.244 - 69.50.112.82 - 7441 - B - - - Snapshot - UDP/IP - 224.0.28.75 - 69.50.112.78 - 6441 - A - - - Snapshot - UDP/IP - 224.0.28.202 - 69.50.112.78 - 7441 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.33 - 69.50.112.125 - 21441 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.129 - 69.50.112.125 - 22441 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.33.81 + 205.209.221.77 + 205.209.223.77 + 14441 + A + + + Incremental + UDP/IP + 224.0.34.81 + 205.209.212.77 + 205.209.211.77 + 15441 + B + + + Instrument Replay + UDP/IP + 224.0.33.91 + 205.209.222.75 + 205.209.222.81 + 14441 + A + + + Instrument Replay + UDP/IP + 224.0.34.91 + 205.209.213.50 + 205.209.214.50 + 15441 + B + + + Snapshot + UDP/IP + 224.0.33.86 + 205.209.222.79 + 205.209.222.83 + 14441 + A + + + Snapshot + UDP/IP + 224.0.34.86 + 205.209.213.54 + 205.209.214.54 + 15441 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.17 + 205.209.222.112 + 205.209.222.113 + 23441 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.80 + 205.209.213.66 + 205.209.214.66 + 22441 + B + + @@ -8990,79 +9343,88 @@ - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.34 - 69.50.112.95 - 14450 - A - - - Incremental - UDP/IP - 224.0.28.161 - 69.50.112.95 - 15450 - B - - - Instrument Replay - UDP/IP - 224.0.28.118 - 69.50.112.82 - 6450 - A - - - Instrument Replay - UDP/IP - 224.0.28.245 - 69.50.112.82 - 7450 - B - - - Snapshot - UDP/IP - 224.0.28.76 - 69.50.112.78 - 6450 - A - - - Snapshot - UDP/IP - 224.0.28.203 - 69.50.112.78 - 7450 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.34 - 69.50.112.125 - 21450 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.130 - 69.50.112.125 - 22450 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.33.96 + 205.209.221.74 + 205.209.223.74 + 14450 + A + + + Incremental + UDP/IP + 224.0.34.96 + 205.209.211.74 + 205.209.212.74 + 15450 + B + + + Instrument Replay + UDP/IP + 224.0.33.106 + 205.209.222.86 + 205.209.222.74 + 14450 + A + + + Instrument Replay + UDP/IP + 224.0.34.106 + 205.209.214.49 + 205.209.213.49 + 15450 + B + + + Snapshot + UDP/IP + 224.0.33.101 + 205.209.222.78 + 205.209.222.88 + 14450 + A + + + Snapshot + UDP/IP + 224.0.34.101 + 205.209.214.53 + 205.209.213.53 + 15450 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.13 + 205.209.222.110 + 205.209.222.111 + 23450 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.76 + 205.209.213.65 + 205.209.214.65 + 22450 + B + + @@ -9093,14 +9455,50 @@ + + + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + @@ -9112,85 +9510,112 @@ - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.35 - 69.50.112.88 - 14460 - A - - - Incremental - UDP/IP - 224.0.28.162 - 69.50.112.88 - 15460 - B - - - Instrument Replay - UDP/IP - 224.0.28.119 - 69.50.112.84 - 6460 - A - - - Instrument Replay - UDP/IP - 224.0.28.246 - 69.50.112.84 - 7460 - B - - - Snapshot - UDP/IP - 224.0.28.77 - 69.50.112.80 - 6460 - A - - - Snapshot - UDP/IP - 224.0.28.204 - 69.50.112.80 - 7460 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.35 - 69.50.112.28 - 21460 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.131 - 69.50.112.28 - 22460 - B - - + + + Historical Replay + TCP/IP + 205.209.220.72 + 205.209.222.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.33.112 + 205.209.221.71 + 205.209.223.71 + 14460 + A + + + Incremental + UDP/IP + 224.0.34.112 + 205.209.212.71 + 205.209.211.71 + 15460 + B + + + Instrument Replay + UDP/IP + 224.0.33.122 + 205.209.222.73 + 205.209.222.85 + 14460 + A + + + Instrument Replay + UDP/IP + 224.0.34.122 + 205.209.213.48 + 205.209.214.48 + 15460 + B + + + Snapshot + UDP/IP + 224.0.33.117 + 205.209.222.77 + 205.209.222.87 + 14460 + A + + + Snapshot + UDP/IP + 224.0.34.117 + 205.209.214.52 + 205.209.213.52 + 15460 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.36 + 205.209.222.109 + 205.209.222.108 + 23460 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.99 + 205.209.214.64 + 205.209.213.64 + 22460 + B + + + + + + + + + + + + + + + + + + + + @@ -9203,9 +9628,30 @@ + + + + + + + + + + + + + + + + + + + + + @@ -9218,373 +9664,621 @@ - - - - - + + - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 224.0.28.36 - 69.50.112.88 - 14461 - A - - - Incremental - UDP/IP - 224.0.28.163 - 69.50.112.88 - 15461 - B - - - Instrument Replay - UDP/IP - 224.0.28.120 - 69.50.112.85 - 6461 - A - - - Instrument Replay - UDP/IP - 224.0.28.247 - 69.50.112.85 - 7461 - B - - - Snapshot - UDP/IP - 224.0.28.78 - 69.50.112.81 - 6461 - A - - - Snapshot - UDP/IP - 224.0.28.205 - 69.50.112.81 - 7461 - B - - - Snapshot-MBO - UDP/IP - 233.119.149.36 - 69.50.112.29 - 21461 - A - - - Snapshot-MBO - UDP/IP - 233.119.149.132 - 69.50.112.29 - 22461 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.33.113 + 205.209.223.74 + 205.209.221.74 + 14461 + A + + + Incremental + UDP/IP + 224.0.34.113 + 205.209.211.74 + 205.209.212.74 + 15461 + B + + + Instrument Replay + UDP/IP + 224.0.33.123 + 205.209.222.86 + 205.209.222.74 + 14461 + A + + + Instrument Replay + UDP/IP + 224.0.34.123 + 205.209.213.49 + 205.209.214.49 + 15461 + B + + + Snapshot + UDP/IP + 224.0.33.118 + 205.209.222.78 + 205.209.222.88 + 14461 + A + + + Snapshot + UDP/IP + 224.0.34.118 + 205.209.213.53 + 205.209.214.53 + 15461 + B + + + Snapshot-MBO + UDP/IP + 233.72.75.37 + 205.209.222.110 + 205.209.222.111 + 23461 + A + + + Snapshot-MBO + UDP/IP + 233.72.75.100 + 205.209.213.65 + 205.209.214.65 + 22461 + B + + - + - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 233.72.75.162 - 69.50.112.46 - 14510 - A - - - Incremental - UDP/IP - 233.72.75.163 - 69.50.112.46 - 15510 - B - - - Instrument Replay - UDP/IP - 233.72.75.166 - 69.50.112.82 - 6510 - A - - - Instrument Replay - UDP/IP - 233.72.75.167 - 69.50.112.82 - 7510 - B - - - Snapshot - UDP/IP - 233.72.75.164 - 69.50.112.78 - 6510 - A - - - Snapshot - UDP/IP - 233.72.75.165 - 69.50.112.78 - 7510 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.33.144 + 205.209.220.70 + 205.209.222.70 + 14520 + A + + + Incremental + UDP/IP + 224.0.34.144 + 205.209.213.46 + 205.209.214.46 + 15520 + B + + + Instrument Replay + UDP/IP + 224.0.33.154 + 205.209.222.76 + 205.209.222.82 + 14520 + A + + + Instrument Replay + UDP/IP + 224.0.34.154 + 205.209.214.51 + 205.209.213.51 + 15520 + B + + + Snapshot + UDP/IP + 224.0.33.149 + 205.209.222.80 + 205.209.222.84 + 14520 + A + + + Snapshot + UDP/IP + 224.0.34.149 + 205.209.214.55 + 205.209.213.55 + 15520 + B + + - + - - - Historical Replay - TCP/IP - 69.50.112.160 - 9000 - A - - - Incremental - UDP/IP - 233.72.75.162 - 69.50.112.46 - 14511 - A - - - Incremental - UDP/IP - 233.72.75.163 - 69.50.112.46 - 15511 - B - - - Instrument Replay - UDP/IP - 233.72.75.166 - 69.50.112.82 - 6511 - A - - - Instrument Replay - UDP/IP - 233.72.75.167 - 69.50.112.82 - 7511 - B - - - Snapshot - UDP/IP - 233.72.75.164 - 69.50.112.78 - 6511 - A - - - Snapshot - UDP/IP - 233.72.75.165 - 69.50.112.78 - 7511 - B - - + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + Incremental + UDP/IP + 224.0.33.145 + 205.209.220.70 + 205.209.222.70 + 14521 + A + + + Incremental + UDP/IP + 224.0.34.145 + 205.209.213.46 + 205.209.214.46 + 15521 + B + + + Instrument Replay + UDP/IP + 224.0.33.155 + 205.209.222.76 + 205.209.222.82 + 14521 + A + + + Instrument Replay + UDP/IP + 224.0.34.155 + 205.209.214.51 + 205.209.213.51 + 15521 + B + + + Snapshot + UDP/IP + 224.0.33.150 + 205.209.222.80 + 205.209.222.84 + 14521 + A + + + Snapshot + UDP/IP + 224.0.34.150 + 205.209.214.55 + 205.209.213.55 + 15521 + B + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Incremental + UDP/IP + 224.0.28.125 + 69.50.112.67 + 11644 + A + + + Incremental + UDP/IP + 224.0.25.101 + 69.50.112.67 + 11744 + B + + + Instrument Replay + UDP/IP + 224.0.28.125 + 69.50.112.76 + 16644 + A + + + Snapshot + UDP/IP + 224.0.28.79 + 69.50.112.76 + 19644 + A + + + Snapshot-MBO + UDP/IP + 224.0.25.254 + 69.50.112.66 + 20644 + A + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + + - - + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + Incremental + UDP/IP + 224.0.28.126 + 69.50.112.67 + 11648 + A + + + Incremental + UDP/IP + 224.0.25.101 + 69.50.112.67 + 11748 + B + + + Instrument Replay + UDP/IP + 224.0.28.126 + 69.50.112.77 + 16648 + A + + + Snapshot + UDP/IP + 224.0.25.127 + 69.50.112.77 + 19648 + A + + + Snapshot-MBO + UDP/IP + 224.0.25.254 + 69.50.112.77 + 20648 + A + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - Incremental - UDP/IP - 224.0.28.164 - 69.50.112.46 - 14520 - A - - - Incremental - UDP/IP - 224.0.28.165 - 69.50.112.46 - 15520 - B - - - Instrument Replay - UDP/IP - 224.0.28.168 - 69.50.112.82 - 6520 - A - - - Instrument Replay - UDP/IP - 224.0.28.169 - 69.50.112.82 - 7520 - B - - - Snapshot - UDP/IP - 224.0.28.166 - 69.50.112.78 - 6520 - A - - - Snapshot - UDP/IP - 224.0.28.167 - 69.50.112.78 - 7520 - B - - + + + Incremental + UDP/IP + 224.0.25.101 + 69.50.112.67 + 11601 + A + + + Incremental + UDP/IP + 224.0.25.101 + 69.50.112.67 + 11701 + B + + + Instrument Replay + UDP/IP + 224.0.25.127 + 69.50.112.74 + 16601 + A + + + Snapshot + UDP/IP + 224.0.25.127 + 69.50.112.74 + 19601 + A + + + Snapshot-MBO + UDP/IP + 224.0.25.254 + 69.50.112.67 + 20601 + A + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - - Incremental - UDP/IP - 224.0.28.164 - 69.50.112.46 - 14521 - A - - - Incremental - UDP/IP - 224.0.28.165 - 69.50.112.46 - 15521 - B - - - Instrument Replay - UDP/IP - 224.0.28.168 - 69.50.112.82 - 6521 - A - - - Instrument Replay - UDP/IP - 224.0.28.169 - 69.50.112.82 - 7521 - B - - - Snapshot - UDP/IP - 224.0.28.166 - 69.50.112.78 - 6521 - A - - - Snapshot - UDP/IP - 224.0.28.167 - 69.50.112.78 - 7521 - B - - + + + Incremental + UDP/IP + 224.0.28.125 + 69.50.112.67 + 11666 + A + + + Incremental + UDP/IP + 224.0.25.101 + 69.50.112.67 + 11766 + B + + + Instrument Replay + UDP/IP + 224.0.28.125 + 69.50.112.74 + 16666 + A + + + Snapshot + UDP/IP + 224.0.28.125 + 69.50.112.74 + 19666 + A + + + Snapshot-MBO + UDP/IP + 224.0.25.254 + 69.50.112.67 + 20666 + A + + + Historical Replay + TCP/IP + 205.209.222.72 + 205.209.220.72 + 10000 + A + + diff --git a/mbp-with-mbo/src/test/resources/log4j2.xml b/mbp-with-mbo/src/test/resources/log4j2.xml new file mode 100644 index 0000000..4c7150c --- /dev/null +++ b/mbp-with-mbo/src/test/resources/log4j2.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + %d %p %c{1.} [%t] %m%n + + + + + + + + + + diff --git a/src/test/resources/templates_FixBinary.xml b/mbp-with-mbo/src/test/resources/templates_FixBinary.xml similarity index 100% rename from src/test/resources/templates_FixBinary.xml rename to mbp-with-mbo/src/test/resources/templates_FixBinary.xml diff --git a/settings.gradle b/settings.gradle index c9318ba..4e7b80a 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,4 @@ -rootProject.name = 'b2bits-jmdp3' +include 'core' +include 'mbp-only' +include 'mbp-with-mbo' + diff --git a/src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedRtmState.java b/src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedRtmState.java deleted file mode 100644 index 113a66a..0000000 --- a/src/main/java/com/epam/cme/mdp3/core/channel/MdpFeedRtmState.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.epam.cme.mdp3.core.channel; - -public enum MdpFeedRtmState { - ACTIVE, PENDING_SHUTDOWN, SHUTDOWN, STOPPED -} diff --git a/src/test/java/com/epam/cme/mdp3/test/InstrumentInfo.java b/src/test/java/com/epam/cme/mdp3/test/InstrumentInfo.java deleted file mode 100644 index d9922b1..0000000 --- a/src/test/java/com/epam/cme/mdp3/test/InstrumentInfo.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.epam.cme.mdp3.test; - -public class InstrumentInfo { - final int instrumentId; - final String desc; - - public InstrumentInfo(final int instrumentId, final String desc) { - this.instrumentId = instrumentId; - this.desc = desc; - } - - @Override - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - InstrumentInfo that = (InstrumentInfo) o; - - if (instrumentId != that.instrumentId) return false; - return desc.equals(that.desc); - - } - - @Override - public int hashCode() { - int result = instrumentId; - result = 31 * result + desc.hashCode(); - return result; - } - - @Override - public String toString() { - return "Instrument{" + instrumentId + ", '" + desc + "'}"; - } -}