|
|||||||||
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.
Constructor Summary | |
---|---|
ConnectionFactory()
|
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. |
int |
getConnectionTimeout()
Retrieve the connection timeout. |
java.lang.String |
getHost()
|
int |
getNumConsumerThreads()
|
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. |
SaslConfig |
getSaslConfig()
Gets the sasl config to use when authenticating |
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(java.util.concurrent.ExecutorService executor)
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 |
setConnectionTimeout(int connectionTimeout)
Set the connection timeout. |
void |
setHost(java.lang.String host)
|
void |
setNumConsumerThreads(int numConsumerThreads)
|
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 |
setSaslConfig(SaslConfig saslConfig)
Sets the sasl config to use when authenticating |
void |
setSocketFactory(javax.net.SocketFactory factory)
Set the socket factory used to make connections with. |
void |
setUri(java.lang.String uriString)
Convenience method for setting the fields in an AMQP URI: host, port, username, password and virtual host. |
void |
setUri(java.net.URI uri)
Convenience method for setting the fields in an AMQP URI: host, port, username, password and virtual host. |
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 supplied protocol and a very 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 |
Constructor Detail |
---|
public ConnectionFactory()
Method Detail |
---|
public int getNumConsumerThreads()
ExecutorService
public void setNumConsumerThreads(int numConsumerThreads)
numConsumerThreads
- threads in created private executor servicepublic 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 void setUri(java.net.URI uri) throws java.net.URISyntaxException, java.security.NoSuchAlgorithmException, java.security.KeyManagementException
uri
- is the AMQP URI containing the data
java.net.URISyntaxException
java.security.NoSuchAlgorithmException
java.security.KeyManagementException
public void setUri(java.lang.String uriString) throws java.net.URISyntaxException, java.security.NoSuchAlgorithmException, java.security.KeyManagementException
uriString
- is the AMQP URI containing the data
java.net.URISyntaxException
java.security.NoSuchAlgorithmException
java.security.KeyManagementException
public 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 setConnectionTimeout(int connectionTimeout)
connectionTimeout
- connection establishment timeout in milliseconds; zero for infinitepublic int getConnectionTimeout()
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 SaslConfig getSaslConfig()
SaslConfig
public void setSaslConfig(SaslConfig saslConfig)
saslConfig
- SaslConfig
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() throws java.io.IOException
java.io.IOException
- if it encounters a problempublic Connection newConnection(java.util.concurrent.ExecutorService executor) throws java.io.IOException
executor
- thread execution service for consumers on the connection
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 |