KMStompConnectionFactory Class Reference
Inherits from | KMConnectionFactory : KCObject : NSObject |
Declared in | KMStompConnectionFactory.h |
Overview
JMS Client implementation of ConnectionFactory. Used to create a connection with a JMS provider via a WebSocket connection. Also provides the ability to set the Gateway location dynamically
Tasks
-
– initWithUrl:
Initializes the KMStompConnectionFactory with a url for the Gateway location.
-
– initWithUrl:properties:
Initializes the KMStompConnectionFactory with a url for the Gateway location.
-
– webSocketFactory
Returns the instance of underlying KGWebSocketFactory that is used to create and establish WebSocket connection to send/receive data over WebSocket connection.
-
– setWebSocketFactory:
Sets the KGWebSocketFactory that will be used to create and establish WebSocket connections to send/receive data over WebSocket connection. When KMStompConnectionFactory is created, the KGWebSocketFactory is implicitly created. The function can be used to replace the default WebSocketFactory. Application developer can create WebSocketFactory externally, enable extensions, set parameter values and can provide the WebSocketFactory instance to the StompConnectionFactory.
-
– gatewayLocation
Returns the url for the Gateway for the WebSocket underlying subsequent JMS Connections.
-
– setGatewayLocation:
Sets the url for the WebSocket underlying subsequent JMS Connections.
-
– createConnection
Creates a connection with the default user identity. The connection is created in stopped mode. No messages will be delivered until the [KMConnection start] method is explicitly called.
-
– createConnectionWithListener:
Creates a connection with the default user identity. The connection is created in stopped mode. No messages will be delivered until the [KMConnection start] method is explicitly called.
-
– createConnectionWithClientID:
Creates a connection with the default user identity and clientID specified. The clientID is used to create a namespace for durable subscriber name. If clientID is not specified, then the durable subscriber name should be unique in the broker. However, if clientID is provided, then the durable subscriber names will be scoped by the clientID. The connection is created in stopped mode. No messages will be delivered until the [KMConnection start] method is explicitly called.
-
– createConnectionWithClientID:connectionListener:
Creates a connection with the default user identity and clientID specified. The clientID is used to create a namespace for durable subscriber name. If clientID is not specified, then the durable subscriber name should be unique in the broker. However, if clientID is provided, then the durable subscriber names will be scoped by the clientID. The connection is created in stopped mode. No messages will be delivered until the [KMConnection start] method is explicitly called.
-
– createConnectionWithUsername:password:
Creates a connection with the specified user identity. The connection is created in stopped mode. No messages will be delivered until the [KMConnection start] method is explicitly called.
-
– createConnectionWithUsername:password:connectionListener:
Creates a connection with the specified user identity. The connection is created in stopped mode. No messages will be delivered until the [KMConnection start] method is explicitly called.
-
– createConnectionWithUsername:password:clientID:
Creates a connection with the specified user identity and clientID. The clientID is used to create a namespace for durable subscriber name. If clientID is not specified, then the durable subscriber name should be unique in the broker. However, if clientID is provided, then the durable subscriber names will be scoped by the clientID. The connection is created in stopped mode. No messages will be delivered until the [KMConnection start] method is explicitly called.
-
– createConnectionWithUsername:password:clientID:connectionListener:
Creates a connection with the specified user identity and clientID. The clientID is used to create a namespace for durable subscriber name. If clientID is not specified, then the durable subscriber name should be unique in the broker. However, if clientID is provided, then the durable subscriber names will be scoped by the clientID. The connection is created in stopped mode. No messages will be delivered until the [KMConnection start] method is explicitly called.
Instance Methods
createConnection
Creates a connection with the default user identity. The connection is created in stopped mode. No messages will be delivered until the [KMConnection start] method is explicitly called.
- (KMConnection *)createConnection
Return Value
KMConnection object
Declared In
KMStompConnectionFactory.h
createConnectionWithClientID:
Creates a connection with the default user identity and clientID specified. The clientID is used to create a namespace for durable subscriber name. If clientID is not specified, then the durable subscriber name should be unique in the broker. However, if clientID is provided, then the durable subscriber names will be scoped by the clientID. The connection is created in stopped mode. No messages will be delivered until the [KMConnection start] method is explicitly called.
- (KMConnection *)createConnectionWithClientID:(NSString *)clientID
Parameters
- clientID
used to credurable subscriptions.
Return Value
KMConnection object
Declared In
KMStompConnectionFactory.h
createConnectionWithClientID:connectionListener:
Creates a connection with the default user identity and clientID specified. The clientID is used to create a namespace for durable subscriber name. If clientID is not specified, then the durable subscriber name should be unique in the broker. However, if clientID is provided, then the durable subscriber names will be scoped by the clientID. The connection is created in stopped mode. No messages will be delivered until the [KMConnection start] method is explicitly called.
- (KMConnection *)createConnectionWithClientID:(NSString *)clientID connectionListener:(id<KMStompConnectionListener>)connectionListener
Parameters
- clientID
used to credurable subscriptions.
- connectionListener
a delegate for observing connect, start, stop, and close events
Return Value
KMConnection object
Declared In
KMStompConnectionFactory.h
createConnectionWithListener:
Creates a connection with the default user identity. The connection is created in stopped mode. No messages will be delivered until the [KMConnection start] method is explicitly called.
- (KMConnection *)createConnectionWithListener:(id<KMStompConnectionListener>)connectionListener
Parameters
- connectionListener
a delegate for observing connect, start, stop, and close events
Return Value
KMConnection object
Declared In
KMStompConnectionFactory.h
createConnectionWithUsername:password:
Creates a connection with the specified user identity. The connection is created in stopped mode. No messages will be delivered until the [KMConnection start] method is explicitly called.
- (KMConnection *)createConnectionWithUsername:(NSString *)username password:(NSString *)password
Parameters
- username
the caller’s user name
- password
the caller’s password
Return Value
KMConnection object
Declared In
KMStompConnectionFactory.h
createConnectionWithUsername:password:clientID:
Creates a connection with the specified user identity and clientID. The clientID is used to create a namespace for durable subscriber name. If clientID is not specified, then the durable subscriber name should be unique in the broker. However, if clientID is provided, then the durable subscriber names will be scoped by the clientID. The connection is created in stopped mode. No messages will be delivered until the [KMConnection start] method is explicitly called.
- (KMConnection *)createConnectionWithUsername:(NSString *)username password:(NSString *)password clientID:(NSString *)clientID
Parameters
- username
the caller’s user name
- password
the caller’s password
- clientID
the clientID to use for durable subscriptions
Return Value
KMConnection object
Declared In
KMStompConnectionFactory.h
createConnectionWithUsername:password:clientID:connectionListener:
Creates a connection with the specified user identity and clientID. The clientID is used to create a namespace for durable subscriber name. If clientID is not specified, then the durable subscriber name should be unique in the broker. However, if clientID is provided, then the durable subscriber names will be scoped by the clientID. The connection is created in stopped mode. No messages will be delivered until the [KMConnection start] method is explicitly called.
- (KMConnection *)createConnectionWithUsername:(NSString *)username password:(NSString *)password clientID:(NSString *)clientID connectionListener:(id<KMStompConnectionListener>)connectionListener
Parameters
- username
the caller’s user name
- password
the caller’s password
- clientID
the clientID to use for durable subscriptions
- connectionListener
a delegate for observing connect, start, stop, and close events
Return Value
KMConnection object
Declared In
KMStompConnectionFactory.h
createConnectionWithUsername:password:connectionListener:
Creates a connection with the specified user identity. The connection is created in stopped mode. No messages will be delivered until the [KMConnection start] method is explicitly called.
- (KMConnection *)createConnectionWithUsername:(NSString *)username password:(NSString *)password connectionListener:(id<KMStompConnectionListener>)connectionListener
Parameters
- username
the caller’s user name
- password
the caller’s password
- connectionListener
a delegate for observing connect, start, stop, and close events
Return Value
KMConnection object
Declared In
KMStompConnectionFactory.h
gatewayLocation
Returns the url for the Gateway for the WebSocket underlying subsequent JMS Connections.
- (NSURL *)gatewayLocation
Return Value
NSURL representing the location of the Gateway
Declared In
KMStompConnectionFactory.h
initWithUrl:
Initializes the KMStompConnectionFactory with a url for the Gateway location.
- (id)initWithUrl:(NSURL *)url
Parameters
- url
the Gateway location
Return Value
id instance of KMStompConnectionFactory
Declared In
KMStompConnectionFactory.h
initWithUrl:properties:
Initializes the KMStompConnectionFactory with a url for the Gateway location.
- (id)initWithUrl:(NSURL *)url properties:(KMStompConnectionProperties *)properties
Parameters
- url
the Gateway location
- properties
Connection properties to specify timeout and reconnect behavior
Return Value
id instance of KMStompConnectionFactory
Declared In
KMStompConnectionFactory.h
setGatewayLocation:
Sets the url for the WebSocket underlying subsequent JMS Connections.
- (void)setGatewayLocation:(NSURL *)gatewayLocation
Parameters
- gatewayLocation
location of the Gateway
Declared In
KMStompConnectionFactory.h
setWebSocketFactory:
Sets the KGWebSocketFactory that will be used to create and establish WebSocket connections to send/receive data over WebSocket connection. When KMStompConnectionFactory is created, the KGWebSocketFactory is implicitly created. The function can be used to replace the default WebSocketFactory. Application developer can create WebSocketFactory externally, enable extensions, set parameter values and can provide the WebSocketFactory instance to the StompConnectionFactory.
- (void)setWebSocketFactory:(KGWebSocketFactory *)webSocketFactory
Parameters
- webSocketFactory
Instance of KGWebSocketFactory
Declared In
KMStompConnectionFactory.h
webSocketFactory
Returns the instance of underlying KGWebSocketFactory that is used to create and establish WebSocket connection to send/receive data over WebSocket connection.
- (KGWebSocketFactory *)webSocketFactory
Discussion
The KGWebSocketFactory instance can be used to set default enabled extensions and corresponding value of WebSocket extension parameter(s). For example, an application developer can use it to set the challenge handler on it for authentication purposes. Similarly, the factory can be used to set the value of parameters – device token and bundle id of the KGApnsExtension.
Declared In
KMStompConnectionFactory.h