|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.connector.Connector
com.ibm.di.connector.TimerConnector
public class TimerConnector
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()
Class constructor |
Method Summary | |
---|---|
void |
calcNextRun()
Calculates the next run |
void |
checkDate(java.lang.String[] checkTime,
int dateNum,
int whichDate)
Checks if the date specified is correct |
void |
checkDay(java.lang.String month,
int dateNum,
java.lang.String[] checkTime)
Checks if the specified day options are correct |
void |
doWait(long p1,
long p2)
Connector waits for the specified difference in the parameters |
java.lang.String |
getMaskSchedule()
Retrieves the schedule to next run |
java.lang.String |
getMonthValue(java.lang.String strMonth)
Translates month of the year to number |
ConnectorInterface |
getNextClient()
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. |
Entry |
getNextEntry()
Returns the next Entry from the connector. The entry is populated with attributes and values from the next entry in the input set. Example: var ctor = input.getConnector(); var entry = ctor.getNextEntry(); for (; entry != null; entry = ctor.getNextEntry()) { main.logmsg("Read entry..."); main.dumpEntry(entry); } |
java.lang.String |
getVersion()
Return version information |
java.lang.String |
getWeekValue(java.lang.String strWeekDay)
Translates day of the week to number |
void |
initialize(java.lang.Object o)
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. |
void |
selectEntries()
Default implementation |
void |
setNextEntry(Entry e)
Sets next entry for server mode |
boolean |
sleepSeconds(long p1)
This function is not used directly, but maybe some old configurations use this.Connector sleeps for the specified time |
void |
validSchedule(java.lang.String[] checkTime)
Verifies the the schedule is correct |
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 |
---|
public TimerConnector()
Method Detail |
---|
public void selectEntries() throws java.lang.Exception
selectEntries
in interface ConnectorInterface
selectEntries
in class Connector
java.lang.Exception
- neverpublic void initialize(java.lang.Object o) throws java.lang.Exception
initialize
in interface ConnectorInterface
initialize
in class Connector
o
- User provided parameter
java.lang.Exception
- if the initialization of this connector fails.public void setNextEntry(Entry e)
e
- next clienpublic Entry getNextEntry() throws java.lang.Exception
Example:
var ctor = input.getConnector(); var entry = ctor.getNextEntry(); for (; entry != null; entry = ctor.getNextEntry()) { main.logmsg("Read entry..."); main.dumpEntry(entry); }
getNextEntry
in interface ConnectorInterface
getNextEntry
in class Connector
java.lang.Exception
- if an error occurs.ConnectorInterface.selectEntries()
public ConnectorInterface getNextClient() throws java.lang.Exception
getNextClient
in interface ConnectorInterface
getNextClient
in class Connector
java.lang.Exception
- if an error occurs.public void checkDay(java.lang.String month, int dateNum, java.lang.String[] checkTime) throws java.lang.Exception
month
- month namedateNum
- date numbercheckTime
- time
java.lang.Exception
- if the day is not validpublic void checkDate(java.lang.String[] checkTime, int dateNum, int whichDate) throws java.lang.Exception
checkTime
- timedateNum
- month numberwhichDate
- date number
java.lang.Exception
- if an error occurspublic void validSchedule(java.lang.String[] checkTime) throws java.lang.Exception
checkTime
- time to be checked
java.lang.Exception
- if a problem occurspublic void calcNextRun() throws java.lang.Exception
java.lang.Exception
- if schedule is invalid or missingpublic void doWait(long p1, long p2) throws java.lang.InterruptedException
p1
- wait untilp2
- current time in milliseconds
java.lang.InterruptedException
- if the connector is interruptedpublic boolean sleepSeconds(long p1)
p1
- time to wait
public java.lang.String getMaskSchedule()
public java.lang.String getMonthValue(java.lang.String strMonth)
strMonth
- string representation
public java.lang.String getWeekValue(java.lang.String strWeekDay)
strWeekDay
- string representation
public java.lang.String getVersion()
getVersion
in interface VersionInfoInterface
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |