Message message = ERR_RECURRINGTASK_NO_ID.get(ATTR_RECURRING_TASK_ID);
throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message);
}
Iterator<AttributeValue> iterator = attr.iterator();
AttributeValue value = iterator.next();
if (iterator.hasNext())
{
Message message =
ERR_RECURRINGTASK_MULTIPLE_ID_VALUES.get(ATTR_RECURRING_TASK_ID);
throw new DirectoryException(ResultCode.OBJECTCLASS_VIOLATION, message);
}
recurringTaskID = value.getValue().toString();
// Get the schedule for this task.
attrType = DirectoryServer.getAttributeType(
ATTR_RECURRING_TASK_SCHEDULE.toLowerCase());
if (attrType == null)
{
attrType = DirectoryServer.getDefaultAttributeType(
ATTR_RECURRING_TASK_SCHEDULE);
}
attrList = recurringTaskEntry.getAttribute(attrType);
if ((attrList == null) || attrList.isEmpty())
{
Message message = ERR_RECURRINGTASK_NO_SCHEDULE_ATTRIBUTE.get(
ATTR_RECURRING_TASK_SCHEDULE);
throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message);
}
if (attrList.size() > 1)
{
Message message = ERR_RECURRINGTASK_MULTIPLE_SCHEDULE_TYPES.get(
ATTR_RECURRING_TASK_SCHEDULE);
throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message);
}
attr = attrList.get(0);
if (attr.isEmpty())
{
Message message = ERR_RECURRINGTASK_NO_SCHEDULE_VALUES.get(
ATTR_RECURRING_TASK_SCHEDULE);
throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message);
}
iterator = attr.iterator();
value = iterator.next();
if (iterator.hasNext())
{
Message message = ERR_RECURRINGTASK_MULTIPLE_SCHEDULE_VALUES.get(
ATTR_RECURRING_TASK_SCHEDULE);
throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message);
}
String taskScheduleTab = value.toString();
boolean[][] taskArrays = new boolean[][]{null, null, null, null, null};
parseTaskTab(taskScheduleTab, taskArrays, true);
minutesArray = taskArrays[MINUTE_INDEX];
hoursArray = taskArrays[HOUR_INDEX];
daysArray = taskArrays[DAY_INDEX];
monthArray = taskArrays[MONTH_INDEX];
weekdayArray = taskArrays[WEEKDAY_INDEX];
// Get the class name from the entry. If there isn't one, then fail.
attrType = DirectoryServer.getAttributeType(
ATTR_TASK_CLASS.toLowerCase());
if (attrType == null)
{
attrType = DirectoryServer.getDefaultAttributeType(ATTR_TASK_CLASS);
}
attrList = recurringTaskEntry.getAttribute(attrType);
if ((attrList == null) || attrList.isEmpty())
{
Message message = ERR_TASKSCHED_NO_CLASS_ATTRIBUTE.get(
ATTR_TASK_CLASS);
throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message);
}
if (attrList.size() > 1)
{
Message message = ERR_TASKSCHED_MULTIPLE_CLASS_TYPES.get(
ATTR_TASK_CLASS);
throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message);
}
attr = attrList.get(0);
if (attr.isEmpty())
{
Message message =
ERR_TASKSCHED_NO_CLASS_VALUES.get(ATTR_TASK_CLASS);
throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message);
}
iterator = attr.iterator();
value = iterator.next();
if (iterator.hasNext())
{
Message message = ERR_TASKSCHED_MULTIPLE_CLASS_VALUES.get(
ATTR_TASK_CLASS);
throw new DirectoryException(ResultCode.CONSTRAINT_VIOLATION, message);
}
taskClassName = value.getValue().toString();
// Make sure that the specified class can be loaded.
Class<?> taskClass;
try