org.wildfly.swarm.config.management.security_realm.SecretServerIdentity 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;
import java.util.Map;
/**
* Configuration of the secret/password-based identity of a server or host
* controller.
*/
@Address("/core-service=management/security-realm=*/server-identity=secret")
@ResourceType("server-identity")
@Implicit
public class SecretServerIdentity>
implements
org.wildfly.swarm.config.runtime.Keyed {
private String key;
private PropertyChangeSupport pcs;
@AttributeDocumentation("The reference to credential for the secret / password stored in CredentialStore under defined alias or clear text password.")
private Map credentialReference;
@AttributeDocumentation("The secret / password - Base64 Encoded.")
private String value;
public SecretServerIdentity() {
super();
this.key = "secret";
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 reference to credential for the secret / password stored in
* CredentialStore under defined alias or clear text password.
*/
@ModelNodeBinding(detypedName = "credential-reference")
public Map credentialReference() {
return this.credentialReference;
}
/**
* The reference to credential for the secret / password stored in
* CredentialStore under defined alias or clear text password.
*/
@SuppressWarnings("unchecked")
public T credentialReference(java.util.Map value) {
Object oldValue = this.credentialReference;
this.credentialReference = value;
if (this.pcs != null)
this.pcs.firePropertyChange("credentialReference", oldValue, value);
return (T) this;
}
/**
* The reference to credential for the secret / password stored in
* CredentialStore under defined alias or clear text password.
*/
@SuppressWarnings("unchecked")
public T credentialReference(java.lang.String key, java.lang.Object value) {
if (this.credentialReference == null) {
this.credentialReference = new java.util.HashMap<>();
}
this.credentialReference.put(key, value);
return (T) this;
}
/**
* The secret / password - Base64 Encoded.
*/
@ModelNodeBinding(detypedName = "value")
public String value() {
return this.value;
}
/**
* The secret / password - Base64 Encoded.
*/
@SuppressWarnings("unchecked")
public T value(java.lang.String value) {
Object oldValue = this.value;
this.value = value;
if (this.pcs != null)
this.pcs.firePropertyChange("value", oldValue, value);
return (T) this;
}
}