org.dps.core.market
Interface IEveMarketData


public interface IEveMarketData

An interface for storing an accessing EVE exported market data.


Method Summary
 void begin()
          Start a new transaction for interacting with the Eve External Market Data tables.
 void close()
          Close the session (if any) associated with the current thread.
 void commit()
          Commit a previously started transaction on the current thread.
 EveMarketQuote getBBO(int typeID, long[] regions, long[] solarSystems, long[] stations, java.lang.String[] sources, java.lang.Long ignoreBefore, java.lang.Long asOf)
          Retrieve the best bid and offer for a given type.
 org.hibernate.Session getSession()
          Retrieve a session for use in interacting with the Eve External Market Data tables.
 void loadExportedClientMarketData(java.io.InputStream inData, long sampleTime, java.lang.String source)
          Convenience method for loading market orders from data in the format of market data exports provided by the EVE client.
 void loadExportedHistoricTradeData(java.io.InputStream inData, java.lang.String source)
          Convenience method for loading historic trade data in the format provided in the experimental download from CCP (see development site docs for more info).
 void rollback()
          Rollback a previously started transaction on the current thread.
 IExternalHistoricTradeRecord storeEntry(IExternalHistoricTradeRecord entry)
          Convenience method for the common action of adding a new entry to the external historic trade table.
 IExternalMarketOrderRecord storeEntry(IExternalMarketOrderRecord entry)
          Convenience method for the common action of adding a new entry to the external market order table.
 

Method Detail

getSession

org.hibernate.Session getSession()
Retrieve a session for use in interacting with the Eve External Market Data tables.

Returns:
a Hibernate session.

begin

void begin()
Start a new transaction for interacting with the Eve External Market Data tables.


commit

void commit()
Commit a previously started transaction on the current thread. The transaction to be committed must have been started on the thread calling commit.


rollback

void rollback()
Rollback a previously started transaction on the current thread. The transaction to be rolled back must have been started on the thread calling rollback.


close

void close()
Close the session (if any) associated with the current thread.


storeEntry

IExternalMarketOrderRecord storeEntry(IExternalMarketOrderRecord entry)
                                      throws org.hibernate.HibernateException
Convenience method for the common action of adding a new entry to the external market order table. If the specified entry already exists in the table, then the existing row is updated according to the fields of the new entry. Otherwise, the entry is added as a new row to the table. In either case, a persisted version of the entry is returned. The caller should normally replace the entry passed as an argument with the entry returned by the call. On a commit failure, this method performs a rollback before returning.

Parameters:
entry - the entry to be stored.
Returns:
the persisted instance which was stored to the external market order table.
Throws:
org.hibernate.HibernateException

storeEntry

IExternalHistoricTradeRecord storeEntry(IExternalHistoricTradeRecord entry)
                                        throws org.hibernate.HibernateException
Convenience method for the common action of adding a new entry to the external historic trade table. If the specified entry already exists in the table, then the existing row is updated according to the fields of the new entry. Otherwise, the entry is added as a new row to the table. In either case, a persisted version of the entry is returned. The caller should normally replace the entry passed as an argument with the entry returned by the call. On a commit failure, this method performs a rollback before returning.

Parameters:
entry - the entry to be stored.
Returns:
the persisted instance which was stored to the external historic trade table.
Throws:
org.hibernate.HibernateException

getBBO

EveMarketQuote getBBO(int typeID,
                      long[] regions,
                      long[] solarSystems,
                      long[] stations,
                      java.lang.String[] sources,
                      java.lang.Long ignoreBefore,
                      java.lang.Long asOf)
                      throws java.io.IOException
Retrieve the best bid and offer for a given type. If regions are specified and not null then limit the BBO to the listed regions. If, instead, solarsystems are specified and not null, then limit the BBO to the listed solarsystems. If, instead, stations are specified and not null, then limit the BBO to the listed stations. If asOf is not null, then limit the BBO to those orders which were active on the given date (GMT millis since epoch).

Parameters:
typeID - the type for which the BBO will be computed.
regions - a list of regions over which the query is restricted.
solarSystems - a list of solarsystems over which the query is restricted. If specified, this overrides the list of regions.
stations - a list of stations over which the query is restricted. If specified, this overrides the list of regions or solar systems.
sources - if not null, then only consider quotes from the specified sources.
ignoreBefore - if not null, then ignore external market orders with a sample time before the specified time.
asOf - if non null, then only consider orders active on the given date. Otherwise, consider only those orders which are active now.
Returns:
an instance of EveMarketQuote. This quote may have zero, one or two sides depending on which orders were active on the asOf date.
Throws:
java.io.IOException - if an error occurs while querying the external market orders table.

loadExportedClientMarketData

void loadExportedClientMarketData(java.io.InputStream inData,
                                  long sampleTime,
                                  java.lang.String source)
                                  throws java.io.IOException
Convenience method for loading market orders from data in the format of market data exports provided by the EVE client. The format of this data is normally comma separated values with the first line giving the names of headers.

Parameters:
inData - an input stream from which market orders will be read. We continue loading rows until the input stream is exhausted.
sampleTime - the timestamp to use for the sample time of the new records.
source - the source to use for the new records.
Throws:
java.io.IOException - if an error occurs while loading rows.

loadExportedHistoricTradeData

void loadExportedHistoricTradeData(java.io.InputStream inData,
                                   java.lang.String source)
                                   throws java.io.IOException
Convenience method for loading historic trade data in the format provided in the experimental download from CCP (see development site docs for more info).

Parameters:
inData - an input stream from which historic trades will be read. We continue loading rows until the input stream is exhausted.
source - the source to use for the new records.
Throws:
java.io.IOException - if an error occurs while loading rows.