|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IClient
Main entry point for the connection to the server
| Method Summary | |
|---|---|
void |
addNewsFilter(INewsFilter newsFilter)
Adds news filter |
void |
connect(String jnlp,
String username,
String password)
Authenticates and connects to dukascopy servers |
void |
connect(String jnlp,
String username,
String password,
String pin)
Authenticates and connects to dukascopy servers |
BufferedImage |
getCaptchaImage(String jnlp)
Returns the image that can be provided to the user to generate correct pin code |
INewsFilter |
getNewsFilter(INewsFilter.NewsSource newsSource)
Returns news filter for the source |
Map<Long,IStrategy> |
getStartedStrategies()
Returns map with ids mapped to associated strategies |
Set<Instrument> |
getSubscribedInstruments()
Returns subscribed instruments |
boolean |
isConnected()
Returns true if client is authenticated authorized and transport is in connected state |
IStrategy |
loadStrategy(File strategyBinaryFile)
Loads strategy from jfx file |
void |
reconnect()
Tries to reconnect transport without reauthenticating. |
INewsFilter |
removeNewsFilter(INewsFilter.NewsSource newsSource)
Removes news filter, resetting it to the default value |
void |
setCacheDirectory(File cacheDirectory)
Sets the location of the cache files. |
void |
setErr(PrintStream err)
Sets stream that will be passed to the strategy through IConsole. |
void |
setOut(PrintStream out)
Sets stream that will be passed to the strategy through IConsole. |
void |
setSystemListener(ISystemListener systemListener)
Sets the listener, that will receive notifications about connects disconnects and strategies starts and stops |
void |
setSubscribedInstruments(Set<Instrument> instruments)
Subscribes to the specified instruments set |
long |
startStrategy(IStrategy strategy)
Starts the strategy with default exception handler that will stop strategy if it trows exception |
long |
startStrategy(IStrategy strategy,
IStrategyExceptionHandler exceptionHandler)
Starts the strategy |
void |
stopStrategy(long processId)
Stops the strategy with the specified id |
| Method Detail |
|---|
void connect(String jnlp,
String username,
String password)
throws JFAuthenticationException,
JFVersionException,
Exception
jnlp - address of jnlp file, that is used to launch platformusername - user namepassword - password
JFAuthenticationException - authentication error, incorrect username or password,
IP address unrecognized in case of LIVE systems
JFVersionException - version is blocked on the server, update your libraries
Exception - all kinds of errors that resulted in exception
void connect(String jnlp,
String username,
String password,
String pin)
throws JFAuthenticationException,
JFVersionException,
Exception
jnlp - address of jnlp file, that is used to launch platformusername - user namepassword - passwordpin - pin code generated with the captcha from the last getCaptchaImage(java.lang.String) call
JFAuthenticationException - authentication error, incorrect username or password,
IP address unrecognized in case of LIVE systems
JFVersionException - version is blocked on the server, update your libraries
Exception - all kinds of errors that resulted in exception
BufferedImage getCaptchaImage(String jnlp)
throws Exception
jnlp - address of jnlp file, that is used to launch platform
Exception - if request for captcha failedvoid reconnect()
ISystemListener interface
boolean isConnected()
long startStrategy(IStrategy strategy)
throws IllegalStateException,
NullPointerException
strategy - strategy to run
IllegalStateException - if not connected
NullPointerException - if one of the parameters is null
long startStrategy(IStrategy strategy,
IStrategyExceptionHandler exceptionHandler)
throws IllegalStateException,
NullPointerException
strategy - strategy to runexceptionHandler - if not null then passed exception handler will be called when strategy throws exception
IllegalStateException - if not connected
NullPointerException - if one of the parameters is null
IStrategy loadStrategy(File strategyBinaryFile)
throws Exception
strategyBinaryFile - jfx file
Exception - if loading failedvoid stopStrategy(long processId)
processId - id of the strategyMap<Long,IStrategy> getStartedStrategies()
void setSystemListener(ISystemListener systemListener)
systemListener - listenervoid addNewsFilter(INewsFilter newsFilter)
newsFilter - news filterINewsFilter getNewsFilter(INewsFilter.NewsSource newsSource)
newsSource - news source
INewsFilter removeNewsFilter(INewsFilter.NewsSource newsSource)
newsSource - news source
void setSubscribedInstruments(Set<Instrument> instruments)
instruments - set of the instrumentsSet<Instrument> getSubscribedInstruments()
void setOut(PrintStream out)
out - streamvoid setErr(PrintStream err)
err - streamvoid setCacheDirectory(File cacheDirectory)
System.getProperty("java.io.tmpdir") + "/.cache"
cacheDirectory - directory where cache files should be saved
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||