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.AuthorizationException;
032import org.opends.server.admin.client.CommunicationException;
033import org.opends.server.admin.client.ConcurrentModificationException;
034import org.opends.server.admin.client.MissingMandatoryPropertiesException;
035import org.opends.server.admin.client.OperationRejectedException;
036
037
038
039/**
040 * A common base interface for all managed object configuration
041 * clients.
042 */
043public interface ConfigurationClient {
044
045  /**
046   * Get the configuration definition associated with this
047   * configuration.
048   *
049   * @return Returns the configuration definition associated with this
050   *         configuration.
051   */
052  ManagedObjectDefinition<? extends ConfigurationClient,
053      ? extends Configuration> definition();
054
055
056
057  /**
058   * Get a property provider view of this configuration.
059   *
060   * @return Returns a property provider view of this configuration.
061   */
062  PropertyProvider properties();
063
064
065
066  /**
067   * If this is a new configuration this method will attempt to add it
068   * to the server, otherwise it will commit any changes made to this
069   * configuration.
070   *
071   * @throws ManagedObjectAlreadyExistsException
072   *           If this is a new configuration but it could not be
073   *           added to the server because it already exists.
074   * @throws MissingMandatoryPropertiesException
075   *           If this configuration contains some mandatory
076   *           properties which have been left undefined.
077   * @throws ConcurrentModificationException
078   *           If this is a new configuration which is being added to
079   *           the server but its parent has been removed by another
080   *           client, or if this configuration is being modified but
081   *           it has been removed from the server by another client.
082   * @throws OperationRejectedException
083   *           If the server refuses to add or modify this
084   *           configuration due to some server-side constraint which
085   *           cannot be satisfied.
086   * @throws AuthorizationException
087   *           If the server refuses to add or modify this
088   *           configuration because the client does not have the
089   *           correct privileges.
090   * @throws CommunicationException
091   *           If the client cannot contact the server due to an
092   *           underlying communication problem.
093   */
094  void commit() throws ManagedObjectAlreadyExistsException,
095      MissingMandatoryPropertiesException, ConcurrentModificationException,
096      OperationRejectedException, AuthorizationException,
097      CommunicationException;
098
099}