/*
 * JOnAS: Java(TM) Open Application Server
 * Copyright (C) 1999 Bull S.A.
 * Contact: jonas-team@objectweb.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 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., 59 Temple Place, Suite 330, Boston, MA  02111-1307
 * USA
 *
 * Initial developer(s): Laurent Chauvirey, Frederic Maistre, Nicolas Tachker
 * Contributor(s):
 * Philippe Durieux
 *
 * --------------------------------------------------------------------------
 * $Id$
 * --------------------------------------------------------------------------
 */

package org.objectweb.jonas_jms;


/**
 * JMS Administration  interface to be implemented for each jms provider.
 */
public interface JmsJmxManagement {
    /**
     * Management method
     * @return the current number of Jms Connection Factory
     */
    public int getCurrentNumberOfJmsConnectionFactory();

    /**
     * Management method
     * @return the current number of Topic Jms Connection Factory
     */
    public int getCurrentNumberOfJmsTopicConnectionFactory();

    /**
     * Management method
     * @return the current number of Queue Jms Connection Factory
     */
    public int getCurrentNumberOfJmsQueueConnectionFactory();

    /**
     * Management method
     * @return the current number of Topic Jms Destination
     */
    public int getCurrentNumberOfJmsTopicDestination();

    /**
     * Management method
     * @return the current number of Queue Jms Destination
     */
    public int getCurrentNumberOfJmsQueueDestination();

    /**
     * Management method
     * Remove a Jms destination
     * @param String jndi name
     * @return the destination type
     */
    public String removeJmsDestination(String jndiName) throws Exception;

    /**
     * Management method
     * @return String name of default Connection factory
     */
    public String getDefaultConnectionFactoryName();

    /**
     * Management method
     * @return String name of default Queue Connection factory
     */
    public String getDefaultQueueConnectionFactoryName();


    /**
     * Management method
     * @return String name of default Topic Connection factory
     */
    public String getDefaultTopicConnectionFactoryName();

    // Monitoring methods

    /**
     * Get the messaging mode a connection factory belongs to
     * @param jndiName connection factory name
     * @return messaging mode
     * @throws Exception on calling monitoring operation
     */
    public String getConnectionFactoryMode(String jndiName) throws Exception;

    /**
     * Get number of pending messages on a queue
     * @param jndiName queue name
     * @return number of pending messages
     * @throws Exception failure on calling monitoring operation
     */
    public int getPendingMessages(String jndiName) throws Exception;

    /**
     * Get number of pending requests on a queue
     * @param jndiName queue name
     * @return number of pending requests
     * @throws Exception on calling monitoring operation
     */
    public int getPendingRequests(String jndiName) throws Exception;

    /**
     * Get number of subscriptions on a topic
     * @param jndiName topic name
     * @return number of subscriptions
     * @throws Exception on calling monitoring operation
     */
    public int getSubscriptions(String jndiName) throws Exception;
}

