public class ReportServiceImpl extends Object implements ReportService
Constructor and Description |
---|
ReportServiceImpl() |
Modifier and Type | Method and Description |
---|---|
<M extends Message,R extends Report<M>> |
addReport(R report)
Adds a report
|
void |
addReportListener(ReportListener<?,?> listener)
Adds a report listener
|
void |
deleteAllReports()
Deletes all reports.
|
Collection<ReportSession> |
getAllSessions()
Get all saved sessions.
|
com.google.common.collect.Multimap<Class<? extends Report<?>>,Report<?>> |
getCurrentReports()
Get all reports.
|
long |
getCurrentSessionDescription()
Get the current session description.
|
com.google.common.collect.Multimap<Class<? extends Report<?>>,Report<?>> |
getReports(Class<? extends Message> messageType)
Get all reports matching the given message type
|
void |
loadReport(File file)
Load a specific report log file.
|
void |
loadReportsOnStartup()
Try to reload previous saved reports and their session at program
startup.
|
protected <M extends Message,R extends Report<M>> |
notifyReportAdded(Class<? extends R> reportType,
Class<M> messageType,
R report)
Notify listeners that a report has been added
|
protected void |
notifyReportsDeleted()
Notify listeners that all reports have been deleted
|
void |
removeReportListener(ReportListener<?,?> listener)
Removes a report listener
|
boolean |
saveCurrentReports(File file)
Saves all reports from
ReportService to a specific file. |
void |
saveReportsOnShutdown()
Saves all reports with there corresponding session on program shutdown.
|
void |
updateCurrentSessionDescription()
Update the session description.
|
public <M extends Message,R extends Report<M>> void addReport(R report)
ReportService
addReport
in interface ReportService
M
- the message typeR
- the report typereport
- the report to addReportService.addReport(Report)
protected <M extends Message,R extends Report<M>> void notifyReportAdded(Class<? extends R> reportType, Class<M> messageType, R report)
M
- the message typeR
- the report typereportType
- the report typemessageType
- the message typereport
- the reportprotected void notifyReportsDeleted()
public com.google.common.collect.Multimap<Class<? extends Report<?>>,Report<?>> getReports(Class<? extends Message> messageType)
getReports
in interface ReportService
messageType
- the message typepublic com.google.common.collect.Multimap<Class<? extends Report<?>>,Report<?>> getCurrentReports()
getCurrentReports
in interface ReportService
public void addReportListener(ReportListener<?,?> listener)
ReportService
addReportListener
in interface ReportService
listener
- the report listener to addReportService.addReportListener(ReportListener)
public void removeReportListener(ReportListener<?,?> listener)
ReportService
removeReportListener
in interface ReportService
listener
- the report listener to removeReportService.removeReportListener(ReportListener)
public void deleteAllReports()
ReportService
deleteAllReports
in interface ReportService
ReportService.deleteAllReports()
public boolean saveCurrentReports(File file) throws IOException
ReportService
ReportService
to a specific file.saveCurrentReports
in interface ReportService
file
- the file to saveIOException
- an exception if IO failsReportService.saveCurrentReports(File)
public void loadReportsOnStartup()
ReportService
loadReportsOnStartup
in interface ReportService
ReportService.loadReportsOnStartup()
public void saveReportsOnShutdown()
ReportService
saveReportsOnShutdown
in interface ReportService
ReportService.saveReportsOnShutdown()
public Collection<ReportSession> getAllSessions()
ReportService
getAllSessions
in interface ReportService
ReportService.getAllSessions()
public void loadReport(File file) throws org.eclipse.jface.bindings.keys.ParseException
ReportService
loadReport
in interface ReportService
file
- report log fileorg.eclipse.jface.bindings.keys.ParseException
- if a parse error
occurredReportService.loadReport(java.io.File)
public long getCurrentSessionDescription()
ReportService
getCurrentSessionDescription
in interface ReportService
ReportService.getCurrentSessionDescription()
public void updateCurrentSessionDescription()
ReportService
updateCurrentSessionDescription
in interface ReportService
ReportService.updateCurrentSessionDescription()
Build 2013-10-07_11-27-38
Revision 99b27713a799a59a21b0b166eaaea8aaefbf125a