|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.shimari.fxtp.FXTP
This interface provides an API into the ideosphere.com server; it has been developed independently by Justin Wells. The API is built on top of the FXTP protocol, and operates by connecting to the FXTP server (typically, ideosphere.com:7001). This interface manages the underlying connection to the server for you, does all the parsing, and provides access to key objects and methods.
Actual connections will be opened as-needed by this interface, and closed after a minute of disuse. There are caches for User and Claim objects within this interface; you can clear these caches explicitly when you require a fresh copy of the object. Otherwise the cache is refreshed after a minute or two.
Remember that the FX server is run on a free/voluntary basis, so try not to hit it too hard. In that spirit, this class has some built in throttles, and opens a maximum of one connection to the server at a time. Please don't abuse that, or the server operators might disable access to the FXTP protocol.
Constructor Summary | |
FXTP(Config conf)
|
Method Summary | |
java.lang.String |
cancelOrder(FXTP_Order order,
java.lang.String password)
Cancel an order via the FXTP server. |
FXTP_Claim |
getClaim(java.lang.String claimName)
Get an FXTP_Claim object. |
java.util.List |
getTicker(int maxResults,
java.lang.Integer id,
java.lang.String symbol,
int days)
Get a ticker from the FXTP server. |
FXTP_User |
getUser(FXTP_UserId userId)
Get an FXTP_User object. |
FXTP_User |
getUser(java.lang.Integer id)
Lookup a user. |
FXTP_UserId |
getUserId(int id)
Call getUser(FXTP_UserId) |
FXTP_UserId |
getUserId(java.lang.Integer id)
Resolve an integer id to a full userid. |
FXTP_UserId |
getUserId(java.lang.String nym)
Resolve a nym to a userid. |
void |
init(Registry components)
|
void |
refresh(FXTP_UserId id)
Clear a specific user from the cache |
void |
refresh(java.lang.Integer id)
Clear a specific user from the cache |
void |
refresh(java.lang.String claimName)
Clear a specific claim from the cache |
java.lang.String |
submitOrder(FXTP_Order order,
java.lang.String password)
Submit an order to the FXTP server. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FXTP(Config conf) throws ConfigException
Method Detail |
public void init(Registry components) throws ConfigException
init
in interface Component
ConfigException
public void refresh(java.lang.String claimName)
public void refresh(java.lang.Integer id)
public void refresh(FXTP_UserId id)
public FXTP_User getUser(java.lang.Integer id) throws FXTP_Exception
FXTP_Exception
public FXTP_UserId getUserId(java.lang.String nym) throws FXTP_Exception
FXTP_Exception
public FXTP_UserId getUserId(java.lang.Integer id) throws FXTP_Exception
FXTP_Exception
public FXTP_User getUser(FXTP_UserId userId) throws FXTP_Exception
FXTP_Exception
public FXTP_UserId getUserId(int id) throws FXTP_Exception
FXTP_Exception
public FXTP_Claim getClaim(java.lang.String claimName) throws FXTP_Exception
FXTP_Exception
public java.lang.String submitOrder(FXTP_Order order, java.lang.String password) throws FXTP_Exception
FXTP_Exception
public java.lang.String cancelOrder(FXTP_Order order, java.lang.String password) throws FXTP_Exception
FXTP_Exception
public java.util.List getTicker(int maxResults, java.lang.Integer id, java.lang.String symbol, int days) throws FXTP_Exception
FXTP_Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |