diff --git a/src/main/java/com/rabbitmq/http/client/domain/QueueInfo.java b/src/main/java/com/rabbitmq/http/client/domain/QueueInfo.java index 303e863..eeb5936 100644 --- a/src/main/java/com/rabbitmq/http/client/domain/QueueInfo.java +++ b/src/main/java/com/rabbitmq/http/client/domain/QueueInfo.java @@ -80,6 +80,9 @@ // "name": "langohr.tests2.queues.non-auto-deleted1", // "node": "rabbit@mercurio", // "policy": "", +// "effective_policy_definition": { +// "overflow": "reject-publish" +// } // "recoverable_slaves": "", // "state": "running", // "vhost": "/" @@ -88,449 +91,470 @@ @SuppressWarnings("unused") @JsonIgnoreProperties("backing_queue_status") public class QueueInfo { - private String vhost; - private String name; - private boolean durable; - private boolean exclusive; - @JsonProperty("auto_delete") - private boolean autoDelete; - private Map arguments; - private String node; - @JsonProperty("exclusive_consumer_tag") - private String exclusiveConsumerTag; - private String state; - private String policy; - @JsonProperty("idle_since") - private String idleSince; - - @JsonProperty("disk_reads") - private long diskReads = -1; - @JsonProperty("disk_writes") - private long diskWrites = -1; - @JsonProperty("memory") - private long memoryUsed = -1; - @JsonProperty("message_bytes") - private long messageBytes = -1; - @JsonProperty("message_bytes_persistent") - private long messageBytesPersistent = -1; - @JsonProperty("message_bytes_ram") - private long messageBytesRAM = -1; - @JsonProperty("message_bytes_ready") - private long messageBytesReady = -1; - @JsonProperty("message_bytes_unacknowledged") - private long messageBytesUnacknowledged = -1; - @JsonProperty("messages") - private long totalMessages = -1; - @JsonProperty("message_stats") - private MessageStats messageStats; - @JsonProperty("messages_persistent") - private long totalPersistentMessages = -1; - @JsonProperty("messages_ram") - private long totalTransientMessages = -1; - @JsonProperty("messages_details") - private RateDetails messagesDetails; - @JsonProperty("messages_ready") - private long messagesReady = -1; - @JsonProperty("messages_ready_details") - private RateDetails messagesReadyDetails; - @JsonProperty("messages_unacknowledged") - private long messagesUnacknowledged = -1; - @JsonProperty("messages_unacknowledged_details") - private RateDetails messagesUnacknowledgedDetails; - @JsonProperty("owner_pid_details") - private OwnerPidDetails ownerPidDetails; - // TODO: messages_ready_ram - // TODO: recoverable_slaves - - @JsonProperty("consumers") - private long consumerCount; - // ignored due to rabbitmq/rabbitmq-management#26 - @JsonIgnore - @JsonProperty("consumer_utilisation") - private long consumerUtilisation; - - // TODO: should we expose backing_queue_status, - // which is an implementation detail? - - @JsonProperty("consumer_details") - private List consumerDetails; - @JsonProperty("single_active_consumer_tag") - private String singleActiveConsumerTag; - - @JsonProperty("type") - private String type; - - // for classic HA queues - @JsonProperty("recoverable_slaves") - private List recoverableMirrors; - @JsonProperty("slave_nodes") - private List mirrorNodes; - @JsonProperty("synchronised_slave_nodes") - private List synchronisedMirrorNodes; - - // for quorum queues - @JsonProperty("leader") - private String leaderNode; - @JsonProperty("members") - private List memberNodes; - - public QueueInfo() { - } - - public QueueInfo(boolean durable, boolean exclusive, boolean autoDelete) { - this(durable, exclusive, autoDelete, new HashMap<>()); - } - - public QueueInfo(boolean durable, boolean exclusive, boolean autoDelete, Map arguments) { - this.durable = durable; - this.exclusive = exclusive; - this.autoDelete = autoDelete; - this.arguments = arguments; - } - - public String getVhost() { - return vhost; - } - - public void setVhost(String vhost) { - this.vhost = vhost; - } - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public boolean isDurable() { - return durable; - } - - public void setDurable(boolean durable) { - this.durable = durable; - } - - public boolean isExclusive() { - // versions prior to 3.6.0 did not have an exclusive field in the payload. Fallback to ownerPidDetails for - // compatibility. - return exclusive || (ownerPidDetails != null); - } - - public void setExclusive(boolean exclusive) { - this.exclusive = exclusive; - } - - public boolean isAutoDelete() { - return autoDelete; - } - - public void setAutoDelete(boolean autoDelete) { - this.autoDelete = autoDelete; - } - - public Map getArguments() { - return arguments; - } - - public void setArguments(Map arguments) { - this.arguments = arguments; - } - - public String getNode() { - return node; - } - - public void setNode(String node) { - this.node = node; - } - - public String getExclusiveConsumerTag() { - return exclusiveConsumerTag; - } - - public void setExclusiveConsumerTag(String exclusiveConsumerTag) { - this.exclusiveConsumerTag = exclusiveConsumerTag; - } - - public String getState() { - return state; - } - - public void setState(String state) { - this.state = state; - } - - public String getPolicy() { - return policy; - } - - public void setPolicy(String policy) { - this.policy = policy; - } - - public String getIdleSince() { - return idleSince; - } + private String vhost; + private String name; + private boolean durable; + private boolean exclusive; + @JsonProperty("auto_delete") + private boolean autoDelete; + private Map arguments; + private String node; + @JsonProperty("exclusive_consumer_tag") + private String exclusiveConsumerTag; + private String state; + private String policy; + @JsonIgnore + private PolicyInfo policyInfo; + @JsonProperty("effective_policy_definition") + private Map effectivePolicyDefinition; + @JsonProperty("idle_since") + private String idleSince; + + @JsonProperty("disk_reads") + private long diskReads = -1; + @JsonProperty("disk_writes") + private long diskWrites = -1; + @JsonProperty("memory") + private long memoryUsed = -1; + @JsonProperty("message_bytes") + private long messageBytes = -1; + @JsonProperty("message_bytes_persistent") + private long messageBytesPersistent = -1; + @JsonProperty("message_bytes_ram") + private long messageBytesRAM = -1; + @JsonProperty("message_bytes_ready") + private long messageBytesReady = -1; + @JsonProperty("message_bytes_unacknowledged") + private long messageBytesUnacknowledged = -1; + @JsonProperty("messages") + private long totalMessages = -1; + @JsonProperty("message_stats") + private MessageStats messageStats; + @JsonProperty("messages_persistent") + private long totalPersistentMessages = -1; + @JsonProperty("messages_ram") + private long totalTransientMessages = -1; + @JsonProperty("messages_details") + private RateDetails messagesDetails; + @JsonProperty("messages_ready") + private long messagesReady = -1; + @JsonProperty("messages_ready_details") + private RateDetails messagesReadyDetails; + @JsonProperty("messages_unacknowledged") + private long messagesUnacknowledged = -1; + @JsonProperty("messages_unacknowledged_details") + private RateDetails messagesUnacknowledgedDetails; + @JsonProperty("owner_pid_details") + private OwnerPidDetails ownerPidDetails; + // TODO: messages_ready_ram + // TODO: recoverable_slaves + + @JsonProperty("consumers") + private long consumerCount; + // ignored due to rabbitmq/rabbitmq-management#26 + @JsonIgnore + @JsonProperty("consumer_utilisation") + private long consumerUtilisation; + + // TODO: should we expose backing_queue_status, + // which is an implementation detail? + + @JsonProperty("consumer_details") + private List consumerDetails; + @JsonProperty("single_active_consumer_tag") + private String singleActiveConsumerTag; + + @JsonProperty("type") + private String type; + + // for classic HA queues + @JsonProperty("recoverable_slaves") + private List recoverableMirrors; + @JsonProperty("slave_nodes") + private List mirrorNodes; + @JsonProperty("synchronised_slave_nodes") + private List synchronisedMirrorNodes; + + // for quorum queues + @JsonProperty("leader") + private String leaderNode; + @JsonProperty("members") + private List memberNodes; + + public QueueInfo() { + } + + public QueueInfo(boolean durable, boolean exclusive, boolean autoDelete) { + this(durable, exclusive, autoDelete, new HashMap<>()); + } + + public QueueInfo(boolean durable, boolean exclusive, boolean autoDelete, Map arguments) { + this.durable = durable; + this.exclusive = exclusive; + this.autoDelete = autoDelete; + this.arguments = arguments; + } + + public String getVhost() { + return vhost; + } + + public void setVhost(String vhost) { + this.vhost = vhost; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public boolean isDurable() { + return durable; + } + + public void setDurable(boolean durable) { + this.durable = durable; + } + + public boolean isExclusive() { + // versions prior to 3.6.0 did not have an exclusive field in the payload. Fallback to ownerPidDetails for + // compatibility. + return exclusive || (ownerPidDetails != null); + } + + public void setExclusive(boolean exclusive) { + this.exclusive = exclusive; + } + + public boolean isAutoDelete() { + return autoDelete; + } + + public void setAutoDelete(boolean autoDelete) { + this.autoDelete = autoDelete; + } + + public Map getArguments() { + return arguments; + } + + public void setArguments(Map arguments) { + this.arguments = arguments; + } + + public String getNode() { + return node; + } + + public void setNode(String node) { + this.node = node; + } + + public String getExclusiveConsumerTag() { + return exclusiveConsumerTag; + } + + public void setExclusiveConsumerTag(String exclusiveConsumerTag) { + this.exclusiveConsumerTag = exclusiveConsumerTag; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public String getPolicy() { + return policy; + } + + public void setPolicy(String policy) { + this.policy = policy; + } + + public PolicyInfo getPolicyInfo() { + return policyInfo; + } - public void setIdleSince(String idleSince) { - this.idleSince = idleSince; - } - - public long getDiskReads() { - return diskReads; - } - - public void setDiskReads(long diskReads) { - this.diskReads = diskReads; - } + public void setPolicyInfo(PolicyInfo policyInfo) { + this.policyInfo = policyInfo; + } + + public Map getEffectivePolicyDefinition() { + return effectivePolicyDefinition; + } + + public void setEffectivePolicyDefinition(Map effectivePolicyDefinition) { + this.effectivePolicyDefinition = effectivePolicyDefinition; + } - public long getDiskWrites() { - return diskWrites; - } + public String getIdleSince() { + return idleSince; + } - public void setDiskWrites(long diskWrites) { - this.diskWrites = diskWrites; - } + public void setIdleSince(String idleSince) { + this.idleSince = idleSince; + } - public long getMemoryUsed() { - return memoryUsed; - } + public long getDiskReads() { + return diskReads; + } - public void setMemoryUsed(long memoryUsed) { - this.memoryUsed = memoryUsed; - } + public void setDiskReads(long diskReads) { + this.diskReads = diskReads; + } - public long getMessageBytes() { - return messageBytes; - } + public long getDiskWrites() { + return diskWrites; + } - public void setMessageBytes(long messageBytes) { - this.messageBytes = messageBytes; - } + public void setDiskWrites(long diskWrites) { + this.diskWrites = diskWrites; + } - public long getMessageBytesPersistent() { - return messageBytesPersistent; - } + public long getMemoryUsed() { + return memoryUsed; + } - public void setMessageBytesPersistent(long messageBytesPersistent) { - this.messageBytesPersistent = messageBytesPersistent; - } + public void setMemoryUsed(long memoryUsed) { + this.memoryUsed = memoryUsed; + } - public long getMessageBytesRAM() { - return messageBytesRAM; - } + public long getMessageBytes() { + return messageBytes; + } - public void setMessageBytesRAM(long messageBytesRAM) { - this.messageBytesRAM = messageBytesRAM; - } + public void setMessageBytes(long messageBytes) { + this.messageBytes = messageBytes; + } - public long getMessageBytesReady() { - return messageBytesReady; - } + public long getMessageBytesPersistent() { + return messageBytesPersistent; + } - public void setMessageBytesReady(long messageBytesReady) { - this.messageBytesReady = messageBytesReady; - } + public void setMessageBytesPersistent(long messageBytesPersistent) { + this.messageBytesPersistent = messageBytesPersistent; + } - public long getMessageBytesUnacknowledged() { - return messageBytesUnacknowledged; - } + public long getMessageBytesRAM() { + return messageBytesRAM; + } - public void setMessageBytesUnacknowledged(long messageBytesUnacknowledged) { - this.messageBytesUnacknowledged = messageBytesUnacknowledged; - } + public void setMessageBytesRAM(long messageBytesRAM) { + this.messageBytesRAM = messageBytesRAM; + } - public long getTotalMessages() { - return totalMessages; - } + public long getMessageBytesReady() { + return messageBytesReady; + } - public void setTotalMessages(long totalMessages) { - this.totalMessages = totalMessages; - } + public void setMessageBytesReady(long messageBytesReady) { + this.messageBytesReady = messageBytesReady; + } - public MessageStats getMessageStats() { - return messageStats; - } + public long getMessageBytesUnacknowledged() { + return messageBytesUnacknowledged; + } - public void setMessageStats(MessageStats messageStats) { - this.messageStats = messageStats; - } + public void setMessageBytesUnacknowledged(long messageBytesUnacknowledged) { + this.messageBytesUnacknowledged = messageBytesUnacknowledged; + } - public long getTotalPersistentMessages() { - return totalPersistentMessages; - } + public long getTotalMessages() { + return totalMessages; + } - public void setTotalPersistentMessages(long totalPersistentMessages) { - this.totalPersistentMessages = totalPersistentMessages; - } + public void setTotalMessages(long totalMessages) { + this.totalMessages = totalMessages; + } - public long getTotalTransientMessages() { - return totalTransientMessages; - } + public MessageStats getMessageStats() { + return messageStats; + } - public void setTotalTransientMessages(long totalTransientMessages) { - this.totalTransientMessages = totalTransientMessages; - } + public void setMessageStats(MessageStats messageStats) { + this.messageStats = messageStats; + } - public long getMessagesReady() { - return messagesReady; - } + public long getTotalPersistentMessages() { + return totalPersistentMessages; + } - public void setMessagesReady(long messagesReady) { - this.messagesReady = messagesReady; - } + public void setTotalPersistentMessages(long totalPersistentMessages) { + this.totalPersistentMessages = totalPersistentMessages; + } - public RateDetails getMessagesDetails() { - return messagesDetails; - } + public long getTotalTransientMessages() { + return totalTransientMessages; + } - public void setMessagesDetails(RateDetails messagesDetails) { - this.messagesDetails = messagesDetails; - } + public void setTotalTransientMessages(long totalTransientMessages) { + this.totalTransientMessages = totalTransientMessages; + } - public RateDetails getMessagesReadyDetails() { - return messagesReadyDetails; - } + public long getMessagesReady() { + return messagesReady; + } - public void setMessagesReadyDetails(RateDetails messagesReadyDetails) { - this.messagesReadyDetails = messagesReadyDetails; - } + public void setMessagesReady(long messagesReady) { + this.messagesReady = messagesReady; + } - public long getMessagesUnacknowledged() { - return messagesUnacknowledged; - } + public RateDetails getMessagesDetails() { + return messagesDetails; + } - public void setMessagesUnacknowledged(long messagesUnacknowledged) { - this.messagesUnacknowledged = messagesUnacknowledged; - } - - public RateDetails getMessagesUnacknowledgedDetails() { - return messagesUnacknowledgedDetails; - } - - public void setMessagesUnacknowledgedDetails(RateDetails messagesUnacknowledgedDetails) { - this.messagesUnacknowledgedDetails = messagesUnacknowledgedDetails; - } - - public long getConsumerCount() { - return consumerCount; - } - - public void setConsumerCount(long consumerCount) { - this.consumerCount = consumerCount; - } - - public long getConsumerUtilisation() { - return consumerUtilisation; - } - - public void setConsumerUtilisation(long consumerUtilisation) { - this.consumerUtilisation = consumerUtilisation; - } - - public void setOwnerPidDetails(OwnerPidDetails ownerPidDetails) { - this.ownerPidDetails = ownerPidDetails; - } - - public List getConsumerDetails() { - return consumerDetails; - } - - public void setConsumerDetails(List consumerDetails) { - this.consumerDetails = consumerDetails; - } - - public String getSingleActiveConsumerTag() { - return singleActiveConsumerTag; - } - - public void setSingleActiveConsumerTag(String singleActiveConsumerTag) { - this.singleActiveConsumerTag = singleActiveConsumerTag; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public List getRecoverableMirrors() { - return recoverableMirrors; - } - - public void setRecoverableMirrors(List recoverableMirrors) { - this.recoverableMirrors = recoverableMirrors; - } - - public List getMirrorNodes() { - return mirrorNodes; - } - - public void setMirrorNodes(List mirrorNodes) { - this.mirrorNodes = mirrorNodes; - } - - public List getSynchronisedMirrorNodes() { - return synchronisedMirrorNodes; - } - - public void setSynchronisedMirrorNodes(List synchronisedMirrorNodes) { - this.synchronisedMirrorNodes = synchronisedMirrorNodes; - } - - public String getLeaderNode() { - return leaderNode; - } - - public void setLeaderNode(String leaderNode) { - this.leaderNode = leaderNode; - } - - public List getMemberNodes() { - return memberNodes; - } - - public void setMemberNodes(List memberNodes) { - this.memberNodes = memberNodes; - } - - @Override - public String toString() { - return "QueueInfo{" + - "vhost='" + vhost + '\'' + - ", name='" + name + '\'' + - ", durable=" + durable + - ", exclusive=" + exclusive + - ", autoDelete=" + autoDelete + - ", arguments=" + arguments + - ", node='" + node + '\'' + - ", exclusiveConsumerTag='" + exclusiveConsumerTag + '\'' + - ", state='" + state + '\'' + - ", policy='" + policy + '\'' + - ", idleSince='" + idleSince + '\'' + - ", diskReads=" + diskReads + - ", diskWrites=" + diskWrites + - ", memoryUsed=" + memoryUsed + - ", messageBytes=" + messageBytes + - ", messageBytesPersistent=" + messageBytesPersistent + - ", messageBytesRAM=" + messageBytesRAM + - ", messageBytesReady=" + messageBytesReady + - ", messageBytesUnacknowledged=" + messageBytesUnacknowledged + - ", totalMessages=" + totalMessages + - ", messageStats=" + messageStats + - ", totalPersistentMessages=" + totalPersistentMessages + - ", totalTransientMessages=" + totalTransientMessages + - ", messagesReady=" + messagesReady + - ", messagesReadyDetails=" + messagesReadyDetails + - ", messagesUnacknowledged=" + messagesUnacknowledged + - ", messagesUnacknowledgedDetails=" + messagesUnacknowledgedDetails + - ", consumerCount=" + consumerCount + - ", singleActiveConsumerTag=" + singleActiveConsumerTag + - ", type=" + type + - '}'; - } + public void setMessagesDetails(RateDetails messagesDetails) { + this.messagesDetails = messagesDetails; + } + + public RateDetails getMessagesReadyDetails() { + return messagesReadyDetails; + } + + public void setMessagesReadyDetails(RateDetails messagesReadyDetails) { + this.messagesReadyDetails = messagesReadyDetails; + } + + public long getMessagesUnacknowledged() { + return messagesUnacknowledged; + } + + public void setMessagesUnacknowledged(long messagesUnacknowledged) { + this.messagesUnacknowledged = messagesUnacknowledged; + } + + public RateDetails getMessagesUnacknowledgedDetails() { + return messagesUnacknowledgedDetails; + } + + public void setMessagesUnacknowledgedDetails(RateDetails messagesUnacknowledgedDetails) { + this.messagesUnacknowledgedDetails = messagesUnacknowledgedDetails; + } + + public long getConsumerCount() { + return consumerCount; + } + + public void setConsumerCount(long consumerCount) { + this.consumerCount = consumerCount; + } + + public long getConsumerUtilisation() { + return consumerUtilisation; + } + + public void setConsumerUtilisation(long consumerUtilisation) { + this.consumerUtilisation = consumerUtilisation; + } + + public void setOwnerPidDetails(OwnerPidDetails ownerPidDetails) { + this.ownerPidDetails = ownerPidDetails; + } + + public List getConsumerDetails() { + return consumerDetails; + } + + public void setConsumerDetails(List consumerDetails) { + this.consumerDetails = consumerDetails; + } + + public String getSingleActiveConsumerTag() { + return singleActiveConsumerTag; + } + + public void setSingleActiveConsumerTag(String singleActiveConsumerTag) { + this.singleActiveConsumerTag = singleActiveConsumerTag; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public List getRecoverableMirrors() { + return recoverableMirrors; + } + + public void setRecoverableMirrors(List recoverableMirrors) { + this.recoverableMirrors = recoverableMirrors; + } + + public List getMirrorNodes() { + return mirrorNodes; + } + + public void setMirrorNodes(List mirrorNodes) { + this.mirrorNodes = mirrorNodes; + } + + public List getSynchronisedMirrorNodes() { + return synchronisedMirrorNodes; + } + + public void setSynchronisedMirrorNodes(List synchronisedMirrorNodes) { + this.synchronisedMirrorNodes = synchronisedMirrorNodes; + } + + public String getLeaderNode() { + return leaderNode; + } + + public void setLeaderNode(String leaderNode) { + this.leaderNode = leaderNode; + } + + public List getMemberNodes() { + return memberNodes; + } + + public void setMemberNodes(List memberNodes) { + this.memberNodes = memberNodes; + } + + @Override + public String toString() { + return "QueueInfo{" + + "vhost='" + vhost + '\'' + + ", name='" + name + '\'' + + ", durable=" + durable + + ", exclusive=" + exclusive + + ", autoDelete=" + autoDelete + + ", arguments=" + arguments + + ", node='" + node + '\'' + + ", exclusiveConsumerTag='" + exclusiveConsumerTag + '\'' + + ", state='" + state + '\'' + + ", policy='" + policy + '\'' + + ", effective_policy_definition='" + effectivePolicyDefinition + '\'' + + ", idleSince='" + idleSince + '\'' + + ", diskReads=" + diskReads + + ", diskWrites=" + diskWrites + + ", memoryUsed=" + memoryUsed + + ", messageBytes=" + messageBytes + + ", messageBytesPersistent=" + messageBytesPersistent + + ", messageBytesRAM=" + messageBytesRAM + + ", messageBytesReady=" + messageBytesReady + + ", messageBytesUnacknowledged=" + messageBytesUnacknowledged + + ", totalMessages=" + totalMessages + + ", messageStats=" + messageStats + + ", totalPersistentMessages=" + totalPersistentMessages + + ", totalTransientMessages=" + totalTransientMessages + + ", messagesReady=" + messagesReady + + ", messagesReadyDetails=" + messagesReadyDetails + + ", messagesUnacknowledged=" + messagesUnacknowledged + + ", messagesUnacknowledgedDetails=" + messagesUnacknowledgedDetails + + ", consumerCount=" + consumerCount + + ", singleActiveConsumerTag=" + singleActiveConsumerTag + + ", type=" + type + + '}'; + } }