public abstract class BaseExchange extends Object implements Exchange
Modifier and Type | Field and Description |
---|---|
protected ExchangeSpecification |
exchangeSpecification |
protected org.slf4j.Logger |
logger |
protected ExchangeMetaData |
metaData |
protected PollingAccountService |
pollingAccountService |
protected PollingMarketDataService |
pollingMarketDataService |
protected PollingTradeService |
pollingTradeService |
protected StreamingExchangeService |
streamingExchangeService |
Constructor and Description |
---|
BaseExchange() |
Modifier and Type | Method and Description |
---|---|
void |
applySpecification(ExchangeSpecification exchangeSpecification)
Applies any exchange specific parameters
|
ExchangeSpecification |
getExchangeSpecification() |
ExchangeMetaData |
getMetaData()
The MetaData defining some semi-static properties of an exchange such as currency pairs, trading fees, etc.
|
String |
getMetaDataFileName(ExchangeSpecification exchangeSpecification) |
PollingAccountService |
getPollingAccountService()
An account service typically provides access to the user's private exchange data
|
PollingMarketDataService |
getPollingMarketDataService()
A market data service typically consists of a regularly updated list of the available prices for the various symbols
|
PollingTradeService |
getPollingTradeService()
An trade service typically provides access to trading functionality
|
StreamingExchangeService |
getStreamingExchangeService(ExchangeStreamingConfiguration configuration)
A market data service typically consists of a regularly updated list of the available prices for the various symbols
|
protected void |
initServices() |
protected void |
loadExchangeMetaData(InputStream is) |
protected void |
loadMetaData(InputStream is) |
protected <T> T |
loadMetaData(InputStream is,
Class<T> type) |
void |
remoteInit()
Initialize this instance with the remote meta data.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getDefaultExchangeSpecification, getNonceFactory
protected final org.slf4j.Logger logger
protected ExchangeSpecification exchangeSpecification
protected ExchangeMetaData metaData
protected PollingMarketDataService pollingMarketDataService
protected PollingTradeService pollingTradeService
protected PollingAccountService pollingAccountService
protected StreamingExchangeService streamingExchangeService
public void applySpecification(ExchangeSpecification exchangeSpecification)
Exchange
applySpecification
in interface Exchange
exchangeSpecification
- The ExchangeSpecification
protected void initServices()
public void remoteInit() throws IOException, ExchangeException
Exchange
Exchange.getMetaData()
. Some exchanges
require it before using some of their services.remoteInit
in interface Exchange
IOException
ExchangeException
protected void loadMetaData(InputStream is)
protected <T> T loadMetaData(InputStream is, Class<T> type)
protected void loadExchangeMetaData(InputStream is)
public String getMetaDataFileName(ExchangeSpecification exchangeSpecification)
public ExchangeSpecification getExchangeSpecification()
getExchangeSpecification
in interface Exchange
public ExchangeMetaData getMetaData()
Exchange
getMetaData
in interface Exchange
public PollingMarketDataService getPollingMarketDataService()
Exchange
A market data service typically consists of a regularly updated list of the available prices for the various symbols
This is the non-streaming (blocking) version of the service
getPollingMarketDataService
in interface Exchange
public PollingTradeService getPollingTradeService()
Exchange
An trade service typically provides access to trading functionality
Typically access is restricted by a secret API key and/or username password authentication which are usually provided in the
ExchangeSpecification
getPollingTradeService
in interface Exchange
public PollingAccountService getPollingAccountService()
Exchange
An account service typically provides access to the user's private exchange data
Typically access is restricted by a secret API key and/or username password authentication which are usually provided in the
ExchangeSpecification
getPollingAccountService
in interface Exchange
public StreamingExchangeService getStreamingExchangeService(ExchangeStreamingConfiguration configuration)
Exchange
A market data service typically consists of a regularly updated list of the available prices for the various symbols
This is the streaming (non-blocking and event driven) version of the service, and requires an application to provide a suitable implementation of the listener to allow event callbacks to take place.
getStreamingExchangeService
in interface Exchange
configuration
- The exchange-specific configuration to be applied after creationCopyright © 2012–2017 Xeiam, LLC. All rights reserved.