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

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

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 org.wildfly.swarm.config.runtime.Implicit;
import java.beans.PropertyChangeSupport;
import java.beans.PropertyChangeListener;
import java.util.List;
import org.wildfly.swarm.config.runtime.Subresource;
import org.wildfly.swarm.config.messaging.activemq.server.ha_policy.shared_store_colocated.MasterConfiguration;
import org.wildfly.swarm.config.messaging.activemq.server.ha_policy.shared_store_colocated.MasterConfigurationConsumer;
import org.wildfly.swarm.config.messaging.activemq.server.ha_policy.shared_store_colocated.MasterConfigurationSupplier;
import org.wildfly.swarm.config.messaging.activemq.server.ha_policy.shared_store_colocated.SlaveConfiguration;
import org.wildfly.swarm.config.messaging.activemq.server.ha_policy.shared_store_colocated.SlaveConfigurationConsumer;
import org.wildfly.swarm.config.messaging.activemq.server.ha_policy.shared_store_colocated.SlaveConfigurationSupplier;
import org.wildfly.swarm.config.runtime.ModelNodeBinding;

/**
 * A messaging resource that allows you to configure High Availability for the
 * ActiveMQ server (the value of ha-policy can be live-only, replication-master,
 * replication-slave, replication-colocated, shared-store-master,
 * shared-store-slave, or shared-store-colocated).
 */
@Address("/subsystem=messaging-activemq/server=*/ha-policy=shared-store-colocated")
@ResourceType("ha-policy")
@Implicit
public class SharedStoreColocatedHAPolicy>
		implements
			org.wildfly.swarm.config.runtime.Keyed {

	private String key;
	private PropertyChangeSupport pcs;
	private SharedStoreColocatedHAPolicyResources subresources = new SharedStoreColocatedHAPolicyResources();
	@AttributeDocumentation("The offset to use for the Connectors and Acceptors when creating a new backup server.")
	private Integer backupPortOffset;
	@AttributeDocumentation("How many times the live server will try to request a backup, -1 means for ever.")
	private Integer backupRequestRetries;
	@AttributeDocumentation("How long (in ms) to wait for retries between attempts to request a backup server.")
	private Long backupRequestRetryInterval;
	@AttributeDocumentation("Whether or not this live server will accept backup requests from other live servers.")
	private Integer maxBackups;
	@AttributeDocumentation("If true then the server will request a backup on another node.")
	private Boolean requestBackup;

	public SharedStoreColocatedHAPolicy() {
		super();
		this.key = "shared-store-colocated";
		this.pcs = new PropertyChangeSupport(this);
	}

	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);
	}

	public SharedStoreColocatedHAPolicyResources subresources() {
		return this.subresources;
	}

	/**
	 * A messaging resource that allows you to configure High Availability for
	 * the ActiveMQ server (the value of ha-policy can be live-only,
	 * replication-master, replication-slave, replication-colocated,
	 * shared-store-master, shared-store-slave, or shared-store-colocated).
	 */
	@SuppressWarnings("unchecked")
	public T masterConfiguration(MasterConfiguration value) {
		this.subresources.masterConfiguration = value;
		return (T) this;
	}

	/**
	 * A messaging resource that allows you to configure High Availability for
	 * the ActiveMQ server (the value of ha-policy can be live-only,
	 * replication-master, replication-slave, replication-colocated,
	 * shared-store-master, shared-store-slave, or shared-store-colocated).
	 */
	@SuppressWarnings("unchecked")
	public T masterConfiguration(MasterConfigurationConsumer consumer) {
		MasterConfiguration child = new MasterConfiguration<>();
		if (consumer != null) {
			consumer.accept(child);
		}
		this.subresources.masterConfiguration = child;
		return (T) this;
	}

	/**
	 * A messaging resource that allows you to configure High Availability for
	 * the ActiveMQ server (the value of ha-policy can be live-only,
	 * replication-master, replication-slave, replication-colocated,
	 * shared-store-master, shared-store-slave, or shared-store-colocated).
	 */
	@SuppressWarnings("unchecked")
	public T masterConfiguration() {
		MasterConfiguration child = new MasterConfiguration<>();
		this.subresources.masterConfiguration = child;
		return (T) this;
	}

	/**
	 * A messaging resource that allows you to configure High Availability for
	 * the ActiveMQ server (the value of ha-policy can be live-only,
	 * replication-master, replication-slave, replication-colocated,
	 * shared-store-master, shared-store-slave, or shared-store-colocated).
	 */
	@SuppressWarnings("unchecked")
	public T masterConfiguration(MasterConfigurationSupplier supplier) {
		this.subresources.masterConfiguration = supplier.get();
		return (T) this;
	}

	/**
	 * A messaging resource that allows you to configure High Availability for
	 * the ActiveMQ server (the value of ha-policy can be live-only,
	 * replication-master, replication-slave, replication-colocated,
	 * shared-store-master, shared-store-slave, or shared-store-colocated).
	 */
	@SuppressWarnings("unchecked")
	public T slaveConfiguration(SlaveConfiguration value) {
		this.subresources.slaveConfiguration = value;
		return (T) this;
	}

	/**
	 * A messaging resource that allows you to configure High Availability for
	 * the ActiveMQ server (the value of ha-policy can be live-only,
	 * replication-master, replication-slave, replication-colocated,
	 * shared-store-master, shared-store-slave, or shared-store-colocated).
	 */
	@SuppressWarnings("unchecked")
	public T slaveConfiguration(SlaveConfigurationConsumer consumer) {
		SlaveConfiguration child = new SlaveConfiguration<>();
		if (consumer != null) {
			consumer.accept(child);
		}
		this.subresources.slaveConfiguration = child;
		return (T) this;
	}

	/**
	 * A messaging resource that allows you to configure High Availability for
	 * the ActiveMQ server (the value of ha-policy can be live-only,
	 * replication-master, replication-slave, replication-colocated,
	 * shared-store-master, shared-store-slave, or shared-store-colocated).
	 */
	@SuppressWarnings("unchecked")
	public T slaveConfiguration() {
		SlaveConfiguration child = new SlaveConfiguration<>();
		this.subresources.slaveConfiguration = child;
		return (T) this;
	}

	/**
	 * A messaging resource that allows you to configure High Availability for
	 * the ActiveMQ server (the value of ha-policy can be live-only,
	 * replication-master, replication-slave, replication-colocated,
	 * shared-store-master, shared-store-slave, or shared-store-colocated).
	 */
	@SuppressWarnings("unchecked")
	public T slaveConfiguration(SlaveConfigurationSupplier supplier) {
		this.subresources.slaveConfiguration = supplier.get();
		return (T) this;
	}

	/**
	 * Child mutators for SharedStoreColocatedHAPolicy
	 */
	public static class SharedStoreColocatedHAPolicyResources {
		@SingletonResource
		@ResourceDocumentation("A messaging resource that allows you to configure High Availability for the ActiveMQ server (the value of ha-policy can be live-only, replication-master, replication-slave, replication-colocated, shared-store-master, shared-store-slave, or shared-store-colocated).")
		private MasterConfiguration masterConfiguration;
		@SingletonResource
		@ResourceDocumentation("A messaging resource that allows you to configure High Availability for the ActiveMQ server (the value of ha-policy can be live-only, replication-master, replication-slave, replication-colocated, shared-store-master, shared-store-slave, or shared-store-colocated).")
		private SlaveConfiguration slaveConfiguration;

		/**
		 * A messaging resource that allows you to configure High Availability
		 * for the ActiveMQ server (the value of ha-policy can be live-only,
		 * replication-master, replication-slave, replication-colocated,
		 * shared-store-master, shared-store-slave, or shared-store-colocated).
		 */
		@Subresource
		public MasterConfiguration masterConfiguration() {
			return this.masterConfiguration;
		}

		/**
		 * A messaging resource that allows you to configure High Availability
		 * for the ActiveMQ server (the value of ha-policy can be live-only,
		 * replication-master, replication-slave, replication-colocated,
		 * shared-store-master, shared-store-slave, or shared-store-colocated).
		 */
		@Subresource
		public SlaveConfiguration slaveConfiguration() {
			return this.slaveConfiguration;
		}
	}

	/**
	 * The offset to use for the Connectors and Acceptors when creating a new
	 * backup server.
	 */
	@ModelNodeBinding(detypedName = "backup-port-offset")
	public Integer backupPortOffset() {
		return this.backupPortOffset;
	}

	/**
	 * The offset to use for the Connectors and Acceptors when creating a new
	 * backup server.
	 */
	@SuppressWarnings("unchecked")
	public T backupPortOffset(java.lang.Integer value) {
		Object oldValue = this.backupPortOffset;
		this.backupPortOffset = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("backupPortOffset", oldValue, value);
		return (T) this;
	}

	/**
	 * How many times the live server will try to request a backup, -1 means for
	 * ever.
	 */
	@ModelNodeBinding(detypedName = "backup-request-retries")
	public Integer backupRequestRetries() {
		return this.backupRequestRetries;
	}

	/**
	 * How many times the live server will try to request a backup, -1 means for
	 * ever.
	 */
	@SuppressWarnings("unchecked")
	public T backupRequestRetries(java.lang.Integer value) {
		Object oldValue = this.backupRequestRetries;
		this.backupRequestRetries = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("backupRequestRetries", oldValue, value);
		return (T) this;
	}

	/**
	 * How long (in ms) to wait for retries between attempts to request a backup
	 * server.
	 */
	@ModelNodeBinding(detypedName = "backup-request-retry-interval")
	public Long backupRequestRetryInterval() {
		return this.backupRequestRetryInterval;
	}

	/**
	 * How long (in ms) to wait for retries between attempts to request a backup
	 * server.
	 */
	@SuppressWarnings("unchecked")
	public T backupRequestRetryInterval(java.lang.Long value) {
		Object oldValue = this.backupRequestRetryInterval;
		this.backupRequestRetryInterval = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("backupRequestRetryInterval", oldValue,
					value);
		return (T) this;
	}

	/**
	 * Whether or not this live server will accept backup requests from other
	 * live servers.
	 */
	@ModelNodeBinding(detypedName = "max-backups")
	public Integer maxBackups() {
		return this.maxBackups;
	}

	/**
	 * Whether or not this live server will accept backup requests from other
	 * live servers.
	 */
	@SuppressWarnings("unchecked")
	public T maxBackups(java.lang.Integer value) {
		Object oldValue = this.maxBackups;
		this.maxBackups = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("maxBackups", oldValue, value);
		return (T) this;
	}

	/**
	 * If true then the server will request a backup on another node.
	 */
	@ModelNodeBinding(detypedName = "request-backup")
	public Boolean requestBackup() {
		return this.requestBackup;
	}

	/**
	 * If true then the server will request a backup on another node.
	 */
	@SuppressWarnings("unchecked")
	public T requestBackup(java.lang.Boolean value) {
		Object oldValue = this.requestBackup;
		this.requestBackup = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("requestBackup", oldValue, value);
		return (T) this;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy