TIBCO eFTL™
Instance Methods | Public Attributes | List of all members
eFTLConnection Class Reference

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

Inheritance diagram for eFTLConnection:

Instance Methods

(void) - disconnect
 Disconnect from the eFTL server. More...
 
(NSString *) - 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) - publishMessage:
 Publish a one-to-many message to all subscribing clients. More...
 
(void) - publishMessage:listener:
 Publish a one-to-many message to all subscribing clients. More...
 
(void) - reconnectWithProperties:
 Reopen a closed connection. More...
 
(NSString *) - subscribeWithMatcher:durable:listener:
 Create a durable subscriber to messages. More...
 
(NSString *) - subscribeWithMatcher:durable:properties:listener:
 Create a durable subscriber to messages. More...
 
(NSString *) - subscribeWithMatcher:listener:
 Subscribe to messages. More...
 
(void) - unsubscribe:
 Close a subscription. More...
 
(void) - unsubscribeAll
 Close all subscriptions. More...
 

Public Attributes

NSInteger const eFTLBadSubscriptionId
 Bad subscription identifier (20). More...
 
NSInteger const eFTLConnectionBadData
 Invalid message from server (1003). Please report this error to TIBCO. More...
 
NSInteger const eFTLConnectionBadPayload
 Invalid network data (1007). Please report this error to TIBCO. More...
 
NSInteger const eFTLConnectionError
 Connection error (1006). More...
 
NSInteger const eFTLConnectionFailedSSLHandshake
 SSL handshake failed (1015). More...
 
NSInteger const eFTLConnectionForceClose
 Force close (4000). More...
 
NSInteger const eFTLConnectionMessageTooLarge
 Message too large (1009). More...
 
NSInteger const eFTLConnectionNormal
 Normal close (1000). More...
 
NSInteger const eFTLConnectionNotAuthenticated
 Not authenticated (4002). More...
 
NSInteger const eFTLConnectionPolicyViolation
 Policy violation (1008). Please report this error to TIBCO. More...
 
NSInteger const eFTLConnectionProtocol
 Protocol error (1002). Please report this error to TIBCO. More...
 
NSInteger const eFTLConnectionRestart
 The server is restarting (1012). More...
 
NSInteger const eFTLConnectionServerError
 eFTL server error (1011). Please report this error to TIBCO. More...
 
NSInteger const eFTLConnectionShutdown
 The server shut down the connection (1001). More...
 
NSInteger const eFTLPublishDisallowed
 User cannot publish messages (12). More...
 
NSInteger const eFTLPublishFailed
 The eFTL server could not forward the published message (11). More...
 
NSInteger const eFTLSubscriptionDisallowed
 User cannot subscribe (13). More...
 
NSInteger const eFTLSubscriptionFailed
 The eFTL server could not establish the subscription (21). More...
 
NSInteger const eFTLSubscriptionInvalid
 The client supplied an invalid matcher or durable name in the subscribe call (22). More...
 

Detailed Description

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

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

Programs receive connection objects through eFTLConnectionListener callbacks.

Method Documentation

◆ disconnect()

- (void) 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 eFTLConnectionListener::connection:didDisconnectWithCode:reason: callback.

◆ getClientId()

- (NSString *) getClientId

Gets the client identifier for this connection.

Returns
The client's identifier.
See also
+ connect:properties:listener: (eFTL)

◆ isConnected()

- (BOOL) isConnected

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

Returns
YES if this connection is open; NO otherwise.

◆ publishMessage:()

- (void) publishMessage: (eFTLMessage *)  message

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

It is good practice to publish each message to a specific destination by using the message field name eFTLMessage::eFTLFieldNameDestination.

To direct a message to a specific destination, add a string field to the message; for example:

[message setField:eFTLFieldNameDestination asString:@"myTopic"];
Parameters
messagePublish this message.
Exceptions
NSInvalidArgumentExceptionThe message exceeds the maximum message size.

◆ publishMessage:listener:()

- (void) publishMessage: (eFTLMessage *)  message
listener: (id< eFTLCompletionListener >)  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 eFTLCompletionListener::messageDidComplete: callback.

It is good practice to publish each message to a specific destination by using the message field name eFTLMessage::eFTLFieldNameDestination.

To direct a message to a specific destination, add a string field to the message; for example:

[message setField:eFTLFieldNameDestination asString:@"myTopic"];
Parameters
messagePublish this message.
listenerThis listener defines callback methods for successful completion and errors.
Exceptions
NSInvalidArgumentExceptionThe message exceeds the maximum message size.

◆ reconnectWithProperties:()

- (void) reconnectWithProperties: (NSDictionary *)  properties

Reopen a closed connection.

You may call this method within your eFTLConnectionListener::connection:didDisconnectWithCode:reason: method.

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

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

Parameters
propertiesThese 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::eFTLPropertyClientId
eFTL::eFTLPropertyUsername
eFTL::eFTLPropertyPassword
eFTL::eFTLPropertyTimeout
eFTL::eFTLPropertyNotificationToken

◆ subscribeWithMatcher:durable:listener:()

- (NSString *) subscribeWithMatcher: (NSString *)  matcher
durable: (NSString *)  durable
listener: (id< eFTLSubscriptionListener >)  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 eFTLSubscriptionListener::subscriptionDidSubscribe: callback.

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

