| | |
| | | * |
| | | * |
| | | * Copyright 2006-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014 ForgeRock AS |
| | | * Portions Copyright 2014-2015 ForgeRock AS |
| | | */ |
| | | package org.opends.server.backends.task; |
| | | |
| | |
| | | import org.forgerock.opendj.ldap.ByteString; |
| | | import org.forgerock.opendj.ldap.ResultCode; |
| | | import org.opends.server.core.DirectoryServer; |
| | | import org.opends.server.core.ServerContext; |
| | | import org.opends.server.types.Attribute; |
| | | import org.opends.server.types.AttributeType; |
| | | import org.opends.server.types.Attributes; |
| | |
| | | private final boolean[] monthArray; |
| | | private final boolean[] weekdayArray; |
| | | |
| | | private final ServerContext serverContext; |
| | | |
| | | /** |
| | | * Creates a new recurring task based on the information in the provided |
| | | * entry. |
| | | * |
| | | * @param serverContext |
| | | * The server context. |
| | | * |
| | | * @param taskScheduler A reference to the task scheduler that may be |
| | | * used to schedule new tasks. |
| | | * @param recurringTaskEntry The entry containing the information to use to |
| | |
| | | * @throws DirectoryException If the provided entry does not contain a valid |
| | | * recurring task definition. |
| | | */ |
| | | public RecurringTask(TaskScheduler taskScheduler, Entry recurringTaskEntry) |
| | | public RecurringTask(ServerContext serverContext, TaskScheduler taskScheduler, Entry recurringTaskEntry) |
| | | throws DirectoryException |
| | | { |
| | | this.serverContext = serverContext; |
| | | this.taskScheduler = taskScheduler; |
| | | this.recurringTaskEntry = recurringTaskEntry; |
| | | this.recurringTaskEntryDN = recurringTaskEntry.getName(); |
| | |
| | | // provided entry. |
| | | try |
| | | { |
| | | task.initializeTaskInternal(taskScheduler, recurringTaskEntry); |
| | | task.initializeTaskInternal(serverContext, taskScheduler, recurringTaskEntry); |
| | | } |
| | | catch (InitializationException ie) |
| | | { |
| | |
| | | taskStartTimeAttrType, nextTaskStartTime); |
| | | nextTaskEntry.replaceAttribute(nextTaskStartTimeAttr); |
| | | |
| | | nextTask.initializeTaskInternal(taskScheduler, nextTaskEntry); |
| | | nextTask.initializeTaskInternal(serverContext, taskScheduler, nextTaskEntry); |
| | | nextTask.initializeTask(); |
| | | } catch (Exception e) { |
| | | // Should not happen, debug log it otherwise. |