com.dukascopy.api
Interface IReportService


public interface IReportService

Provide access to consolidated trading activity reports:


Method Summary
 java.util.List<IReportPosition> getClosedPositions(long from, long to)
          Returns a list of closed positions for specified:
 java.util.List<IReportPosition> getOpenPositions()
          Returns a list of all open positions
 void readClosedPositions(long from, long to, ILoadingReportPositionListener reportPositionListener, LoadingProgressListener loadingProgress)
          Loads closed positions from the server in the background.
 void readOpenPositions(ILoadingReportPositionListener reportPositionListener, LoadingProgressListener loadingProgress)
          Loads all open positions from the server in the background.
 

Method Detail

getOpenPositions

java.util.List<IReportPosition> getOpenPositions()
                                                 throws JFException
Returns a list of all open positions

Returns:
a list of all open positions
Throws:
JFException - in case of any system error

readOpenPositions

void readOpenPositions(ILoadingReportPositionListener reportPositionListener,
                       LoadingProgressListener loadingProgress)
                       throws JFException
Loads all open positions from the server in the background. Method returns fast after creating request for data not waiting for any data to be loaded. After internal request is sent, open positions will be returned by calling method in ILoadingReportPositionListener. LoadingProgressListener is used to receive feedback about loading progress, to cancel loading and its method LoadingProgressListener.loadingFinished(boolean, long, long, long) is called when loading is finished or as a result of error. This method can be used for open positions loading without blocking strategy execution

Parameters:
reportPositionListener - receives data about requested open positions
loadingProgress - used to control loading progress
Throws:
JFException - in case of any system error

getClosedPositions

java.util.List<IReportPosition> getClosedPositions(long from,
                                                   long to)
                                                   throws JFException
Returns a list of closed positions for specified:

Parameters:
from - start of the time interval for which closed positions should be loaded
to - end time of the time interval for which closed positions should be loaded
Returns:
a list of closed positions (never null).
Throws:
JFException - in case of any system error

readClosedPositions

void readClosedPositions(long from,
                         long to,
                         ILoadingReportPositionListener reportPositionListener,
                         LoadingProgressListener loadingProgress)
                         throws JFException
Loads closed positions from the server in the background. Method returns fast after creating request for data not waiting for any data to be loaded. After internal request is sent, closed positions will be returned by calling method in ILoadingReportPositionListener. LoadingProgressListener is used to receive feedback about loading progress, to cancel loading and its method. LoadingProgressListener.loadingFinished(boolean, long, long, long) is called when loading is finished or as a result of error. This method can be used for positions loading without blocking strategy execution

Parameters:
from - start of the time interval for which closed positions should be loaded
to - end time of the time interval for which closed positions should be loaded
reportPositionListener - receives data about requested closed positions
loadingProgress - used to control loading progress
Throws:
JFException - in case of any system error