Package uk.m0nom.adifproc.activity
Class ActivityDatabaseService
java.lang.Object
uk.m0nom.adifproc.activity.ActivityDatabaseService
This is the collection of all activity databases, including the readers to obtain the data from the source
files
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor creates readers for all supported activities -
Method Summary
Modifier and TypeMethodDescriptionfindActivity(String reference) Given an arbitrary activity reference, search each of the databases for a matching activitygetDatabase(String requested) Get the database for the named activity based on the activityName field in each activity typegetDatabase(ActivityType type) Given an activity type return the corresponding databasevoidloadData()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.
-
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
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
Given an activity type return the corresponding database- Parameters:
type- Activity type- Returns:
- database for activity
-
getDatabase
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
-