+ "\nExisting...");
si.getServerConnection().logout();
return;
}
ScheduledTaskManager stm = si.getScheduledTaskManager();
if(stm!=null)
{
//to save space, we just check one name here
if(taskNameExists(stm, "ViMaster_OneTime"))
{
si.getServerConnection().logout();
return;
}
// Note: the time should be fetched from server,
// just to make sure it's synchronized.
ScheduledTaskSpec oneSpec = createOneTimeSchedulerSpec(
"ViMaster_OneTime", si.currentTime());
ScheduledTaskSpec weekSpec = createWeeklySchedulerSpec(
"ViMaster_Weekly");
ScheduledTask st = stm.createScheduledTask(vm, oneSpec);
ScheduledTask st1 = stm.createScheduledTask(vm, weekSpec);
// sleep two minutes before deleting
// the one time scheduled task.
// An one time scheduled task has not to be deleted after
// it's run. It can be run any time again by calling the
// runScheduledTask() method.