Class ActivityDatabaseService

java.lang.Object
uk.m0nom.adifproc.activity.ActivityDatabaseService

@Service public class ActivityDatabaseService extends Object
This is the collection of all activity databases, including the readers to obtain the data from the source files
  • Constructor Details

    • ActivityDatabaseService

      public ActivityDatabaseService()
      Constructor creates readers for all supported activities
  • Method Details

    • loadData

      public void loadData()
      For each supported activity this calls the reader to load the activity data into a database and then maintain a reference here using the ActivityType. Source files are read from the resources directory
    • findActivity

      public Activity findActivity(String reference)
      Given an arbitrary activity reference, search each of the databases for a matching activity
      Parameters:
      reference - String reference for the activity to search for
      Returns:
      If a match is found the corresponding activity is returned, otherwise null
    • getDatabase

      public ActivityDatabase getDatabase(ActivityType type)
      Given an activity type return the corresponding database
      Parameters:
      type - Activity type
      Returns:
      database for activity
    • getDatabase

      public ActivityDatabase getDatabase(String requested)
      Get the database for the named activity based on the activityName field in each activity type
      Parameters:
      requested - name of the activity type
      Returns:
      database if activity type found, otherwise null