|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.apache.commons.httpclient.HttpClient
com.betfair.games.ApiAdapter
com.betfair.games.ApiClient
public class ApiClient
An ApiClient is a runnable client extending the ApiAdapter. The purpose of an ApiClient is to gather the common features of a runnable http client making calls to the API using ApiAdapter. The ApiClient has no functional methods and it's run() method is empty. This is a superclass intended to be inherited by functional client classes that communicates with the ApiAdapter.
| Constructor Summary | |
|---|---|
ApiClient(ApiApplication app)
Constructs an ApiClient and a Thread for its execution. |
|
ApiClient(ApiApplication app,
java.lang.String service)
Constructs an ApiClient and a Thread for its execution. |
|
| Method Summary | |
|---|---|
java.lang.String |
getBaseResourceUrl()
Returns the base resource url. |
long |
getSleep()
Returns the number of milliseconds this client is supposed to sleep between each request while watching an API channel. |
boolean |
isWatching()
Returns the watch status of the client. |
void |
run()
The run method is empty and should be overridden by any client sub-class. |
void |
setBaseResourceUrl(java.lang.String url)
Set the base resource url for the API service this client is using. |
void |
setSleep(int sec)
Set the number of seconds this client is supposed to sleep between each request while watching an API channel. |
void |
startWatching()
The client should now start to watch a specified API channel. |
void |
stopWatching()
If the client is in a loop watching an API channel it should stop and must not resume unless the start() method is called again for the Thread. |
void |
wake()
If the client is in a loop listening to an API channel and currently sleeping it is woke up to start listen again immediately. |
| Methods inherited from class com.betfair.games.ApiAdapter |
|---|
createAgentInstanceID, get, get, getParam, getVersion, post, putParam |
| Methods inherited from class org.apache.commons.httpclient.HttpClient |
|---|
executeMethod, executeMethod, executeMethod, getHost, getHostConfiguration, getHttpConnectionManager, getParams, getPort, getState, isStrictMode, setConnectionTimeout, setHostConfiguration, setHttpConnectionFactoryTimeout, setHttpConnectionManager, setParams, setState, setStrictMode, setTimeout |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ApiClient(ApiApplication app)
throws ApiAdapterException
app - a reference to the application
ApiAdapterException - if it is thrown by the ApiAdapter
public ApiClient(ApiApplication app,
java.lang.String service)
throws ApiAdapterException
app - a reference to the applicationservice - the Api service this client is using
ApiAdapterException - if it is thrown by the ApiAdapter| Method Detail |
|---|
public void stopWatching()
public void startWatching()
public boolean isWatching()
public void wake()
public void setSleep(int sec)
public long getSleep()
public java.lang.String getBaseResourceUrl()
public void setBaseResourceUrl(java.lang.String url)
url - url to the specified service from the API serverpublic void run()
run in interface java.lang.Runnable
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||