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