Package com.day.crx.statistics
Class Statistics
java.lang.Object
com.day.crx.statistics.Statistics
- All Implemented Interfaces:
Runnable
Statistics acts as a facade for adding entries and running
reports.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an entry to the statistics workspace.voidaddEntryAsync(Entry entry) Adds an entry to the statistics workspace but does not guarantee that the entry is persisted when the method returns.voidrun()Runs a report and returns the result of the report.Runs a report and returns the result of the report.voidstop()Stops the statistics instance and releases resource.
-
Constructor Details
-
Statistics
-
-
Method Details
-
stop
public void stop()Stops the statistics instance and releases resource. -
runReport
Runs a report and returns the result of the report. Please note that this implementation serializes access to the underlying session that runs the report. For improved concurrency, userunReport(Session, Report)instead and provide your own session. This method is thread-safe.- Parameters:
report- the report to run.- Returns:
- the result of the report.
- Throws:
RepositoryException- if an error occurs while reading from the workspace.
-
runReport
Runs a report and returns the result of the report. This method is thread-safe.- Parameters:
session- The Session to access the data from the repository to generate the reportreport- the report to run.- Returns:
- the result of the report.
- Throws:
RepositoryException- if an error occurs while reading from the workspace.
-
addEntry
Adds an entry to the statistics workspace. This method is thread-safe.- Parameters:
entry- the entry to add.- Throws:
RepositoryException- if an error occurs while writing to the workspace.
-
addEntryAsync
Adds an entry to the statistics workspace but does not guarantee that the entry is persisted when the method returns. The entry may be persisted at some time in the future or may even fail (silently) because of an exception. This method is thread-safe.- Parameters:
entry- the entry to add.- Throws:
RepositoryException- if an error occurs while writing to the workspace.
-
run
public void run()
-