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

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

There is a newer version: 2.7.0
Show newest version
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.Map;

/**
 * Definition of a custom RoleMapper
 */
@Address("/subsystem=elytron/custom-role-mapper=*")
@ResourceType("custom-role-mapper")
public class CustomRoleMapper>
		implements
			org.wildfly.swarm.config.runtime.Keyed {

	private String key;
	private PropertyChangeSupport pcs;
	@AttributeDocumentation("Fully qualified class name of the RoleMapper")
	private String className;
	@AttributeDocumentation("The optional key/value configuration for the RoleMapper")
	private Map configuration;
	@AttributeDocumentation("Name of the module to use to load the RoleMapper")
	private String module;

	public CustomRoleMapper(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);
	}

	/**
	 * Fully qualified class name of the RoleMapper
	 */
	@ModelNodeBinding(detypedName = "class-name")
	public String className() {
		return this.className;
	}

	/**
	 * Fully qualified class name of the RoleMapper
	 */
	@SuppressWarnings("unchecked")
	public T className(java.lang.String value) {
		Object oldValue = this.className;
		this.className = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("className", oldValue, value);
		return (T) this;
	}

	/**
	 * The optional key/value configuration for the RoleMapper
	 */
	@ModelNodeBinding(detypedName = "configuration")
	public Map configuration() {
		return this.configuration;
	}

	/**
	 * The optional key/value configuration for the RoleMapper
	 */
	@SuppressWarnings("unchecked")
	public T configuration(java.util.Map value) {
		Object oldValue = this.configuration;
		this.configuration = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("configuration", oldValue, value);
		return (T) this;
	}

	/**
	 * The optional key/value configuration for the RoleMapper
	 */
	@SuppressWarnings("unchecked")
	public T configuration(java.lang.String key, java.lang.Object value) {
		if (this.configuration == null) {
			this.configuration = new java.util.HashMap<>();
		}
		this.configuration.put(key, value);
		return (T) this;
	}

	/**
	 * Name of the module to use to load the RoleMapper
	 */
	@ModelNodeBinding(detypedName = "module")
	public String module() {
		return this.module;
	}

	/**
	 * Name of the module to use to load the RoleMapper
	 */
	@SuppressWarnings("unchecked")
	public T module(java.lang.String value) {
		Object oldValue = this.module;
		this.module = value;
		if (this.pcs != null)
			this.pcs.firePropertyChange("module", oldValue, value);
		return (T) this;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy