예제 #1
0
 /**
  * Sets the virtual host.
  *
  * @throws NullPointerException if {@code virtualHost} is null
  */
 public ConnectionOptions withVirtualHost(String virtualHost) {
   factory.setVirtualHost(Assert.notNull(virtualHost, "virtualHost"));
   return this;
 }
예제 #2
0
 /**
  * Creates a new Options object for the {@code connectionFactory}.
  *
  * @throws NullPointerException if {@code connectionFactory} is null
  */
 public ConnectionOptions(ConnectionFactory connectionFactory) {
   this.factory = Assert.notNull(connectionFactory, "connectionFactory");
   withHost(factory.getHost());
 }
예제 #3
0
 /**
  * Sets the {@code sslProtocol} and {@code trustManager} to use.
  *
  * @throws NullPointerException if {@code sslProtocol} or {@code trustManager} are null
  */
 public ConnectionOptions withSslProtocol(String sslProtocol, TrustManager trustManager)
     throws NoSuchAlgorithmException, KeyManagementException {
   factory.useSslProtocol(
       Assert.notNull(sslProtocol, "sslProtocol"), Assert.notNull(trustManager, "trustManager"));
   return this;
 }
예제 #4
0
 /**
  * Sets the username.
  *
  * @throws NullPointerException if {@code username} is null
  */
 public ConnectionOptions withUsername(String username) {
   factory.setUsername(Assert.notNull(username, "username"));
   return this;
 }
예제 #5
0
 /**
  * Sets the connection name. Used for logging and consumer thread naming.
  *
  * @throws NullPointerException if {@code name} is null
  */
 public ConnectionOptions withName(String name) {
   this.name = Assert.notNull(name, "name");
   return this;
 }
예제 #6
0
 /**
  * Sets the SocketFactory to create connections with.
  *
  * @throws NullPointerException if {@code hosts} is null
  */
 public ConnectionOptions withSocketFactory(SocketFactory socketFactory) {
   factory.setSocketFactory(Assert.notNull(socketFactory, "socketFactory"));
   return this;
 }
예제 #7
0
 /**
  * Sets the {@code host}.
  *
  * @throws NullPointerException if {@code host} is null
  */
 public ConnectionOptions withHost(String host) {
   this.host = Assert.notNull(host, "host");
   return this;
 }
예제 #8
0
 /**
  * Sets the {@code hosts} to attempt connections to, in round-robin order.
  *
  * @throws NullPointerException if {@code hosts} is null
  */
 public ConnectionOptions withHosts(String... hosts) {
   this.addresses = Addresses.addressesFor(Assert.notNull(hosts, "hosts"), 5672);
   return this;
 }
예제 #9
0
 /**
  * Sets the executor used to handle consumer callbacks. The {@code executor} will not be shutdown
  * when a connection is closed.
  *
  * @throws NullPointerException if {@code executor} is null
  */
 public ConnectionOptions withConsumerExecutor(ExecutorService executor) {
   this.executor = Assert.notNull(executor, "executor");
   return this;
 }
예제 #10
0
 /**
  * Sets the {@code connectionFactory}.
  *
  * @throws NullPointerException if {@code connectionFactory} is null
  */
 public ConnectionOptions withConnectionFactory(ConnectionFactory connectionFactory) {
   this.factory = Assert.notNull(connectionFactory, "connectionFactory");
   return this;
 }
예제 #11
0
 /**
  * Sets the client properties.
  *
  * @throws NullPointerException if {@code clientProperties} is null
  */
 public ConnectionOptions withClientProperties(Map<String, Object> clientProperties) {
   factory.setClientProperties(Assert.notNull(clientProperties, "clientProperties"));
   return this;
 }
예제 #12
0
 /**
  * Sets the {@code addresses}.
  *
  * @param addresses formatted as "host1[:port],host2[:port]", etc.
  * @throws NullPointerException if {@code addresses} is null
  */
 public ConnectionOptions withAddresses(String addresses) {
   this.addresses = Address.parseAddresses(Assert.notNull(addresses, "addresses"));
   return this;
 }
예제 #13
0
 /**
  * Sets the {@code addresses} to attempt connections to, in round-robin order.
  *
  * @throws NullPointerException if {@code addresses} is null
  */
 public ConnectionOptions withAddresses(Address... addresses) {
   this.addresses = Assert.notNull(addresses, "addresses");
   return this;
 }