Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.ui.service.report.internal
Class ReportServiceImpl

java.lang.Object
  extended by eu.esdihumboldt.hale.ui.service.report.internal.ReportServiceImpl
All Implemented Interfaces:
ReportService

public class ReportServiceImpl
extends Object
implements ReportService

Report service implementation

Since:
2.2
Author:
Simon Templer
Partner:
01 / Fraunhofer Institute for Computer Graphics Research

Constructor Summary
ReportServiceImpl()
           
 
Method Summary
<M extends Message,R extends Report<M>>
void
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>>
void
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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReportServiceImpl

public ReportServiceImpl()
Method Detail

addReport

public <M extends Message,R extends Report<M>> void addReport(R report)
Description copied from interface: ReportService
Adds a report

Specified by:
addReport in interface ReportService
Type Parameters:
M - the message type
R - the report type
Parameters:
report - the report to add
See Also:
ReportService.addReport(Report)

notifyReportAdded

protected <M extends Message,R extends Report<M>> void notifyReportAdded(Class<? extends R> reportType,
                                                                         Class<M> messageType,
                                                                         R report)
Notify listeners that a report has been added

Type Parameters:
M - the message type
R - the report type
Parameters:
reportType - the report type
messageType - the message type
report - the report

notifyReportsDeleted

protected void notifyReportsDeleted()
Notify listeners that all reports have been deleted


getReports

public com.google.common.collect.Multimap<Class<? extends Report<?>>,Report<?>> getReports(Class<? extends Message> messageType)
Get all reports matching the given message type

Specified by:
getReports in interface ReportService
Parameters:
messageType - the message type
Returns:
report types mapped to reports

getCurrentReports

public com.google.common.collect.Multimap<Class<? extends Report<?>>,Report<?>> getCurrentReports()
Get all reports.

Specified by:
getCurrentReports in interface ReportService
Returns:
all reports

addReportListener

public void addReportListener(ReportListener<?,?> listener)
Description copied from interface: ReportService
Adds a report listener

Specified by:
addReportListener in interface ReportService
Parameters:
listener - the report listener to add
See Also:
ReportService.addReportListener(ReportListener)

removeReportListener

public void removeReportListener(ReportListener<?,?> listener)
Description copied from interface: ReportService
Removes a report listener

Specified by:
removeReportListener in interface ReportService
Parameters:
listener - the report listener to remove
See Also:
ReportService.removeReportListener(ReportListener)

deleteAllReports

public void deleteAllReports()
Description copied from interface: ReportService
Deletes all reports.

Specified by:
deleteAllReports in interface ReportService
See Also:
ReportService.deleteAllReports()

saveCurrentReports

public boolean saveCurrentReports(File file)
                           throws IOException
Description copied from interface: ReportService
Saves all reports from ReportService to a specific file.

Specified by:
saveCurrentReports in interface ReportService
Parameters:
file - the file to save
Returns:
true on success
Throws:
IOException - an exception if IO fails
See Also:
ReportService.saveCurrentReports(File)

loadReportsOnStartup

public void loadReportsOnStartup()
Description copied from interface: ReportService
Try to reload previous saved reports and their session at program startup.

Specified by:
loadReportsOnStartup in interface ReportService
See Also:
ReportService.loadReportsOnStartup()

saveReportsOnShutdown

public void saveReportsOnShutdown()
Description copied from interface: ReportService
Saves all reports with there corresponding session on program shutdown.

Specified by:
saveReportsOnShutdown in interface ReportService
See Also:
ReportService.saveReportsOnShutdown()

getAllSessions

public Collection<ReportSession> getAllSessions()
Description copied from interface: ReportService
Get all saved sessions.

Specified by:
getAllSessions in interface ReportService
Returns:
all sessions
See Also:
ReportService.getAllSessions()

loadReport

public void loadReport(File file)
                throws org.eclipse.jface.bindings.keys.ParseException
Description copied from interface: ReportService
Load a specific report log file.

Specified by:
loadReport in interface ReportService
Parameters:
file - report log file
Throws:
org.eclipse.jface.bindings.keys.ParseException - if a parse error occurred
See Also:
ReportService.loadReport(java.io.File)

getCurrentSessionDescription

public long getCurrentSessionDescription()
Description copied from interface: ReportService
Get the current session description.

Specified by:
getCurrentSessionDescription in interface ReportService
Returns:
session description
See Also:
ReportService.getCurrentSessionDescription()

updateCurrentSessionDescription

public void updateCurrentSessionDescription()
Description copied from interface: ReportService
Update the session description.

Specified by:
updateCurrentSessionDescription in interface ReportService
See Also:
ReportService.updateCurrentSessionDescription()

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d