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, waitgetDefaultExchangeSpecification, getNonceFactoryprotected 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)
ExchangeapplySpecification in interface ExchangeexchangeSpecification - The ExchangeSpecificationprotected void initServices()
public void remoteInit()
throws IOException,
ExchangeException
ExchangeExchange.getMetaData(). Some exchanges
require it before using some of their services.remoteInit in interface ExchangeIOExceptionExchangeExceptionprotected 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 Exchangepublic ExchangeMetaData getMetaData()
ExchangegetMetaData in interface Exchangepublic PollingMarketDataService getPollingMarketDataService()
ExchangeA 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 Exchangepublic PollingTradeService getPollingTradeService()
ExchangeAn 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 Exchangepublic PollingAccountService getPollingAccountService()
ExchangeAn 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 Exchangepublic StreamingExchangeService getStreamingExchangeService(ExchangeStreamingConfiguration configuration)
ExchangeA 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 Exchangeconfiguration - The exchange-specific configuration to be applied after creationCopyright © 2012–2017 Xeiam, LLC. All rights reserved.