com.mycompany.expense
Class ReportRegistry

java.lang.Object
  extended bycom.mycompany.expense.ReportRegistry
Direct Known Subclasses:
FileReportRegistry

public abstract class ReportRegistry
extends java.lang.Object

This abstract class represents the report registry for the sample expense report application. Concrete subclasses can use any type of permanent storage.

Version:
1.0
Author:
Hans Bergsten, Gefion Software

Constructor Summary
ReportRegistry()
           
 
Method Summary
abstract  void addReport(Report report)
          Adds a copy of the report to the registry.
abstract  Report getReport(int id)
          Returns a copy of the report with the specified ID, or null if there's no matching report in the registry.
abstract  java.util.List getReports(java.lang.String owner, java.util.Date from, java.util.Date to, int[] status)
          Returns a List with copies of all reports matching the search criteria.
abstract  void removeReport(Report report)
          Removes an existing report in the registry with ID of the provided report.
abstract  void updateReport(Report report)
          Replaces an existing report in the registry with a copy of the provided report.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReportRegistry

public ReportRegistry()
Method Detail

addReport

public abstract void addReport(Report report)
                        throws RegistryException
Adds a copy of the report to the registry.

Throws:
RegistryException

updateReport

public abstract void updateReport(Report report)
                           throws RegistryException
Replaces an existing report in the registry with a copy of the provided report.

Throws:
RegistryException

removeReport

public abstract void removeReport(Report report)
                           throws RegistryException
Removes an existing report in the registry with ID of the provided report.

Throws:
RegistryException

getReport

public abstract Report getReport(int id)
                          throws RegistryException
Returns a copy of the report with the specified ID, or null if there's no matching report in the registry.

Throws:
RegistryException

getReports

public abstract java.util.List getReports(java.lang.String owner,
                                          java.util.Date from,
                                          java.util.Date to,
                                          int[] status)
                                   throws RegistryException
Returns a List with copies of all reports matching the search criteria.

Throws:
RegistryException