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

org.wildfly.swarm.config.elytron.AggregateHTTPServerMechanismFactory Maven / Gradle / Ivy

package org.wildfly.swarm.config.elytron;

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;
import java.util.List;
import java.util.Arrays;
import java.util.stream.Collectors;

/**
 * A http server factory definition where the http server factory is an
 * aggregation of other http server factories.
 */
@Address("/subsystem=elytron/aggregate-http-server-mechanism-factory=*")
@ResourceType("aggregate-http-server-mechanism-factory")
public class AggregateHTTPServerMechanismFactory>
		implements
			org.wildfly.swarm.config.runtime.Keyed {

	private String key;
	private PropertyChangeSupport pcs;
	@AttributeDocumentation("The HTTP mechanisms available from this factory instance.")
	private List availableMechanisms;
	@AttributeDocumentation("The referenced http server factories to aggregate.")
	private List httpServerMechanismFactories;

	public AggregateHTTPServerMechanismFactory(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 HTTP mechanisms available from this factory instance.
	 */
	@ModelNodeBinding(detypedName = "available-mechanisms")
	public List availableMechanisms() {
		return this.availableMechanisms;
	}

	/**
	 * The HTTP mechanisms available from this factory instance.
	 */
	@SuppressWarnings("unchecked")
	public T availableMechanisms(java.util.List value) {
		Object oldValue = this.availableMechanisms;
		this.availableMechanisms = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("availableMechanisms", oldValue, value);
		return (T) this;
	}

	/**
	 * The HTTP mechanisms available from this factory instance.
	 */
	@SuppressWarnings("unchecked")
	public T availableMechanism(String value) {
		if (this.availableMechanisms == null) {
			this.availableMechanisms = new java.util.ArrayList<>();
		}
		this.availableMechanisms.add(value);
		return (T) this;
	}

	/**
	 * The HTTP mechanisms available from this factory instance.
	 */
	@SuppressWarnings("unchecked")
	public T availableMechanisms(String... args) {
		availableMechanisms(Arrays.stream(args).collect(Collectors.toList()));
		return (T) this;
	}

	/**
	 * The referenced http server factories to aggregate.
	 */
	@ModelNodeBinding(detypedName = "http-server-mechanism-factories")
	public List httpServerMechanismFactories() {
		return this.httpServerMechanismFactories;
	}

	/**
	 * The referenced http server factories to aggregate.
	 */
	@SuppressWarnings("unchecked")
	public T httpServerMechanismFactories(java.util.List value) {
		Object oldValue = this.httpServerMechanismFactories;
		this.httpServerMechanismFactories = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("httpServerMechanismFactories",
					oldValue, value);
		return (T) this;
	}

	/**
	 * The referenced http server factories to aggregate.
	 */
	@SuppressWarnings("unchecked")
	public T httpServerMechanismFactory(String value) {
		if (this.httpServerMechanismFactories == null) {
			this.httpServerMechanismFactories = new java.util.ArrayList<>();
		}
		this.httpServerMechanismFactories.add(value);
		return (T) this;
	}

	/**
	 * The referenced http server factories to aggregate.
	 */
	@SuppressWarnings("unchecked")
	public T httpServerMechanismFactories(String... args) {
		httpServerMechanismFactories(Arrays.stream(args).collect(
				Collectors.toList()));
		return (T) this;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy