|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.marketcetera.ors.history.BasicReportHistoryServices
public class BasicReportHistoryServices
Provides basic services to save and query reports.
| Constructor Summary | |
|---|---|
BasicReportHistoryServices()
Creates a new basic report history services provider. |
|
| Method Summary | |
|---|---|
protected void |
assignID(ReportBase report)
Sets the ID of the given report. |
Map<PositionKey<Equity>,BigDecimal> |
getAllEquityPositionsAsOf(SimpleUser inUser,
Date inDate)
Returns the aggregate position of each (equity,account,actor) tuple based on all reports received for each tuple on or before the supplied date, and which are visible to the given user. |
Map<PositionKey<Future>,BigDecimal> |
getAllFuturePositionsAsOf(SimpleUser inUser,
Date inDate)
Returns the aggregate position of each future (future,account,actor) tuple based on all reports received for each future instrument on or before the supplied date, and which are visible to the given user. |
Map<PositionKey<Option>,BigDecimal> |
getAllOptionPositionsAsOf(SimpleUser inUser,
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, and which are visible to the given user. |
BigDecimal |
getEquityPositionAsOf(SimpleUser inUser,
Date inDate,
Equity inEquity)
Returns the position of the equity based on all reports received for it before or on the supplied date, and which are visible to the given user. |
BigDecimal |
getFuturePositionAsOf(SimpleUser inUser,
Date inDate,
Future inFuture)
Gets the current aggregate position for the future instrument based on execution reports received before or on the supplied date, and which are visible to the given user. |
protected JmsManager |
getJmsManager()
Returns the receiver's JMS manager. |
BigDecimal |
getOptionPositionAsOf(SimpleUser inUser,
Date inDate,
Option inOption)
Gets the current aggregate position for the option instrument based on execution reports received before or on the supplied date, and which are visible to the given user. |
Map<PositionKey<Option>,BigDecimal> |
getOptionPositionsAsOf(SimpleUser inUser,
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, and which are visible to the given user. |
Principals |
getPrincipals(OrderID orderID)
Returns the principals associated with the report with given order ID. |
protected LongIDFactory |
getReportIDFactory()
Returns the receiver's report ID factory. |
protected ReportSavedListener |
getReportSavedListener()
Returns the receiver's listener which should be notified after a report has been saved. |
ReportBaseImpl[] |
getReportsSince(SimpleUser inUser,
Date inDate)
Returns all the reports received after the supplied date-time value, and which are visible to the given user. |
void |
init(IDFactory idFactory,
JmsManager jmsManager,
ReportSavedListener reportSavedListener)
Initializes the receiver with the given system resources. |
protected void |
invokeListener(ReportBase report,
boolean status)
Invokes the listener which should be notified after the given report has been saved. |
void |
save(ReportBase report)
Saves the supplied report to the database. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BasicReportHistoryServices()
| Method Detail |
|---|
public void init(IDFactory idFactory,
JmsManager jmsManager,
ReportSavedListener reportSavedListener)
throws ReportPersistenceException
ReportHistoryServices
init in interface ReportHistoryServicesidFactory - The ID factory to be used for report ID
generation.jmsManager - The JMS manager used for asychronous
persistence of reports. Null may be acceptable to certain
implementations.reportSavedListener - The listener notified after a report
has been saved (successfully or not). It may be null if no
notifications are needed.
ReportPersistenceException - Thrown if initialization
cannot complete.
public ReportBaseImpl[] getReportsSince(SimpleUser inUser,
Date inDate)
throws PersistenceException,
ReportPersistenceException
ReportHistoryServices
getReportsSince in interface ReportHistoryServicesinUser - the user making the query. Cannot be null.inDate - the date-time value. Cannot be null.
PersistenceException - if there were persistence errors
fetching the reports.
ReportPersistenceException - if the data retrieved had
unexpected errors.
public BigDecimal getEquityPositionAsOf(SimpleUser inUser,
Date inDate,
Equity inEquity)
throws PersistenceException
ReportHistoryServices
getEquityPositionAsOf in interface ReportHistoryServicesinUser - the user making the query. Cannot be null.inDate - the date to compare with all the reports. Only the reports
that were received prior to or on this date will be used in this calculation.
Cannot be null.inEquity - the equity whose position is desired. Cannot be null.
PersistenceException - if there were errors retrieving the equity
position
public Map<PositionKey<Equity>,BigDecimal> getAllEquityPositionsAsOf(SimpleUser inUser,
Date inDate)
throws PersistenceException
ReportHistoryServices
getAllEquityPositionsAsOf in interface ReportHistoryServicesinUser - the user making the query. Cannot be null.inDate - the date to compare with all the reports. Only
the reports that were received on or prior to this date will be
used in this calculation. Cannot be null.
PersistenceException - if there were errors retrieving the
position map.
public Map<PositionKey<Future>,BigDecimal> getAllFuturePositionsAsOf(SimpleUser inUser,
Date inDate)
throws PersistenceException
ReportHistoryServicesBuy trades result in positive positions. All other kinds of trades result in negative positions.
getAllFuturePositionsAsOf in interface ReportHistoryServicesinUser - the user making the query. Cannot be null.inDate - the date to compare with all the reports. Only
the reports that were received on or prior to this date will be
used in this calculation. Cannot be null.
PersistenceException - if there were errors retrieving the
position map.
public BigDecimal getFuturePositionAsOf(SimpleUser inUser,
Date inDate,
Future inFuture)
throws PersistenceException
ReportHistoryServicesBuy trades result in positive positions. All other kinds of trades result in negative positions.
getFuturePositionAsOf in interface ReportHistoryServicesinUser - the user making the query. Cannot be null.inDate - the time. execution reports with sending time values less
than or equal to this time are included in this calculation.inFuture - The future instrument
PersistenceException - if there were errors retrieving the
position.
public BigDecimal getOptionPositionAsOf(SimpleUser inUser,
Date inDate,
Option inOption)
throws PersistenceException
ReportHistoryServicesBuy trades result in positive positions. All other kinds of trades result in negative positions.
getOptionPositionAsOf in interface ReportHistoryServicesinUser - the user making the query. Cannot be null.inDate - the time. execution reports with sending time values less
than or equal to this time are included in this calculation.inOption - The option instrument
PersistenceException - if there were errors retrieving the
position.
public Map<PositionKey<Option>,BigDecimal> getAllOptionPositionsAsOf(SimpleUser inUser,
Date inDate)
throws PersistenceException
ReportHistoryServicesBuy trades result in positive positions. All other kinds of trades result in negative positions.
getAllOptionPositionsAsOf in interface ReportHistoryServicesinUser - the user making the query. Cannot be null.inDate - the date to compare with all the reports. Only
the reports that were received on or prior to this date will be
used in this calculation. Cannot be null.
PersistenceException - if there were errors retrieving the
position map.
public Map<PositionKey<Option>,BigDecimal> getOptionPositionsAsOf(SimpleUser inUser,
Date inDate,
String... inSymbols)
throws PersistenceException
ReportHistoryServicesBuy trades result in positive positions. All other kinds of trades result in negative positions.
getOptionPositionsAsOf in interface ReportHistoryServicesinUser - the user making the query. Cannot be null.inDate - the date to compare with all the reports. Only
the reports that were received on or prior to this date will be
used in this calculation. Cannot be null.inSymbols - the list of option roots.
PersistenceException - if there were errors retrieving the
position map.
public void save(ReportBase report)
throws PersistenceException
ReportHistoryServices
save in interface ReportHistoryServicesreport - the report to be saved. Cannot be null.
PersistenceException - if there
were errors saving the report.
public Principals getPrincipals(OrderID orderID)
throws PersistenceException
ReportHistoryServices
getPrincipals in interface ReportHistoryServicesorderID - The order ID.
Principals.UNKNOWN is returned, and no
exception is thrown.
PersistenceException - Thrown if there were errors
accessing the report.protected LongIDFactory getReportIDFactory()
protected JmsManager getJmsManager()
protected ReportSavedListener getReportSavedListener()
protected void assignID(ReportBase report)
throws PersistenceException
report - The report.
PersistenceException - Thrown if there were errors
assigning the ID.
protected void invokeListener(ReportBase report,
boolean status)
report - The report.status - True if saving completed successfully.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||