TIBCO eFTL™
Public Member Functions | List of all members
TIBCO.EFTL.IConnection Interface Reference

A connection object represents a program's connection to an eFTL server. More...

Inheritance diagram for TIBCO.EFTL.IConnection:

Public Member Functions

void Acknowledge (IMessage message)
 Acknowledge this message. More...
 
void AcknowledgeAll (IMessage message)
 Acknowledge all messages up to and including this message. More...
 
IKVMap CreateKVMap (String name)
 Create a IKVMap. More...
 
IMessage CreateMessage ()
 Create a IMessage. More...
 
void Disconnect ()
 Disconnect from the eFTL server. More...
 
String GetClientId ()
 Gets the client identifier for this connection. More...
 
bool IsConnected ()
 Determine whether this connection to the eFTL server is open or closed. More...
 
void Publish (IMessage message)
 Publish a one-to-many message to all subscribing clients. More...
 
void Publish (IMessage message, ICompletionListener listener)
 Publish a one-to-many message to all subscribing clients. More...
 
void Reconnect (System.Collections.Hashtable props)
 Reopen a closed connection. More...
 
void RemoveKVMap (String name)
 Remove a key-value map. More...
 
void SendReply (IMessage reply, IMessage request, ICompletionListener listener)
 Send a reply message in response to a request message. More...
 
void SendRequest (IMessage request, double timeout, IRequestListener listener)
 Publish a request message. More...
 
String Subscribe (String matcher, ISubscriptionListener listener)
 Subscribe to messages. More...
 
String Subscribe (String matcher, String durable, ISubscriptionListener listener)
 Create a durable subscriber to messages. More...
 
String Subscribe (String matcher, String durable, Hashtable props, ISubscriptionListener listener)
 Create a durable subscriber to messages. More...
 
void Unsubscribe (String subscriptionId)
 Close a subscription. More...
 
void UnsubscribeAll ()
 Close all subscriptions. More...
 

Detailed Description

A connection object represents a program's connection to an eFTL server.

Programs use connection objects to create messages, send messages, and subscribe to messages.

Programs receive connection objects through IConnectionListener callbacks.

Member Function Documentation

void TIBCO.EFTL.IConnection.Acknowledge ( IMessage  message)

Acknowledge this message.

Messages consumed from subscriptions with a client acknowledgment mode must be explicitly acknowledged. The eFTL server will stop delivering messages to the client once the server's configured maximum number of unacknowledged messages is reached.

Parameters
messageThe message being acknowledged.
Exceptions
ExceptionThe connection is not open.
See Also
AcknowledgeMode.CLIENT
void TIBCO.EFTL.IConnection.AcknowledgeAll ( IMessage  message)

Acknowledge all messages up to and including this message.

Messages consumed from subscriptions with a client acknowledgment mode must be explicitly acknowledged. The eFTL server will stop delivering messages to the client once the server's configured maximum number of unacknowledged messages is reached.

Parameters
messageThe message being acknowledged.
Exceptions
ExceptionThe connection is not open.
See Also
AcknowledgeMode.CLIENT
IKVMap TIBCO.EFTL.IConnection.CreateKVMap ( String  name)

Create a IKVMap.

Parameters
nameKey-value map name.
Returns
A new key-value map object.
IMessage TIBCO.EFTL.IConnection.CreateMessage ( )

Create a IMessage.

Returns
A new message object.
void TIBCO.EFTL.IConnection.Disconnect ( )

Disconnect from the eFTL server.

Programs may disconnect to free server resources.

This call returns immediately; disconnecting continues asynchronously. When the connection has closed, the eFTL library calls your IConnectionListener.OnDisconnect} callback.

String TIBCO.EFTL.IConnection.GetClientId ( )

Gets the client identifier for this connection.

Returns
The client's identifier.
See Also
EFTL.Connect

.

bool TIBCO.EFTL.IConnection.IsConnected ( )

Determine whether this connection to the eFTL server is open or closed.

Returns
true if this connection is open; false otherwise.
void TIBCO.EFTL.IConnection.Publish ( IMessage  message)

Publish a one-to-many message to all subscribing clients.

Parameters
messagePublish this message.
Exceptions
ExceptionThe connection is not open.
ExceptionThe message would exceed the eFTL server's maximum message size.
See Also
MessageConstants.FIELD_NAME_DESTINATION
void TIBCO.EFTL.IConnection.Publish ( IMessage  message,
ICompletionListener  listener 
)

Publish a one-to-many message to all subscribing clients.

This call returns immediately; publishing continues asynchronously. When the publish completes successfully, the eFTL library calls your ICompletionListener.OnCompletion callback.

Parameters
messagePublish this message.
listenerThis listener defines callback methods for successful completion and for errors.
Exceptions
ExceptionThe connection is not open.
ExceptionThe message would exceed the eFTL server's maximum message size.
See Also
MessageConstants.FIELD_NAME_DESTINATION
void TIBCO.EFTL.IConnection.Reconnect ( System.Collections.Hashtable  props)

Reopen a closed connection.

You may call this method within your IConnectionListener.OnDisconnect method.

This call returns immediately; connecting continues asynchronously. When the connection is ready to use, the eFTL library calls your IConnectionListener.OnReconnect callback.

Reconnecting automatically re-activates all subscriptions on the connection. The eFTL library invokes your ISubscriptionListener.OnSubscribe callback for each successful resubscription.

Parameters
propsThese properties affect the connection attempt. You must supply username and password credentials each time. All other properties remain stored from earlier connect and reconnect calls. New values overwrite stored values.
See Also
EFTL.PROPERTY_CLIENT_ID, EFTL.PROPERTY_USERNAME, EFTL.PROPERTY_PASSWORD, EFTL.PROPERTY_TIMEOUT, EFTL.PROPERTY_TRUST_ALL
void TIBCO.EFTL.IConnection.RemoveKVMap ( String  name)

Remove a key-value map.

Parameters
nameKey-value map name.
void TIBCO.EFTL.IConnection.SendReply ( IMessage  reply,
IMessage  request,
ICompletionListener  listener 
)

Send a reply message in response to a request message.

This call returns immediately. When the send completes successfully, the eFTL library calls your ICompletionListener.OnCompletion callback.

Parameters
replyThe reply message to send.
requestThe request message.
listenerThis listener defines callback methods for successful completion and for errors.
Exceptions
ExceptionThe connection is not open.
ExceptionThe message would exceed the eFTL server's maximum message size.
void TIBCO.EFTL.IConnection.SendRequest ( IMessage  request,
double  timeout,
IRequestListener  listener 
)

Publish a request message.

This call returns immediately. When the reply is received the eFTL library calls your IRequestListener.OnReply callback.

Parameters
requestThe request message to publish.
timeoutSeconds to wait for a reply.
listenerThis listener defines callback methods for successful completion and for errors.
Exceptions
ExceptionThe connection is not open.
ExceptionThe message would exceed the eFTL server's maximum message size.
See Also
MessageConstants.FIELD_NAME_DESTINATION
String TIBCO.EFTL.IConnection.Subscribe ( String  matcher,
ISubscriptionListener  listener 
)

Subscribe to messages.

Register a subscription for one-to-many messages.

This call returns immediately; subscribing continues asynchronously. When the subscription is ready to receive messages, the eFTL library calls your ISubscriptionListener.OnSubscribe callback.

A matcher can narrow subscription interest in the inbound message stream.

Parameters
matcherThe subscription uses this content matcher to narrow the message stream.
listenerThis listener defines callback methods for successful subscription, message arrival, and errors.
Returns
An identifier that represents the new subscription.
Exceptions
ExceptionThe connection is not open.
See Also
ISubscriptionListener, IConnection.Unsubscribe
See Also
MessageConstants.FIELD_NAME_DESTINATION
String TIBCO.EFTL.IConnection.Subscribe ( String  matcher,
String  durable,
ISubscriptionListener  listener 
)

Create a durable subscriber to messages.

Register a durable subscription for one-to-many messages.

This call returns immediately; subscribing continues asynchronously. When the subscription is ready to receive messages, the eFTL library calls your ISubscriptionListener.OnSubscribe callback.

A matcher can narrow subscription interest in the inbound message stream.

Parameters
matcherThe subscription uses this matcher to narrow the message stream.
durableThe subscription uses this durable name.
listenerThis listener defines callback methods for successful subscription, message arrival and errors.
Returns
An identifier that represents the new subscription.
Exceptions
ExceptionThe connection is not open.
See Also
ISubscriptionListener, IConnection.Unsubscribe
See Also
MessageConstants.FIELD_NAME_DESTINATION
String TIBCO.EFTL.IConnection.Subscribe ( String  matcher,
String  durable,
Hashtable  props,
ISubscriptionListener  listener 
)

Create a durable subscriber to messages.

Register a durable subscription for one-to-many messages.

This call returns immediately; subscribing continues asynchronously. When the subscription is ready to receive messages, the eFTL library calls your ISubscriptionListener.OnSubscribe callback.

A matcher can narrow subscription interest in the inbound message stream.

Parameters
matcherThe subscription uses this matcher to narrow the message stream.
durableThe subscription uses this durable name.
propsThese properties can be used to affect the subscription:
listenerThis listener defines callback methods for successful subscription, message arrival and errors.
Returns
An identifier that represents the new subscription.
Exceptions
ExceptionThe connection is not open.
See Also
ISubscriptionListener, IConnection.Unsubscribe
See Also
MessageConstants.FIELD_NAME_DESTINATION
void TIBCO.EFTL.IConnection.Unsubscribe ( String  subscriptionId)

Close a subscription.

For durable subscriptions, this will cause the persistence service to remove the durable subscription as well, along with any persisted messages.

Parameters
subscriptionIdClose this subscription.
See Also
IConnection.Subscribe(string, ISubscriptionListener), IConnection.Subscribe(string, string, ISubscriptionListener), IConnection.Subscribe(string, string, Hashtable, ISubscriptionListener)
void TIBCO.EFTL.IConnection.UnsubscribeAll ( )

Close all subscriptions.

For durable subscriptions, this will cause the persistence service to remove the durable subscription as well, along with any persisted messages.

See Also
IConnection.Subscribe(string, ISubscriptionListener), IConnection.Subscribe(string, string, ISubscriptionListener), IConnection.Subscribe(string, string, Hashtable, ISubscriptionListener)