org.wildfly.swarm.config.elytron.ConstantPrincipalDecoder Maven / Gradle / Ivy
The 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;
/**
* Definition of a principal decoder that always returns the same constant.
*/
@Address("/subsystem=elytron/constant-principal-decoder=*")
@ResourceType("constant-principal-decoder")
public class ConstantPrincipalDecoder>
implements
org.wildfly.swarm.config.runtime.Keyed {
private String key;
private PropertyChangeSupport pcs;
@AttributeDocumentation("The constant value the principal decoder will always return.")
private String constant;
public ConstantPrincipalDecoder(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 constant value the principal decoder will always return.
*/
@ModelNodeBinding(detypedName = "constant")
public String constant() {
return this.constant;
}
/**
* The constant value the principal decoder will always return.
*/
@SuppressWarnings("unchecked")
public T constant(java.lang.String value) {
Object oldValue = this.constant;
this.constant = value;
if (this.pcs != null)
this.pcs.firePropertyChange("constant", oldValue, value);
return (T) this;
}
}