001/*
002 * Copyright 2015-2018 Ping Identity Corporation
003 * All Rights Reserved.
004 */
005/*
006 * Copyright (C) 2015-2018 Ping Identity Corporation
007 *
008 * This program is free software; you can redistribute it and/or modify
009 * it under the terms of the GNU General Public License (GPLv2 only)
010 * or the terms of the GNU Lesser General Public License (LGPLv2.1 only)
011 * as published by the Free Software Foundation.
012 *
013 * This program is distributed in the hope that it will be useful,
014 * but WITHOUT ANY WARRANTY; without even the implied warranty of
015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016 * GNU General Public License for more details.
017 *
018 * You should have received a copy of the GNU General Public License
019 * along with this program; if not, see <http://www.gnu.org/licenses>.
020 */
021package com.unboundid.ldap.sdk.unboundidds.tasks;
022
023
024
025import java.util.ArrayList;
026import java.util.Arrays;
027import java.util.Collections;
028import java.util.Date;
029import java.util.LinkedHashMap;
030import java.util.List;
031import java.util.Map;
032
033import com.unboundid.ldap.sdk.Attribute;
034import com.unboundid.ldap.sdk.Entry;
035import com.unboundid.util.NotMutable;
036import com.unboundid.util.ThreadSafety;
037import com.unboundid.util.ThreadSafetyLevel;
038import com.unboundid.util.Validator;
039
040import static com.unboundid.ldap.sdk.unboundidds.tasks.TaskMessages.*;
041
042
043
044/**
045 * This class defines a Directory Proxy Server task that can be used to reload
046 * the contents of the global index.
047 * <BR>
048 * <BLOCKQUOTE>
049 *   <B>NOTE:</B>  This class, and other classes within the
050 *   {@code com.unboundid.ldap.sdk.unboundidds} package structure, are only
051 *   supported for use against Ping Identity, UnboundID, and
052 *   Nokia/Alcatel-Lucent 8661 server products.  These classes provide support
053 *   for proprietary functionality or for external specifications that are not
054 *   considered stable or mature enough to be guaranteed to work in an
055 *   interoperable way with other types of LDAP servers.
056 * </BLOCKQUOTE>
057 * <BR>
058 * The properties that are available for use with this type of task include:
059 * <UL>
060 *   <LI>The base DN for the entry-balancing request processor.</LI>
061 *   <LI>An optional set of attributes for which to reload the index
062 *       information.</LI>
063 *   <LI>A flag indicating whether to perform the reload in the background.</LI>
064 *   <LI>A flag indicating whether to reload entries from backend Directory
065 *       Server instances rather than a peer Directory Proxy Server
066 *       instance.</LI>
067 *   <LI>An optional maximum number of entries per second to access when
068 *       priming.</LI>
069 * </UL>
070 */
071@NotMutable()
072@ThreadSafety(level=ThreadSafetyLevel.COMPLETELY_THREADSAFE)
073public final class ReloadGlobalIndexTask
074       extends Task
075{
076  /**
077   * The fully-qualified name of the Java class that is used for the re-encode
078   * entries task.
079   */
080  static final String RELOAD_GLOBAL_INDEX_TASK_CLASS =
081       "com.unboundid.directory.proxy.tasks.ReloadTask";
082
083
084
085  /**
086   * The name of the attribute used to indicate whether the reload should be
087   * done in the background.
088   */
089  private static final String ATTR_BACKGROUND_RELOAD =
090       "ds-task-reload-background";
091
092
093
094  /**
095   * The name of the attribute used to specify the base DN for the
096   * entry-balancing request processor.
097   */
098  private static final String ATTR_BASE_DN = "ds-task-reload-base-dn";
099
100
101
102  /**
103   * The name of the attribute used to specify the names of the attributes for
104   * which to reload the indexes.
105   */
106  private static final String ATTR_INDEX_NAME = "ds-task-reload-index-name";
107
108
109
110  /**
111   * The name of the attribute used to specify a target rate limit for the
112   * maximum number of entries per second.
113   */
114  private static final String ATTR_MAX_ENTRIES_PER_SECOND =
115       "ds-task-search-entry-per-second";
116
117
118
119  /**
120   * The name of the attribute used to indicate whether the data should be
121   * loaded from backend Directory Server instances rather than a peer Directory
122   * Proxy Server instance.
123   */
124  private static final String ATTR_RELOAD_FROM_DS = "ds-task-reload-from-ds";
125
126
127
128  /**
129   * The name of the object class used in reload global index task entries.
130   */
131  private static final String OC_RELOAD_GLOBAL_INDEX_TASK =
132       "ds-task-reload-index";
133
134
135
136  /**
137   * The task property that will be used for the request processor base DN.
138   */
139  private static final TaskProperty PROPERTY_BACKGROUND_RELOAD =
140       new TaskProperty(ATTR_BACKGROUND_RELOAD,
141            INFO_DISPLAY_NAME_RELOAD_GLOBAL_INDEX_BACKGROUND.get(),
142            INFO_DESCRIPTION_RELOAD_GLOBAL_INDEX_BACKGROUND.get(),
143            Boolean.class, false, false, false);
144
145
146
147  /**
148   * The task property that will be used for the request processor base DN.
149   */
150  private static final TaskProperty PROPERTY_BASE_DN = new TaskProperty(
151       ATTR_BASE_DN, INFO_DISPLAY_NAME_RELOAD_GLOBAL_INDEX_BASE_DN.get(),
152       INFO_DESCRIPTION_RELOAD_GLOBAL_INDEX_BASE_DN.get(), String.class, true,
153       false, false);
154
155
156
157  /**
158   * The task property that will be used for the request processor base DN.
159   */
160  private static final TaskProperty PROPERTY_INDEX_NAME = new TaskProperty(
161       ATTR_INDEX_NAME, INFO_DISPLAY_NAME_RELOAD_GLOBAL_INDEX_ATTR_NAME.get(),
162       INFO_DESCRIPTION_RELOAD_GLOBAL_INDEX_ATTR_NAME.get(), String.class,
163       false, true, false);
164
165
166
167  /**
168   * The task property that will be used for the request processor base DN.
169   */
170  private static final TaskProperty PROPERTY_MAX_ENTRIES_PER_SECOND =
171       new TaskProperty(ATTR_MAX_ENTRIES_PER_SECOND,
172            INFO_DISPLAY_NAME_RELOAD_GLOBAL_INDEX_MAX_ENTRIES_PER_SECOND.get(),
173            INFO_DESCRIPTION_RELOAD_GLOBAL_INDEX_MAX_ENTRIES_PER_SECOND.get(),
174            Long.class, false, false, false);
175
176
177
178  /**
179   * The task property that will be used for the request processor base DN.
180   */
181  static final TaskProperty PROPERTY_RELOAD_FROM_DS = new TaskProperty(
182       ATTR_RELOAD_FROM_DS,
183       INFO_DISPLAY_NAME_RELOAD_GLOBAL_INDEX_RELOAD_FROM_DS.get(),
184       INFO_DESCRIPTION_RELOAD_GLOBAL_INDEX_RELOAD_FROM_DS.get(), Boolean.class,
185       false, false, false);
186
187
188
189  /**
190   * The serial version UID for this serializable class.
191   */
192  private static final long serialVersionUID = 9152807987055252560L;
193
194
195
196  // Indicates whether to reload from backend Directory Server instances.
197  private final Boolean reloadFromDS;
198
199  // Indicates whether to reload in the background.
200  private final Boolean reloadInBackground;
201
202  // The names of the indexes to reload.
203  private final List<String> indexNames;
204
205  // The target maximum rate limit to use when loading entry data.
206  private final Long maxEntriesPerSecond;
207
208  // The base DN for the entry-balancing request processor.
209  private final String baseDN;
210
211
212
213  /**
214   * Creates a new uninitialized reload global index task instance which should
215   * only be used for obtaining general information about this task, including
216   * the task name, description, and supported properties.  Attempts to use a
217   * task created with this constructor for any other reason will likely fail.
218   */
219  public ReloadGlobalIndexTask()
220  {
221    reloadFromDS        = null;
222    reloadInBackground  = null;
223    indexNames          = null;
224    maxEntriesPerSecond = null;
225    baseDN              = null;
226  }
227
228
229
230  /**
231   * Creates a new reload global index task with the provided information.
232   *
233   * @param  taskID               The task ID to use for this task.  If it is
234   *                              {@code null} then a UUID will be generated for
235   *                              use as the task ID.
236   * @param  baseDN               The base DN of the entry-balancing request
237   *                              processor for which to reload index
238   *                              information.
239   * @param  indexNames           The names of the attributes for which to
240   *                              reload index data.  This may be {@code null}
241   *                              or empty to indicate that all indexes should
242   *                              be reloaded.
243   * @param  reloadFromDS         Indicates whether to load index data from
244   *                              backend Directory Server instances rather than
245   *                              a peer Directory Proxy Server instance.  This
246   *                              may be {@code null} to indicate that the
247   *                              Directory Proxy Server should automatically
248   *                              select the appropriate source for obtaining
249   *                              index data.
250   * @param  reloadInBackground   Indicates whether to perform the reload in
251   *                              the background, so that the task completes
252   *                              immediately.
253   * @param  maxEntriesPerSecond  The maximum target rate at which to reload
254   *                              index data (in entries per second).  A value
255   *                              of zero indicates no limit.  A value of
256   *                              {@code null} indicates that the Directory
257   *                              Proxy Server should attempt to determine the
258   *                              limit based on its configuration.
259   */
260  public ReloadGlobalIndexTask(final String taskID, final String baseDN,
261                               final List<String> indexNames,
262                               final Boolean reloadFromDS,
263                               final Boolean reloadInBackground,
264                               final Long maxEntriesPerSecond)
265  {
266    this(taskID, baseDN, indexNames, reloadFromDS, reloadInBackground,
267         maxEntriesPerSecond, null, null, null, null, null);
268  }
269
270
271
272  /**
273   * Creates a new reload global index task with the provided information.
274   *
275   * @param  taskID                  The task ID to use for this task.  If it is
276   *                                 {@code null} then a UUID will be generated
277   *                                 for use as the task ID.
278   * @param  baseDN                  The base DN of the entry-balancing request
279   *                                 processor for which to reload index
280   *                                 information.
281   * @param  indexNames              The names of the attributes for which to
282   *                                 reload index data.  This may be
283   *                                 {@code null} or empty to indicate that all
284   *                                 indexes should be reloaded.
285   * @param  reloadFromDS            Indicates whether to load index data from
286   *                                 backend Directory Server instances rather
287   *                                 than a peer Directory Proxy Server
288   *                                 instance.  This may be {@code null} to
289   *                                 indicate that the Directory Proxy Server
290   *                                 should automatically select the appropriate
291   *                                 source for obtaining index data.
292   * @param  reloadInBackground      Indicates whether to perform the reload in
293   *                                 the background, so that the task completes
294   *                                 immediately.
295   * @param  maxEntriesPerSecond     The maximum target rate at which to reload
296   *                                 index data (in entries per second).  A
297   *                                 value of zero indicates no limit.  A value
298   *                                 of {@code null} indicates that the
299   *                                 Directory Proxy Server should attempt to
300   *                                 determine the limit based on its
301   *                                 configuration.
302   * @param  scheduledStartTime      The time that this task should start
303   *                                 running.
304   * @param  dependencyIDs           The list of task IDs that will be required
305   *                                 to complete before this task will be
306   *                                 eligible to start.
307   * @param  failedDependencyAction  Indicates what action should be taken if
308   *                                 any of the dependencies for this task do
309   *                                 not complete successfully.
310   * @param  notifyOnCompletion      The list of e-mail addresses of individuals
311   *                                 that should be notified when this task
312   *                                 completes.
313   * @param  notifyOnError           The list of e-mail addresses of individuals
314   *                                 that should be notified if this task does
315   *                                 not complete successfully.
316   */
317  public ReloadGlobalIndexTask(final String taskID, final String baseDN,
318              final List<String> indexNames, final Boolean reloadFromDS,
319              final Boolean reloadInBackground, final Long maxEntriesPerSecond,
320              final Date scheduledStartTime,
321              final List<String> dependencyIDs,
322              final FailedDependencyAction failedDependencyAction,
323              final List<String> notifyOnCompletion,
324              final List<String> notifyOnError)
325  {
326    this(taskID, baseDN, indexNames, reloadFromDS, reloadInBackground,
327         maxEntriesPerSecond, scheduledStartTime, dependencyIDs,
328         failedDependencyAction, null, notifyOnCompletion, null,
329         notifyOnError, null, null, null);
330  }
331
332
333
334  /**
335   * Creates a new reload global index task with the provided information.
336   *
337   * @param  taskID                  The task ID to use for this task.  If it is
338   *                                 {@code null} then a UUID will be generated
339   *                                 for use as the task ID.
340   * @param  baseDN                  The base DN of the entry-balancing request
341   *                                 processor for which to reload index
342   *                                 information.
343   * @param  indexNames              The names of the attributes for which to
344   *                                 reload index data.  This may be
345   *                                 {@code null} or empty to indicate that all
346   *                                 indexes should be reloaded.
347   * @param  reloadFromDS            Indicates whether to load index data from
348   *                                 backend Directory Server instances rather
349   *                                 than a peer Directory Proxy Server
350   *                                 instance.  This may be {@code null} to
351   *                                 indicate that the Directory Proxy Server
352   *                                 should automatically select the appropriate
353   *                                 source for obtaining index data.
354   * @param  reloadInBackground      Indicates whether to perform the reload in
355   *                                 the background, so that the task completes
356   *                                 immediately.
357   * @param  maxEntriesPerSecond     The maximum target rate at which to reload
358   *                                 index data (in entries per second).  A
359   *                                 value of zero indicates no limit.  A value
360   *                                 of {@code null} indicates that the
361   *                                 Directory Proxy Server should attempt to
362   *                                 determine the limit based on its
363   *                                 configuration.
364   * @param  scheduledStartTime      The time that this task should start
365   *                                 running.
366   * @param  dependencyIDs           The list of task IDs that will be required
367   *                                 to complete before this task will be
368   *                                 eligible to start.
369   * @param  failedDependencyAction  Indicates what action should be taken if
370   *                                 any of the dependencies for this task do
371   *                                 not complete successfully.
372   * @param  notifyOnStart           The list of e-mail addresses of individuals
373   *                                 that should be notified when this task
374   *                                 starts running.
375   * @param  notifyOnCompletion      The list of e-mail addresses of individuals
376   *                                 that should be notified when this task
377   *                                 completes.
378   * @param  notifyOnSuccess         The list of e-mail addresses of individuals
379   *                                 that should be notified if this task
380   *                                 completes successfully.
381   * @param  notifyOnError           The list of e-mail addresses of individuals
382   *                                 that should be notified if this task does
383   *                                 not complete successfully.
384   * @param  alertOnStart            Indicates whether the server should send an
385   *                                 alert notification when this task starts.
386   * @param  alertOnSuccess          Indicates whether the server should send an
387   *                                 alert notification if this task completes
388   *                                 successfully.
389   * @param  alertOnError            Indicates whether the server should send an
390   *                                 alert notification if this task fails to
391   *                                 complete successfully.
392   */
393  public ReloadGlobalIndexTask(final String taskID, final String baseDN,
394              final List<String> indexNames, final Boolean reloadFromDS,
395              final Boolean reloadInBackground, final Long maxEntriesPerSecond,
396              final Date scheduledStartTime,
397              final List<String> dependencyIDs,
398              final FailedDependencyAction failedDependencyAction,
399              final List<String> notifyOnStart,
400              final List<String> notifyOnCompletion,
401              final List<String> notifyOnSuccess,
402              final List<String> notifyOnError, final Boolean alertOnStart,
403              final Boolean alertOnSuccess, final Boolean alertOnError)
404  {
405    super(taskID, RELOAD_GLOBAL_INDEX_TASK_CLASS, scheduledStartTime,
406         dependencyIDs, failedDependencyAction, notifyOnStart,
407         notifyOnCompletion, notifyOnSuccess, notifyOnError, alertOnStart,
408         alertOnSuccess, alertOnError);
409
410    Validator.ensureNotNull(baseDN);
411
412    this.baseDN              = baseDN;
413    this.reloadFromDS        = reloadFromDS;
414    this.reloadInBackground  = reloadInBackground;
415    this.maxEntriesPerSecond = maxEntriesPerSecond;
416
417    if (indexNames == null)
418    {
419      this.indexNames = Collections.emptyList();
420    }
421    else
422    {
423      this.indexNames =
424           Collections.unmodifiableList(new ArrayList<>(indexNames));
425    }
426  }
427
428
429
430  /**
431   * Creates a new reload global index task from the provided entry.
432   *
433   * @param  entry  The entry to use to create this reload global index task.
434   *
435   * @throws  TaskException  If the provided entry cannot be parsed as a reload
436   *                         global index task entry.
437   */
438  public ReloadGlobalIndexTask(final Entry entry)
439         throws TaskException
440  {
441    super(entry);
442
443    // Get the base DN.  It must be present.
444    baseDN = entry.getAttributeValue(ATTR_BASE_DN);
445    if (baseDN == null)
446    {
447      throw new TaskException(
448           ERR_RELOAD_GLOBAL_INDEX_MISSING_REQUIRED_ATTR.get(ATTR_BASE_DN));
449    }
450
451    // Get the names of the indexes to reload.  It may be empty or null.
452    final String[] nameArray = entry.getAttributeValues(ATTR_INDEX_NAME);
453    if ((nameArray == null) || (nameArray.length == 0))
454    {
455      indexNames = Collections.emptyList();
456    }
457    else
458    {
459      indexNames = Collections.unmodifiableList(Arrays.asList(nameArray));
460    }
461
462    // Get the flag indicating whether to reload from backend Directory Server
463    // instances.
464    reloadFromDS = entry.getAttributeValueAsBoolean(ATTR_RELOAD_FROM_DS);
465
466    // Get the flag indicating whether to reload in a background thread.
467    reloadInBackground =
468         entry.getAttributeValueAsBoolean(ATTR_BACKGROUND_RELOAD);
469
470    // Get the value specifying the maximum reload rate in entries per second.
471    maxEntriesPerSecond =
472         entry.getAttributeValueAsLong(ATTR_MAX_ENTRIES_PER_SECOND);
473  }
474
475
476
477  /**
478   * Creates a new reload global index task from the provided set of task
479   * properties.
480   *
481   * @param  properties  The set of task properties and their corresponding
482   *                     values to use for the task.  It must not be
483   *                     {@code null}.
484   *
485   * @throws  TaskException  If the provided set of properties cannot be used to
486   *                         create a valid reload global index task.
487   */
488  public ReloadGlobalIndexTask(final Map<TaskProperty,List<Object>> properties)
489         throws TaskException
490  {
491    super(RELOAD_GLOBAL_INDEX_TASK_CLASS, properties);
492
493    final List<String> attrs = new ArrayList<>(10);
494    Boolean background   = null;
495    Boolean fromDS       = null;
496    Long    maxPerSecond = null;
497    String  baseDNStr    = null;
498
499    for (final Map.Entry<TaskProperty,List<Object>> e : properties.entrySet())
500    {
501      final TaskProperty p = e.getKey();
502      final String attrName = p.getAttributeName();
503      final List<Object> values = e.getValue();
504
505      if (attrName.equalsIgnoreCase(ATTR_BASE_DN))
506      {
507        baseDNStr = parseString(p, values, null);
508      }
509      else if (attrName.equalsIgnoreCase(ATTR_INDEX_NAME))
510      {
511        final String[] nameArray = parseStrings(p, values, null);
512        if (nameArray != null)
513        {
514          attrs.addAll(Arrays.asList(nameArray));
515        }
516      }
517      else if (attrName.equalsIgnoreCase(ATTR_RELOAD_FROM_DS))
518      {
519        fromDS = parseBoolean(p, values, null);
520      }
521      else if (attrName.equalsIgnoreCase(ATTR_BACKGROUND_RELOAD))
522      {
523        background = parseBoolean(p, values, null);
524      }
525      else if (attrName.equalsIgnoreCase(ATTR_MAX_ENTRIES_PER_SECOND))
526      {
527        maxPerSecond = parseLong(p, values, null);
528      }
529    }
530
531    if (baseDNStr == null)
532    {
533      throw new TaskException(
534           ERR_RELOAD_GLOBAL_INDEX_MISSING_REQUIRED_PROPERTY.get(ATTR_BASE_DN));
535    }
536
537    baseDN              = baseDNStr;
538    indexNames          = Collections.unmodifiableList(attrs);
539    reloadFromDS        = fromDS;
540    reloadInBackground  = background;
541    maxEntriesPerSecond = maxPerSecond;
542  }
543
544
545
546  /**
547   * {@inheritDoc}
548   */
549  @Override()
550  public String getTaskName()
551  {
552    return INFO_TASK_NAME_RELOAD_GLOBAL_INDEX.get();
553  }
554
555
556
557  /**
558   * {@inheritDoc}
559   */
560  @Override()
561  public String getTaskDescription()
562  {
563    return INFO_TASK_DESCRIPTION_RELOAD_GLOBAL_INDEX.get();
564  }
565
566
567
568  /**
569   * Retrieves the base DN of the entry-balancing request processor for which to
570   * reload index data.
571   *
572   * @return  The base DN of the entry-balancing request processor for which to
573   *          reload index data.
574   */
575  public String getBaseDN()
576  {
577    return baseDN;
578  }
579
580
581
582  /**
583   * Retrieves the names of the indexes to be reloaded.
584   *
585   * @return  The names of the indexes to be reloaded, or an empty list if the
586   *          Directory Proxy Server should reload all indexes.
587   */
588  public List<String> getIndexNames()
589  {
590    return indexNames;
591  }
592
593
594
595  /**
596   * Indicates whether to reload index information from backend Directory
597   * Servers rather than a peer Directory Proxy Server.
598   *
599   * @return  {@code true} if the index information should be reloaded from
600   *          backend Directory Servers, {@code false} if the index information
601   *          should be reloaded from a peer Directory Proxy Server instance, or
602   *          {@code null} if the Directory Proxy Server should automatically
603   *          determine the reload data source.
604   */
605  public Boolean reloadFromDS()
606  {
607    return reloadFromDS;
608  }
609
610
611
612  /**
613   * Indicates whether to perform the index reload processing in the background.
614   *
615   * @return  {@code true} if the index reload processing should be performed
616   *          in the background (so that the task completes immediately),
617   *          {@code false} if not, or {@code null} if the Directory Proxy
618   *          Server should determine whether to perform the reload in the
619   *          background.
620   */
621  public Boolean reloadInBackground()
622  {
623    return reloadInBackground;
624  }
625
626
627
628  /**
629   * Retrieves the maximum reload rate in entries per second, if defined.
630   *
631   * @return  The maximum rate at which to reload index data, in entries per
632   *          second, zero if no limit should be imposed, or {@code null} if the
633   *          Directory Proxy Server should determine the maximum reload rate.
634   */
635  public Long getMaxEntriesPerSecond()
636  {
637    return maxEntriesPerSecond;
638  }
639
640
641
642  /**
643   * {@inheritDoc}
644   */
645  @Override()
646  protected List<String> getAdditionalObjectClasses()
647  {
648    return Collections.singletonList(OC_RELOAD_GLOBAL_INDEX_TASK);
649  }
650
651
652
653  /**
654   * {@inheritDoc}
655   */
656  @Override()
657  protected List<Attribute> getAdditionalAttributes()
658  {
659    final ArrayList<Attribute> attrList = new ArrayList<>(5);
660
661    attrList.add(new Attribute(ATTR_BASE_DN, baseDN));
662
663    if (! indexNames.isEmpty())
664    {
665      attrList.add(new Attribute(ATTR_INDEX_NAME, indexNames));
666    }
667
668    if (reloadFromDS != null)
669    {
670      attrList.add(new Attribute(ATTR_RELOAD_FROM_DS,
671           String.valueOf(reloadFromDS)));
672    }
673
674    if (reloadInBackground != null)
675    {
676      attrList.add(new Attribute(ATTR_BACKGROUND_RELOAD,
677           String.valueOf(reloadInBackground)));
678    }
679
680    if (maxEntriesPerSecond != null)
681    {
682      attrList.add(new Attribute(ATTR_MAX_ENTRIES_PER_SECOND,
683           String.valueOf(maxEntriesPerSecond)));
684    }
685
686    return attrList;
687  }
688
689
690
691  /**
692   * {@inheritDoc}
693   */
694  @Override()
695  public List<TaskProperty> getTaskSpecificProperties()
696  {
697    return Collections.unmodifiableList(Arrays.asList(
698         PROPERTY_BASE_DN,
699         PROPERTY_INDEX_NAME,
700         PROPERTY_RELOAD_FROM_DS,
701         PROPERTY_BACKGROUND_RELOAD,
702         PROPERTY_MAX_ENTRIES_PER_SECOND));
703  }
704
705
706
707  /**
708   * {@inheritDoc}
709   */
710  @Override()
711  public Map<TaskProperty,List<Object>> getTaskPropertyValues()
712  {
713    final LinkedHashMap<TaskProperty,List<Object>> props =
714         new LinkedHashMap<>(15);
715
716    props.put(PROPERTY_BASE_DN,
717         Collections.<Object>singletonList(baseDN));
718    props.put(PROPERTY_INDEX_NAME,
719         Collections.<Object>unmodifiableList(indexNames));
720
721    if (reloadFromDS == null)
722    {
723      props.put(PROPERTY_RELOAD_FROM_DS,
724           Collections.emptyList());
725    }
726    else
727    {
728      props.put(PROPERTY_RELOAD_FROM_DS,
729           Collections.<Object>singletonList(reloadFromDS));
730    }
731
732    if (reloadInBackground == null)
733    {
734      props.put(PROPERTY_BACKGROUND_RELOAD,
735           Collections.emptyList());
736    }
737    else
738    {
739      props.put(PROPERTY_BACKGROUND_RELOAD,
740           Collections.<Object>singletonList(reloadInBackground));
741    }
742
743    if (maxEntriesPerSecond == null)
744    {
745      props.put(PROPERTY_MAX_ENTRIES_PER_SECOND,
746           Collections.emptyList());
747    }
748    else
749    {
750      props.put(PROPERTY_MAX_ENTRIES_PER_SECOND,
751           Collections.<Object>singletonList(maxEntriesPerSecond));
752    }
753
754    props.putAll(super.getTaskPropertyValues());
755    return Collections.unmodifiableMap(props);
756  }
757}