/*
 * Copyright (c) OSGi Alliance (2009, 2010). All Rights Reserved.
 * 
 * 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 org.osgi.jmx.service.coordination;

import java.io.IOException;

import javax.management.openmbean.*;

import org.osgi.jmx.Item;
import org.osgi.jmx.JmxConstants;

/**
 * This MBean provides the management interface to the OSGi Coordinator Service
 * 
 * @version $Id$
 * @ThreadSafe
 */
public interface CoordinatorMBean {
	/**
	 * User Admin MBean object name.
	 */
	String			OBJECTNAME			= JmxConstants.OSGI_COMPENDIUM
												+ ":service=coordinator,version=1.0";

	/**
	 * The key NAME, used in {@link #NAME_ITEM}.
	 */
	String			NAME				= "Name";

	/**
	 * The item for the user name for an authorization object. The key is
	 * {@link #NAME} and the type is {@link SimpleType#STRING}.
	 */
	Item			NAME_ITEM			= new Item(NAME,
												"The name of a Coordination",
												SimpleType.STRING);

	/**
	 * The key ID, used in {@link #ID_ITEM}.
	 */
	String			ID					= "Id";

	/**
	 * The item for the id of an Coordination object. The key is {@link #ID} and
	 * the type is {@link SimpleType#LONG}. The id must be generated by the
	 * Mbean and map to a unique Coordination (which should no be pinnned in
	 * memory because of this).
	 */
	Item			ID_ITEM				= new Item(ID,
												"The id of a Coordination",
												SimpleType.LONG);

	/**
	 * The key TIMEOUT, used in {@link #TIMEOUT_ITEM}.
	 */
	String			TIMEOUT				= "Id";

	/**
	 * The item for the id of an Coordination object. The key is {@link #ID} and
	 * the type is {@link SimpleType#LONG}.
	 */
	Item			TIMEOUT_ITEM		= new Item(
												ID,
												"The timeout of a Coordination",
												SimpleType.LONG);

	/**
	 * The Composite Type for a Group. It extends {@link #USER_TYPE} and adds
	 * {@link #MEMBERS_ITEM}, and {@link #REQUIRED_MEMBERS_ITEM}.
	 * 
	 * This type extends the {@link #USER_TYPE}. It adds:
	 * <ul>
	 * <li>{@link #MEMBERS}</li>
	 * <li>{@link #REQUIRED_MEMBERS}</li>
	 * </ul>
	 */
	CompositeType	COORDINATION_TYPE	= Item.compositeType("COORDINATION",
												"Coordination mapping",
												ID_ITEM, NAME_ITEM,
												TIMEOUT_ITEM);

	/**
	 * Defines a list of {@link #COORDINATION_TYPE}
	 */
	ArrayType		COORDINATIONS_TYPE	= Item.arrayType(1, COORDINATION_TYPE);

	/**
	 * List the current coordinations.
	 * 
	 * The Composite Data is typed by {@link #COORDINATIONS_TYPE}.
	 * 
	 * @param regexFilter a regular expression filter on the coordination name
	 * @return the Coordinations typed by {@link #COORDINATIONS_TYPE}.
	 * @throws IOException if the operation fails
	 */
	TabularData listCoordinations(String regexFilter) throws IOException;

	/**
	 * Get a Coordination.
	 * 
	 * The Composite Data is typed by {@link #COORDINATION_TYPE}.
	 * 
	 * @param id The id of a Coordination
	 * @return the Coordinations typed by {@link #COORDINATION_TYPE}.
	 * @throws IOException if the operation fails
	 */
	CompositeData getCoordination(long id) throws IOException;

	/**
	 * Fail a Coordination.
	 * 
	 * @param id The id of the coordination to be failed.
	 * @return <code>true</code> if the coordination was failed by this call,
	 *         otherwise <code>false</code>.
	 */
	boolean fail(long id, String reason) throws IOException;

	/**
	 * Set/Change the timeout of a Coordination.
	 * 
	 * @param id The id of the Coordination
	 * @param timeout The nr of milliseconds for the next timeout.
	 */
	void setTimeout(long id, long timeout) throws IOException;

}
@@ -1748,17 +1748,16 @@
  be pinn
-n
 ed in%0A%09 
@@ -2249,294 +2249,8 @@
 /**%0A
-%09 * The Composite Type for a Group. It extends %7B@link #USER_TYPE%7D and adds%0A%09 * %7B@link #MEMBERS_ITEM%7D, and %7B@link #REQUIRED_MEMBERS_ITEM%7D.%0A%09 * %0A%09 * This type extends the %7B@link #USER_TYPE%7D. It adds:%0A%09 * %3Cul%3E%0A%09 * %3Cli%3E%7B@link #MEMBERS%7D%3C/li%3E%0A%09 * %3Cli%3E%7B@link #REQUIRED_MEMBERS%7D%3C/li%3E%0A%09 * %3C/ul%3E%0A
 %09 */

Comment errors fixed