Class RestTemplateNodeLocator
java.lang.Object
org.springframework.amqp.rabbit.connection.RestTemplateNodeLocator
- All Implemented Interfaces:
LocalizedQueueConnectionFactory.NodeLocator<org.springframework.amqp.rabbit.connection.RestTemplateHolder>
public class RestTemplateNodeLocator
extends Object
implements LocalizedQueueConnectionFactory.NodeLocator<org.springframework.amqp.rabbit.connection.RestTemplateHolder>
A
LocalizedQueueConnectionFactory.NodeLocator
using the RestTemplate
.- Since:
- 3.0
- Author:
- Gary Russell
-
Field Summary
Fields inherited from interface org.springframework.amqp.rabbit.connection.LocalizedQueueConnectionFactory.NodeLocator
LOGGER
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close
(org.springframework.amqp.rabbit.connection.RestTemplateHolder client) Close the client.org.springframework.amqp.rabbit.connection.RestTemplateHolder
createClient
(String userName, String password) Create a client for subsequent use.restCall
(org.springframework.amqp.rabbit.connection.RestTemplateHolder client, String baseUri, String vhost, String queue) Retrieve a map of queue properties using the RabbitMQ Management REST API.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.amqp.rabbit.connection.LocalizedQueueConnectionFactory.NodeLocator
locate
-
Constructor Details
-
RestTemplateNodeLocator
public RestTemplateNodeLocator()
-
-
Method Details
-
createClient
public org.springframework.amqp.rabbit.connection.RestTemplateHolder createClient(String userName, String password) Description copied from interface:LocalizedQueueConnectionFactory.NodeLocator
Create a client for subsequent use.- Specified by:
createClient
in interfaceLocalizedQueueConnectionFactory.NodeLocator<org.springframework.amqp.rabbit.connection.RestTemplateHolder>
- Parameters:
userName
- the user name.password
- the password.- Returns:
- the client.
-
restCall
@Nullable public Map<String,Object> restCall(org.springframework.amqp.rabbit.connection.RestTemplateHolder client, String baseUri, String vhost, String queue) throws URISyntaxException Description copied from interface:LocalizedQueueConnectionFactory.NodeLocator
Retrieve a map of queue properties using the RabbitMQ Management REST API.- Specified by:
restCall
in interfaceLocalizedQueueConnectionFactory.NodeLocator<org.springframework.amqp.rabbit.connection.RestTemplateHolder>
- Parameters:
client
- the client.baseUri
- the base uri.vhost
- the virtual host.queue
- the queue name.- Returns:
- the map of queue properties.
- Throws:
URISyntaxException
- if the syntax is bad.
-
close
public void close(org.springframework.amqp.rabbit.connection.RestTemplateHolder client) Description copied from interface:LocalizedQueueConnectionFactory.NodeLocator
Close the client.- Specified by:
close
in interfaceLocalizedQueueConnectionFactory.NodeLocator<org.springframework.amqp.rabbit.connection.RestTemplateHolder>
- Parameters:
client
- the client.
-