|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.safmq.MQBuilder
public class MQBuilder
A static builder class which builds connections to SAFMQ servers and message queues.
In the case that a connection to a queue server is sought, use the method
MQBuilder.buildConnection(String url, String user, String password)
.
This method will evaluate the URL and create a new connection to the queue
server.
In the case that a connection to a message queue is sought, the use the
method MQBuilder.buildMessageQueue(String url, String user, String password)
.
This method will evaluate the URL and create a new connection tot he queue
server and wrap that connection with a MessageQueue
instance.
Field Summary | |
---|---|
static int |
DEF_PORT
The number of the default port for SAFMQ servers. |
static int |
DEF_SSL_PORT
|
static java.lang.String |
SAFMQ_PROTO
|
static java.lang.String |
SAFMQ_SSL_PROTO
|
Constructor Summary | |
---|---|
MQBuilder()
|
Method Summary | |
---|---|
static MQConnection |
buildConnection(java.net.URI uri,
java.lang.String user,
java.lang.String password)
Constructs a MQConnection |
static MQConnection |
buildConnection(java.net.URI uri,
java.lang.String user,
java.lang.String password,
javax.net.ssl.SSLContext ctx)
Constructs a MQConnection |
static MessageQueue |
buildMessageQueue(java.net.URI uri,
java.lang.String user,
java.lang.String password)
Constructs a new MQConnection connection object and then a
MessageQueue to wrap it. |
static MessageQueue |
buildMessageQueue(java.net.URI uri,
java.lang.String user,
java.lang.String password,
javax.net.ssl.SSLContext ctx)
Constructs a new MQConnection connection object and then a
MessageQueue to wrap it. |
static void |
setSSLContext(javax.net.ssl.SSLContext ctx)
Sets the SSLContext object for use in SSL communications. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int DEF_PORT
public static final int DEF_SSL_PORT
public static final java.lang.String SAFMQ_PROTO
public static final java.lang.String SAFMQ_SSL_PROTO
Constructor Detail |
---|
public MQBuilder()
Method Detail |
---|
public static MQConnection buildConnection(java.net.URI uri, java.lang.String user, java.lang.String password) throws MQException, java.io.IOException
MQConnection connection object connected to a
SAFMQ server.
- Parameters:
uri
- The URI of the message queue object in the format:
protocol://user:password@server-name:port/
where the ":port" , "user", and "password" portion of the url
is optional. Valid selections for "protocol" are "safmq" for
a clear text connection and "safmqs" for a SSL encrypted connection.user
- [optional] The name of the user which is connecting to the server, used if
not specified in the uripassword
- [optional] The password of the user which is connecting to the server, used if
not specified in the uri
- Returns:
- A valid
MQConnection connection object connected to
a SAFMQ server.
- Throws:
MQException
- In the case that the server refuses the supplied
login credintials, or in the case that the URL could not be correctly
parsed. See MQConnection.MQConnection(String,int,String,String) for
details on connection errors.
java.io.IOException
- In the case that there is a network error attempting
to connect to the server via the TCP/IP network.- See Also:
MQConnection.MQConnection(Socket,String,String)
public static MQConnection buildConnection(java.net.URI uri, java.lang.String user, java.lang.String password, javax.net.ssl.SSLContext ctx) throws MQException, java.io.IOException
MQConnection connection object connected to a
SAFMQ server.
- Parameters:
uri
- The URI of the message queue object in the format:
protocol://user:password@server-name:port/
where the ":port" , "user", and "password" portion of the url
is optional. Valid selections for "protocol" are "safmq" for
a clear text connection and "safmqs" for a SSL encrypted connection.user
- [optional] The name of the user which is connecting to the server, used if
not specified in the uripassword
- [optional] The password of the user which is connecting to the server, used if
not specified in the urictx
- [optional] A SSLContext to use when connecting via SSL. This will override
the contex set by calling MQCOnnection.setSSLContext(SSLContext).
- Returns:
- A valid
MQConnection connection object connected to
a SAFMQ server.
- Throws:
MQException
- In the case that the server refuses the supplied
login credintials, or in the case that the URL could not be correctly
parsed. See MQConnection.MQConnection(String,int,String,String) for
details on connection errors.
java.io.IOException
- In the case that there is a network error attempting
to connect to the server via the TCP/IP network.- See Also:
MQConnection.MQConnection(Socket,String,String)
public static MessageQueue buildMessageQueue(java.net.URI uri, java.lang.String user, java.lang.String password) throws MQException, java.io.IOException
MQConnection
connection object and then a
MessageQueue
to wrap it.
uri
- The URI of the message queue object in the format:
protocol://user:password@server-name:port/queue
where the ":port" , "user", and "password" portion of the url
is optional. Valid selections for "protocol" are "safmq" for
a clear text connection and "safmqs" for a SSL encrypted connection.user
- [optional] The name of the user which is connecting to the server, used if
not specified in the uripassword
- [optional] The password of the user which is connecting to the server, used if
not specified in the uri
MessageQueue
connected to a message queue
on a SAFMQ server.
MQException
- In the case that the server refuses the supplied
login credintials, or in the case that the URL could not be correctly
parsed. See errors from MQConnection(String,String,String) and
MQConnection.OpenQueue(String,QueueHandle).
java.io.IOException
- In the case that there is a network error attempting
to connect to the server via the TCP/IP network.MQConnection.MQConnection(Socket,String,String)
,
MQConnection.OpenQueue(String,QueueHandle)
public static MessageQueue buildMessageQueue(java.net.URI uri, java.lang.String user, java.lang.String password, javax.net.ssl.SSLContext ctx) throws MQException, java.io.IOException
MQConnection
connection object and then a
MessageQueue
to wrap it.
uri
- The URI of the message queue object in the format:
protocol://user:password@server-name:port/queue
where the ":port" , "user", and "password" portion of the url
is optional. Valid selections for "protocol" are "safmq" for
a clear text connection and "safmqs" for a SSL encrypted connection.user
- [optional] The name of the user which is connecting to the server, used if
not specified in the uripassword
- [optional] The password of the user which is connecting to the server, used if
not specified in the urictx
- [optional] A SSLContext to use when connecting via SSL. This will override
the contex set by calling MQCOnnection.setSSLContext(SSLContext).
MessageQueue
connected to a message queue
on a SAFMQ server.
MQException
- In the case that the server refuses the supplied
login credintials, or in the case that the URL could not be correctly
parsed. See errors from MQConnection(String,String,String) and
MQConnection.OpenQueue(String,QueueHandle).
java.io.IOException
- In the case that there is a network error attempting
to connect to the server via the TCP/IP network.MQConnection.MQConnection(Socket,String,String)
,
MQConnection.OpenQueue(String,QueueHandle)
public static void setSSLContext(javax.net.ssl.SSLContext ctx)
ctx
- The SSLContext to use. Specifying null will cause the use of the default
SSLContext.
|
Copyright Matthew J. Battey, 2004-2010; Powered By: |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |