Package com.bank.trading.data
Class MarketData
java.lang.Object
com.bank.trading.data.MarketData
- All Implemented Interfaces:
Runnable
This service takes market data from bloomberg and streams to lamport service.
This service is run as a cluster with one active leader, the others on standby in case of failure.
-
Constructor Summary
ConstructorsConstructorDescriptionMarketData(InetSocketAddress address, URI bloombergURI, InetSocketAddress LamportAddress, List<InetSocketAddress> peers) Constructor to initialize the market data service. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMarketData(String marketData) 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.voidsendMarketData(Event marketData) Send market data to the lamport service.
-
Constructor Details
-
MarketData
public MarketData(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.
-
addMarketData
Add market data to the system.- Parameters:
marketData- the market data to be added.
-
sendMarketData
Send market data to the lamport service. This will be called to send the latest market data.- Parameters:
marketData- the market data event to be sent.
-