io.github.fallwizard.rabbitmq.mgmt.model.federation.FederationPolicy 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.model.federation;
import io.github.fallwizard.rabbitmq.mgmt.model.BasePolicy;
/**
* @author Richard Clayton (Berico Technologies)
*/
public class FederationPolicy extends BasePolicy {
public FederationPolicy(){
setUseAllUpstreamConnections();
}
public void setUseAllUpstreamConnections(){
getDefinition().put("federation-upstream-set", "all");
}
public void setUpstreamConnectionSet(String upstreamSetName){
getDefinition().put("federation-upstream-set", upstreamSetName);
}
public void setUpstreamConnection(String upstreamConnectionName){
getDefinition().put("federation-upstream", upstreamConnectionName);
}
public static Builder builder(){ return new Builder(); }
public static class Builder extends BasePolicy.Builder {
public Builder() { super(new FederationPolicy()); }
public Builder upstream(String upstream){
this.policy.getDefinition().put("federation-upstream", upstream);
return self();
}
public Builder upstreamSet(String upstreamSetName){
this.policy.getDefinition().put("federation-upstream-set", upstreamSetName);
return self();
}
public Builder useAllUpstreams(){
this.policy.getDefinition().put("federation-upstream-set", "all");
return self();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy