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