|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectuk.org.ogsadai.persistence.file.SimpleFileDAO
uk.org.ogsadai.persistence.file.activity.SimpleFileActivitySpecDAO
public class SimpleFileActivitySpecDAO
This class manages the persistence of activity-related information within configuration files. It populates objects with state from persistence media and also persists state represented by objects. The DAO records itself as a listener to any ActivitySpec objects it provides or is given and, depending upon the persistence policy in place, will react to changes in the activity specification and persist such changes. The activity-related file is expected to be called activties.txt and be within a configuration directory provided to this class. The file is expected to have the following format:
# Activity ID # A value compliant with the format of uk.org.ogsadai.activity.ActivityID. id=ACTIVITY-ID # Activity implementation class name. class=ACTIVITY-CLASS # Human-readable description. description=ACTIVITY-DESCRIPTION CONFIG # Activity configuration - specific to implementation class. # Zero or more key-value properties. # Key must be compliant with uk.org.ogsadai.common.Key. # Value can be a string, boolean or number. KEY1=VALUE1 KEY2=VALUE2 KEY3=VALUE3 ... END ...For example:
id=uk.org.ogsadai.SQLQueryActivity class=uk.org.ogsadai.activity.sql.SQLQueryActivity description=A standard SQL query activity. CONFIG default.fetch.size=1234 max.fetch.size=5678 END id=uk.org.ogsadai.XSLTransformActivity class=uk.org.ogsadai.activity.transform.XSLTransformActivity description=An XSL transform activity. CONFIG END ...
This class does not support auto-detection of changes to configuration files.
| Field Summary |
|---|
| Fields inherited from class uk.org.ogsadai.persistence.file.SimpleFileDAO |
|---|
mConfigDir, mFileUtils |
| Constructor Summary | |
|---|---|
SimpleFileActivitySpecDAO()
Constructor. |
|
SimpleFileActivitySpecDAO(java.io.File configDir)
Constructor. |
|
| Method Summary | |
|---|---|
void |
activityUpdated(ActivityUpdateEvent event)
Inform a component that an activity-related component changed state. |
void |
deleteActivitySpec(ActivityID activityID)
Delete the specification of an activity. |
ActivitySpec |
getActivitySpec(ActivityID activityID)
This class will register itself as a listener for changes in the ActivitySpec returned. |
boolean |
hasPersistedStateChanged(ActivityID activityID)
This class does not support auto-detection of changes to configuration files. |
void |
insertActivitySpec(ActivitySpec activitySpec)
If activitySpec implements ActivityEventDispatcher then this class will register itself as a listener. |
boolean |
isActivityKnown(ActivityID activityID)
Is an activity recorded in the persistence media? |
java.util.List |
listActivities()
Get a list of activities persisted in the persistence media. |
void |
setConfigDir(java.io.File configDir)
Set the configuration directory. |
| Methods inherited from class uk.org.ogsadai.persistence.file.SimpleFileDAO |
|---|
getConfigDir |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimpleFileActivitySpecDAO()
public SimpleFileActivitySpecDAO(java.io.File configDir)
configDir - Configuration directory
java.lang.IllegalArgumentException - If configDir is null.| Method Detail |
|---|
public void setConfigDir(java.io.File configDir)
FilePersistenceConfiguration
setConfigDir in interface FilePersistenceConfigurationsetConfigDir in class SimpleFileDAOconfigDir - Configuration directory.
public java.util.List listActivities()
throws PersistenceException
ActivitySpecDAO
listActivities in interface ActivitySpecDAOPersistenceException - If any problems arise when interacting with the persistence
media.
public boolean isActivityKnown(ActivityID activityID)
throws PersistenceException
ActivitySpecDAO
isActivityKnown in interface ActivitySpecDAOactivityID - Activity ID
java.lang.IllegalArgumentException - If activityID is null.
PersistenceException - If any problems arise when interacting with the persistence
media.
public ActivitySpec getActivitySpec(ActivityID activityID)
throws ActivityUnknownException,
PersistenceException
getActivitySpec in interface ActivitySpecDAOactivityID - Activity ID
java.lang.IllegalArgumentException - If activityID is null.
ActivityUnknownException - If the activity is unknown i.e. not recorded in the
persistence media.
PersistenceException - If any problems arise when interacting with the persistence
media.
public void deleteActivitySpec(ActivityID activityID)
throws PersistenceException
ActivitySpecDAO
deleteActivitySpec in interface ActivitySpecDAOactivityID - Activity ID
java.lang.IllegalArgumentException - If activitySpec is null.
PersistenceException - If any problems arise when interacting with the persistence
media.
public void insertActivitySpec(ActivitySpec activitySpec)
throws PersistenceException
insertActivitySpec in interface ActivitySpecDAOactivitySpec - Activity specification
java.lang.IllegalArgumentException - If activitySpec is null.
PersistenceException - If any problems arise when interacting with the persistence
media.public void activityUpdated(ActivityUpdateEvent event)
ActivityEventListener
activityUpdated in interface ActivityEventListenerevent - Information on the update.
java.lang.IllegalArgumentException - If event is null.
PersistenceException - If any problems arise when interacting with the persistence
media.
public boolean hasPersistedStateChanged(ActivityID activityID)
throws PersistenceException
hasPersistedStateChanged in interface ActivitySpecDAOactivityID - Activity ID
PersistenceException - If any problems arise when interacting with the persistence
media.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||