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

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

- (NSString *) getClientId

Gets the client identifier for this connection.

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

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

Returns
YES if this connection is open; NO otherwise.
- (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.
- (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 messageDidComplete: (eFTLCompletionListener-p) 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.
- (void) reconnectWithProperties: (NSDictionary *)  properties

Reopen a closed connection.

You may call this method within your connection:didDisconnectWithCode:reason: (eFTLConnectionListener-p) method.

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

Reconnecting automatically re-activates all subscriptions on the connection. The eFTL library invokes your subscriptionDidSubscribe: (eFTLSubscriptionListener-p) 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
- (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 subscriptionDidSubscribe: (eFTLSubscriptionListener-p) callback.

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

It is good practice to subscribe to messages published to a specific destination by using the message field name eFTLMessage::eFTLFieldNameDestination.

To subscribe for messages published to a specific destination, create a subscription matcher for that destination; for example:

{"_dest":"myTopic"}
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
- (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 subscriptionDidSubscribe: (eFTLSubscriptionListener-p) 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
- (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 subscriptionDidSubscribe: (eFTLSubscriptionListener-p) callback.

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

It is good practice to subscribe to messages published to a specific destination by using the message field name eFTLMessage::eFTLFieldNameDestination.

To subscribe for messages published to a specific destination, create a subscription matcher for that destination; for example:

{"_dest":"myTopic"}
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
- (void) unsubscribe: (NSString *)  subscription

Close a subscription.

Programs receive subscription identifiers through their subscriptionDidSubscribe: (eFTLSubscriptionListener-p) methods.

Parameters
subscriptionClose this subscription.
See also
- subscribeWithMatcher:listener:
- (void) unsubscribeAll

Close all subscriptions.

See also
- subscribeWithMatcher:listener:

Member Data Documentation

- (NSInteger const) eFTLBadSubscriptionId

Bad subscription identifier (20).

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

- (NSInteger const) eFTLConnectionBadData

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

- (NSInteger const) eFTLConnectionBadPayload

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

- (NSInteger const) eFTLConnectionError

Connection error (1006).

Programs may attempt to reconnect.

- (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.
- (NSInteger const) eFTLConnectionForceClose

Force close (4000).

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

- (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.)

- (NSInteger const) eFTLConnectionNormal

Normal close (1000).

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

- (NSInteger const) eFTLConnectionNotAuthenticated

Not authenticated (4002).

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

- (NSInteger const) eFTLConnectionPolicyViolation

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

- (NSInteger const) eFTLConnectionProtocol

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

- (NSInteger const) eFTLConnectionServerError

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

- (NSInteger const) eFTLConnectionShutdown

The server shut down the connection (1001).

Programs may wait, then attempt to reconnect.

- (NSInteger const) eFTLPublishDisallowed

User cannot publish messages (12).

The user does not have permission to publish.

Administrators configure permission to publish.

- (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.

- (NSInteger const) eFTLSubscriptionDisallowed

User cannot subscribe (13).

The user does not have permission to subscribe.

Administrators configure permission to subscribe.

- (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.

- (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: