/* JFox, the OpenSource J2EE Application Server
 *
 * Distributable under GNU LGPL license by gun.org
 * more details please visit http://www.huihoo.org/jfox
 */

package org.jfox.jms.connector;

import java.rmi.Remote;
import java.rmi.RemoteException;
import javax.jms.Connection;
import javax.jms.ConnectionMetaData;
import javax.jms.JMSException;
import javax.jms.Queue;
import javax.jms.TemporaryQueue;
import javax.jms.TemporaryTopic;
import javax.jms.Topic;

import org.jfox.jms.JMSConnectionRemote;

/**
 * define all the method the client can call
 *
 * @author <a href="mailto:young_yy@hotmail.com">Young Yang</a>
 */

public interface JMSConnectorService extends Remote {
    // --- from javax.jms.ConnectionFactory
    Connection createConnection() throws RemoteException, JMSException;

    Connection createConnection(String userName, String password) throws RemoteException, JMSException;

    // --- from javax.jms.Session
    Queue createQueue(java.lang.String queueName) throws RemoteException, JMSException;

    Topic createTopic(String topicName) throws RemoteException, JMSException;

    TemporaryQueue createTemporaryQueue() throws RemoteException, JMSException;

    TemporaryTopic createTemporaryTopic() throws RemoteException, JMSException;

    // --- from javax.jms.Connection
    String getClientID() throws RemoteException, JMSException;

    void setClientID(String clientID) throws RemoteException, JMSException;

    ConnectionMetaData getMetaData() throws RemoteException, JMSException;

    void ping() throws RemoteException;

    void setPort(int port) throws RemoteException;

    int getPort() throws RemoteException;

    Protocol getProtocol() throws RemoteException;

    void registerConnection(String clientId, JMSConnectionRemote conn) throws RemoteException;

    void unregisterConnection(String clientId) throws RemoteException;

    boolean isConnectionRegistered(String clientId) throws RemoteException;
}
