if (entry == null)
{
break;
}
DN entryDN = entry.getDN();
if (entryDN.equals(taskBackend.getTaskRootDN()))
{
taskRootEntry = entry;
}
else if (entryDN.equals(taskBackend.getRecurringTasksParentDN()))
{
recurringTaskParentEntry = entry;
}
else if (entryDN.equals(taskBackend.getScheduledTasksParentDN()))
{
scheduledTaskParentEntry = entry;
}
else
{
DN parentDN = entryDN.getParentDNInSuffix();
if (parentDN == null)
{
Message message = ERR_TASKSCHED_ENTRY_HAS_NO_PARENT.
get(String.valueOf(entryDN),
String.valueOf(taskBackend.getTaskRootDN()));
logError(message);
}
else if (parentDN.equals(taskBackend.getScheduledTasksParentDN()))
{
try
{
Task task = entryToScheduledTask(entry, null);
if (TaskState.isDone(task.getTaskState()))
{
String id = task.getTaskID();
if (tasks.containsKey(id))
{
Message message =
WARN_TASKSCHED_DUPLICATE_TASK_ID.get(
String.valueOf(id));
logError(message);
}
else
{
completedTasks.add(task);
tasks.put(id, task);
}
}
else
{
scheduleTask(task, false);
}
}
catch (DirectoryException de)
{
if (debugEnabled())
{
TRACER.debugCaught(DebugLogLevel.ERROR, de);
}
Message message = ERR_TASKSCHED_CANNOT_SCHEDULE_TASK_FROM_ENTRY.
get(String.valueOf(entryDN), de.getMessageObject());
logError(message);
}
}
else if (parentDN.equals(taskBackend.getRecurringTasksParentDN()))
{
try
{
RecurringTask recurringTask = entryToRecurringTask(entry);
addRecurringTask(recurringTask, false);