/**
 * Copyright (C) FuseSource, Inc.
 * http://fusesource.com
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package io.fabric8.api;

import java.util.List;
import java.util.Map;

public interface ZooKeeperClusterService {

	/**
	 * Returns the {@List} of containers that participate in the ensemble.
	 * @return
	 */
    List<String> getEnsembleContainers();

	/**
	 * Reutrns the Zookeeper URL.
	 * @return
	 */
    String getZooKeeperUrl();

    /**
     * Returns the ZooKeeper Password.
     * @return
     */
    String getZookeeperPassword();

    Map<String, String> getEnsembleConfiguration() throws Exception;

	/**
	 * Creates a cluster, with the specified containers as servers.
	 * @param containers
	 */
    void createCluster(List<String> containers);

	/**
	 * Creates a Zookeeper cluster, with the specified containers as servers.
	 * @param containers	The list of containers.
	 * @param options		The ensemble options.
	 */
    void createCluster(List<String> containers, CreateEnsembleOptions options);

	/**
	 * Adds the containers to the cluster.
	 * @param containers
	 */
    void addToCluster(List<String> containers);

	/**
	 * Adds the containers to the cluster.
	 * @param containers
	 */
	void addToCluster(List<String> containers, CreateEnsembleOptions options);

	/**
	 * Removes the containers from the cluster.
	 * @param containers
	 */
    void removeFromCluster(List<String> containers);

	/**
	 * Removes the containers from the cluster.
	 * @param containers
	 */
	void removeFromCluster(List<String> containers, CreateEnsembleOptions options);

    void clean();
}