Parameters
matcherThe subscription uses this content 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.
See also
- unsubscribe:
eFTLSubscriptionListener

◆ subscribeWithMatcher:durable:properties:listener:()

- (NSString *) subscribeWithMatcher: (NSString *)  matcher
durable: (NSString *)  durable
properties: (NSDictionary *)  properties
listener: (id< eFTLSubscriptionListener >)  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 eFTLSubscriptionListener::subscriptionDidSubscribe: callback.

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

Parameters
matcherThe subscription uses this content matcher to narrow the message stream.
durableThe subscription uses this durable name.
propertiesThese properties affect the subscription.
listenerThis listener defines callback methods for successful subscription, message arrival, and errors.
Returns
An identifier that represents the new subscription.
See also
- unsubscribe:
eFTLSubscriptionListener

◆ subscribeWithMatcher:listener:()

- (NSString *) subscribeWithMatcher: (NSString *)  matcher
listener: (id< eFTLSubscriptionListener >)  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 eFTLSubscriptionListener::subscriptionDidSubscribe: 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.
See also
- unsubscribe:
eFTLSubscriptionListener

◆ unsubscribe:()

- (void) unsubscribe: (NSString *)  subscription

Close a subscription.

Programs receive subscription identifiers through their eFTLSubscriptionListener::subscriptionDidSubscribe: methods.

Parameters
subscriptionClose this subscription.
See also
- subscribeWithMatcher:listener:

◆ unsubscribeAll()

- (void) unsubscribeAll

Close all subscriptions.

See also
- subscribeWithMatcher:listener:

Member Data Documentation

◆ eFTLBadSubscriptionId

- (NSInteger const) eFTLBadSubscriptionId

Bad subscription identifier (20).

The server detected an invalid subscription identifier. Please report this error to TIBCO support staff.

◆ eFTLConnectionBadData

- (NSInteger const) eFTLConnectionBadData

Invalid message from server (1003). Please report this error to TIBCO.

◆ eFTLConnectionBadPayload

- (NSInteger const) eFTLConnectionBadPayload

Invalid network data (1007). Please report this error to TIBCO.

◆ eFTLConnectionError

- (NSInteger const) eFTLConnectionError

Connection error (1006).

Programs may attempt to reconnect.

◆ eFTLConnectionFailedSSLHandshake

- (NSInteger const) eFTLConnectionFailedSSLHandshake

SSL handshake failed (1015).

The client could not establish a secure connection to the eFTL server.

Possible diagnoses:

  • Client rejected server certificate.
  • Encryption protocols do not match.

◆ eFTLConnectionForceClose

- (NSInteger const) eFTLConnectionForceClose

Force close (4000).

The eFTL server closed the connection because another client with the same client identifier has connected.

◆ eFTLConnectionMessageTooLarge

- (NSInteger const) eFTLConnectionMessageTooLarge

Message too large (1009).

The eFTL server closed the connection because your program sent a message that exceeds the server's limit. (Administrators configure this limit.)

◆ eFTLConnectionNormal

- (NSInteger const) eFTLConnectionNormal

Normal close (1000).

Your program closed the connection by calling disconnect:. You may now proceed with clean-up.

◆ eFTLConnectionNotAuthenticated

- (NSInteger const) eFTLConnectionNotAuthenticated

Not authenticated (4002).

The eFTL server could not authenticate the client's username and password.

◆ eFTLConnectionPolicyViolation

- (NSInteger const) eFTLConnectionPolicyViolation

Policy violation (1008). Please report this error to TIBCO.

◆ eFTLConnectionProtocol

- (NSInteger const) eFTLConnectionProtocol

Protocol error (1002). Please report this error to TIBCO.

◆ eFTLConnectionRestart

- (NSInteger const) eFTLConnectionRestart

The server is restarting (1012).

Programs may wait, then attempt to reconnect.

◆ eFTLConnectionServerError

- (NSInteger const) eFTLConnectionServerError

eFTL server error (1011). Please report this error to TIBCO.

◆ eFTLConnectionShutdown

- (NSInteger const) eFTLConnectionShutdown

The server shut down the connection (1001).

Programs may wait, then attempt to reconnect.

◆ eFTLPublishDisallowed

- (NSInteger const) eFTLPublishDisallowed

User cannot publish messages (12).

The user does not have permission to publish.

Administrators configure permission to publish.

◆ eFTLPublishFailed

- (NSInteger const) eFTLPublishFailed

The eFTL server could not forward the published message (11).

To determine the root cause, examine the server log.

You may attempt to publish again.

◆ eFTLSubscriptionDisallowed

- (NSInteger const) eFTLSubscriptionDisallowed

User cannot subscribe (13).

The user does not have permission to subscribe.

Administrators configure permission to subscribe.

◆ eFTLSubscriptionFailed

- (NSInteger const) eFTLSubscriptionFailed

The eFTL server could not establish the subscription (21).

You may attempt to subscribe again. It is good practice that administrators check the server log to determine the root cause.

◆ eFTLSubscriptionInvalid

- (NSInteger const) eFTLSubscriptionInvalid

The client supplied an invalid matcher or durable name in the subscribe call (22).


The documentation for this class was generated from the following file: