|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.rabbitmq.client.ConnectionFactory
public class ConnectionFactory
Convenience "factory" class to facilitate opening a Connection
to an AMQP broker.
Field Summary | |
---|---|
static int |
DEFAULT_AMQP_OVER_SSL_PORT
The default port to use for AMQP connections when using SSL |
static int |
DEFAULT_AMQP_PORT
The default port to use for AMQP connections when not using SSL |
static int |
DEFAULT_CHANNEL_MAX
Default value for the desired maximum channel number; zero for unlimited |
static int |
DEFAULT_FRAME_MAX
Default value for the desired maximum frame size; zero for unlimited |
static int |
DEFAULT_HEARTBEAT
Default value for desired heartbeat interval; zero for none |
static java.lang.String |
DEFAULT_HOST
The default host to connect to |
static java.lang.String |
DEFAULT_PASS
Default password |
static java.lang.String |
DEFAULT_SSL_PROTOCOL
The default SSL protocol (currently "SSLv3"). |
static java.lang.String |
DEFAULT_USER
Default user name |
static java.lang.String |
DEFAULT_VHOST
Default virtual host |
static int |
USE_DEFAULT_PORT
A constant that when passed as a port number causes the connection to use the default port |
Constructor Summary | |
---|---|
ConnectionFactory()
Instantiate a ConnectionFactory with a default set of parameters. |
Method Summary | |
---|---|
ConnectionFactory |
clone()
|
protected void |
configureSocket(java.net.Socket socket)
Provides a hook to insert custom configuration of the sockets used to connect to an AMQP server before they connect. |
protected FrameHandler |
createFrameHandler(Address addr)
|
protected FrameHandler |
createFrameHandler(java.net.Socket sock)
|
java.util.Map<java.lang.String,java.lang.Object> |
getClientProperties()
Retrieve the currently-configured table of client properties that will be sent to the server during connection startup. |
java.lang.String |
getHost()
|
java.lang.String |
getPassword()
Retrieve the password. |
int |
getPort()
|
int |
getRequestedChannelMax()
Retrieve the requested maximum channel number |
int |
getRequestedFrameMax()
Retrieve the requested maximum frame size |
int |
getRequestedHeartbeat()
Retrieve the requested heartbeat interval. |
javax.net.SocketFactory |
getSocketFactory()
Retrieve the socket factory used to make connections with. |
java.lang.String |
getUsername()
Retrieve the user name. |
java.lang.String |
getVirtualHost()
Retrieve the virtual host. |
boolean |
isSSL()
|
Connection |
newConnection()
Create a new broker connection |
Connection |
newConnection(Address[] addrs)
Create a new broker connection |
void |
setClientProperties(java.util.Map<java.lang.String,java.lang.Object> clientProperties)
Replace the table of client properties that will be sent to the server during subsequent connection startups. |
void |
setHost(java.lang.String host)
|
void |
setPassword(java.lang.String password)
Set the password. |
void |
setPort(int port)
Set the target port. |
void |
setRequestedChannelMax(int requestedChannelMax)
Set the requested maximum channel number |
void |
setRequestedFrameMax(int requestedFrameMax)
Set the requested maximum frame size |
void |
setRequestedHeartbeat(int requestedHeartbeat)
Set the requested heartbeat. |
void |
setSocketFactory(javax.net.SocketFactory factory)
Set the socket factory used to make connections with. |
void |
setUsername(java.lang.String username)
Set the user name. |
void |
setVirtualHost(java.lang.String virtualHost)
Set the virtual host. |
void |
useSslProtocol()
Convenience method for setting up a SSL socket factory, using the DEFAULT_SSL_PROTOCOL and a trusting TrustManager. |
void |
useSslProtocol(javax.net.ssl.SSLContext context)
Convenience method for setting up an SSL socket factory. |
void |
useSslProtocol(java.lang.String protocol)
Convenience method for setting up a SSL socket factory, using the DEFAULT_SSL_PROTOCOL and a trusting TrustManager. |
void |
useSslProtocol(java.lang.String protocol,
javax.net.ssl.TrustManager trustManager)
Convenience method for setting up an SSL socket factory. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_USER
public static final java.lang.String DEFAULT_PASS
public static final java.lang.String DEFAULT_VHOST
public static final int DEFAULT_CHANNEL_MAX
public static final int DEFAULT_FRAME_MAX
public static final int DEFAULT_HEARTBEAT
public static final java.lang.String DEFAULT_HOST
public static final int USE_DEFAULT_PORT
public static final int DEFAULT_AMQP_PORT
public static final int DEFAULT_AMQP_OVER_SSL_PORT
public static final java.lang.String DEFAULT_SSL_PROTOCOL
Constructor Detail |
---|
public ConnectionFactory()
Method Detail |
---|
public java.lang.String getHost()
public void setHost(java.lang.String host)
host
- the default host to use for connectionspublic int getPort()
public void setPort(int port)
port
- the default port to use for connectionspublic java.lang.String getUsername()
public void setUsername(java.lang.String username)
username
- the AMQP user name to use when connecting to the brokerpublic java.lang.String getPassword()
public void setPassword(java.lang.String password)
password
- the password to use when connecting to the brokerpublic java.lang.String getVirtualHost()
public void setVirtualHost(java.lang.String virtualHost)
virtualHost
- the virtual host to use when connecting to the brokerpublic int getRequestedChannelMax()
public void setRequestedChannelMax(int requestedChannelMax)
requestedChannelMax
- initially requested maximum channel number; zero for unlimitedpublic int getRequestedFrameMax()
public void setRequestedFrameMax(int requestedFrameMax)
requestedFrameMax
- initially requested maximum frame size, in octets; zero for unlimitedpublic int getRequestedHeartbeat()
public void setRequestedHeartbeat(int requestedHeartbeat)
requestedHeartbeat
- the initially requested heartbeat interval, in seconds; zero for nonepublic java.util.Map<java.lang.String,java.lang.Object> getClientProperties()
setClientProperties(java.util.Map)
public void setClientProperties(java.util.Map<java.lang.String,java.lang.Object> clientProperties)
clientProperties
- the map of extra client propertiesgetClientProperties()
public javax.net.SocketFactory getSocketFactory()
public void setSocketFactory(javax.net.SocketFactory factory)
useSslProtocol()
public boolean isSSL()
public void useSslProtocol() throws java.security.NoSuchAlgorithmException, java.security.KeyManagementException
java.security.NoSuchAlgorithmException
java.security.KeyManagementException
public void useSslProtocol(java.lang.String protocol) throws java.security.NoSuchAlgorithmException, java.security.KeyManagementException
java.security.NoSuchAlgorithmException
java.security.KeyManagementException
public void useSslProtocol(java.lang.String protocol, javax.net.ssl.TrustManager trustManager) throws java.security.NoSuchAlgorithmException, java.security.KeyManagementException
protocol
- SSL protocol to use.
java.security.NoSuchAlgorithmException
java.security.KeyManagementException
public void useSslProtocol(javax.net.ssl.SSLContext context)
context
- An initialized SSLContextprotected FrameHandler createFrameHandler(Address addr) throws java.io.IOException
java.io.IOException
protected FrameHandler createFrameHandler(java.net.Socket sock) throws java.io.IOException
java.io.IOException
protected void configureSocket(java.net.Socket socket) throws java.io.IOException
socket
- The socket that is to be used for the Connection
java.io.IOException
public Connection newConnection(Address[] addrs) throws java.io.IOException
addrs
- an array of known broker addresses (hostname/port pairs) to try in order
java.io.IOException
- if it encounters a problempublic Connection newConnection() throws java.io.IOException
java.io.IOException
- if it encounters a problempublic ConnectionFactory clone()
clone
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |