@ThreadSafe public class RpcClientImpl extends ClientImpl
Client.
This client replaces the web services component of the standard client, not the JMS component.
ClientImpl.BrokerStatusReceiver, ClientImpl.TradeMessageReceivermParameters| Constructor and Description |
|---|
RpcClientImpl(ClientParameters inParameters)
Create a new RpcClientImpl instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addReport(FIXMessageWrapper inReport,
BrokerID inBrokerID,
Hierarchy inHierarchy)
Adds the given report to the system data flow.
|
void |
close()
Closes the connection to the server.
|
protected void |
closeWebServices()
Closes the web service.
|
protected void |
connectJms()
Connects the JMS service.
|
protected void |
connectWebServices()
Connects the web services.
|
void |
deleteReport(ExecutionReportImpl inReport)
Removes the given report from the persistent report store.
|
OrderID |
findRootOrderIdFor(OrderID inOrderID)
Find the root order ID for the order chain of the given order ID.
|
Map<PositionKey<Currency>,BigDecimal> |
getAllCurrencyPositionsAsOf(Date inDate)
Returns all open currency positions based on reports,
generated and received on or before the supplied date in UTC.
|
Map<PositionKey<Equity>,BigDecimal> |
getAllEquityPositionsAsOf(Date inDate)
Returns all open equity positions based on reports,
generated and received on or before the supplied date in UTC.
|
Map<PositionKey<Future>,BigDecimal> |
getAllFuturePositionsAsOf(Date inDate)
Returns all open future positions based on reports,
generated and received on or before the supplied date in UTC.
|
Map<PositionKey<Option>,BigDecimal> |
getAllOptionPositionsAsOf(Date inDate)
Returns the aggregate position of each option (option,account,actor)
tuple based on all reports received for each option instrument on or before
the supplied date in UTC and which are visible to the given user.
|
BrokersStatus |
getBrokersStatus()
Returns the server's broker status.
|
BigDecimal |
getCurrencyPositionAsOf(Date inDate,
Currency inCurrency)
Returns the position of the supplied currency based on reports,
generated and received on or before the supplied date in UTC.
|
BigDecimal |
getEquityPositionAsOf(Date inDate,
Equity inEquity)
Returns the position of the supplied equity based on reports,
generated and received on or before the supplied date in UTC.
|
BigDecimal |
getFuturePositionAsOf(Date inDate,
Future inFuture)
Returns the position of the supplied future based on reports,
generated and received on or before the supplied date in UTC.
|
protected String |
getNextServerID()
Fetches the next orderID base from server.
|
List<ReportBaseImpl> |
getOpenOrders()
Gets all open orders visible to the current user.
|
BigDecimal |
getOptionPositionAsOf(Date inDate,
Option inOption)
Gets the current aggregate position for the option instrument based on
execution reports received on or before the supplied date in UTC, and which
are visible to the given user.
|
Map<PositionKey<Option>,BigDecimal> |
getOptionPositionsAsOf(Date inDate,
String... inSymbols)
Returns the aggregate position of each option
(option,account,actor)
tuple based on all reports received for each option instrument on or before
the supplied date in UTC, and which are visible to the given user.
|
Collection<String> |
getOptionRoots(String inUnderlying)
Returns the collection of known option roots for the underlying symbol.
|
ReportBase[] |
getReportsSince(Date inDate)
Returns all the reports (execution report and order cancel rejects)
generated and received by the server since the supplied date in UTC.
|
protected SessionId |
getSessionId()
Gets the session ID value.
|
String |
getUnderlying(String inOptionRoot)
Returns the underlying symbol for the supplied option root, if
a mapping is found for it.
|
Properties |
getUserData()
Gets the user data associated with the current user.
|
UserInfo |
getUserInfo(UserID inId,
boolean inUseCache)
Returns the information of the user with the given ID.
|
protected void |
heartbeat()
Executes a heartbeat.
|
protected void |
reconnectWebServices()
Reconnects the web service.
|
Instrument |
resolveSymbol(String inSymbol)
Resolves the given symbol to an
Instrument. |
void |
setUserData(Properties inProperties)
Sets the user data associated with the current user.
|
protected void |
startJms()
Starts the JMS connection.
|
addBrokerStatusListener, addExceptionListener, addReportListener, addServerStatusListener, getLastConnectTime, getParameters, isCredentialsMatch, isServerAlive, onException, reconnect, reconnect, removeBrokerStatusListener, removeExceptionListener, removeReportListener, removeServerStatusListener, sendOrder, sendOrder, sendOrder, sendOrderRawpublic RpcClientImpl(ClientParameters inParameters) throws ConnectionException
inParameters - a ClientParameters valueConnectionException - if an error occurs connecting to the RPC clientpublic Map<PositionKey<Equity>,BigDecimal> getAllEquityPositionsAsOf(Date inDate) throws ConnectionException
ClientgetAllEquityPositionsAsOf in interface ClientgetAllEquityPositionsAsOf in class ClientImplinDate - the date in UTC. Cannot be null.ConnectionException - if there were connection errors fetching
data from the server.public BigDecimal getEquityPositionAsOf(Date inDate, Equity inEquity) throws ConnectionException
ClientgetEquityPositionAsOf in interface ClientgetEquityPositionAsOf in class ClientImplinDate - the date in UTC. Cannot be null.inEquity - The equity. Cannot be null.ConnectionException - if there were connection errors fetching
data from the server.public BigDecimal getCurrencyPositionAsOf(Date inDate, Currency inCurrency) throws ConnectionException
ClientgetCurrencyPositionAsOf in interface ClientgetCurrencyPositionAsOf in class ClientImplinDate - the date in UTC. Cannot be null.inCurrency - The currency. Cannot be null.ConnectionException - if there were connection errors fetching
data from the server.public Map<PositionKey<Currency>,BigDecimal> getAllCurrencyPositionsAsOf(Date inDate) throws ConnectionException
ClientgetAllCurrencyPositionsAsOf in interface ClientgetAllCurrencyPositionsAsOf in class ClientImplinDate - the date in UTC. Cannot be null.ConnectionException - if there were connection errors fetching
data from the server.public Map<PositionKey<Future>,BigDecimal> getAllFuturePositionsAsOf(Date inDate) throws ConnectionException
ClientgetAllFuturePositionsAsOf in interface ClientgetAllFuturePositionsAsOf in class ClientImplinDate - the date in UTC. Cannot be null.ConnectionException - if there were connection errors fetching
data from the server.public BigDecimal getFuturePositionAsOf(Date inDate, Future inFuture) throws ConnectionException
ClientgetFuturePositionAsOf in interface ClientgetFuturePositionAsOf in class ClientImplinDate - the date in UTC. Cannot be null.inFuture - The future. Cannot be null.ConnectionException - if there were connection errors fetching
data from the server.public BigDecimal getOptionPositionAsOf(Date inDate, Option inOption) throws ConnectionException
ClientBuy trades result in positive positions. All other kinds of trades result in negative positions.
getOptionPositionAsOf in interface ClientgetOptionPositionAsOf in class ClientImplinDate - the date in UTC. Cannot be null.inOption - the option instrumentConnectionException - if there were errors retrieving the
position.public Map<PositionKey<Option>,BigDecimal> getAllOptionPositionsAsOf(Date inDate) throws ConnectionException
ClientBuy trades result in positive positions. All other kinds of trades result in negative positions.
getAllOptionPositionsAsOf in interface ClientgetAllOptionPositionsAsOf in class ClientImplinDate - the date in UTC. Cannot be null.ConnectionException - if there were errors retrieving the
position map.public Map<PositionKey<Option>,BigDecimal> getOptionPositionsAsOf(Date inDate, String... inSymbols) throws ConnectionException
ClientBuy trades result in positive positions. All other kinds of trades result in negative positions.
getOptionPositionsAsOf in interface ClientgetOptionPositionsAsOf in class ClientImplinDate - the date in UTC. Cannot be null.inSymbols - the list of option root symbols.ConnectionException - if there were errors retrieving the
position map.public String getUnderlying(String inOptionRoot) throws ConnectionException
Client
The mapping is retrieved from the server the first time an
option root symbol is specified. The value returned by the server is
cached on the client for all subsequent invocations for the
same root symbol. All the cached values are cleared when the client
is closed.
getUnderlying in interface ClientgetUnderlying in class ClientImplinOptionRoot - The option root symbol.ConnectionException - if there were errors retrieving the
underlying symbol.public Collection<String> getOptionRoots(String inUnderlying) throws ConnectionException
Client
The mapping is retrieved from the server the first time an
underlying symbol is specified. The value returned by the server is
cached on the client for all subsequent invocations for the
same underlying symbol. All the cached values are cleared when the client
is closed.
getOptionRoots in interface ClientgetOptionRoots in class ClientImplinUnderlying - The underlying symbol.ConnectionException - if there were errors retrieving the
option roots.public Instrument resolveSymbol(String inSymbol) throws ConnectionException
ClientInstrument.resolveSymbol in interface ClientresolveSymbol in class ClientImplinSymbol - a String valueInstrument valueConnectionException - if an error occurs connecting to the serverpublic OrderID findRootOrderIdFor(OrderID inOrderID)
ClientfindRootOrderIdFor in interface ClientfindRootOrderIdFor in class ClientImplinOrderID - an OrderID valueOrderID valuepublic void addReport(FIXMessageWrapper inReport, BrokerID inBrokerID, Hierarchy inHierarchy) throws ConnectionException
ClientReports added this way will be added to the system data bus. Reports will be persisted and become part of the system record. All clients will receive this report.
This will affect reported positions
.addReport in interface ClientaddReport in class ClientImplinReport - a FIXMessageWrapper valueinBrokerID - a BrokerID valueinHierarchy - a Hierarchy valueConnectionException - if an error occurs connecting to the serverpublic void deleteReport(ExecutionReportImpl inReport) throws ConnectionException
ClientReports removed this way will not be added to the system data bus and no clients will receive this report.
This will affect reported positions
.deleteReport in interface ClientdeleteReport in class ClientImplinReport - an ExecutionReportImpl valueConnectionException - if an error occurs connecting to the serverpublic Properties getUserData() throws ConnectionException
ClientgetUserData in interface ClientgetUserData in class ClientImplProperties valueConnectionException - if an error occurs connecting to the serverpublic void setUserData(Properties inProperties) throws ConnectionException
ClientsetUserData in interface ClientsetUserData in class ClientImplinProperties - a Properties valueConnectionException - if an error occurs connecting to the serverpublic UserInfo getUserInfo(UserID inId, boolean inUseCache) throws ConnectionException
Client
All cached values are cleared when the client is closed.
getUserInfo in interface ClientgetUserInfo in class ClientImplinId - The user ID.inUseCache - True if the local cache should be used.ConnectionException - Thrown if the operation cannot be
completed.public ReportBase[] getReportsSince(Date inDate) throws ConnectionException
ClientgetReportsSince in interface ClientgetReportsSince in class ClientImplinDate - The date in UTC. Cannot be null.ConnectionException - if there were connection errors fetching
data from the server.public List<ReportBaseImpl> getOpenOrders() throws ConnectionException
ClientgetOpenOrders in interface ClientgetOpenOrders in class ClientImplList<ReportBaseImpl> valueConnectionException - if an error occurs connecting to the serverpublic BrokersStatus getBrokersStatus() throws ConnectionException
ClientgetBrokersStatus in interface ClientgetBrokersStatus in class ClientImplConnectionException - Thrown if the operation cannot be
completed.public void close()
Clientclose in interface Clientclose in class ClientImplprotected String getNextServerID() throws RemoteException
ClientImplgetNextServerID in class ClientImplRemoteException - if there were communication errors.protected void heartbeat()
throws RemoteException
ClientImplheartbeat in class ClientImplRemoteException - if the heartbeat cannot be executedprotected SessionId getSessionId()
ClientImplgetSessionId in class ClientImplSessionId valueprotected void connectWebServices()
throws I18NException,
RemoteException
ClientImplconnectWebServices in class ClientImplI18NException - if an error occurs connectingRemoteException - if an error occurs connectingprotected void reconnectWebServices()
throws RemoteException
ClientImplreconnectWebServices in class ClientImplRemoteException - if an error occurs reconnectingprotected void closeWebServices()
throws RemoteException
ClientImplcloseWebServices in class ClientImplRemoteException - if an error occurs closingprotected void connectJms()
throws JAXBException
ClientImplconnectJms in class ClientImplJAXBException - if an error occurs connecting to the JMS serviceprotected void startJms()
throws JAXBException
ClientImplstartJms in class ClientImplJAXBException - if an error occurs starting the JMS connectionCopyright © 2015. All Rights Reserved.