class safmq::MQFactory

A factory class which is used to construct connections to safmq servers and message queues

Child Classes

A factory class which is used to construct connections to safmq servers and message queues

This class has no child classes.

Public Methods

[more]MQConnection* BuildConnection(const std::string& serverurl, const std::string& user, const std::string& password, tcpsocket::SSLContext* pCtx) throw(ErrorCode, MQFactoryException, tcpsocket::SocketException)
Establishes a connection to a safmq server.
[more]MessageQueue* BuildQueueConnection(const std::string& queueurl, const std::string& user, const std::string& password, tcpsocket::SSLContext* pCtx) throw(ErrorCode, MQFactoryException, tcpsocket::SocketException)
Establishes a connection to a safmq server and opens a queue.

Member Documentation


MQConnection* BuildConnection (const std::string& serverurl, const std::string& user, const std::string& password, tcpsocket::SSLContext* pCtx) throw(ErrorCode, MQFactoryException, tcpsocket::SocketException)
Establishes a connection to a safmq server. The parameter serverurl has the form:
safmq://user:password@server:port -or-
safmqs://user:password@server:port

Note that the protocol specification "safmq" and "safmqs" are optional as well as the user, password and password portions, leaving the minimum url to be "//server". If the user and password are not specified in the url the parameters user and password will used instead. Defaults are used in cases where they are not specified.

Note: if ssl has not been compiled into the safmq library, using the safmqs protocol will result in an error.

Throws:
ErrorCode - thrown if an error occurs logging in
MQFactorException - Thrown if the url cannot be understood
tcpsocket::SocketException - Thrown if there is a network error
Parameters:
serverurl - [in] The url locating the safmq server
user - [in,optional] The user name to login with, if not specified in the url
password - [in,optional] The password to login with, if not specified in the url
pCtx - [in,optional] The tcpsocket::SSLContext specifying the SSL environment
Returns:
A MQConnection connected to the safmq server


MessageQueue* BuildQueueConnection (const std::string& queueurl, const std::string& user, const std::string& password, tcpsocket::SSLContext* pCtx) throw(ErrorCode, MQFactoryException, tcpsocket::SocketException)
Establishes a connection to a safmq server and opens a queue. The parameter serverurl has the form:
safmq://user:password@server:port/queue -or-
safmqs://user:password@server:port/queue

Note that the protocol specification "safmq" and "safmqs" are optional as well as the user, password and password portions, leaving the minimum url to be "//server/queue". If the user and password are not specified in the url the parameters user and password will used instead. Defaults are used in cases where they are not specified.

Note: if ssl has not been compiled into the safmq library, using the safmqs protocol will result in an error.

Throws:
ErrorCode - thrown if an error occurs logging in, or if the user cannot access the queue
MQFactorException - Thrown if the url cannot be understood
tcpsocket::SocketException - Thrown if there is a network error
Parameters:
queueurl - [in] The url locating the safmq server and queue
user - [in,optional] The user name to login with, if not specified in the url
password - [in,optional] The password to login with, if not specified in the url
pCtx - [in,optional] The tcpsocket::SSLContext specifying the SSL environment
Returns:
A MQConnection connected to the safmq server

Table of Contents HTML hierarchy of classes or Java


Safmq Documentation, copyright (c) 2004-2010 Matthew J. Battey, Licensed Under Apache License Ver 2.0
Powered By: Get SAFMQ: Store and Forward Message Queue at SourceForge.net. Fast, secure and Free Open Source software downloads