/*
 * 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
 *
 * --------------------------------------------------------------------------
 * $Id$
 * --------------------------------------------------------------------------
 */

package org.objectweb.jonas.jms;
import java.util.Set;

/**
 * MBean Interface for Jms Service Management
 * MBean type: Standard
 * MBean model: Delegate (JmsService)
 * @author Guillaume Riviere
 * @author Frederic Maistre
 * 03.05.27 - Add support for monitoring of JMS destinations
 * 03.09 - New methods related to connection factories
 */
public interface JmsServiceImplMBean {

    /**
     * @return the current number of Jms Connection Factory
     */
    public Integer getCurrentNumberOfJmsConnectionFactory();

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

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

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

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

    /**
     * Create a new Jms queue destination
     * @param String jndi Name
     */
    public void createJmsQueueDestination(String jndiName);

    /**
     * Create a new Jms topic destination
     * @param String jndi Name
     */
    public void createJmsTopicDestination(String jndiName);

    /**
     * Remove a Topic Jms destination
     * @param String jndi name
     */
    public void removeJmsTopicDestination(String jndiName);

   /**
     * Remove a Queue Jms destination
     * @param String jndi name
     */
    public void removeJmsQueueDestination(String jndiName);

   /**
     * Remove a Jms destination
     * @param String jndi name
     */
    public void removeJmsDestination(String jndiName);

    /**
     * return Set of Queue Destinations Names
     */
    public Set getAllJmsQueueDestinationNames();

    /**
     * return Set of Topic Destination Names
     */
    public Set getAllJmsTopicDestinationNames();

    /**
     * return Set of Connection Factory Names
     */
    public Set getAllJmsConnectionFactoryNames();

    /**
     * return Set of Queue Connection Factory Names
     */
    public Set getAllJmsQueueConnectionFactoryNames();

    /**
     * return Set of Topic Destination Names
     */
    public Set getAllJmsTopicConnectionFactoryNames();
    /**
     * return String name of default Queue Connection factory
     */
    public String getDefaultQueueConnectionFactoryName();

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

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

    /**
     * MBean method:
     * save updated configuration
     */
    public void saveConfig();

    // Monitoring methods

    /**
     * Get the messaging mode a connection factory belongs to
     * @param jndiName connection factory name
     * @return messaging mode
     */
    public String getConnectionFactoryMode(String jndiName);

    /**
     * Get number of pending messages on a queue
     * @param jndiName queue name
     * @return number of pending messages
     */
    public Integer getPendingMessages(String jndiName);

    /**
     * Get number of pending requests on a queue
     * @param jndiName queue name
     * @return number of pending requests
     */
    public Integer getPendingRequests(String jndiName);

    /**
     * Get number of subscriptions on a topic
     * @param jndiName topic name
     * @return number of subscriptions
     */
    public Integer getSubscriptions(String jndiName);
    Boolean isMomLocal();
    public String getUrl();
    public String getMom();
}
