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