Package com.bank.trading.data
Class ReferenceData
java.lang.Object
com.bank.trading.data.ReferenceData
- All Implemented Interfaces:
Runnable
This service takes market data from bloomberg and stream to lamport service.
This service is run as a cluster with one active leader, the others on standby in case of failure.
-
Constructor Summary
ConstructorsConstructorDescriptionReferenceData(InetSocketAddress address, URI bloombergURI, InetSocketAddress LamportAddress, List<InetSocketAddress> peers) Constructor to initialize the market data service. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddReferenceData(String ReferenceData) Add market data to the system.voidchangeLamportAddress(InetSocketAddress address) Change the lamport address to a new one.voidrun()This method is responsible for streaming data from bloomberg to lamport service.voidsendReferenceData(Event ReferenceData) Send market data to the lamport service.
-
Constructor Details
-
ReferenceData
public ReferenceData(InetSocketAddress address, URI bloombergURI, InetSocketAddress LamportAddress, List<InetSocketAddress> peers) Constructor to initialize the market data service.- Parameters:
address- the address of this service.bloombergURI- the URI of the bloomberg service.LamportAddress- the address of the lamport service.
-
-
Method Details
-
run
public void run()This method is responsible for streaming data from bloomberg to lamport service. -
changeLamportAddress
Change the lamport address to a new one. This is called when the lamport leader changes.- Parameters:
address- the new lamport address.
-
addReferenceData
Add market data to the system.- Parameters:
ReferenceData- the market data to be added.
-
sendReferenceData
Send market data to the lamport service. This will be called to send the latest market data.- Parameters:
ReferenceData- the market data event to be sent.
-