org.wildfly.swarm.config.management.security_realm.PropertiesAuthentication Maven / Gradle / Ivy
package org.wildfly.swarm.config.management.security_realm;
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 org.wildfly.swarm.config.runtime.ModelNodeBinding;
/**
* Configuration to use a list users stored within a properties file as the user
* repository. The entries within the properties file are username={credentials}
* with each user being specified on it's own line.
*/
@Address("/core-service=management/security-realm=*/authentication=properties")
@ResourceType("authentication")
@Implicit
public class PropertiesAuthentication>
implements
org.wildfly.swarm.config.runtime.Keyed {
private String key;
private PropertyChangeSupport pcs;
@AttributeDocumentation("The path of the properties file containing the users.")
private String path;
@AttributeDocumentation("Are the credentials within the properties file stored in plain text. If not the credential is expected to be the hex encoded Digest hash of 'username : realm : password'.")
private Boolean plainText;
@AttributeDocumentation("The name of another previously named path, or of one of the standard paths provided by the system. If 'relative-to' is provided, the value of the 'path' attribute is treated as relative to the path specified by this attribute.")
private String relativeTo;
public PropertiesAuthentication() {
super();
this.key = "properties";
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);
}
/**
* The path of the properties file containing the users.
*/
@ModelNodeBinding(detypedName = "path")
public String path() {
return this.path;
}
/**
* The path of the properties file containing the users.
*/
@SuppressWarnings("unchecked")
public T path(java.lang.String value) {
Object oldValue = this.path;
this.path = value;
if (this.pcs != null)
this.pcs.firePropertyChange("path", oldValue, value);
return (T) this;
}
/**
* Are the credentials within the properties file stored in plain text. If
* not the credential is expected to be the hex encoded Digest hash of
* 'username : realm : password'.
*/
@ModelNodeBinding(detypedName = "plain-text")
public Boolean plainText() {
return this.plainText;
}
/**
* Are the credentials within the properties file stored in plain text. If
* not the credential is expected to be the hex encoded Digest hash of
* 'username : realm : password'.
*/
@SuppressWarnings("unchecked")
public T plainText(java.lang.Boolean value) {
Object oldValue = this.plainText;
this.plainText = value;
if (this.pcs != null)
this.pcs.firePropertyChange("plainText", oldValue, value);
return (T) this;
}
/**
* The name of another previously named path, or of one of the standard
* paths provided by the system. If 'relative-to' is provided, the value of
* the 'path' attribute is treated as relative to the path specified by this
* attribute.
*/
@ModelNodeBinding(detypedName = "relative-to")
public String relativeTo() {
return this.relativeTo;
}
/**
* The name of another previously named path, or of one of the standard
* paths provided by the system. If 'relative-to' is provided, the value of
* the 'path' attribute is treated as relative to the path specified by this
* attribute.
*/
@SuppressWarnings("unchecked")
public T relativeTo(java.lang.String value) {
Object oldValue = this.relativeTo;
this.relativeTo = value;
if (this.pcs != null)
this.pcs.firePropertyChange("relativeTo", oldValue, value);
return (T) this;
}
}