public interface ISchedule
ILexiCom.getSchedule()
The following example
demonstrates setting various types of schedules:
ILexiCom lexicom = LexiComFactory.getVersaLex(...);
ISchedule schedule = lexicom.getSchedule();
ISchedule.Item item;
ISchedule.Item.Calendar calendar;
ISchedule.Item.Calendar.Time time;
// schedule send action to be autosend
String[] path = new String[] {"Looptest FTP", "myMailbox", "send"};
item = schedule.newItem(path);
item.setOnlyIfFile(true, true);
schedule.updateItem(item, false);
// schedule receive action to be weekdays every 2 hours from 8am to 4pm and weekend days at noon
path[ILexiCom.ACTION_INDEX] = "receive";
item = schedule.newItem(path);
item.setPeriod(ISchedule.WEEKLY);
calendar = item.addCalendar();
calendar.setDays(ISchedule.MONDAY + ISchedule.THROUGH + ISchedule.FRIDAY);
time = calendar.addTime();
time.setStart("8:00");
time.setRecurring("2:00");
time.setUntil("16:00");
calendar = item.addCalendar();
calendar.setDays(ISchedule.SUNDAY + ISchedule.SATURDAY);
time = calendar.addTime();
time.setStart("12:00");
schedule.updateItem(item, false);
// schedule report action to be first monday of every month at 8am
path[ILexiCom.ACTION_INDEX] = "report";
item = schedule.newItem(path);
item.setPeriod(ISchedule.MONTHLY);
calendar = item.addCalendar();
calendar.setMonths(ISchedule.JANUARY + ISchedule.THROUGH + ISchedule.DECEMBER);
calendar.setDaysOfMonth(ISchedule.FIRST, ISchedule.MONDAY);
time = calendar.addTime();
time.setStart("8:00");
schedule.updateItem(item, false);
// save changes
schedule.save();
| Modifier and Type | Interface and Description |
|---|---|
static interface |
ISchedule.Item |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
APRIL
MONTHLY scheduling period fourth month
|
static java.lang.String |
AUGUST
MONTHLY scheduling period eighth month
|
static java.lang.String |
DECEMBER
MONTHLY scheduling period twelfth and last month
|
static java.lang.String |
EVERY
MONTHLY scheduling period recurrence
|
static java.lang.String |
FEBRUARY
MONTHLY scheduling period second month
|
static java.lang.String |
FIRST
MONTHLY scheduling period recurrence
|
static java.lang.String |
FOURTH
MONTHLY scheduling period recurrence
|
static java.lang.String |
FRIDAY
WEEKLY or MONTHLY scheduling period sixth day
|
static java.lang.String |
JANUARY
MONTHLY scheduling period first month
|
static java.lang.String |
JULY
MONTHLY scheduling period seventh month
|
static java.lang.String |
JUNE
MONTHLY scheduling period sixth month
|
static java.lang.String |
LAST
MONTHLY scheduling period recurrence
|
static java.lang.String |
MARCH
MONTHLY scheduling period third month
|
static java.lang.String |
MAY
MONTHLY scheduling period fifth month
|
static java.lang.String |
MONDAY
WEEKLY or MONTHLY scheduling period second day
|
static java.lang.String |
MONTHLY
Monthly scheduling period
|
static java.lang.String |
NOVEMBER
MONTHLY scheduling period eleventh month
|
static java.lang.String |
OCTOBER
MONTHLY scheduling period tenth month
|
static java.lang.String |
ONE_TIME
One-time only scheduling period
|
static java.lang.String |
SATURDAY
WEEKLY or MONTHLY scheduling period seventh and last day
|
static java.lang.String |
SECOND
MONTHLY scheduling period recurrence
|
static java.lang.String |
SEPTEMBER
MONTHLY scheduling period ninth month
|
static java.lang.String |
SUNDAY
WEEKLY or MONTHLY scheduling period first day
|
static java.lang.String |
THIRD
MONTHLY scheduling period recurrence
|
static java.lang.String |
THROUGH
WEEKLY or MONTHLY scheduling period inclusive symbol
|
static java.lang.String |
THURSDAY
WEEKLY or MONTHLY scheduling period fifth day
|
static java.lang.String |
TUESDAY
WEEKLY or MONTHLY scheduling period third day
|
static java.lang.String |
WEDNESDAY
WEEKLY or MONTHLY scheduling period fourth day
|
static java.lang.String |
WEEKLY
Weekly scheduling period
|
| Modifier and Type | Method and Description |
|---|---|
ISchedule.Item |
findItem(java.lang.String[] path)
Find the scheduled item for the action
|
java.lang.String |
getLastStatus(ISchedule.Item item)
Returns the status of the last time the action associated with the item was run.
|
java.util.Date |
getNextRun(ISchedule.Item item)
Returns the next date and time the action associated with the item could be run.
|
java.util.List<ISchedule.Item> |
listItems()
Get the list of schedule items
|
ISchedule.Item |
newItem(java.lang.String[] path)
Create a new schedule item for the action.
|
boolean |
removeItem(java.lang.String[] path,
boolean save)
Remove the scheduled item for the action
|
void |
save()
Save all the current settings permanently
|
void |
updateItem(ISchedule.Item item,
boolean save)
Update or add the item to the schedule
|
static final java.lang.String WEEKLY
static final java.lang.String MONTHLY
static final java.lang.String ONE_TIME
static final java.lang.String SUNDAY
static final java.lang.String MONDAY
static final java.lang.String TUESDAY
static final java.lang.String WEDNESDAY
static final java.lang.String THURSDAY
static final java.lang.String FRIDAY
static final java.lang.String SATURDAY
static final java.lang.String JANUARY
static final java.lang.String FEBRUARY
static final java.lang.String MARCH
static final java.lang.String APRIL
static final java.lang.String MAY
static final java.lang.String JUNE
static final java.lang.String JULY
static final java.lang.String AUGUST
static final java.lang.String SEPTEMBER
static final java.lang.String OCTOBER
static final java.lang.String NOVEMBER
static final java.lang.String DECEMBER
static final java.lang.String THROUGH
static final java.lang.String EVERY
static final java.lang.String FIRST
static final java.lang.String SECOND
static final java.lang.String THIRD
static final java.lang.String FOURTH
static final java.lang.String LAST
java.util.List<ISchedule.Item> listItems()
ISchedule.Item findItem(java.lang.String[] path)
path - the alias path to the actionboolean removeItem(java.lang.String[] path,
boolean save)
throws java.lang.Exception
path - the alias path to the actionsave - true if change should be permanently saved nowjava.lang.ExceptionISchedule.Item newItem(java.lang.String[] path) throws java.lang.Exception
path - the alias path to the actionjava.lang.Exceptionvoid updateItem(ISchedule.Item item, boolean save) throws java.lang.Exception
item - the schedule for an actionsave - true if change should be permanently saved now
(use true if updating an existing schedule for an action; otherwise the currently
running scheduler will not pick up the change)java.lang.Exception - if the item fails verificationvoid save() throws java.lang.Exception
java.lang.Exceptionjava.util.Date getNextRun(ISchedule.Item item)
item - the schedule itemjava.lang.String getLastStatus(ISchedule.Item item)
item - the schedule item