jBroker® MQ 2.1

com.sssw.jms.api
Class JMQConnectionFactory

java.lang.Object
  |
  +--org.omg.CORBA.portable.ObjectImpl
        |
        +--com.sssw.jbroker.orb.ValueWrapper
              |
              +--com.sssw.jms.api.JMQAdministeredObject
                    |
                    +--com.sssw.jms.api.JMQConnectionFactory
All Implemented Interfaces:
ConnectionFactory, Object, Referenceable, Serializable
Direct Known Subclasses:
JMQQueueConnectionFactory, JMQTopicConnectionFactory, JMQXAQueueConnectionFactory, JMQXATopicConnectionFactory

public abstract class JMQConnectionFactory
extends JMQAdministeredObject
implements ConnectionFactory

Factory for creating JMS connections in JBroker MQ. The factories are JMQAdministeredObject's which means that they can be stored into any JNDI context.

See Also:
JMQTopicConnectionFactory, JMQQueueConnectionFactory, JMQXATopicConnectionFactory, JMQXAQueueConnectionFactory, Serialized Form

Field Summary
static String IIOP_PROTOCOL
          The IIOP protocol supported by jBroker MQ
static String IIOP_SSL_PROTOCOL
          The IIOP/SSL protocol supported by jBroker MQ
static int QUEUE
          Queue Connection.
static int TOPIC
          Topic Connection.
static int XA_QUEUE
          Queue XA Connection
static int XA_TOPIC
          Topic XA Connection
 
Method Summary
 void addCACertificate(byte[][] derCert)
          Add a DER encoded trusted CA certificate to this connection factory.
 Connection createConnection()
          Create a Connection using the factory's default configuration.
 Connection createConnection(String username, String password)
          Create a Connection using the factory's default configuration and specified user name and password.
 CipherSuite[] getCipherSuites()
          Get the SSL cipher suites that client connections support.
 String getClientId()
          Get the JMS Client ID
 String getDefaultPassword()
          Get the default password
 String getDefaultUserName()
          Get the default username
 String getHost()
          Get the (primary) host name of the jBroker MQ Server
 int getPort()
          Get the port of the (primary) jBroker MQ Server
 String getProtocol()
          Get the protocol used for sending/receiveing messages
 Reference getReference()
          Get a JNDI Reference for this Connection Factory.
 JMQServerInfo[] getServers()
          Get the servers in the cluster for this connection factory.
 int getType()
          Get the connection Type.
 boolean isClientPull()
          Get whether or not this connection factory will create connections that use pull mode when retrieving messages from the jBroker MQ server.
 void setCertificateChain(byte[][] derCertChain, byte[] privateKeyBER)
          Set the SSL certificate chain for clients using this connection factory.
 void setCertificateChain(byte[][] derCertChain, byte[] privateKey, String password)
          Set the SSL certificate chain for clients using this connection factory.
 void setCipherSuites(CipherSuite[] ciphers)
          Set the SSL cipher suites that client connections should support.
 void setClientId(String clientId)
          Set the JMS Client ID
 void setClientPull(boolean clientPull)
          Set whether or not this connection factory will create connections that use pull mode when retrieving messages from the jBroker MQ server.
 void setDefaultPassword(String defaultPassword)
          Set the default password
 void setDefaultUserName(String defaultUser)
          Set the default username
 void setHost(String hostName)
          Set the primary host name of the jBroker MQ Server.
 void setPort(int port)
          Set the port of the (primary) jBroker MQ Server
 void setProtocol(String protocol)
          Set the protocol to use for sending/receiveing messages
 void setServers(JMQServerInfo[] servers)
          Set the servers in the cluster for this connection factory
 String toString()
          Return a pretty printed string form of this connection factory
 
Methods inherited from class com.sssw.jbroker.orb.ValueWrapper
_ids
 
Methods inherited from class org.omg.CORBA.portable.ObjectImpl
_create_request, _create_request, _duplicate, _get_delegate, _get_domain_managers, _get_interface_def, _get_policy, _hash, _invoke, _is_a, _is_equivalent, _is_local, _non_existent, _orb, _release, _releaseReply, _request, _request, _servant_postinvoke, _servant_preinvoke, _set_delegate, _set_policy_override, equals, hashCode
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

QUEUE

public static final int QUEUE
Queue Connection.

TOPIC

public static final int TOPIC
Topic Connection.

XA_QUEUE

public static final int XA_QUEUE
Queue XA Connection

XA_TOPIC

public static final int XA_TOPIC
Topic XA Connection

IIOP_PROTOCOL

public static final String IIOP_PROTOCOL
The IIOP protocol supported by jBroker MQ

IIOP_SSL_PROTOCOL

public static final String IIOP_SSL_PROTOCOL
The IIOP/SSL protocol supported by jBroker MQ
Since:
jBroker MQ 2.1
Method Detail

getType

public int getType()
Get the connection Type.
Returns:
the integer constant for this factory's type
See Also:
QUEUE, TOPIC, XA_TOPIC, XA_QUEUE

toString

public String toString()
Return a pretty printed string form of this connection factory
Overrides:
toString in class ObjectImpl
Returns:
string form of object

createConnection

public Connection createConnection()
                            throws JMSException
Create a Connection using the factory's default configuration.
Returns:
a newly created Connection object.
Since:
jBroker MQ 2.1

createConnection

public Connection createConnection(String username,
                                   String password)
                            throws JMSException
Create a Connection using the factory's default configuration and specified user name and password.
Parameters:
userName - connection user name
password - connection password
Returns:
a newly created Connection object.

getProtocol

public String getProtocol()
Get the protocol used for sending/receiveing messages
Returns:
integer constant for this factory's protocol
See Also:
IIOP_PROTOCOL, IIOP_SSL_PROTOCOL

setProtocol

public void setProtocol(String protocol)
Set the protocol to use for sending/receiveing messages
Parameters:
protocol - the new protocol for connection factory
Throws:
IllegalArgumentException - if protocol is not supported.
See Also:
IIOP_PROTOCOL, IIOP_SSL_PROTOCOL

getHost

public String getHost()
Get the (primary) host name of the jBroker MQ Server
Returns:
host string.

setHost

public void setHost(String hostName)
Set the primary host name of the jBroker MQ Server. This should typically be a fully qualified name or an IP address
Parameters:
hostName - the host name used by this connection factory

getPort

public int getPort()
Get the port of the (primary) jBroker MQ Server
Returns:
port number

setPort

public void setPort(int port)
Set the port of the (primary) jBroker MQ Server
Parameters:
port - the port number used by this connection factory

getServers

public JMQServerInfo[] getServers()
Get the servers in the cluster for this connection factory. This method returns message brokers that are alternatives to the host and port returned by getHost and getPort methods
Returns:
an array of host/port pairs for the servers in a cluster
Since:
jBroker MQ 2.0

setServers

public void setServers(JMQServerInfo[] servers)
Set the servers in the cluster for this connection factory
Parameters:
servers - an array of host/port pairs for the servers in a cluster
Since:
jBroker MQ 2.0

getClientId

public String getClientId()
Get the JMS Client ID
Returns:
the default client ID set on connections created by this connection factory

setClientId

public void setClientId(String clientId)
Set the JMS Client ID
Parameters:
clientId - the new default client ID to use on connections created by this connection factory

getDefaultUserName

public String getDefaultUserName()
Get the default username
Returns:
the default user name used to create connections with this connection factory

setDefaultUserName

public void setDefaultUserName(String defaultUser)
Set the default username
Parameters:
defaultUser - the new default user name used to create connections with this connection factory

getDefaultPassword

public String getDefaultPassword()
Get the default password
Returns:
the default password used to create connections with this connection factory

setDefaultPassword

public void setDefaultPassword(String defaultPassword)
Set the default password
Parameters:
defaultPassword - the new default user name used to create connections with this connection factory.

Since:
jBroker MQ 2.1

getCipherSuites

public CipherSuite[] getCipherSuites()
Get the SSL cipher suites that client connections support.
Returns:
an array of cipher suites supported by the client
Since:
jBroker MQ 2.1

setCipherSuites

public void setCipherSuites(CipherSuite[] ciphers)
Set the SSL cipher suites that client connections should support.
Parameters:
suites - an array of cipher suites If this connection factory has been configured for the IIOP/SSL protocol, this value must be set prior to creating any connections.
Since:
jBroker MQ 2.1

setCertificateChain

public void setCertificateChain(byte[][] derCertChain,
                                byte[] privateKeyBER)
Set the SSL certificate chain for clients using this connection factory. This must be set if the jBroker MQ server is configured to require client certifcates.

Parameters:
derCertChain - the DER encoded certificate chain (using ASN.1 Distinguished Encoding Rules)
privateKeyBER - private key in clear text using the format defined by PKCS #1 (PrivateKeyBER)

Since:
jBroker MQ 2.1

setCertificateChain

public void setCertificateChain(byte[][] derCertChain,
                                byte[] privateKey,
                                String password)
Set the SSL certificate chain for clients using this connection factory. This must be set if the jBroker MQ server is configured to require client certifcates.

Parameters:
derCertChain - the DER encoded certificate chain (using ASN.1 Distinguished Encoding Rules)
privateKey - encrypted private key using the format defined by PKCS #8
password - the password with which to decrypt the private key

Since:
jBroker MQ 2.1

addCACertificate

public void addCACertificate(byte[][] derCert)
Add a DER encoded trusted CA certificate to this connection factory. Clients created from this connection factory will accept certificates issued by this certificate authority. A CA certificate must be added to ensure communication between client and server can not be compromised.

Parameters:
derCert - a DER encoded CA certificate (using ASN.1 Distinguished Encoding Rules)
Since:
jBroker MQ 2.1

isClientPull

public boolean isClientPull()
Get whether or not this connection factory will create connections that use pull mode when retrieving messages from the jBroker MQ server.
Returns:
True if pull mode; false otherwise
Since:
jBroker MQ 2.1

setClientPull

public void setClientPull(boolean clientPull)
Set whether or not this connection factory will create connections that use pull mode when retrieving messages from the jBroker MQ server. Push mode is the default which means that the server will create a callback connection to the client when the client creates a connection.
Parameters:
clientPull - if set to true use pull mode; otherwise use push mode.
Since:
jBroker MQ 2.1

getReference

public Reference getReference()
                       throws NamingException
Get a JNDI Reference for this Connection Factory. This allows for storing jBroker MQ Connection Factories in all JNDI naming contexts.

jBroker® MQ 2.1

jBroker is a registered trademark of Novell, Inc.
Copyright 1998-2003 Novell, Inc. All Rights Reserved.