TIBCO EMS .NET API 8.5 TIBCO EMS .NET API 8.5

- Main Page
- Related Pages
- Namespaces
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | List of all members
TIBCO.EMS.ConnectionFactory Class Reference

Administered object for creating server connections. More...

Inheritance diagram for TIBCO.EMS.ConnectionFactory:

## Public Member Functions
Connection | CreateConnection ()
| Create a connection More...
Connection | CreateConnection (string userName, string password)
| Create a connection object with the given user name and password. More...
| ConnectionFactory ()
| Construct an empty ConnectionFactory More...
| ConnectionFactory (string serverUrl)
| Construct a ConnectionFactory given server url More...
| ConnectionFactory (string serverUrl, string clientId)
| Construct a ConnectionFactory given the server url, and client id More...
| ConnectionFactory (string serverUrl, string clientId, Hashtable properties)
| Construct a ConnectionFactory given server url, client id and properties More...
override Object | Clone ()
| Overrides the cloning process More...
void | SetServerUrl (String serverUrl)
| set the server url. More...
void | SetClientID (String clientID)
| Set the client id More...
void | SetMetric (int metric)
| Set the load balance metric More...
void | SetConnAttemptCount (int attempts)
| Set the number of connection attempts More...
void | SetConnAttemptDelay (int delay)
| Set delay between connection attempts More...
void | SetReconnAttemptCount (int attempts)
| Set number of reconnect attempts More...
void | SetReconnAttemptDelay (int delay)
| Set delay between reconnect attempts More...
void | SetUserName (String username)
| Set user name More...
void | SetUserPassword (String password)
| Set user password More...
void | SetConnAttemptTimeout (int timeout)
| Set the Connect Attempt timeout for a given connection. More...
void | SetReconnAttemptTimeout (int timeout)
| Set the Reconnect Attempt timeout for a given connection. More...
void | SetMulticastEnabled (bool enabled)
| Set whether MessageConsumers subscribed to a multicast-enabled topic will receive messages over multicast. More...
void | SetMulticastDaemon (string port)
| Set the port on which the client will connect to the multicast daemon. More...
void | SetSSLTrace (bool trace)
| Enable or disable tracing on the client side. More...
void | SetSSLAuthOnly (bool authOnly)
| Enable or disable encryption/decryption of the message data over the SSL connection More...
void | SetTargetHostName (String targetHostName)
| Set the name of the target EMS server. More...
void | SetCertificateStoreType (EMSSSLStoreType type, Object storeInfo)
| Set the certificate store type and info. More...
Object | GetCertificateStore ()
| Get the certificate store info object associated with this connection factory. More...
void | SetHostNameVerifier (EMSSSLHostNameVerifier verifier)
| Set the custom host name verifier. Set to null to remove custom host name verifier. More...
void | SetClientTracer (System.IO.StreamWriter tracer)
| Set client tracer to given output stream. More...
void | SetSSLProxy (String host, int port)
| Set the connection factory's parameters for connecting through an SSL proxy. More...
void | SetSSLProxyAuth (String username, String password)
| Set a connection factory's username and password for connecting through an SSL proxy. More...
String | GetSSLProxyHost ()
| Get the SSL proxy host from this connection factory. More...
int | GetSSLProxyPort ()
| Get the SSL proxy port from this connection factory. More...
String | GetSSLProxyUser ()
| Get the SSL proxy username from a connection factory. More...
String | GetSSLProxyPassword ()
| Get the SSL proxy password from a connection factory. More...

## Protected Member Functions
| ConnectionFactory (SerializationInfo info, StreamingContext context)
| ISerializable constructor More...

## Detailed Description

Administered object for creating server connections.

Connection factories are administered objects. They support concurrent use.

Administrators define connection factories in a repository. Each connection factory has administrative parameters that guide the creation of server connections. Usage follows either of two models:

EMS Server

You can use the EMS server as a name service provider - one tibemsd process provides both the name repository and the message service. Administrators define factories in the name repository. Client programs create connection factory objects with the URL of the repository, and call the CreateConnection() method. This method automatically accesses the corresponding factory in the repository, and uses it to create a connection to the message service.

Separate JNDI Repository

Administrators define factories in a JNDI repository. Client programs call LookupContext.Lookup to retrieve factories and use them to create connections to the server.

Administered Objects

Administered objects let administrators configure EMS behavior at the enterprise level. Administrators define these objects, and client programs use them. This arrangement relieves program developers and end users of the responsibility for correct configuration.

## Constructor & Destructor Documentation

TIBCO.EMS.ConnectionFactory.ConnectionFactory | ( | SerializationInfo | info,
|  | StreamingContext | context
| ) |  |
| inline protected

ISerializable constructor

TIBCO.EMS.ConnectionFactory.ConnectionFactory | ( |  | ) |
| inline

Construct an empty ConnectionFactory

When administrators define factories in the EMS server, these constructors automatically access the corresponding objects in the repository.

TIBCO.EMS.ConnectionFactory.ConnectionFactory | ( | string | serverUrl | ) |
| inline

Construct a ConnectionFactory given server url

When administrators define factories in the EMS server, these constructors automatically access the corresponding objects in the repository.

Reconnect and Fault Tolerance

To enable reconnection behavior and fault tolerance, the connection factory's server URL parameter must be a comma-separated list of two or more URLs. To enable client reconnection in a situation with only one server, you may supply two copies of that server's URL (for example, tcp://localhost:7222,tcp://localhost:7222)

Parameters

  serverUrl | The constructor contacts the EMS server at this URL, to access a factory. If connecting a fault-tolerant client, specify two or more comma-separated URLs, as described below in Reconnect and Fault Tolerance.

TIBCO.EMS.ConnectionFactory.ConnectionFactory | ( | string | serverUrl,
|  | string | clientId
| ) |  |
| inline

Construct a ConnectionFactory given the server url, and client id

When administrators define factories in the EMS server, these constructors automatically access the corresponding objects in the repository.

Reconnect and Fault Tolerance

To enable reconnection behavior and fault tolerance, the connection factory's server URL parameter must be a comma-separated list of two or more URLs. To enable client reconnection in a situation with only one server, you may supply two copies of that server's URL (for example, tcp://localhost:7222,tcp://localhost:7222)

Parameters

  serverUrl | The constructor contacts the EMS server at this URL, to access a factory. If connecting a fault-tolerant client, specify two or more comma-separated URLs, as described below in Reconnect and Fault Tolerance.
  clientId | The id of the client.

A client ID string lets the server associate a client-specific factory with each client program. When present, the server supplies that factory to the client. If a factory does not yet exist for the client, the server creates one, and stores it for future use by that specific client.

TIBCO.EMS.ConnectionFactory.ConnectionFactory | ( | string | serverUrl,
|  | string | clientId,
|  | Hashtable | properties
| ) |  |
| inline

Construct a ConnectionFactory given server url, client id and properties

When administrators define factories in the EMS server, these constructors automatically access the corresponding objects in the repository.

Reconnect and Fault Tolerance

To enable reconnection behavior and fault tolerance, the connection factory's server URL parameter must be a comma-separated list of two or more URLs. To enable client reconnection in a situation with only one server, you may supply two copies of that server's URL (for example, tcp://localhost:7222,tcp://localhost:7222)

Parameters

  serverUrl | The constructor contacts the EMS server at this URL, to access a factory. If connecting a fault-tolerant client, specify two or more comma-separated URLs, as described below in Reconnect and Fault Tolerance.
  clientId | The id of the client.

A client ID string lets the server associate a client-specific factory with each client program. When present, the server supplies that factory to the client. If a factory does not yet exist for the client, the server creates one, and stores it for future use by that specific client.

Parameters

  properties | The properties of the client such as user name and password.

When present, these properties govern the behavior of the connection objects that a client-specific factory creates. For a list of properties, see the Connection-Related Fields in the Tibems members.

## Member Function Documentation

override Object TIBCO.EMS.ConnectionFactory.Clone | ( |  | ) |
| inline

Overrides the cloning process

Returns
  An object that is a clone of this `ConnectionFactory` object

Connection TIBCO.EMS.ConnectionFactory.CreateConnection | ( |  | ) |
| inline

Create a connection

The connection object presents a default user identity. If the server configuration permits that user, then the call succeeds.

Returns
  The newly created Connection.

Connection TIBCO.EMS.ConnectionFactory.CreateConnection | ( | string | userName,
|  | string | password
| ) |  |
| inline

Create a connection object with the given user name and password.

Parameters

  userName | The connection object presents this user identity to the server. This parameter can be omitted if the server isn't authenticating or authorizing users.
  password | The connection object authenticates the user identity with this password. This parameter can be omitted if the server isn't authenticating or authorizing users.

Returns
  The newly created Connection.

Object TIBCO.EMS.ConnectionFactory.GetCertificateStore | ( |  | ) |
| inline

Get the certificate store info object associated with this connection factory.

can be null or of type EMSSSLFileStoreInfo or EMSSSLSystemStoreInfo. NOTE: SSL Connection factory objects that are looked up in JNDI have a certificate store info already created. This allows a user to get access to the certificate store object and set properties not present in the JNDI object. e.g. ssl password.

EMSSSLFileStoreInfo info = (EMSSSLFileStoreInfo)cf.GetCertificateStore();
String _password = "password";
info.SetSSLPassword(_password.ToCharArray());

String TIBCO.EMS.ConnectionFactory.GetSSLProxyHost | ( |  | ) |
| inline

Get the SSL proxy host from this connection factory.

Returns
  return the host

Exceptions

  EMSException | if the protocol of the connection factory's URL is not SSL.

String TIBCO.EMS.ConnectionFactory.GetSSLProxyPassword | ( |  | ) |
| inline

Get the SSL proxy password from a connection factory.

Returns
  the password.

Exceptions

  EMSException | if the protocol of the connection factory's URL is not SSL.

int TIBCO.EMS.ConnectionFactory.GetSSLProxyPort | ( |  | ) |
| inline

Get the SSL proxy port from this connection factory.

Returns
  the port.

Exceptions

  EMSException | if the protocol of the connection factory's URL is not SSL.

String TIBCO.EMS.ConnectionFactory.GetSSLProxyUser | ( |  | ) |
| inline

Get the SSL proxy username from a connection factory.

Returns
  the username.

Exceptions

  EMSException | if the protocol of the connection factory's URL is not SSL.

void TIBCO.EMS.ConnectionFactory.SetCertificateStoreType | ( | EMSSSLStoreType | type,
|  | Object | storeInfo
| ) |  |
| inline

Set the certificate store type and info.

Parameters

  type | The type of certificate store. Can be either EMSSSL_STORE_TYPE_SYSTEM or EMSSSL_STORE_TYPE_FILE. See EMSSSLStoreType for details.
  storeInfo | If the store type is EMSSSL_STORE_TYPE_SYSTEM, then storeInfo must be an EMSSSLSystemStoreInfo object. If the store type is EMSSSL_STORE_TYPE_FILE, then storeInfo must be an EMSSSLFileStoreInfo object.

void TIBCO.EMS.ConnectionFactory.SetClientID | ( | String | clientID | ) |
| inline

Set the client id

Parameters

  clientID | The client id

Exceptions

  EMSException | The specified client id already exists

void TIBCO.EMS.ConnectionFactory.SetClientTracer | ( | System.IO.StreamWriter | tracer | ) |
| inline

Set client tracer to given output stream.

Client tracing prints loaded certificates and information about the SSL handshake errors and results.

Parameters

  tracer | The output stream to send the tracing information. Specify null as parameter to disable client tracing.

void TIBCO.EMS.ConnectionFactory.SetConnAttemptCount | ( | int | attempts | ) |
| inline

Set the number of connection attempts

Parameters

  attempts | The number of connection attempts

void TIBCO.EMS.ConnectionFactory.SetConnAttemptDelay | ( | int | delay | ) |
| inline

Set delay between connection attempts

Parameters

  delay | Time (in milliseconds) of the delay between connection attempts.

void TIBCO.EMS.ConnectionFactory.SetConnAttemptTimeout | ( | int | timeout | ) |
| inline

Set the Connect Attempt timeout for a given connection.

This timeout is per url and per connect_attempt. For example, to specify two connect attempts for a given url, then for each attempt the client will wait for the period specified by the connect attempt timeout for the connection to be established. If no connection is established within that the specified timeframe, the client connection attempt is terminated.

Parameters

  timeout | The timeout, in milliseconds. The minimum value is 100 milliseconds. If a value of less than 100 milliseconds is specified, then the minimum value of 100 milliseconds is used.

void TIBCO.EMS.ConnectionFactory.SetHostNameVerifier | ( | EMSSSLHostNameVerifier | verifier | ) |
| inline

Set the custom host name verifier. Set to null to remove custom host name verifier.

Parameters

  verifier | Host name verifier. Set to null to remove custom host name verifier. See EMSSSLHostNameVerifier for details.

void TIBCO.EMS.ConnectionFactory.SetMetric | ( | int | metric | ) |
| inline

Set the load balance metric

Parameters

  metric | The load balance metric

Exceptions

  EMSException | Invalid metric

void TIBCO.EMS.ConnectionFactory.SetMulticastDaemon | ( | string | port | ) |
| inline

Set the port on which the client will connect to the multicast daemon.

A connection to the multicast daemon is required when multicast is enabled and a MessageConsumer is subscribed to a multicast-enabled topic. Setting the port with this method will override the default port supplied by the server.

Parameters

  port | the port on which the client will connect to the multicast daemon.

Deprecated:
  As of release 8.3.

void TIBCO.EMS.ConnectionFactory.SetMulticastEnabled | ( | bool | enabled | ) |
| inline

Set whether MessageConsumers subscribed to a multicast-enabled topic will receive messages over multicast.

When enabled, MessageConsumers subscribed to a multicast-enabled topic will receive messages over multicast. The default is enabled.

Parameters

  enabled | true to enable multicast, false to disable multicast.

Deprecated:
  As of release 8.3.

void TIBCO.EMS.ConnectionFactory.SetReconnAttemptCount | ( | int | attempts | ) |
| inline

Set number of reconnect attempts

Parameters

  attempts | The number of connection attempts

void TIBCO.EMS.ConnectionFactory.SetReconnAttemptDelay | ( | int | delay | ) |
| inline

Set delay between reconnect attempts

Parameters

  delay | Time (in milliseconds) of the delay between reconnect attempts

void TIBCO.EMS.ConnectionFactory.SetReconnAttemptTimeout | ( | int | timeout | ) |
| inline

Set the Reconnect Attempt timeout for a given connection.

This timeout is per url and per reconnect_attempt. For example, to specify two reconnect attempts for a given url, then for each attempt the client will wait for the period specified by the reconnect attempt timeout for the connection to be established. If no reconnection is established within that the specified timeframe, the reconnection attempt is terminated.

Parameters

  timeout | The timeout, in milliseconds. The minimum value is 100 milliseconds. If a value of less than 100 milliseconds is specified, then the minimum value of 100 milliseconds is used.

void TIBCO.EMS.ConnectionFactory.SetServerUrl | ( | String | serverUrl | ) |
| inline

set the server url.

The server URL is of the form:

protocol://hostName:portNumber

For example:

tcp://localhost:7222

The server URL for a fault-tolerant configuration is a string with multiple URL's that are comma separated.

For example:

tcp://localhost:7222,tcp://localhost:7224

Parameters

  serverUrl | The constructor contacts the EMS server at this URL, to access a factory. If connecting a fault-tolerant client, specify two or more comma-separated URLs, as described below in Reconnect and Fault Tolerance.

Exceptions

  EMSException | Url is already set or some other error.

void TIBCO.EMS.ConnectionFactory.SetSSLAuthOnly | ( | bool | authOnly | ) |
| inline

Enable or disable encryption/decryption of the message data over the SSL connection

For the client and server to require an SSL connection only to perform authentication, the ssl_auth_only parameter needs to be set on the server and AUTH_ONLY needs to be set by the client. Setting these flags on both the server and client side indicates that the SSL connection is only used to only perform authentication. Once authentication is complete, the client switches to a regular TCP connection to communicate with the server.

Parameters

  authOnly | Flag to indicate whether the connection should only authenticate. When true, only the authentication to connect is performed and data sent over the connection is not encrypted or decrypted. When false (the default), authentication to is performed and data sent over the connection is encrypted and decrypted.

void TIBCO.EMS.ConnectionFactory.SetSSLProxy | ( | String | host,
|  | int | port
| ) |  |
| inline

Set the connection factory's parameters for connecting through an SSL proxy.

An SSL proxy lets an EMS application create an SSL connection to an EMS server, even though a firewall separates the application from the server. The proxy usually runs within the firewall's DMZ. A connection factory contacts the SSL proxy, requesting an SSL connection to the server. The proxy authenticates the application program, and mediates the initial SSL negotiation between application and server. After the SSL connection is established, the application and server use it to communicate directly with one another.

Parameters

  host | The connection factory establishes SSL communication through a web proxy at this host. Supply a simple hostname, a fully qualified hostname with domain name, or an IP address (dot notation).
  port | The connection factory establishes SSL communication through a web proxy on this port.

Exceptions

  EMSException | if the proxy host is null or empty, the port is zero or the protocol of the connection factory's URL is not SSL.

void TIBCO.EMS.ConnectionFactory.SetSSLProxyAuth | ( | String | username,
|  | String | password
| ) |  |
| inline

Set a connection factory's username and password for connecting through an SSL proxy.

When a connection factory establishes an EMS server connection through an SSL proxy host, the proxy might first require authentication before facilitating a connection. When required, use this call to set that authentication data on the connection factory.

Note: This proxy authentication data is distinct from the server authentication data and from the SSL private key encryption password.

Parameters

  username | The connection factory authenticates itself to the SSL proxy using this username.
  password | The connection factory authenticates itself to the SSL proxy using this password.

Exceptions

  EMSException | if the protocol of the connection factory's URL is not SSL.

void TIBCO.EMS.ConnectionFactory.SetSSLTrace | ( | bool | trace | ) |
| inline

Enable or disable tracing on the client side.

Tracing will show information during the SSL handshake and on messages received and sent by the SSL link.

Parameters

  trace | Flag to indicate whether tracing should be enabled for all connection created via this connection factory. When true, tracing is enabled. When false, (the default) tracing is disabled.

void TIBCO.EMS.ConnectionFactory.SetTargetHostName | ( | String | targetHostName | ) |
| inline

Set the name of the target EMS server.

This is a required parameter for all .NET SSL connections. Because System.Net.Security.SslStream requires a targetHost, this value is required and cannot be NULL.

Parameters

  targetHostName | The name of the server as defined in the server's certificate. Usually the server's HostName is specified as the CN in the server's certificate.

void TIBCO.EMS.ConnectionFactory.SetUserName | ( | String | username | ) |
| inline

Set user name

Parameters

  username | User name

void TIBCO.EMS.ConnectionFactory.SetUserPassword | ( | String | password | ) |
| inline

Set user password

Parameters

  password | User password