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 */
016
017package org.opends.server.admin;
018
019
020
021import org.opends.server.admin.client.ManagedObject;
022import org.opends.server.admin.server.ServerManagedObject;
023
024
025
026/**
027 * Defines the structure of a managed object which can be
028 * instantiated.
029 *
030 * @param <C>
031 *          The type of client managed object configuration that this
032 *          definition represents.
033 * @param <S>
034 *          The type of server managed object configuration that this
035 *          definition represents.
036 */
037public abstract class ManagedObjectDefinition
038    <C extends ConfigurationClient, S extends Configuration>
039    extends AbstractManagedObjectDefinition<C, S> {
040
041  /**
042   * Create a new managed object definition.
043   *
044   * @param name
045   *          The name of the definition.
046   * @param parent
047   *          The parent definition, or <code>null</code> if there
048   *          is no parent.
049   */
050  protected ManagedObjectDefinition(String name,
051      AbstractManagedObjectDefinition<? super C, ? super S> parent) {
052    super(name, parent);
053  }
054
055
056
057  /**
058   * Creates a client configuration view of the provided managed
059   * object. Modifications made to the underlying managed object will
060   * be reflected in the client configuration view and vice versa.
061   *
062   * @param managedObject
063   *          The managed object.
064   * @return Returns a client configuration view of the provided
065   *         managed object.
066   */
067  public abstract C createClientConfiguration(
068      ManagedObject<? extends C> managedObject);
069
070
071
072  /**
073   * Creates a server configuration view of the provided server
074   * managed object.
075   *
076   * @param managedObject
077   *          The server managed object.
078   * @return Returns a server configuration view of the provided
079   *         server managed object.
080   */
081  public abstract S createServerConfiguration(
082      ServerManagedObject<? extends S> managedObject);
083
084
085
086  /**
087   * Gets the server configuration class instance associated with this
088   * managed object definition.
089   *
090   * @return Returns the server configuration class instance
091   *         associated with this managed object definition.
092   */
093  public abstract Class<S> getServerConfigurationClass();
094}