001/*
002 * CDDL HEADER START
003 *
004 * The contents of this file are subject to the terms of the
005 * Common Development and Distribution License, Version 1.0 only
006 * (the "License").  You may not use this file except in compliance
007 * with the License.
008 *
009 * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
010 * or http://forgerock.org/license/CDDLv1.0.html.
011 * See the License for the specific language governing permissions
012 * and limitations under the License.
013 *
014 * When distributing Covered Code, include this CDDL HEADER in each
015 * file and include the License file at legal-notices/CDDLv1_0.txt.
016 * If applicable, add the following below this CDDL HEADER, with the
017 * fields enclosed by brackets "[]" replaced with your own identifying
018 * information:
019 *      Portions Copyright [yyyy] [name of copyright owner]
020 *
021 * CDDL HEADER END
022 *
023 *
024 *      Copyright 2008 Sun Microsystems, Inc.
025 */
026package org.forgerock.opendj.server.config.meta;
027
028
029
030import java.util.Collection;
031import java.util.SortedSet;
032import org.forgerock.opendj.config.AdministratorAction;
033import org.forgerock.opendj.config.AliasDefaultBehaviorProvider;
034import org.forgerock.opendj.config.AttributeTypePropertyDefinition;
035import org.forgerock.opendj.config.BooleanPropertyDefinition;
036import org.forgerock.opendj.config.ClassPropertyDefinition;
037import org.forgerock.opendj.config.client.ConcurrentModificationException;
038import org.forgerock.opendj.config.client.ManagedObject;
039import org.forgerock.opendj.config.client.MissingMandatoryPropertiesException;
040import org.forgerock.opendj.config.client.OperationRejectedException;
041import org.forgerock.opendj.config.DefaultBehaviorProvider;
042import org.forgerock.opendj.config.DefinedDefaultBehaviorProvider;
043import org.forgerock.opendj.config.DNPropertyDefinition;
044import org.forgerock.opendj.config.DurationPropertyDefinition;
045import org.forgerock.opendj.config.EnumPropertyDefinition;
046import org.forgerock.opendj.config.ManagedObjectAlreadyExistsException;
047import org.forgerock.opendj.config.ManagedObjectDefinition;
048import org.forgerock.opendj.config.PropertyOption;
049import org.forgerock.opendj.config.PropertyProvider;
050import org.forgerock.opendj.config.server.ConfigurationChangeListener;
051import org.forgerock.opendj.config.server.ServerManagedObject;
052import org.forgerock.opendj.config.StringPropertyDefinition;
053import org.forgerock.opendj.config.Tag;
054import org.forgerock.opendj.config.UndefinedDefaultBehaviorProvider;
055import org.forgerock.opendj.ldap.DN;
056import org.forgerock.opendj.ldap.LdapException;
057import org.forgerock.opendj.ldap.schema.AttributeType;
058import org.forgerock.opendj.server.config.client.ReferentialIntegrityPluginCfgClient;
059import org.forgerock.opendj.server.config.meta.PluginCfgDefn.PluginType;
060import org.forgerock.opendj.server.config.server.PluginCfg;
061import org.forgerock.opendj.server.config.server.ReferentialIntegrityPluginCfg;
062
063
064
065/**
066 * An interface for querying the Referential Integrity Plugin managed
067 * object definition meta information.
068 * <p>
069 * The Referential Integrity Plugin maintains referential integrity
070 * for DN valued attributes.
071 */
072public final class ReferentialIntegrityPluginCfgDefn extends ManagedObjectDefinition<ReferentialIntegrityPluginCfgClient, ReferentialIntegrityPluginCfg> {
073
074  // The singleton configuration definition instance.
075  private static final ReferentialIntegrityPluginCfgDefn INSTANCE = new ReferentialIntegrityPluginCfgDefn();
076
077
078
079  /**
080   * Defines the set of permissable values for the "check-references-scope-criteria" property.
081   * <p>
082   * Specifies whether or not referenced entries must reside within
083   * the same naming context as the entry containing the reference.
084   * <p>
085   * The reference scope will only be enforced when reference checking
086   * is enabled.
087   */
088  public static enum CheckReferencesScopeCriteria {
089
090    /**
091     * References may refer to existing entries located anywhere in
092     * the Directory.
093     */
094    GLOBAL("global"),
095
096
097
098    /**
099     * References must refer to existing entries located within the
100     * same naming context.
101     */
102    NAMING_CONTEXT("naming-context");
103
104
105
106    // String representation of the value.
107    private final String name;
108
109
110
111    // Private constructor.
112    private CheckReferencesScopeCriteria(String name) { this.name = name; }
113
114
115
116    /**
117     * {@inheritDoc}
118     */
119    public String toString() { return name; }
120
121  }
122
123
124
125  // The "attribute-type" property definition.
126  private static final AttributeTypePropertyDefinition PD_ATTRIBUTE_TYPE;
127
128
129
130  // The "base-dn" property definition.
131  private static final DNPropertyDefinition PD_BASE_DN;
132
133
134
135  // The "check-references" property definition.
136  private static final BooleanPropertyDefinition PD_CHECK_REFERENCES;
137
138
139
140  // The "check-references-filter-criteria" property definition.
141  private static final StringPropertyDefinition PD_CHECK_REFERENCES_FILTER_CRITERIA;
142
143
144
145  // The "check-references-scope-criteria" property definition.
146  private static final EnumPropertyDefinition<CheckReferencesScopeCriteria> PD_CHECK_REFERENCES_SCOPE_CRITERIA;
147
148
149
150  // The "java-class" property definition.
151  private static final ClassPropertyDefinition PD_JAVA_CLASS;
152
153
154
155  // The "log-file" property definition.
156  private static final StringPropertyDefinition PD_LOG_FILE;
157
158
159
160  // The "plugin-type" property definition.
161  private static final EnumPropertyDefinition<PluginType> PD_PLUGIN_TYPE;
162
163
164
165  // The "update-interval" property definition.
166  private static final DurationPropertyDefinition PD_UPDATE_INTERVAL;
167
168
169
170  // Build the "attribute-type" property definition.
171  static {
172      AttributeTypePropertyDefinition.Builder builder = AttributeTypePropertyDefinition.createBuilder(INSTANCE, "attribute-type");
173      builder.setOption(PropertyOption.MULTI_VALUED);
174      builder.setOption(PropertyOption.MANDATORY);
175      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "attribute-type"));
176      builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<AttributeType>());
177      PD_ATTRIBUTE_TYPE = builder.getInstance();
178      INSTANCE.registerPropertyDefinition(PD_ATTRIBUTE_TYPE);
179  }
180
181
182
183  // Build the "base-dn" property definition.
184  static {
185      DNPropertyDefinition.Builder builder = DNPropertyDefinition.createBuilder(INSTANCE, "base-dn");
186      builder.setOption(PropertyOption.MULTI_VALUED);
187      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "base-dn"));
188      builder.setDefaultBehaviorProvider(new AliasDefaultBehaviorProvider<DN>(INSTANCE, "base-dn"));
189      PD_BASE_DN = builder.getInstance();
190      INSTANCE.registerPropertyDefinition(PD_BASE_DN);
191  }
192
193
194
195  // Build the "check-references" property definition.
196  static {
197      BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "check-references");
198      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "check-references"));
199      DefaultBehaviorProvider<Boolean> provider = new DefinedDefaultBehaviorProvider<Boolean>("false");
200      builder.setDefaultBehaviorProvider(provider);
201      PD_CHECK_REFERENCES = builder.getInstance();
202      INSTANCE.registerPropertyDefinition(PD_CHECK_REFERENCES);
203  }
204
205
206
207  // Build the "check-references-filter-criteria" property definition.
208  static {
209      StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "check-references-filter-criteria");
210      builder.setOption(PropertyOption.MULTI_VALUED);
211      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "check-references-filter-criteria"));
212      builder.setDefaultBehaviorProvider(new UndefinedDefaultBehaviorProvider<String>());
213      builder.setPattern("^[^:]+:\\(.+\\)$", "ATTRIBUTE:FILTER");
214      PD_CHECK_REFERENCES_FILTER_CRITERIA = builder.getInstance();
215      INSTANCE.registerPropertyDefinition(PD_CHECK_REFERENCES_FILTER_CRITERIA);
216  }
217
218
219
220  // Build the "check-references-scope-criteria" property definition.
221  static {
222      EnumPropertyDefinition.Builder<CheckReferencesScopeCriteria> builder = EnumPropertyDefinition.createBuilder(INSTANCE, "check-references-scope-criteria");
223      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "check-references-scope-criteria"));
224      DefaultBehaviorProvider<CheckReferencesScopeCriteria> provider = new DefinedDefaultBehaviorProvider<CheckReferencesScopeCriteria>("global");
225      builder.setDefaultBehaviorProvider(provider);
226      builder.setEnumClass(CheckReferencesScopeCriteria.class);
227      PD_CHECK_REFERENCES_SCOPE_CRITERIA = builder.getInstance();
228      INSTANCE.registerPropertyDefinition(PD_CHECK_REFERENCES_SCOPE_CRITERIA);
229  }
230
231
232
233  // Build the "java-class" property definition.
234  static {
235      ClassPropertyDefinition.Builder builder = ClassPropertyDefinition.createBuilder(INSTANCE, "java-class");
236      builder.setOption(PropertyOption.MANDATORY);
237      builder.setOption(PropertyOption.ADVANCED);
238      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "java-class"));
239      DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("org.opends.server.plugins.ReferentialIntegrityPlugin");
240      builder.setDefaultBehaviorProvider(provider);
241      builder.addInstanceOf("org.opends.server.api.plugin.DirectoryServerPlugin");
242      PD_JAVA_CLASS = builder.getInstance();
243      INSTANCE.registerPropertyDefinition(PD_JAVA_CLASS);
244  }
245
246
247
248  // Build the "log-file" property definition.
249  static {
250      StringPropertyDefinition.Builder builder = StringPropertyDefinition.createBuilder(INSTANCE, "log-file");
251      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "log-file"));
252      DefaultBehaviorProvider<String> provider = new DefinedDefaultBehaviorProvider<String>("logs/referint");
253      builder.setDefaultBehaviorProvider(provider);
254      builder.setPattern(".*", "FILE");
255      PD_LOG_FILE = builder.getInstance();
256      INSTANCE.registerPropertyDefinition(PD_LOG_FILE);
257  }
258
259
260
261  // Build the "plugin-type" property definition.
262  static {
263      EnumPropertyDefinition.Builder<PluginType> builder = EnumPropertyDefinition.createBuilder(INSTANCE, "plugin-type");
264      builder.setOption(PropertyOption.MULTI_VALUED);
265      builder.setOption(PropertyOption.MANDATORY);
266      builder.setOption(PropertyOption.ADVANCED);
267      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.COMPONENT_RESTART, INSTANCE, "plugin-type"));
268      DefaultBehaviorProvider<PluginType> provider = new DefinedDefaultBehaviorProvider<PluginType>("postoperationdelete", "postoperationmodifydn", "subordinatemodifydn", "subordinatedelete", "preoperationadd", "preoperationmodify");
269      builder.setDefaultBehaviorProvider(provider);
270      builder.setEnumClass(PluginType.class);
271      PD_PLUGIN_TYPE = builder.getInstance();
272      INSTANCE.registerPropertyDefinition(PD_PLUGIN_TYPE);
273  }
274
275
276
277  // Build the "update-interval" property definition.
278  static {
279      DurationPropertyDefinition.Builder builder = DurationPropertyDefinition.createBuilder(INSTANCE, "update-interval");
280      builder.setAdministratorAction(new AdministratorAction(AdministratorAction.Type.NONE, INSTANCE, "update-interval"));
281      DefaultBehaviorProvider<Long> provider = new DefinedDefaultBehaviorProvider<Long>("0 seconds");
282      builder.setDefaultBehaviorProvider(provider);
283      builder.setAllowUnlimited(false);
284      builder.setBaseUnit("s");
285      PD_UPDATE_INTERVAL = builder.getInstance();
286      INSTANCE.registerPropertyDefinition(PD_UPDATE_INTERVAL);
287  }
288
289
290
291  // Register the tags associated with this managed object definition.
292  static {
293    INSTANCE.registerTag(Tag.valueOf("core-server"));
294  }
295
296
297
298  /**
299   * Get the Referential Integrity Plugin configuration definition
300   * singleton.
301   *
302   * @return Returns the Referential Integrity Plugin configuration
303   *         definition singleton.
304   */
305  public static ReferentialIntegrityPluginCfgDefn getInstance() {
306    return INSTANCE;
307  }
308
309
310
311  /**
312   * Private constructor.
313   */
314  private ReferentialIntegrityPluginCfgDefn() {
315    super("referential-integrity-plugin", PluginCfgDefn.getInstance());
316  }
317
318
319
320  /**
321   * {@inheritDoc}
322   */
323  public ReferentialIntegrityPluginCfgClient createClientConfiguration(
324      ManagedObject<? extends ReferentialIntegrityPluginCfgClient> impl) {
325    return new ReferentialIntegrityPluginCfgClientImpl(impl);
326  }
327
328
329
330  /**
331   * {@inheritDoc}
332   */
333  public ReferentialIntegrityPluginCfg createServerConfiguration(
334      ServerManagedObject<? extends ReferentialIntegrityPluginCfg> impl) {
335    return new ReferentialIntegrityPluginCfgServerImpl(impl);
336  }
337
338
339
340  /**
341   * {@inheritDoc}
342   */
343  public Class<ReferentialIntegrityPluginCfg> getServerConfigurationClass() {
344    return ReferentialIntegrityPluginCfg.class;
345  }
346
347
348
349  /**
350   * Get the "attribute-type" property definition.
351   * <p>
352   * Specifies the attribute types for which referential integrity is
353   * to be maintained.
354   * <p>
355   * At least one attribute type must be specified, and the syntax of
356   * any attributes must be either a distinguished name
357   * (1.3.6.1.4.1.1466.115.121.1.12) or name and optional UID
358   * (1.3.6.1.4.1.1466.115.121.1.34).
359   *
360   * @return Returns the "attribute-type" property definition.
361   */
362  public AttributeTypePropertyDefinition getAttributeTypePropertyDefinition() {
363    return PD_ATTRIBUTE_TYPE;
364  }
365
366
367
368  /**
369   * Get the "base-dn" property definition.
370   * <p>
371   * Specifies the base DN that limits the scope within which
372   * referential integrity is maintained.
373   *
374   * @return Returns the "base-dn" property definition.
375   */
376  public DNPropertyDefinition getBaseDNPropertyDefinition() {
377    return PD_BASE_DN;
378  }
379
380
381
382  /**
383   * Get the "check-references" property definition.
384   * <p>
385   * Specifies whether or not reference attributes must refer to
386   * existing entries.
387   * <p>
388   * When this property is set to true, this plugin will ensure that
389   * any new references added as part of an add or modify operation
390   * point to existing entries, and that the referenced entries match
391   * the filter criteria for the referencing attribute, if specified.
392   *
393   * @return Returns the "check-references" property definition.
394   */
395  public BooleanPropertyDefinition getCheckReferencesPropertyDefinition() {
396    return PD_CHECK_REFERENCES;
397  }
398
399
400
401  /**
402   * Get the "check-references-filter-criteria" property definition.
403   * <p>
404   * Specifies additional filter criteria which will be enforced when
405   * checking references.
406   * <p>
407   * If a reference attribute has filter criteria defined then this
408   * plugin will ensure that any new references added as part of an add
409   * or modify operation refer to an existing entry which matches the
410   * specified filter.
411   *
412   * @return Returns the "check-references-filter-criteria" property definition.
413   */
414  public StringPropertyDefinition getCheckReferencesFilterCriteriaPropertyDefinition() {
415    return PD_CHECK_REFERENCES_FILTER_CRITERIA;
416  }
417
418
419
420  /**
421   * Get the "check-references-scope-criteria" property definition.
422   * <p>
423   * Specifies whether or not referenced entries must reside within
424   * the same naming context as the entry containing the reference.
425   * <p>
426   * The reference scope will only be enforced when reference checking
427   * is enabled.
428   *
429   * @return Returns the "check-references-scope-criteria" property definition.
430   */
431  public EnumPropertyDefinition<CheckReferencesScopeCriteria> getCheckReferencesScopeCriteriaPropertyDefinition() {
432    return PD_CHECK_REFERENCES_SCOPE_CRITERIA;
433  }
434
435
436
437  /**
438   * Get the "enabled" property definition.
439   * <p>
440   * Indicates whether the plug-in is enabled for use.
441   *
442   * @return Returns the "enabled" property definition.
443   */
444  public BooleanPropertyDefinition getEnabledPropertyDefinition() {
445    return PluginCfgDefn.getInstance().getEnabledPropertyDefinition();
446  }
447
448
449
450  /**
451   * Get the "invoke-for-internal-operations" property definition.
452   * <p>
453   * Indicates whether the plug-in should be invoked for internal
454   * operations.
455   * <p>
456   * Any plug-in that can be invoked for internal operations must
457   * ensure that it does not create any new internal operatons that can
458   * cause the same plug-in to be re-invoked.
459   *
460   * @return Returns the "invoke-for-internal-operations" property definition.
461   */
462  public BooleanPropertyDefinition getInvokeForInternalOperationsPropertyDefinition() {
463    return PluginCfgDefn.getInstance().getInvokeForInternalOperationsPropertyDefinition();
464  }
465
466
467
468  /**
469   * Get the "java-class" property definition.
470   * <p>
471   * Specifies the fully-qualified name of the Java class that
472   * provides the plug-in implementation.
473   *
474   * @return Returns the "java-class" property definition.
475   */
476  public ClassPropertyDefinition getJavaClassPropertyDefinition() {
477    return PD_JAVA_CLASS;
478  }
479
480
481
482  /**
483   * Get the "log-file" property definition.
484   * <p>
485   * Specifies the log file location where the update records are
486   * written when the plug-in is in background-mode processing.
487   * <p>
488   * The default location is the logs directory of the server
489   * instance, using the file name "referint".
490   *
491   * @return Returns the "log-file" property definition.
492   */
493  public StringPropertyDefinition getLogFilePropertyDefinition() {
494    return PD_LOG_FILE;
495  }
496
497
498
499  /**
500   * Get the "plugin-type" property definition.
501   * <p>
502   * Specifies the set of plug-in types for the plug-in, which
503   * specifies the times at which the plug-in is invoked.
504   *
505   * @return Returns the "plugin-type" property definition.
506   */
507  public EnumPropertyDefinition<PluginType> getPluginTypePropertyDefinition() {
508    return PD_PLUGIN_TYPE;
509  }
510
511
512
513  /**
514   * Get the "update-interval" property definition.
515   * <p>
516   * Specifies the interval in seconds when referential integrity
517   * updates are made.
518   * <p>
519   * If this value is 0, then the updates are made synchronously in
520   * the foreground.
521   *
522   * @return Returns the "update-interval" property definition.
523   */
524  public DurationPropertyDefinition getUpdateIntervalPropertyDefinition() {
525    return PD_UPDATE_INTERVAL;
526  }
527
528
529
530  /**
531   * Managed object client implementation.
532   */
533  private static class ReferentialIntegrityPluginCfgClientImpl implements
534    ReferentialIntegrityPluginCfgClient {
535
536    // Private implementation.
537    private ManagedObject<? extends ReferentialIntegrityPluginCfgClient> impl;
538
539
540
541    // Private constructor.
542    private ReferentialIntegrityPluginCfgClientImpl(
543        ManagedObject<? extends ReferentialIntegrityPluginCfgClient> impl) {
544      this.impl = impl;
545    }
546
547
548
549    /**
550     * {@inheritDoc}
551     */
552    public SortedSet<AttributeType> getAttributeType() {
553      return impl.getPropertyValues(INSTANCE.getAttributeTypePropertyDefinition());
554    }
555
556
557
558    /**
559     * {@inheritDoc}
560     */
561    public void setAttributeType(Collection<AttributeType> values) {
562      impl.setPropertyValues(INSTANCE.getAttributeTypePropertyDefinition(), values);
563    }
564
565
566
567    /**
568     * {@inheritDoc}
569     */
570    public SortedSet<DN> getBaseDN() {
571      return impl.getPropertyValues(INSTANCE.getBaseDNPropertyDefinition());
572    }
573
574
575
576    /**
577     * {@inheritDoc}
578     */
579    public void setBaseDN(Collection<DN> values) {
580      impl.setPropertyValues(INSTANCE.getBaseDNPropertyDefinition(), values);
581    }
582
583
584
585    /**
586     * {@inheritDoc}
587     */
588    public boolean isCheckReferences() {
589      return impl.getPropertyValue(INSTANCE.getCheckReferencesPropertyDefinition());
590    }
591
592
593
594    /**
595     * {@inheritDoc}
596     */
597    public void setCheckReferences(Boolean value) {
598      impl.setPropertyValue(INSTANCE.getCheckReferencesPropertyDefinition(), value);
599    }
600
601
602
603    /**
604     * {@inheritDoc}
605     */
606    public SortedSet<String> getCheckReferencesFilterCriteria() {
607      return impl.getPropertyValues(INSTANCE.getCheckReferencesFilterCriteriaPropertyDefinition());
608    }
609
610
611
612    /**
613     * {@inheritDoc}
614     */
615    public void setCheckReferencesFilterCriteria(Collection<String> values) {
616      impl.setPropertyValues(INSTANCE.getCheckReferencesFilterCriteriaPropertyDefinition(), values);
617    }
618
619
620
621    /**
622     * {@inheritDoc}
623     */
624    public CheckReferencesScopeCriteria getCheckReferencesScopeCriteria() {
625      return impl.getPropertyValue(INSTANCE.getCheckReferencesScopeCriteriaPropertyDefinition());
626    }
627
628
629
630    /**
631     * {@inheritDoc}
632     */
633    public void setCheckReferencesScopeCriteria(CheckReferencesScopeCriteria value) {
634      impl.setPropertyValue(INSTANCE.getCheckReferencesScopeCriteriaPropertyDefinition(), value);
635    }
636
637
638
639    /**
640     * {@inheritDoc}
641     */
642    public Boolean isEnabled() {
643      return impl.getPropertyValue(INSTANCE.getEnabledPropertyDefinition());
644    }
645
646
647
648    /**
649     * {@inheritDoc}
650     */
651    public void setEnabled(boolean value) {
652      impl.setPropertyValue(INSTANCE.getEnabledPropertyDefinition(), value);
653    }
654
655
656
657    /**
658     * {@inheritDoc}
659     */
660    public boolean isInvokeForInternalOperations() {
661      return impl.getPropertyValue(INSTANCE.getInvokeForInternalOperationsPropertyDefinition());
662    }
663
664
665
666    /**
667     * {@inheritDoc}
668     */
669    public void setInvokeForInternalOperations(Boolean value) {
670      impl.setPropertyValue(INSTANCE.getInvokeForInternalOperationsPropertyDefinition(), value);
671    }
672
673
674
675    /**
676     * {@inheritDoc}
677     */
678    public String getJavaClass() {
679      return impl.getPropertyValue(INSTANCE.getJavaClassPropertyDefinition());
680    }
681
682
683
684    /**
685     * {@inheritDoc}
686     */
687    public void setJavaClass(String value) {
688      impl.setPropertyValue(INSTANCE.getJavaClassPropertyDefinition(), value);
689    }
690
691
692
693    /**
694     * {@inheritDoc}
695     */
696    public String getLogFile() {
697      return impl.getPropertyValue(INSTANCE.getLogFilePropertyDefinition());
698    }
699
700
701
702    /**
703     * {@inheritDoc}
704     */
705    public void setLogFile(String value) {
706      impl.setPropertyValue(INSTANCE.getLogFilePropertyDefinition(), value);
707    }
708
709
710
711    /**
712     * {@inheritDoc}
713     */
714    public SortedSet<PluginType> getPluginType() {
715      return impl.getPropertyValues(INSTANCE.getPluginTypePropertyDefinition());
716    }
717
718
719
720    /**
721     * {@inheritDoc}
722     */
723    public void setPluginType(Collection<PluginType> values) {
724      impl.setPropertyValues(INSTANCE.getPluginTypePropertyDefinition(), values);
725    }
726
727
728
729    /**
730     * {@inheritDoc}
731     */
732    public long getUpdateInterval() {
733      return impl.getPropertyValue(INSTANCE.getUpdateIntervalPropertyDefinition());
734    }
735
736
737
738    /**
739     * {@inheritDoc}
740     */
741    public void setUpdateInterval(Long value) {
742      impl.setPropertyValue(INSTANCE.getUpdateIntervalPropertyDefinition(), value);
743    }
744
745
746
747    /**
748     * {@inheritDoc}
749     */
750    public ManagedObjectDefinition<? extends ReferentialIntegrityPluginCfgClient, ? extends ReferentialIntegrityPluginCfg> definition() {
751      return INSTANCE;
752    }
753
754
755
756    /**
757     * {@inheritDoc}
758     */
759    public PropertyProvider properties() {
760      return impl;
761    }
762
763
764
765    /**
766     * {@inheritDoc}
767     */
768    public void commit() throws ManagedObjectAlreadyExistsException,
769        MissingMandatoryPropertiesException, ConcurrentModificationException,
770        OperationRejectedException, LdapException {
771      impl.commit();
772    }
773
774  }
775
776
777
778  /**
779   * Managed object server implementation.
780   */
781  private static class ReferentialIntegrityPluginCfgServerImpl implements
782    ReferentialIntegrityPluginCfg {
783
784    // Private implementation.
785    private ServerManagedObject<? extends ReferentialIntegrityPluginCfg> impl;
786
787    // The value of the "attribute-type" property.
788    private final SortedSet<AttributeType> pAttributeType;
789
790    // The value of the "base-dn" property.
791    private final SortedSet<DN> pBaseDN;
792
793    // The value of the "check-references" property.
794    private final boolean pCheckReferences;
795
796    // The value of the "check-references-filter-criteria" property.
797    private final SortedSet<String> pCheckReferencesFilterCriteria;
798
799    // The value of the "check-references-scope-criteria" property.
800    private final CheckReferencesScopeCriteria pCheckReferencesScopeCriteria;
801
802    // The value of the "enabled" property.
803    private final boolean pEnabled;
804
805    // The value of the "invoke-for-internal-operations" property.
806    private final boolean pInvokeForInternalOperations;
807
808    // The value of the "java-class" property.
809    private final String pJavaClass;
810
811    // The value of the "log-file" property.
812    private final String pLogFile;
813
814    // The value of the "plugin-type" property.
815    private final SortedSet<PluginType> pPluginType;
816
817    // The value of the "update-interval" property.
818    private final long pUpdateInterval;
819
820
821
822    // Private constructor.
823    private ReferentialIntegrityPluginCfgServerImpl(ServerManagedObject<? extends ReferentialIntegrityPluginCfg> impl) {
824      this.impl = impl;
825      this.pAttributeType = impl.getPropertyValues(INSTANCE.getAttributeTypePropertyDefinition());
826      this.pBaseDN = impl.getPropertyValues(INSTANCE.getBaseDNPropertyDefinition());
827      this.pCheckReferences = impl.getPropertyValue(INSTANCE.getCheckReferencesPropertyDefinition());
828      this.pCheckReferencesFilterCriteria = impl.getPropertyValues(INSTANCE.getCheckReferencesFilterCriteriaPropertyDefinition());
829      this.pCheckReferencesScopeCriteria = impl.getPropertyValue(INSTANCE.getCheckReferencesScopeCriteriaPropertyDefinition());
830      this.pEnabled = impl.getPropertyValue(INSTANCE.getEnabledPropertyDefinition());
831      this.pInvokeForInternalOperations = impl.getPropertyValue(INSTANCE.getInvokeForInternalOperationsPropertyDefinition());
832      this.pJavaClass = impl.getPropertyValue(INSTANCE.getJavaClassPropertyDefinition());
833      this.pLogFile = impl.getPropertyValue(INSTANCE.getLogFilePropertyDefinition());
834      this.pPluginType = impl.getPropertyValues(INSTANCE.getPluginTypePropertyDefinition());
835      this.pUpdateInterval = impl.getPropertyValue(INSTANCE.getUpdateIntervalPropertyDefinition());
836    }
837
838
839
840    /**
841     * {@inheritDoc}
842     */
843    public void addReferentialIntegrityChangeListener(
844        ConfigurationChangeListener<ReferentialIntegrityPluginCfg> listener) {
845      impl.registerChangeListener(listener);
846    }
847
848
849
850    /**
851     * {@inheritDoc}
852     */
853    public void removeReferentialIntegrityChangeListener(
854        ConfigurationChangeListener<ReferentialIntegrityPluginCfg> listener) {
855      impl.deregisterChangeListener(listener);
856    }
857    /**
858     * {@inheritDoc}
859     */
860    public void addChangeListener(
861        ConfigurationChangeListener<PluginCfg> listener) {
862      impl.registerChangeListener(listener);
863    }
864
865
866
867    /**
868     * {@inheritDoc}
869     */
870    public void removeChangeListener(
871        ConfigurationChangeListener<PluginCfg> listener) {
872      impl.deregisterChangeListener(listener);
873    }
874
875
876
877    /**
878     * {@inheritDoc}
879     */
880    public SortedSet<AttributeType> getAttributeType() {
881      return pAttributeType;
882    }
883
884
885
886    /**
887     * {@inheritDoc}
888     */
889    public SortedSet<DN> getBaseDN() {
890      return pBaseDN;
891    }
892
893
894
895    /**
896     * {@inheritDoc}
897     */
898    public boolean isCheckReferences() {
899      return pCheckReferences;
900    }
901
902
903
904    /**
905     * {@inheritDoc}
906     */
907    public SortedSet<String> getCheckReferencesFilterCriteria() {
908      return pCheckReferencesFilterCriteria;
909    }
910
911
912
913    /**
914     * {@inheritDoc}
915     */
916    public CheckReferencesScopeCriteria getCheckReferencesScopeCriteria() {
917      return pCheckReferencesScopeCriteria;
918    }
919
920
921
922    /**
923     * {@inheritDoc}
924     */
925    public boolean isEnabled() {
926      return pEnabled;
927    }
928
929
930
931    /**
932     * {@inheritDoc}
933     */
934    public boolean isInvokeForInternalOperations() {
935      return pInvokeForInternalOperations;
936    }
937
938
939
940    /**
941     * {@inheritDoc}
942     */
943    public String getJavaClass() {
944      return pJavaClass;
945    }
946
947
948
949    /**
950     * {@inheritDoc}
951     */
952    public String getLogFile() {
953      return pLogFile;
954    }
955
956
957
958    /**
959     * {@inheritDoc}
960     */
961    public SortedSet<PluginType> getPluginType() {
962      return pPluginType;
963    }
964
965
966
967    /**
968     * {@inheritDoc}
969     */
970    public long getUpdateInterval() {
971      return pUpdateInterval;
972    }
973
974
975
976    /**
977     * {@inheritDoc}
978     */
979    public Class<? extends ReferentialIntegrityPluginCfg> configurationClass() {
980      return ReferentialIntegrityPluginCfg.class;
981    }
982
983
984
985    /**
986     * {@inheritDoc}
987     */
988    public DN dn() {
989      return impl.getDN();
990    }
991
992  }
993}