com.ibm.di.connector
Class TimerConnector

java.lang.Object
  extended by com.ibm.di.connector.Connector
      extended by com.ibm.di.connector.TimerConnector
All Implemented Interfaces:
ConnectorInterface, VersionInfoInterface

public class TimerConnector
extends Connector
implements ConnectorInterface

This connector provides a simplistic version of a crontab style timer.


Field Summary
 
Fields inherited from class com.ibm.di.connector.Connector
ALL_MODES, myLog, PROPERTY_MESSAGE, PROPERTY_READER, PROPERTY_WRITER
 
Constructor Summary
TimerConnector()
           
 
Method Summary
 void calcNextRun()
           
 void checkDate(String[] checkTime, int dateNum, int whichDate)
           
 void checkDay(String month, int dateNum, String[] checkTime)
           
 void doWait(long p1, long p2)
           
 String getMaskSchedule()
           
 String getMonthValue(String strMonth)
           
 ConnectorInterface getNextClient()
          Server mode - return a clone of self that handles the next client instance when running in server mode.
 Entry getNextEntry()
          Returns the next Entry from the connector.
 String getVersion()
          Return version information
 String getWeekValue(String strWeekDay)
           
 void initialize(Object o)
          Initialize the connector.
 void selectEntries()
          Prepare the Connector for sequential read.
 void setNextEntry(Entry e)
           
 boolean sleepSeconds(long p1)
           
 void validSchedule(String[] checkTime)
           
 
Methods inherited from class com.ibm.di.connector.Connector
addFindEntry, allModes, clearFindEntries, debug, debugMode, deleteEntry, findEntry, findEntry, getBoolean, getClassInstance, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getLog, getMaxDuplicateEntries, getModes, getModes, getName, getNextFindEntry, getParam, getParser, getProperty, getPushbackEntry, getRawConnectorConfiguration, getRSInterface, hasConfigValue, hasParser, initParser, isDeltaSupported, isExceptionFatal, isIOException, logmsg, modEntry, modEntry, pushback, putEntry, queryOperations, queryReply, querySchema, queryTables, reconnect, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setModes, setModes, setName, setParam, setParser, setProperty, setRSInterface, terminate, terminateServer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.di.connector.ConnectorInterface
deleteEntry, findEntry, getConfiguration, getContext, getFindEntryCount, getFirstFindEntry, getMaxDuplicateEntries, getName, getNextFindEntry, getParam, getPushbackEntry, getRawConnectorConfiguration, isDeltaSupported, isExceptionFatal, isIOException, modEntry, modEntry, pushback, putEntry, queryOperations, queryReply, querySchema, reconnect, registerScriptBeans, replyEntry, setConfiguration, setContext, setCurrent, setLog, setMaxDuplicateEntries, setName, setParam, setRSInterface, terminate, terminateServer
 

Constructor Detail

TimerConnector

public TimerConnector()
Method Detail

selectEntries

public void selectEntries()
                   throws Exception
Description copied from class: Connector
Prepare the Connector for sequential read. If necessary, create a result set to be used for getNextEntry(). When the Connector is used as an Iterator in an AssemblyLine, this method will be called. Default is an empty method.

Specified by:
selectEntries in interface ConnectorInterface
Overrides:
selectEntries in class Connector
Throws:
Exception

initialize

public void initialize(Object o)
                throws Exception
Description copied from class: Connector
Initialize the connector. The connector may be passed a parameter of any kind by the user. It is up to the connector to determine whether this object can be used or not. The parameter is typically provided by a user script. When an AssemblyLine initializes it's Connectors, they are passed a ConnectorMode object.

Specified by:
initialize in interface ConnectorInterface
Overrides:
initialize in class Connector
Parameters:
o - User provided parameter
Throws:
Exception

setNextEntry

public void setNextEntry(Entry e)

getNextEntry

public Entry getNextEntry()
                   throws Exception
Description copied from class: Connector
Returns the next Entry from the connector. The entry is populated with attributes and values from the next entry in the input set.

Specified by:
getNextEntry in interface ConnectorInterface
Overrides:
getNextEntry in class Connector
Returns:
- the next Entry, or null if no more data
Throws:
Exception
See Also:
Connector.selectEntries()

getNextClient

public ConnectorInterface getNextClient()
                                 throws Exception
Description copied from class: Connector
Server mode - return a clone of self that handles the next client instance when running in server mode. The returned connector may be used in its own thread to handle a "client" request so if the returned instance is returned more than once it must be thread safe.

Specified by:
getNextClient in interface ConnectorInterface
Overrides:
getNextClient in class Connector
Throws:
Exception

checkDay

public void checkDay(String month,
                     int dateNum,
                     String[] checkTime)
              throws Exception
Throws:
Exception

checkDate

public void checkDate(String[] checkTime,
                      int dateNum,
                      int whichDate)
               throws Exception
Throws:
Exception

validSchedule

public void validSchedule(String[] checkTime)
                   throws Exception
Throws:
Exception

calcNextRun

public void calcNextRun()
                 throws Exception
Throws:
Exception

doWait

public void doWait(long p1,
                   long p2)
            throws InterruptedException
Throws:
InterruptedException

sleepSeconds

public boolean sleepSeconds(long p1)

getMaskSchedule

public String getMaskSchedule()

getMonthValue

public String getMonthValue(String strMonth)

getWeekValue

public String getWeekValue(String strWeekDay)

getVersion

public String getVersion()
Return version information

Specified by:
getVersion in interface VersionInfoInterface