/**
 * JOnAS: Java(TM) Open Application Server
 * Copyright (C) 2007 Bull S.A.S.
 * Contact: jonas-team@ow2.org
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 *
 * --------------------------------------------------------------------------
 * $Id$
 * --------------------------------------------------------------------------
 */

package org.ow2.jonas.configuration;

import java.util.List;

/**
 * This interface provides methods to manage the JOnAS service configurations.
 * @author Francois Fornaciari
 */
public interface ConfigurationManager {
    /**
     * Create or update service configuration for each service listed in the jonas.services property except the
     * mandatory services.
     * @throws Exception If an exception occurs during configuration updates
     */
    void updateServiceConfigurations() throws Exception;

    /**
     * Delete configurations for each service listed in the jonas.services property except the mandatory services.
     * The deletion order corresponds to the reversed order for the service list.
     * @throws Exception If an exception occurs during configuration deletions
     */
    void deleteServiceConfigurations() throws Exception;

    /**
     * Halt server by stopping the system bundle.
     * @throws Exception If an exception occurs during server halting
     */
    void haltServer() throws Exception;

    /**
     * Create or update service configurations for the given services.
     * @param services list of service names
     * @throws Exception If an exception occurs during configuration updates
     */
    void updateServiceConfigurations(final List<String> services) throws Exception;

    /**
     * Delete service configurations for the given services.
     * @param services list of service names
     * @throws Exception If an exception occurs during configuration deletions
     */
    void deleteServiceConfigurations(final List<String> services) throws Exception;
  
}
