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
010 * trunk/opends/resource/legal-notices/OpenDS.LICENSE
011 * or https://OpenDS.dev.java.net/OpenDS.LICENSE.
012 * See the License for the specific language governing permissions
013 * and limitations under the License.
014 *
015 * When distributing Covered Code, include this CDDL HEADER in each
016 * file and include the License file at
017 * trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
018 * add the following below this CDDL HEADER, with the fields enclosed
019 * by brackets "[]" replaced with your own identifying information:
020 * Portions Copyright [yyyy] [name of copyright owner]
021 *
022 * CDDL HEADER END
023 *
024 *
025 * Copyright 2008 Sun Microsystems, Inc.
026 */
027
028 package org.opends.server.admin;
029
030
031
032 import org.opends.server.admin.client.ManagedObject;
033 import org.opends.server.admin.server.ServerManagedObject;
034
035
036
037 /**
038 * Defines the structure of a managed object which can be
039 * instantiated.
040 *
041 * @param <C>
042 * The type of client managed object configuration that this
043 * definition represents.
044 * @param <S>
045 * The type of server managed object configuration that this
046 * definition represents.
047 */
048 public abstract class ManagedObjectDefinition
049 <C extends ConfigurationClient, S extends Configuration>
050 extends AbstractManagedObjectDefinition<C, S> {
051
052 /**
053 * Create a new managed object definition.
054 *
055 * @param name
056 * The name of the definition.
057 * @param parent
058 * The parent definition, or <code>null</code> if there
059 * is no parent.
060 */
061 protected ManagedObjectDefinition(String name,
062 AbstractManagedObjectDefinition<? super C, ? super S> parent) {
063 super(name, parent);
064 }
065
066
067
068 /**
069 * Creates a client configuration view of the provided managed
070 * object. Modifications made to the underlying managed object will
071 * be reflected in the client configuration view and vice versa.
072 *
073 * @param managedObject
074 * The managed object.
075 * @return Returns a client configuration view of the provided
076 * managed object.
077 */
078 public abstract C createClientConfiguration(
079 ManagedObject<? extends C> managedObject);
080
081
082
083 /**
084 * Creates a server configuration view of the provided server
085 * managed object.
086 *
087 * @param managedObject
088 * The server managed object.
089 * @return Returns a server configuration view of the provided
090 * server managed object.
091 */
092 public abstract S createServerConfiguration(
093 ServerManagedObject<? extends S> managedObject);
094
095
096
097 /**
098 * Gets the server configuration class instance associated with this
099 * managed object definition.
100 *
101 * @return Returns the server configuration class instance
102 * associated with this managed object definition.
103 */
104 public abstract Class<S> getServerConfigurationClass();
105 }