io.github.fallwizard.rabbitmq.mgmt.ConnectionOperations Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rabbitmq-mgmt Show documentation
Show all versions of rabbitmq-mgmt Show documentation
Manage your RabbitMQ services programmatically
The newest version!
package io.github.fallwizard.rabbitmq.mgmt;
import com.google.common.base.Optional;
import com.google.common.collect.Maps;
import io.github.fallwizard.rabbitmq.mgmt.model.Connection;
import java.util.Collection;
import java.util.Map;
public class ConnectionOperations extends BaseFluent {
public ConnectionOperations(HttpContext httpContext, RabbitMgmtService mgmtService) {
super(httpContext, mgmtService);
}
public Collection all(){
return HTTP.GET("/connections", CONNECTION_COLLECTION).get();
}
public Optional get(String name){
return HTTP.GET(String.format("/connections/%s", name), CONNECTION);
}
public ConnectionOperations forceDisconnect(String name){
HTTP.DELETE(String.format("/connections/%s", name));
return this;
}
public ConnectionOperations forceDisconnect(String name, String reason){
Map headers = Maps.newHashMap();
headers.put("X-Reason", reason);
HTTP.DELETE(String.format("/connections/%s", name), headers);
return this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy