
com.indeed.rabbitmq.admin.pojo.ShovelArguments Maven / Gradle / Ivy
package com.indeed.rabbitmq.admin.pojo;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonPropertyDescription;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.fasterxml.jackson.annotation.JsonValue;
/**
* The shovel declaration.
*
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({
"src-uri",
"src-queue",
"src-exchange",
"src-exchange-key",
"dest-uri",
"dest-queue",
"dest-exchange",
"dest-exchange-key",
"prefetch-count",
"reconnect-delay",
"add-forward-headers",
"ack-mode",
"delete-after"
})
public class ShovelArguments {
/**
* The AMQP URIs for the source RabbitMQ services.
*
*/
@JsonProperty("src-uri")
@JsonPropertyDescription("The AMQP URIs for the source RabbitMQ services.")
private List srcUri = new ArrayList();
/**
* The queue to consume.
* If defined then "src-exchange" must be undefined.
*
*/
@JsonProperty("src-queue")
@JsonPropertyDescription("The queue to consume.\nIf defined then \"src-exchange\" must be undefined.")
private String srcQueue;
/**
* The exchange to consume.
* If defined then "src-queue" must be undefined.
*
*/
@JsonProperty("src-exchange")
@JsonPropertyDescription("The exchange to consume.\nIf defined then \"src-queue\" must be undefined.")
private String srcExchange;
/**
* The routing key when using "src-exchange".
*
*/
@JsonProperty("src-exchange-key")
@JsonPropertyDescription("The routing key when using \"src-exchange\".")
private String srcExchangeKey;
/**
* The AMQP URIs for the destination RabbitMQ services.
*
*/
@JsonProperty("dest-uri")
@JsonPropertyDescription("The AMQP URIs for the destination RabbitMQ services.")
private List destUri = new ArrayList();
/**
* The queue to which messages should be published.
* If defined then "dest-exchange" must be undefined.
*
*/
@JsonProperty("dest-queue")
@JsonPropertyDescription("The queue to which messages should be published.\nIf defined then \"dest-exchange\" must be undefined.")
private String destQueue;
/**
* The exchange to which message should be published.
* If defined then "dest-queue" must be undefined.
*
*/
@JsonProperty("dest-exchange")
@JsonPropertyDescription("The exchange to which message should be published.\nIf defined then \"dest-queue\" must be undefined.")
private String destExchange;
/**
* The routing key to use when using "dest-exchange".
* If undefined the routing key on the original message is used.
*
*/
@JsonProperty("dest-exchange-key")
@JsonPropertyDescription("The routing key to use when using \"dest-exchange\".\nIf undefined the routing key on the original message is used.")
private String destExchangeKey;
/**
* The maximum number of unconfirmed messages to copy over this shovel.
*
*/
@JsonProperty("prefetch-count")
@JsonPropertyDescription("The maximum number of unconfirmed messages to copy over this shovel.")
private Long prefetchCount;
/**
* The duration, in seconds, to wait to reconnect to a broker after being disconnected.
*
*/
@JsonProperty("reconnect-delay")
@JsonPropertyDescription("The duration, in seconds, to wait to reconnect to a broker after being disconnected.")
private Long reconnectDelay;
/**
* If true then add "x-shovelled" headers to each shovelled message.
*
*/
@JsonProperty("add-forward-headers")
@JsonPropertyDescription("If true then add \"x-shovelled\" headers to each shovelled message.")
private Boolean addForwardHeaders;
/**
* Determines how the shovel should acknowledge messages.
*
*/
@JsonProperty("ack-mode")
@JsonPropertyDescription("Determines how the shovel should acknowledge messages.")
private ShovelArguments.AckMode ackMode;
/**
* Determines when (if ever) the shovel should delete itself.
* If "never" then the shovel will never delete itself.
* If "queue-length" the shovel transfers the number of
* messages that existed in the queue when it started up.
* An integer indicates the number of messages to transfer.
*
*/
@JsonProperty("delete-after")
@JsonPropertyDescription("Determines when (if ever) the shovel should delete itself.\nIf \"never\" then the shovel will never delete itself.\nIf \"queue-length\" the shovel transfers the number of\nmessages that existed in the queue when it started up.\nAn integer indicates the number of messages to transfer.")
private String deleteAfter;
@JsonIgnore
private Map additionalProperties = new HashMap();
/**
* The AMQP URIs for the source RabbitMQ services.
*
*/
@JsonProperty("src-uri")
public List getSrcUri() {
return srcUri;
}
/**
* The AMQP URIs for the source RabbitMQ services.
*
*/
@JsonProperty("src-uri")
public void setSrcUri(List srcUri) {
this.srcUri = srcUri;
}
public ShovelArguments withSrcUri(List srcUri) {
this.srcUri = srcUri;
return this;
}
/**
* The queue to consume.
* If defined then "src-exchange" must be undefined.
*
*/
@JsonProperty("src-queue")
public String getSrcQueue() {
return srcQueue;
}
/**
* The queue to consume.
* If defined then "src-exchange" must be undefined.
*
*/
@JsonProperty("src-queue")
public void setSrcQueue(String srcQueue) {
this.srcQueue = srcQueue;
}
public ShovelArguments withSrcQueue(String srcQueue) {
this.srcQueue = srcQueue;
return this;
}
/**
* The exchange to consume.
* If defined then "src-queue" must be undefined.
*
*/
@JsonProperty("src-exchange")
public String getSrcExchange() {
return srcExchange;
}
/**
* The exchange to consume.
* If defined then "src-queue" must be undefined.
*
*/
@JsonProperty("src-exchange")
public void setSrcExchange(String srcExchange) {
this.srcExchange = srcExchange;
}
public ShovelArguments withSrcExchange(String srcExchange) {
this.srcExchange = srcExchange;
return this;
}
/**
* The routing key when using "src-exchange".
*
*/
@JsonProperty("src-exchange-key")
public String getSrcExchangeKey() {
return srcExchangeKey;
}
/**
* The routing key when using "src-exchange".
*
*/
@JsonProperty("src-exchange-key")
public void setSrcExchangeKey(String srcExchangeKey) {
this.srcExchangeKey = srcExchangeKey;
}
public ShovelArguments withSrcExchangeKey(String srcExchangeKey) {
this.srcExchangeKey = srcExchangeKey;
return this;
}
/**
* The AMQP URIs for the destination RabbitMQ services.
*
*/
@JsonProperty("dest-uri")
public List getDestUri() {
return destUri;
}
/**
* The AMQP URIs for the destination RabbitMQ services.
*
*/
@JsonProperty("dest-uri")
public void setDestUri(List destUri) {
this.destUri = destUri;
}
public ShovelArguments withDestUri(List destUri) {
this.destUri = destUri;
return this;
}
/**
* The queue to which messages should be published.
* If defined then "dest-exchange" must be undefined.
*
*/
@JsonProperty("dest-queue")
public String getDestQueue() {
return destQueue;
}
/**
* The queue to which messages should be published.
* If defined then "dest-exchange" must be undefined.
*
*/
@JsonProperty("dest-queue")
public void setDestQueue(String destQueue) {
this.destQueue = destQueue;
}
public ShovelArguments withDestQueue(String destQueue) {
this.destQueue = destQueue;
return this;
}
/**
* The exchange to which message should be published.
* If defined then "dest-queue" must be undefined.
*
*/
@JsonProperty("dest-exchange")
public String getDestExchange() {
return destExchange;
}
/**
* The exchange to which message should be published.
* If defined then "dest-queue" must be undefined.
*
*/
@JsonProperty("dest-exchange")
public void setDestExchange(String destExchange) {
this.destExchange = destExchange;
}
public ShovelArguments withDestExchange(String destExchange) {
this.destExchange = destExchange;
return this;
}
/**
* The routing key to use when using "dest-exchange".
* If undefined the routing key on the original message is used.
*
*/
@JsonProperty("dest-exchange-key")
public String getDestExchangeKey() {
return destExchangeKey;
}
/**
* The routing key to use when using "dest-exchange".
* If undefined the routing key on the original message is used.
*
*/
@JsonProperty("dest-exchange-key")
public void setDestExchangeKey(String destExchangeKey) {
this.destExchangeKey = destExchangeKey;
}
public ShovelArguments withDestExchangeKey(String destExchangeKey) {
this.destExchangeKey = destExchangeKey;
return this;
}
/**
* The maximum number of unconfirmed messages to copy over this shovel.
*
*/
@JsonProperty("prefetch-count")
public Long getPrefetchCount() {
return prefetchCount;
}
/**
* The maximum number of unconfirmed messages to copy over this shovel.
*
*/
@JsonProperty("prefetch-count")
public void setPrefetchCount(Long prefetchCount) {
this.prefetchCount = prefetchCount;
}
public ShovelArguments withPrefetchCount(Long prefetchCount) {
this.prefetchCount = prefetchCount;
return this;
}
/**
* The duration, in seconds, to wait to reconnect to a broker after being disconnected.
*
*/
@JsonProperty("reconnect-delay")
public Long getReconnectDelay() {
return reconnectDelay;
}
/**
* The duration, in seconds, to wait to reconnect to a broker after being disconnected.
*
*/
@JsonProperty("reconnect-delay")
public void setReconnectDelay(Long reconnectDelay) {
this.reconnectDelay = reconnectDelay;
}
public ShovelArguments withReconnectDelay(Long reconnectDelay) {
this.reconnectDelay = reconnectDelay;
return this;
}
/**
* If true then add "x-shovelled" headers to each shovelled message.
*
*/
@JsonProperty("add-forward-headers")
public Boolean getAddForwardHeaders() {
return addForwardHeaders;
}
/**
* If true then add "x-shovelled" headers to each shovelled message.
*
*/
@JsonProperty("add-forward-headers")
public void setAddForwardHeaders(Boolean addForwardHeaders) {
this.addForwardHeaders = addForwardHeaders;
}
public ShovelArguments withAddForwardHeaders(Boolean addForwardHeaders) {
this.addForwardHeaders = addForwardHeaders;
return this;
}
/**
* Determines how the shovel should acknowledge messages.
*
*/
@JsonProperty("ack-mode")
public ShovelArguments.AckMode getAckMode() {
return ackMode;
}
/**
* Determines how the shovel should acknowledge messages.
*
*/
@JsonProperty("ack-mode")
public void setAckMode(ShovelArguments.AckMode ackMode) {
this.ackMode = ackMode;
}
public ShovelArguments withAckMode(ShovelArguments.AckMode ackMode) {
this.ackMode = ackMode;
return this;
}
/**
* Determines when (if ever) the shovel should delete itself.
* If "never" then the shovel will never delete itself.
* If "queue-length" the shovel transfers the number of
* messages that existed in the queue when it started up.
* An integer indicates the number of messages to transfer.
*
*/
@JsonProperty("delete-after")
public String getDeleteAfter() {
return deleteAfter;
}
/**
* Determines when (if ever) the shovel should delete itself.
* If "never" then the shovel will never delete itself.
* If "queue-length" the shovel transfers the number of
* messages that existed in the queue when it started up.
* An integer indicates the number of messages to transfer.
*
*/
@JsonProperty("delete-after")
public void setDeleteAfter(String deleteAfter) {
this.deleteAfter = deleteAfter;
}
public ShovelArguments withDeleteAfter(String deleteAfter) {
this.deleteAfter = deleteAfter;
return this;
}
@JsonAnyGetter
public Map getAdditionalProperties() {
return this.additionalProperties;
}
@JsonAnySetter
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
public ShovelArguments withAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(ShovelArguments.class.getName()).append('@').append(Integer.toHexString(System.identityHashCode(this))).append('[');
sb.append("srcUri");
sb.append('=');
sb.append(((this.srcUri == null)?"":this.srcUri));
sb.append(',');
sb.append("srcQueue");
sb.append('=');
sb.append(((this.srcQueue == null)?"":this.srcQueue));
sb.append(',');
sb.append("srcExchange");
sb.append('=');
sb.append(((this.srcExchange == null)?"":this.srcExchange));
sb.append(',');
sb.append("srcExchangeKey");
sb.append('=');
sb.append(((this.srcExchangeKey == null)?"":this.srcExchangeKey));
sb.append(',');
sb.append("destUri");
sb.append('=');
sb.append(((this.destUri == null)?"":this.destUri));
sb.append(',');
sb.append("destQueue");
sb.append('=');
sb.append(((this.destQueue == null)?"":this.destQueue));
sb.append(',');
sb.append("destExchange");
sb.append('=');
sb.append(((this.destExchange == null)?"":this.destExchange));
sb.append(',');
sb.append("destExchangeKey");
sb.append('=');
sb.append(((this.destExchangeKey == null)?"":this.destExchangeKey));
sb.append(',');
sb.append("prefetchCount");
sb.append('=');
sb.append(((this.prefetchCount == null)?"":this.prefetchCount));
sb.append(',');
sb.append("reconnectDelay");
sb.append('=');
sb.append(((this.reconnectDelay == null)?"":this.reconnectDelay));
sb.append(',');
sb.append("addForwardHeaders");
sb.append('=');
sb.append(((this.addForwardHeaders == null)?"":this.addForwardHeaders));
sb.append(',');
sb.append("ackMode");
sb.append('=');
sb.append(((this.ackMode == null)?"":this.ackMode));
sb.append(',');
sb.append("deleteAfter");
sb.append('=');
sb.append(((this.deleteAfter == null)?"":this.deleteAfter));
sb.append(',');
sb.append("additionalProperties");
sb.append('=');
sb.append(((this.additionalProperties == null)?"":this.additionalProperties));
sb.append(',');
if (sb.charAt((sb.length()- 1)) == ',') {
sb.setCharAt((sb.length()- 1), ']');
} else {
sb.append(']');
}
return sb.toString();
}
@Override
public int hashCode() {
int result = 1;
result = ((result* 31)+((this.prefetchCount == null)? 0 :this.prefetchCount.hashCode()));
result = ((result* 31)+((this.srcExchangeKey == null)? 0 :this.srcExchangeKey.hashCode()));
result = ((result* 31)+((this.srcQueue == null)? 0 :this.srcQueue.hashCode()));
result = ((result* 31)+((this.deleteAfter == null)? 0 :this.deleteAfter.hashCode()));
result = ((result* 31)+((this.destExchangeKey == null)? 0 :this.destExchangeKey.hashCode()));
result = ((result* 31)+((this.reconnectDelay == null)? 0 :this.reconnectDelay.hashCode()));
result = ((result* 31)+((this.addForwardHeaders == null)? 0 :this.addForwardHeaders.hashCode()));
result = ((result* 31)+((this.destQueue == null)? 0 :this.destQueue.hashCode()));
result = ((result* 31)+((this.destExchange == null)? 0 :this.destExchange.hashCode()));
result = ((result* 31)+((this.ackMode == null)? 0 :this.ackMode.hashCode()));
result = ((result* 31)+((this.destUri == null)? 0 :this.destUri.hashCode()));
result = ((result* 31)+((this.srcUri == null)? 0 :this.srcUri.hashCode()));
result = ((result* 31)+((this.additionalProperties == null)? 0 :this.additionalProperties.hashCode()));
result = ((result* 31)+((this.srcExchange == null)? 0 :this.srcExchange.hashCode()));
return result;
}
@Override
public boolean equals(Object other) {
if (other == this) {
return true;
}
if ((other instanceof ShovelArguments) == false) {
return false;
}
ShovelArguments rhs = ((ShovelArguments) other);
return (((((((((((((((this.prefetchCount == rhs.prefetchCount)||((this.prefetchCount!= null)&&this.prefetchCount.equals(rhs.prefetchCount)))&&((this.srcExchangeKey == rhs.srcExchangeKey)||((this.srcExchangeKey!= null)&&this.srcExchangeKey.equals(rhs.srcExchangeKey))))&&((this.srcQueue == rhs.srcQueue)||((this.srcQueue!= null)&&this.srcQueue.equals(rhs.srcQueue))))&&((this.deleteAfter == rhs.deleteAfter)||((this.deleteAfter!= null)&&this.deleteAfter.equals(rhs.deleteAfter))))&&((this.destExchangeKey == rhs.destExchangeKey)||((this.destExchangeKey!= null)&&this.destExchangeKey.equals(rhs.destExchangeKey))))&&((this.reconnectDelay == rhs.reconnectDelay)||((this.reconnectDelay!= null)&&this.reconnectDelay.equals(rhs.reconnectDelay))))&&((this.addForwardHeaders == rhs.addForwardHeaders)||((this.addForwardHeaders!= null)&&this.addForwardHeaders.equals(rhs.addForwardHeaders))))&&((this.destQueue == rhs.destQueue)||((this.destQueue!= null)&&this.destQueue.equals(rhs.destQueue))))&&((this.destExchange == rhs.destExchange)||((this.destExchange!= null)&&this.destExchange.equals(rhs.destExchange))))&&((this.ackMode == rhs.ackMode)||((this.ackMode!= null)&&this.ackMode.equals(rhs.ackMode))))&&((this.destUri == rhs.destUri)||((this.destUri!= null)&&this.destUri.equals(rhs.destUri))))&&((this.srcUri == rhs.srcUri)||((this.srcUri!= null)&&this.srcUri.equals(rhs.srcUri))))&&((this.additionalProperties == rhs.additionalProperties)||((this.additionalProperties!= null)&&this.additionalProperties.equals(rhs.additionalProperties))))&&((this.srcExchange == rhs.srcExchange)||((this.srcExchange!= null)&&this.srcExchange.equals(rhs.srcExchange))));
}
public enum AckMode {
ON_CONFIRM("on-confirm"),
ON_PUBLISH("on-publish"),
NO_ACK("no-ack");
private final String value;
private final static Map CONSTANTS = new HashMap();
static {
for (ShovelArguments.AckMode c: values()) {
CONSTANTS.put(c.value, c);
}
}
private AckMode(String value) {
this.value = value;
}
@Override
public String toString() {
return this.value;
}
@JsonValue
public String value() {
return this.value;
}
@JsonCreator
public static ShovelArguments.AckMode fromValue(String value) {
ShovelArguments.AckMode constant = CONSTANTS.get(value);
if (constant == null) {
throw new IllegalArgumentException(value);
} else {
return constant;
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy