Novell exteNd Messaging Platform 5.2

com.sssw.jms.api
Class JMQConnectionFactory

java.lang.Object
  extended byorg.omg.CORBA.portable.ObjectImpl
      extended bycom.sssw.jbroker.orb.ValueWrapper
          extended bycom.sssw.jms.api.JMQAdministeredObject
              extended bycom.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 Novell exteNd Messaging Platform JMS
static String IIOP_SSL_PROTOCOL
          The IIOP/SSL protocol supported by Novell exteNd Messaging Platform JMS
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 JMS server
 int getPort()
          Get the port of the (primary) JMS 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 JMS server.
 boolean isSecureBroker()
          Get whether or not this connection factory uses a secure broker.
 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 JMS 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 JMS server.
 void setPort(int port)
          Set the port of the (primary) JMS server
 void setProtocol(String protocol)
          Set the protocol to use for sending/receiveing messages
 void setSecureBroker(boolean secure)
          Set whether or not to use a secure message broker.
 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.

See Also:
Constant Field Values

TOPIC

public static final int TOPIC
Topic Connection.

See Also:
Constant Field Values

XA_QUEUE

public static final int XA_QUEUE
Queue XA Connection

See Also:
Constant Field Values

XA_TOPIC

public static final int XA_TOPIC
Topic XA Connection

See Also:
Constant Field Values

IIOP_PROTOCOL

public static final String IIOP_PROTOCOL
The IIOP protocol supported by Novell exteNd Messaging Platform JMS

See Also:
Constant Field Values

IIOP_SSL_PROTOCOL

public static final String IIOP_SSL_PROTOCOL
The IIOP/SSL protocol supported by Novell exteNd Messaging Platform JMS

Since:
jBroker MQ 2.1
See Also:
Constant Field Values
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.
Throws:
JMSException
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:
password - connection password
Returns:
a newly created Connection object.
Throws:
JMSException

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 JMS server

Returns:
host string.

setHost

public void setHost(String hostName)
Set the primary host name of the JMS 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) JMS server

Returns:
port number

setPort

public void setPort(int port)
Set the port of the (primary) JMS 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.

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 JMS 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 JMS 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 JMS 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 JMS 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

setSecureBroker

public void setSecureBroker(boolean secure)
Set whether or not to use a secure message broker. If the client communicates with the JMS server using IIOP/SSL, this should be set to true. This means that all communication with the JMS server occurs on an SSL protected connection. The default setting for this property is true.

If the client communicates with the JMS server using HTTP/S you may want to set this property to false. Since all HTTP traffic is tunneled through the ORB tunnel, which will already be SSL protected, you can avoid requiring SSL between the tunnel and the JMS server by setting this to false.

Parameters:
secure - whether or not to use the secure broker
Since:
jBroker MQ 2.1

isSecureBroker

public boolean isSecureBroker()
Get whether or not this connection factory uses a secure broker.

Since:
jBroker MQ 2.1

getReference

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

Specified by:
getReference in interface Referenceable
Throws:
NamingException

Novell exteNd Messaging Platform 5.2

exteNd is a registered trademark of Novell, Inc.
Copyright 1998-2004 Novell, Inc. All Rights Reserved.