All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.wildfly.swarm.config.messaging.activemq.server.RuntimeQueue Maven / Gradle / Ivy

There is a newer version: 2.7.0
Show newest version
package org.wildfly.swarm.config.messaging.activemq.server;

import org.wildfly.swarm.config.runtime.AttributeDocumentation;
import org.wildfly.swarm.config.runtime.ResourceDocumentation;
import org.wildfly.swarm.config.runtime.SingletonResource;
import org.wildfly.swarm.config.runtime.Address;
import org.wildfly.swarm.config.runtime.ResourceType;
import java.beans.PropertyChangeSupport;
import java.beans.PropertyChangeListener;
import org.wildfly.swarm.config.runtime.ModelNodeBinding;

/**
 * A Queue.
 */
@Address("/subsystem=messaging-activemq/server=*/runtime-queue=*")
@ResourceType("runtime-queue")
public class RuntimeQueue>
		implements
			org.wildfly.swarm.config.runtime.Keyed {

	private String key;
	private PropertyChangeSupport pcs;
	@AttributeDocumentation("The number of consumers consuming messages from this queue.")
	private Integer consumerCount;
	@AttributeDocumentation("The address to send the queue's dead messages to.")
	private String deadLetterAddress;
	@AttributeDocumentation("The number of messages that this queue is currently delivering to its consumers.")
	private Integer deliveringCount;
	@AttributeDocumentation("Defines whether the queue is durable.")
	private Boolean durable;
	@AttributeDocumentation("The address to send the queue's expired messages to.")
	private String expiryAddress;
	@AttributeDocumentation("A queue message filter definition. An undefined or empty filter will match all messages.")
	private String filter;
	@AttributeDocumentation("The id of the queue.")
	private Long id;
	@AttributeDocumentation("The number of messages currently in this queue.")
	private Long messageCount;
	@AttributeDocumentation("The number of messages added to this queue since it was created.")
	private Long messagesAdded;
	@AttributeDocumentation("Whether the queue is paused.")
	private Boolean paused;
	@AttributeDocumentation("The queue address defines what address is used for routing messages.")
	private String queueAddress;
	@AttributeDocumentation("The number of scheduled messages in this queue.")
	private Long scheduledCount;
	@AttributeDocumentation("Whether the queue is temporary.")
	private Boolean temporary;

	public RuntimeQueue(java.lang.String key) {
		super();
		this.key = key;
	}

	public String getKey() {
		return this.key;
	}

	/**
	 * Adds a property change listener
	 */
	public void addPropertyChangeListener(PropertyChangeListener listener) {
		if (null == this.pcs)
			this.pcs = new PropertyChangeSupport(this);
		this.pcs.addPropertyChangeListener(listener);
	}

	/**
	 * Removes a property change listener
	 */
	public void removePropertyChangeListener(
			java.beans.PropertyChangeListener listener) {
		if (this.pcs != null)
			this.pcs.removePropertyChangeListener(listener);
	}

	/**
	 * The number of consumers consuming messages from this queue.
	 */
	@ModelNodeBinding(detypedName = "consumer-count")
	public Integer consumerCount() {
		return this.consumerCount;
	}

	/**
	 * The number of consumers consuming messages from this queue.
	 */
	@SuppressWarnings("unchecked")
	public T consumerCount(java.lang.Integer value) {
		Object oldValue = this.consumerCount;
		this.consumerCount = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("consumerCount", oldValue, value);
		return (T) this;
	}

	/**
	 * The address to send the queue's dead messages to.
	 */
	@ModelNodeBinding(detypedName = "dead-letter-address")
	public String deadLetterAddress() {
		return this.deadLetterAddress;
	}

	/**
	 * The address to send the queue's dead messages to.
	 */
	@SuppressWarnings("unchecked")
	public T deadLetterAddress(java.lang.String value) {
		Object oldValue = this.deadLetterAddress;
		this.deadLetterAddress = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("deadLetterAddress", oldValue, value);
		return (T) this;
	}

	/**
	 * The number of messages that this queue is currently delivering to its
	 * consumers.
	 */
	@ModelNodeBinding(detypedName = "delivering-count")
	public Integer deliveringCount() {
		return this.deliveringCount;
	}

	/**
	 * The number of messages that this queue is currently delivering to its
	 * consumers.
	 */
	@SuppressWarnings("unchecked")
	public T deliveringCount(java.lang.Integer value) {
		Object oldValue = this.deliveringCount;
		this.deliveringCount = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("deliveringCount", oldValue, value);
		return (T) this;
	}

	/**
	 * Defines whether the queue is durable.
	 */
	@ModelNodeBinding(detypedName = "durable")
	public Boolean durable() {
		return this.durable;
	}

	/**
	 * Defines whether the queue is durable.
	 */
	@SuppressWarnings("unchecked")
	public T durable(java.lang.Boolean value) {
		Object oldValue = this.durable;
		this.durable = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("durable", oldValue, value);
		return (T) this;
	}

	/**
	 * The address to send the queue's expired messages to.
	 */
	@ModelNodeBinding(detypedName = "expiry-address")
	public String expiryAddress() {
		return this.expiryAddress;
	}

	/**
	 * The address to send the queue's expired messages to.
	 */
	@SuppressWarnings("unchecked")
	public T expiryAddress(java.lang.String value) {
		Object oldValue = this.expiryAddress;
		this.expiryAddress = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("expiryAddress", oldValue, value);
		return (T) this;
	}

	/**
	 * A queue message filter definition. An undefined or empty filter will
	 * match all messages.
	 */
	@ModelNodeBinding(detypedName = "filter")
	public String filter() {
		return this.filter;
	}

	/**
	 * A queue message filter definition. An undefined or empty filter will
	 * match all messages.
	 */
	@SuppressWarnings("unchecked")
	public T filter(java.lang.String value) {
		Object oldValue = this.filter;
		this.filter = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("filter", oldValue, value);
		return (T) this;
	}

	/**
	 * The id of the queue.
	 */
	@ModelNodeBinding(detypedName = "id")
	public Long id() {
		return this.id;
	}

	/**
	 * The id of the queue.
	 */
	@SuppressWarnings("unchecked")
	public T id(java.lang.Long value) {
		Object oldValue = this.id;
		this.id = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("id", oldValue, value);
		return (T) this;
	}

	/**
	 * The number of messages currently in this queue.
	 */
	@ModelNodeBinding(detypedName = "message-count")
	public Long messageCount() {
		return this.messageCount;
	}

	/**
	 * The number of messages currently in this queue.
	 */
	@SuppressWarnings("unchecked")
	public T messageCount(java.lang.Long value) {
		Object oldValue = this.messageCount;
		this.messageCount = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("messageCount", oldValue, value);
		return (T) this;
	}

	/**
	 * The number of messages added to this queue since it was created.
	 */
	@ModelNodeBinding(detypedName = "messages-added")
	public Long messagesAdded() {
		return this.messagesAdded;
	}

	/**
	 * The number of messages added to this queue since it was created.
	 */
	@SuppressWarnings("unchecked")
	public T messagesAdded(java.lang.Long value) {
		Object oldValue = this.messagesAdded;
		this.messagesAdded = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("messagesAdded", oldValue, value);
		return (T) this;
	}

	/**
	 * Whether the queue is paused.
	 */
	@ModelNodeBinding(detypedName = "paused")
	public Boolean paused() {
		return this.paused;
	}

	/**
	 * Whether the queue is paused.
	 */
	@SuppressWarnings("unchecked")
	public T paused(java.lang.Boolean value) {
		Object oldValue = this.paused;
		this.paused = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("paused", oldValue, value);
		return (T) this;
	}

	/**
	 * The queue address defines what address is used for routing messages.
	 */
	@ModelNodeBinding(detypedName = "queue-address")
	public String queueAddress() {
		return this.queueAddress;
	}

	/**
	 * The queue address defines what address is used for routing messages.
	 */
	@SuppressWarnings("unchecked")
	public T queueAddress(java.lang.String value) {
		Object oldValue = this.queueAddress;
		this.queueAddress = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("queueAddress", oldValue, value);
		return (T) this;
	}

	/**
	 * The number of scheduled messages in this queue.
	 */
	@ModelNodeBinding(detypedName = "scheduled-count")
	public Long scheduledCount() {
		return this.scheduledCount;
	}

	/**
	 * The number of scheduled messages in this queue.
	 */
	@SuppressWarnings("unchecked")
	public T scheduledCount(java.lang.Long value) {
		Object oldValue = this.scheduledCount;
		this.scheduledCount = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("scheduledCount", oldValue, value);
		return (T) this;
	}

	/**
	 * Whether the queue is temporary.
	 */
	@ModelNodeBinding(detypedName = "temporary")
	public Boolean temporary() {
		return this.temporary;
	}

	/**
	 * Whether the queue is temporary.
	 */
	@SuppressWarnings("unchecked")
	public T temporary(java.lang.Boolean value) {
		Object oldValue = this.temporary;
		this.temporary = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("temporary", oldValue, value);
		return (T) this;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy