mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noel Rouvignac
24.11.2015 8d21db36015f8560d9cd2bcee9817f2c0a07a386
opendj-server-legacy/src/test/java/org/opends/server/admin/TestParentCfgDefn.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2007-2008 Sun Microsystems, Inc.
 *      Portions Copyright 2014 ForgeRock AS
 *      Portions Copyright 2014-2015 ForgeRock AS
 */
package org.opends.server.admin;
@@ -74,42 +74,24 @@
 */
public final class TestParentCfgDefn extends ManagedObjectDefinition<TestParentCfgClient, TestParentCfg> {
  // The singleton configuration definition instance.
  /** The singleton configuration definition instance. */
  private static final TestParentCfgDefn INSTANCE = new TestParentCfgDefn();
  // The "mandatory-boolean-property" property definition.
  /** The "mandatory-boolean-property" property definition. */
  private static final BooleanPropertyDefinition PD_MANDATORY_BOOLEAN_PROPERTY;
  // The "mandatory-class-property" property definition.
  /** The "mandatory-class-property" property definition. */
  private static final ClassPropertyDefinition PD_MANDATORY_CLASS_PROPERTY;
  // The "mandatory-read-only-attribute-type-property" property definition.
  /** The "mandatory-read-only-attribute-type-property" property definition. */
  private static final AttributeTypePropertyDefinition PD_MANDATORY_READ_ONLY_ATTRIBUTE_TYPE_PROPERTY;
  // The "optional-multi-valued-dn-property" property definition.
  /** The "optional-multi-valued-dn-property" property definition. */
  private static final DNPropertyDefinition PD_OPTIONAL_MULTI_VALUED_DN_PROPERTY;
  // The "test-children" relation definition.
  /** The "test-children" relation definition. */
  private static final InstantiableRelationDefinition<TestChildCfgClient, TestChildCfg> RD_TEST_CHILDREN;
  // The "optional-test-child" relation definition.
  /** The "optional-test-child" relation definition. */
  private static final OptionalRelationDefinition<TestChildCfgClient, TestChildCfg> RD_OPTIONAL_TEST_CHILD;
  // Build the "mandatory-boolean-property" property definition.
  /** Build the "mandatory-boolean-property" property definition. */
  static {
      BooleanPropertyDefinition.Builder builder = BooleanPropertyDefinition.createBuilder(INSTANCE, "mandatory-boolean-property");
      builder.setOption(PropertyOption.MANDATORY);
@@ -121,7 +103,7 @@
  // Build the "mandatory-class-property" property definition.
  /** Build the "mandatory-class-property" property definition. */
  static {
      ClassPropertyDefinition.Builder builder = ClassPropertyDefinition.createBuilder(INSTANCE, "mandatory-class-property");
      builder.setOption(PropertyOption.MANDATORY);
@@ -135,7 +117,7 @@
  // Build the "mandatory-read-only-attribute-type-property" property definition.
  /** Build the "mandatory-read-only-attribute-type-property" property definition. */
  static {
      AttributeTypePropertyDefinition.Builder builder = AttributeTypePropertyDefinition.createBuilder(INSTANCE, "mandatory-read-only-attribute-type-property");
      builder.setOption(PropertyOption.READ_ONLY);
@@ -148,7 +130,7 @@
  // Build the "optional-multi-valued-dn-property" property definition.
  /** Build the "optional-multi-valued-dn-property" property definition. */
  static {
      DNPropertyDefinition.Builder builder = DNPropertyDefinition.createBuilder(INSTANCE, "optional-multi-valued-dn-property");
      builder.setOption(PropertyOption.MULTI_VALUED);
@@ -161,7 +143,7 @@
  // Build the "test-children" relation definition.
  /** Build the "test-children" relation definition. */
  static {
    InstantiableRelationDefinition.Builder<TestChildCfgClient, TestChildCfg> builder =
      new InstantiableRelationDefinition.Builder<TestChildCfgClient, TestChildCfg>(
@@ -173,7 +155,7 @@
  // Build the "optional-test-child" relation definition.
  /** Build the "optional-test-child" relation definition. */
  static {
    OptionalRelationDefinition.Builder<TestChildCfgClient, TestChildCfg> builder =
      new OptionalRelationDefinition.Builder<TestChildCfgClient, TestChildCfg>(
@@ -205,9 +187,7 @@
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  public TestParentCfgClient createClientConfiguration(
      ManagedObject<? extends TestParentCfgClient> impl) {
    return new TestParentCfgClientImpl(impl);
@@ -215,9 +195,7 @@
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  public TestParentCfg createServerConfiguration(
      ServerManagedObject<? extends TestParentCfg> impl) {
    return new TestParentCfgServerImpl(impl);
@@ -225,9 +203,7 @@
  /**
   * {@inheritDoc}
   */
  /** {@inheritDoc} */
  public Class<TestParentCfg> getServerConfigurationClass() {
    return TestParentCfg.class;
  }
@@ -315,104 +291,64 @@
  private static class TestParentCfgClientImpl implements
    TestParentCfgClient {
    // Private implementation.
    /** Private implementation. */
    private ManagedObject<? extends TestParentCfgClient> impl;
    // Private constructor.
    /** Private constructor. */
    private TestParentCfgClientImpl(
        ManagedObject<? extends TestParentCfgClient> impl) {
      this.impl = impl;
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public Boolean isMandatoryBooleanProperty() {
      return impl.getPropertyValue(INSTANCE.getMandatoryBooleanPropertyPropertyDefinition());
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public void setMandatoryBooleanProperty(boolean value) {
      impl.setPropertyValue(INSTANCE.getMandatoryBooleanPropertyPropertyDefinition(), value);
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public String getMandatoryClassProperty() {
      return impl.getPropertyValue(INSTANCE.getMandatoryClassPropertyPropertyDefinition());
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public void setMandatoryClassProperty(String value) {
      impl.setPropertyValue(INSTANCE.getMandatoryClassPropertyPropertyDefinition(), value);
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public AttributeType getMandatoryReadOnlyAttributeTypeProperty() {
      return impl.getPropertyValue(INSTANCE.getMandatoryReadOnlyAttributeTypePropertyPropertyDefinition());
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public void setMandatoryReadOnlyAttributeTypeProperty(AttributeType value) throws PropertyException {
      impl.setPropertyValue(INSTANCE.getMandatoryReadOnlyAttributeTypePropertyPropertyDefinition(), value);
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public SortedSet<DN> getOptionalMultiValuedDNProperty() {
      return impl.getPropertyValues(INSTANCE.getOptionalMultiValuedDNPropertyPropertyDefinition());
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public void setOptionalMultiValuedDNProperty(Collection<DN> values) {
      impl.setPropertyValues(INSTANCE.getOptionalMultiValuedDNPropertyPropertyDefinition(), values);
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public String[] listTestChildren() throws ConcurrentModificationException,
        AuthorizationException, CommunicationException {
      return impl.listChildren(INSTANCE.getTestChildrenRelationDefinition());
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public TestChildCfgClient getTestChild(String name)
        throws DefinitionDecodingException, ManagedObjectDecodingException,
        ManagedObjectNotFoundException, ConcurrentModificationException,
@@ -420,42 +356,26 @@
      return impl.getChild(INSTANCE.getTestChildrenRelationDefinition(), name).getConfiguration();
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public <M extends TestChildCfgClient> M createTestChild(
        ManagedObjectDefinition<M, ? extends TestChildCfg> d, String name, Collection<PropertyException> exceptions) throws IllegalManagedObjectNameException {
      return impl.createChild(INSTANCE.getTestChildrenRelationDefinition(), d, name, exceptions).getConfiguration();
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public void removeTestChild(String name)
        throws ManagedObjectNotFoundException, ConcurrentModificationException,
        OperationRejectedException, AuthorizationException, CommunicationException {
      impl.removeChild(INSTANCE.getTestChildrenRelationDefinition(), name);
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public boolean hasOptionalTestChild() throws ConcurrentModificationException,
        AuthorizationException, CommunicationException {
      return impl.hasChild(INSTANCE.getOptionalTestChildRelationDefinition());
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public TestChildCfgClient getOptionalChild()
        throws DefinitionDecodingException, ManagedObjectDecodingException,
        ManagedObjectNotFoundException, ConcurrentModificationException,
@@ -463,50 +383,30 @@
      return impl.getChild(INSTANCE.getOptionalTestChildRelationDefinition()).getConfiguration();
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public <M extends TestChildCfgClient> M createOptionalTestChild(
        ManagedObjectDefinition<M, ? extends TestChildCfg> d, Collection<PropertyException> exceptions) {
      return impl.createChild(INSTANCE.getOptionalTestChildRelationDefinition(), d, exceptions).getConfiguration();
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public void removeOptionalTestChild()
        throws ManagedObjectNotFoundException, ConcurrentModificationException,
        OperationRejectedException, AuthorizationException, CommunicationException {
      impl.removeChild(INSTANCE.getOptionalTestChildRelationDefinition());
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public ManagedObjectDefinition<? extends TestParentCfgClient, ? extends TestParentCfg> definition() {
      return INSTANCE;
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public PropertyProvider properties() {
      return impl;
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public void commit() throws ManagedObjectAlreadyExistsException,
        MissingMandatoryPropertiesException, ConcurrentModificationException,
        OperationRejectedException, AuthorizationException,
@@ -524,214 +424,129 @@
  private static class TestParentCfgServerImpl implements
    TestParentCfg {
    // Private implementation.
    /** Private implementation. */
    private ServerManagedObject<? extends TestParentCfg> impl;
    // Private constructor.
    /** Private constructor. */
    private TestParentCfgServerImpl(ServerManagedObject<? extends TestParentCfg> impl) {
      this.impl = impl;
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public void addChangeListener(
        ConfigurationChangeListener<TestParentCfg> listener) {
      impl.registerChangeListener(listener);
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public void removeChangeListener(
        ConfigurationChangeListener<TestParentCfg> listener) {
      impl.deregisterChangeListener(listener);
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public boolean isMandatoryBooleanProperty() {
      return impl.getPropertyValue(INSTANCE.getMandatoryBooleanPropertyPropertyDefinition());
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public String getMandatoryClassProperty() {
      return impl.getPropertyValue(INSTANCE.getMandatoryClassPropertyPropertyDefinition());
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public AttributeType getMandatoryReadOnlyAttributeTypeProperty() {
      return impl.getPropertyValue(INSTANCE.getMandatoryReadOnlyAttributeTypePropertyPropertyDefinition());
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public SortedSet<DN> getOptionalMultiValuedDNProperty() {
      return impl.getPropertyValues(INSTANCE.getOptionalMultiValuedDNPropertyPropertyDefinition());
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public String[] listTestChildren() {
      return impl.listChildren(INSTANCE.getTestChildrenRelationDefinition());
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public TestChildCfg getTestChild(String name) throws ConfigException {
      return impl.getChild(INSTANCE.getTestChildrenRelationDefinition(), name).getConfiguration();
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public void addTestChildAddListener(
        ConfigurationAddListener<TestChildCfg> listener) throws ConfigException {
      impl.registerAddListener(INSTANCE.getTestChildrenRelationDefinition(), listener);
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public void removeTestChildAddListener(
        ConfigurationAddListener<TestChildCfg> listener) {
      impl.deregisterAddListener(INSTANCE.getTestChildrenRelationDefinition(), listener);
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public void addTestChildDeleteListener(
        ConfigurationDeleteListener<TestChildCfg> listener) throws ConfigException {
      impl.registerDeleteListener(INSTANCE.getTestChildrenRelationDefinition(), listener);
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public void removeTestChildDeleteListener(
        ConfigurationDeleteListener<TestChildCfg> listener) {
      impl.deregisterDeleteListener(INSTANCE.getTestChildrenRelationDefinition(), listener);
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public boolean hasOptionalTestChild() {
      return impl.hasChild(INSTANCE.getOptionalTestChildRelationDefinition());
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public TestChildCfg getOptionalTestChild() throws ConfigException {
      return impl.getChild(INSTANCE.getOptionalTestChildRelationDefinition()).getConfiguration();
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public void addOptionalTestChildAddListener(
        ConfigurationAddListener<TestChildCfg> listener) throws ConfigException {
      impl.registerAddListener(INSTANCE.getOptionalTestChildRelationDefinition(), listener);
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public void removeOptionalTestChildAddListener(
        ConfigurationAddListener<TestChildCfg> listener) {
      impl.deregisterAddListener(INSTANCE.getOptionalTestChildRelationDefinition(), listener);
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public void addOptionalChildTestDeleteListener(
        ConfigurationDeleteListener<TestChildCfg> listener) throws ConfigException {
      impl.registerDeleteListener(INSTANCE.getOptionalTestChildRelationDefinition(), listener);
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public void removeOptionalTestChildDeleteListener(
        ConfigurationDeleteListener<TestChildCfg> listener) {
      impl.deregisterDeleteListener(INSTANCE.getOptionalTestChildRelationDefinition(), listener);
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public Class<? extends TestParentCfg> configurationClass() {
      return TestParentCfg.class;
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public ServerManagedObject<? extends TestParentCfg> managedObject() {
      return impl;
    }
    /**
     * {@inheritDoc}
     */
    /** {@inheritDoc} */
    public DN dn() {
      return impl.getDN();
    }
  }
}