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