org.openeai.afa
Class ScheduleIdStore


java.lang.Object

  |

  +--org.openeai.OpenEaiObject

        |

        +--org.openeai.afa.ScheduleIdStore


public class ScheduleIdStore
extends OpenEaiObject

This maintains a list of all Schedules that have been executed by a given ScheduledApp. The Schedule is responsible for clearing the list of executed schedules when the day changes (12am). As a Schedule is executed, its Schedule Id is added to this store so the Schedule won't execute more than once during a 24 hour period. Additionally, this store is persisted to a configurable location so the store survives application starting and stopping.

This implementation, currently only supports storing and loading schedule ids from the file system. However, it could be modified to store and load from other sources as well.

Version:
3.0 beta2 - 28 January 2003
Author:
Tod Jackson (tod@openeai.org), Steve Wheat (steve@openeai.org)
See Also:
Schedule

Field Summary
 
Fields inherited from class org.openeai.OpenEaiObject
logger
 
Constructor Summary
ScheduleIdStore()
          Constructor
 
Method Summary
 void add(java.lang.String scheduleId)
          Adds a Schedule Id to this store.
 boolean contains(java.lang.String scheduleId)
          Determines if a particular Schedule Id exists in this store.
 java.lang.String getPath()
          Returns the path to which schedule ids will be written.
 void load()
          Loads any previously ran schedule ids into memory when the application starts.
 void remove(java.lang.String scheduleId)
          Removes a specific schedule id from the repository that has an id equal to the schedule id passed in.
 void removeSchedulesLike(java.lang.String schedulePattern)
          Removes all schedule ids from the repository that have an id containing the pattern passed in.
 void setPath(java.lang.String path)
          Sets the path to which schedule ids will be written.
 
Methods inherited from class org.openeai.OpenEaiObject
addLog4jProperty, getAppName, getDebug, getFromAddr, getLog4jProperties, getMailHost, getMailService, getProperties, getToAddr, initializeLog4j, initializeLog4j, initializeLog4j, setAppName, setDebug, setFromAddr, setMailHost, setMailService, setProperties, setToAddr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScheduleIdStore


public ScheduleIdStore()
Constructor

Method Detail

load


public final void load()
                throws ScheduleIdStoreException
Loads any previously ran schedule ids into memory when the application starts. This is how the store survives application starting and stopping.

ScheduleIdStoreException

setPath


public final void setPath(java.lang.String path)
Sets the path to which schedule ids will be written.


getPath


public final java.lang.String getPath()
Returns the path to which schedule ids will be written.

Returns:
String path name

removeSchedulesLike


public final void removeSchedulesLike(java.lang.String schedulePattern)
                               throws ScheduleIdStoreException
Removes all schedule ids from the repository that have an id containing the pattern passed in.

ScheduleIdStoreException

remove


public final void remove(java.lang.String scheduleId)
                  throws ScheduleIdStoreException
Removes a specific schedule id from the repository that has an id equal to the schedule id passed in.

ScheduleIdStoreException

contains


public final boolean contains(java.lang.String scheduleId)
                       throws ScheduleIdStoreException
Determines if a particular Schedule Id exists in this store.

Returns:
boolean true if the schedule id exists, false if not.
ScheduleIdStoreException

add


public final void add(java.lang.String scheduleId)
               throws ScheduleIdStoreException
Adds a Schedule Id to this store. Also, persists the schedule id to the file system (in this case) so it will be available when/if the application is restarted.

ScheduleIdStoreException


Copyright © 2002, OpenEAI Software Foundation