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