BUILDER - the specific subclass type returned by the various builder API methodsATTRIBUTE - the type of AttributeDefinition produced by the build() methodpublic abstract class AbstractAttributeDefinitionBuilder<BUILDER extends AbstractAttributeDefinitionBuilder,ATTRIBUTE extends AttributeDefinition> extends Object
AttributeDefinition.| Constructor and Description |
|---|
AbstractAttributeDefinitionBuilder(AttributeDefinition basis)
Creates a builder populated with the values of an existing attribute definition.
|
AbstractAttributeDefinitionBuilder(String attributeName,
AttributeDefinition basis)
Creates a builder populated with the values of an existing attribute definition, with an optional
change of the attribute's name.
|
AbstractAttributeDefinitionBuilder(String attributeName,
org.jboss.dmr.ModelType type)
Creates a builder for an attribute with the give name and type.
|
AbstractAttributeDefinitionBuilder(String attributeName,
org.jboss.dmr.ModelType type,
boolean optional)
Creates a builder for an attribute with the give name and type and nullability setting.
|
| Modifier and Type | Method and Description |
|---|---|
BUILDER |
addAccessConstraint(AccessConstraintDefinition accessConstraint)
Adds an access constraint to the set used with the attribute
|
BUILDER |
addAlternatives(String... alternatives)
Adds
names of alternative attributes that should not
be defined if this attribute is defined. |
BUILDER |
addArbitraryDescriptor(String arbitraryDescriptor,
org.jboss.dmr.ModelNode value)
Adds
arbitrary descriptor. |
BUILDER |
addFlag(AttributeAccess.Flag flag)
Adds a
special purpose flag that is relevant to the attribute |
abstract ATTRIBUTE |
build()
Create the
AttributeDefinition |
AccessConstraintDefinition[] |
getAccessConstraints() |
org.jboss.dmr.ModelNode[] |
getAllowedValues() |
String[] |
getAlternatives() |
Map<String,org.jboss.dmr.ModelNode> |
getArbitraryDescriptors() |
String |
getAttributeGroup() |
AttributeMarshaller |
getAttributeMarshaller() |
protected CapabilityReferenceRecorder |
getCapabilityReferenceRecorder() |
ParameterCorrector |
getCorrector() |
org.jboss.dmr.ModelNode |
getDefaultValue() |
DeprecationData |
getDeprecated() |
AttributeAccess.Flag[] |
getFlags() |
int |
getMaxSize() |
MeasurementUnit |
getMeasurementUnit() |
int |
getMinSize() |
String |
getName() |
Boolean |
getNullSignificant() |
AttributeParser |
getParser() |
String[] |
getRequires() |
org.jboss.dmr.ModelType |
getType() |
org.jboss.dmr.ModelNode |
getUndefinedMetricValue() |
ParameterValidator |
getValidator() |
String |
getXmlName() |
boolean |
isAllowExpression() |
boolean |
isAllowNull() |
protected boolean |
isFlagPresent(AttributeAccess.Flag flag)
Checks if a
special purpose flag has been recorded as relevant to the attribute |
boolean |
isResourceOnly() |
BUILDER |
removeAlternatives(String... alternatives)
Removes
names of alternative attributes from the set of those that should not
be defined if this attribute is defined. |
BUILDER |
removeFlag(AttributeAccess.Flag flag)
Removes a
special purpose flag from the set of those relevant to the attribute |
BUILDER |
setAccessConstraints(AccessConstraintDefinition... accessConstraints)
Sets access constraints to use with the attribute
|
BUILDER |
setAllowedValues(int... allowedValues)
Sets allowed values for attribute
|
BUILDER |
setAllowedValues(org.jboss.dmr.ModelNode... allowedValues)
Sets allowed values for attribute
|
BUILDER |
setAllowedValues(String... allowedValues)
Sets allowed values for attribute
|
BUILDER |
setAllowExpression(boolean allowExpression)
Sets whether the attribute should
allow expressions
If not set the default value is false. |
BUILDER |
setAllowNull(boolean allowNull)
Deprecated.
|
BUILDER |
setAlternatives(String... alternatives)
Sets
names of alternative attributes that should not
be defined if this attribute is defined. |
BUILDER |
setAttributeGroup(String attributeGroup)
Sets the name of the attribute group with which this attribute is associated.
|
BUILDER |
setAttributeMarshaller(AttributeMarshaller marshaller)
Sets a custom
AttributeMarshaller to use for marshalling the attribute to xml. |
BUILDER |
setAttributeParser(AttributeParser parser)
Sets a custom
AttributeParser to use for parsing attribute from xml. |
BUILDER |
setCapabilityReference(CapabilityReferenceRecorder referenceRecorder)
Records that this attribute's value represents a reference to an instance of a
dynamic capability and assigns the
object that should be used to handle adding and removing capability requirements. |
BUILDER |
setCapabilityReference(RuntimeCapability capability,
String referencedCapability,
AttributeDefinition... dependantAttributes)
Records that this attribute's value represents a reference to an instance of a
dynamic capability. |
BUILDER |
setCapabilityReference(String referencedCapability)
Records that this attribute's value represents a reference to an instance of a
dynamic capability. |
BUILDER |
setCapabilityReference(String referencedCapability,
AttributeDefinition... dependantAttributes)
Records that this attribute's value represents a reference to an instance of a
dynamic capability. |
BUILDER |
setCapabilityReference(String referencedCapability,
RuntimeCapability<?> dependentCapability)
Records that this attribute's value represents a reference to an instance of a
dynamic capability. |
BUILDER |
setCapabilityReference(String referencedCapability,
String dependentCapability)
Records that this attribute's value represents a reference to an instance of a
dynamic capability. |
BUILDER |
setCapabilityReference(String referencedCapability,
String dependentCapability,
boolean dynamicDependent)
Deprecated.
Use
setCapabilityReference(String, RuntimeCapability) instead. |
BUILDER |
setCorrector(ParameterCorrector corrector)
Sets a
ParameterCorrector to use to adjust any user provided values
before validation
occurs. |
BUILDER |
setDefaultValue(org.jboss.dmr.ModelNode defaultValue)
Sets a
default value to use for the attribute if no
user-provided value is available. |
BUILDER |
setDeprecated(ModelVersion since)
Marks the attribute as deprecated since the given API version.
|
BUILDER |
setDeprecated(ModelVersion since,
boolean notificationUseful)
Marks the attribute as deprecated since the given API version, with the ability to configure that
notifications to the user (e.g.
|
BUILDER |
setExpressionsDeprecated()
Marks that support for use of an expression for the attribute's value is deprecated and
may be removed in a future release.
|
BUILDER |
setFlags(AttributeAccess.Flag... flags)
Sets the
special purpose flags that are relevant to the attribute |
BUILDER |
setMaxSize(int maxSize)
Sets a maximum size for a collection-type attribute or one whose value is a string or byte[].
|
BUILDER |
setMeasurementUnit(MeasurementUnit unit)
Sets a
measurement unit to describe the unit in
which a numeric attribute is expressed. |
BUILDER |
setMinSize(int minSize)
Sets a minimum size description for a collection-type attribute or one whose value is a string or byte[].
|
BUILDER |
setNullSignificant(boolean nullSignificant)
Sets whether an access control check is required to implicitly set an attribute to
undefined
in a resource "add" operation. |
BUILDER |
setRequired(boolean required)
Sets whether the attribute should
require a defined value
in the absence of alternatives. |
BUILDER |
setRequires(String... requires)
Sets
names of required attributes that must
be defined if this attribute is defined. |
BUILDER |
setResourceOnly()
Marks an attribute as only relevant to a resource, and not a valid parameter to an "add" operation that
creates that resource.
|
BUILDER |
setRestartAllServices()
Adds the
AttributeAccess.Flag#RESTART_ALL_SERVICES flag and removes any conflicting flag. |
BUILDER |
setRestartJVM()
Adds the
AttributeAccess.Flag#RESTART_JVM flag and removes any conflicting flag. |
BUILDER |
setRuntimeServiceNotRequired()
Adds the
AttributeAccess.Flag#RUNTIME_SERVICE_NOT_REQUIRED flag. |
BUILDER |
setStorageRuntime()
Adds the
AttributeAccess.Flag#STORAGE_RUNTIME flag and removes any conflicting flag. |
BUILDER |
setUndefinedMetricValue(org.jboss.dmr.ModelNode undefinedMetricValue)
Sets a
default value to use for the
metric if no runtime value is available (e.g. |
BUILDER |
setValidator(ParameterValidator validator)
Sets the validator that should be used to validate attribute values.
|
BUILDER |
setXmlName(String xmlName)
Sets the
xml name for the attribute, which is only needed
if the name used for the attribute is different from its ordinary
name in the model. |
public AbstractAttributeDefinitionBuilder(String attributeName, org.jboss.dmr.ModelType type)
AbstractAttributeDefinitionBuilder(attributeName, type, falsepublic AbstractAttributeDefinitionBuilder(String attributeName, org.jboss.dmr.ModelType type, boolean optional)
attributeName - the name of the attribute. Cannot be nulltype - the type of the attribute. Cannot be nulloptional - true if the attribute allows undefined values in the absence of alternativespublic AbstractAttributeDefinitionBuilder(AttributeDefinition basis)
basis - the existing attribute definition. Cannot be nullpublic AbstractAttributeDefinitionBuilder(String attributeName, AttributeDefinition basis)
attributeName - the name of the attribute,
or null if the name from basis should be usedbasis - the existing attribute definition. Cannot be nullpublic abstract ATTRIBUTE build()
AttributeDefinitionnullpublic BUILDER setXmlName(String xmlName)
xml name for the attribute, which is only needed
if the name used for the attribute is different from its ordinary
name in the model. If not set the default value is the name
passed to the builder constructor.xmlName - the xml name. null is allowedpublic BUILDER setRequired(boolean required)
require a defined value
in the absence of alternatives.
If not set the default value is the value provided to the builder constructor, or true
if no value is provided.required - true if undefined values should not be allowed in the absence of alternatives@Deprecated public BUILDER setAllowNull(boolean allowNull)
setRequired(boolean)setRequired(boolean); sets whether the attribute should
allow undefined values
in the absence of alternatives.
If not set the default value is the value provided to the builder constructor, or false
if no value is provided.allowNull - true if undefined values should be allowed in the absence of alternativespublic BUILDER setAllowExpression(boolean allowExpression)
allow expressions
If not set the default value is false.allowExpression - true if expression values should be allowedpublic BUILDER setDefaultValue(org.jboss.dmr.ModelNode defaultValue)
default value to use for the attribute if no
user-provided value is available.defaultValue - the default value, or null if no default should be usedpublic BUILDER setMeasurementUnit(MeasurementUnit unit)
measurement unit to describe the unit in
which a numeric attribute is expressed.unit - the unit. null is allowedpublic BUILDER setCorrector(ParameterCorrector corrector)
ParameterCorrector to use to adjust any user provided values
before validation
occurs.corrector - the corrector. May be nullpublic BUILDER setValidator(ParameterValidator validator)
allow null and
allow expression settings, so the given validator
need not be properly configured for those validations.validator - the validator. null is allowedpublic BUILDER setAlternatives(String... alternatives)
names of alternative attributes that should not
be defined if this attribute is defined.alternatives - the attribute namespublic BUILDER addAlternatives(String... alternatives)
names of alternative attributes that should not
be defined if this attribute is defined.alternatives - the attribute namespublic final BUILDER removeAlternatives(String... alternatives)
names of alternative attributes from the set of those that should not
be defined if this attribute is defined.alternatives - the attribute namespublic BUILDER addArbitraryDescriptor(String arbitraryDescriptor, org.jboss.dmr.ModelNode value)
arbitrary descriptor.arbitraryDescriptor - the arbitrary descriptor name.value - the value of the arbitrary descriptor.public BUILDER setRequires(String... requires)
names of required attributes that must
be defined if this attribute is defined.requires - the attribute namespublic BUILDER setFlags(AttributeAccess.Flag... flags)
special purpose flags that are relevant to the attributeflags - the flagspublic BUILDER addFlag(AttributeAccess.Flag flag)
special purpose flag that is relevant to the attributeflag - the flagpublic BUILDER removeFlag(AttributeAccess.Flag flag)
special purpose flag from the set of those relevant to the attributeflag - the flagprotected boolean isFlagPresent(AttributeAccess.Flag flag)
special purpose flag has been recorded as relevant to the attributeflag - the flagpublic BUILDER setStorageRuntime()
AttributeAccess.Flag#STORAGE_RUNTIME flag and removes any conflicting flag.public BUILDER setRuntimeServiceNotRequired()
AttributeAccess.Flag#RUNTIME_SERVICE_NOT_REQUIRED flag.public BUILDER setRestartAllServices()
AttributeAccess.Flag#RESTART_ALL_SERVICES flag and removes any conflicting flag.public BUILDER setRestartJVM()
AttributeAccess.Flag#RESTART_JVM flag and removes any conflicting flag.public BUILDER setMaxSize(int maxSize)
maxSize - the maximum sizepublic BUILDER setMinSize(int minSize)
minSize - the minimum sizepublic BUILDER setAttributeMarshaller(AttributeMarshaller marshaller)
AttributeMarshaller to use for marshalling the attribute to xml.
If not set, a DefaultAttributeMarshaller will be used.marshaller - the marshaller. Can be nullpublic BUILDER setAttributeParser(AttributeParser parser)
AttributeParser to use for parsing attribute from xml.
If not set, a AttributeParser.SIMPLE will be used.parser - the parser. Can be nullpublic BUILDER setResourceOnly()
public BUILDER setDeprecated(ModelVersion since)
setDeprecated(ModelVersion, boolean) with the notificationUseful parameter
set to true.since - the API version, with the API being the one (core or a subsystem) in which the attribute is usedpublic BUILDER setDeprecated(ModelVersion since, boolean notificationUseful)
notificationUseful param is true the text
description of the attribute deprecation available from the read-resource-description
management operation should provide useful information about how the user can avoid using
the attribute.since - the API version, with the API being the one (core or a subsystem) in which the attribute is usednotificationUseful - whether actively advising the user about the deprecation is usefulpublic final BUILDER setExpressionsDeprecated()
public BUILDER setAccessConstraints(AccessConstraintDefinition... accessConstraints)
accessConstraints - the constraintspublic BUILDER addAccessConstraint(AccessConstraintDefinition accessConstraint)
accessConstraint - the constraintpublic BUILDER setNullSignificant(boolean nullSignificant)
undefined
in a resource "add" operation. "Implicitly" setting an attribute refers to not providing a value for
it in the add operation, leaving the attribute in an undefined state. If not set
the default value is whether the attribute AttributeDefinition.isRequired() () is not required} and
has a default value.nullSignificant - true if an undefined value is significant; false if it is not significant,
even if a default value is configuredpublic BUILDER setAttributeGroup(String attributeGroup)
attributeGroup - the attribute group name. Cannot be an empty string but can be null
if the attribute is not associated with a group.public BUILDER setAllowedValues(org.jboss.dmr.ModelNode... allowedValues)
allowedValues - values that are legal as part in this attributepublic BUILDER setAllowedValues(String... allowedValues)
allowedValues - values that are legal as part in this attributepublic BUILDER setAllowedValues(int... allowedValues)
allowedValues - values that are legal as part in this attributepublic BUILDER setCapabilityReference(String referencedCapability, RuntimeCapability<?> dependentCapability)
dynamic capability.
This method is a convenience method equivalent to calling
setCapabilityReference(CapabilityReferenceRecorder)
passing in a CapabilityReferenceRecorder.DefaultCapabilityReferenceRecorder
constructed using the parameters passed to this method.
referencedCapability - the name of the dynamic capability the dynamic portion of whose name is
represented by the attribute's valuedependentCapability - the capability that depends on referencedCapabilityAttributeDefinition.addCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode),
AttributeDefinition.removeCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode)public BUILDER setCapabilityReference(String referencedCapability)
dynamic capability.
This method is a convenience method equivalent to calling
setCapabilityReference(CapabilityReferenceRecorder)
passing in a CapabilityReferenceRecorder.ContextDependencyRecorder
constructed using the parameters passed to this method.
NOTE: This method of recording capability references is only suitable for use in attributes
only used in resources that themselves expose a single capability.
If your resource exposes more than single you should use setCapabilityReference(RuntimeCapability, String, AttributeDefinition...) variant
When the capability requirement is registered, the dependent capability will be that capability.
referencedCapability - the name of the dynamic capability the dynamic portion of whose name is
represented by the attribute's valueAttributeDefinition.addCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode),
AttributeDefinition.removeCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode)public BUILDER setCapabilityReference(String referencedCapability, AttributeDefinition... dependantAttributes)
dynamic capability.
This method is a convenience method equivalent to calling * setCapabilityReference(CapabilityReferenceRecorder)
passing in a CapabilityReferenceRecorder.CompositeAttributeDependencyRecorder
constructed using the parameters passed to this method.
NOTE: This method of recording capability references is only suitable for use in attributes
only used in resources that themselves expose a single capability.
If your resource exposes more than single capability, you should use setCapabilityReference(RuntimeCapability, String, AttributeDefinition...)
When the capability requirement
is registered, the dependent capability will be that capability.
referencedCapability - the name of the dynamic capability the dynamic portion of whose name is
represented by the attribute's valuedependantAttributes - attribute from same resource that will be used to derive multiple dynamic parts for the dependant capabilityAttributeDefinition.addCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode),
AttributeDefinition.removeCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode)public BUILDER setCapabilityReference(RuntimeCapability capability, String referencedCapability, AttributeDefinition... dependantAttributes)
dynamic capability.
This method is a convenience method equivalent to calling setCapabilityReference(CapabilityReferenceRecorder)
passing in a CapabilityReferenceRecorder.CompositeAttributeDependencyRecorder
constructed using the parameters passed to this method.
When the capability requirement is registered, the dependent capability will be that capability.
capability - requirement capabilityreferencedCapability - the name of the dynamic capability the dynamic portion of whose name is
represented by the attribute's valuedependantAttributes - attributes on resource which will be used for registering capability reference, can be multiple.AttributeDefinition.addCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode),
AttributeDefinition.removeCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode)@Deprecated public BUILDER setCapabilityReference(String referencedCapability, String dependentCapability, boolean dynamicDependent)
setCapabilityReference(String, RuntimeCapability) instead.dynamic capability.
This method is a convenience method equivalent to calling
setCapabilityReference(CapabilityReferenceRecorder)
passing in a CapabilityReferenceRecorder.DefaultCapabilityReferenceRecorder
constructed using the parameters passed to this method.
referencedCapability - the name of the dynamic capability the dynamic portion of whose name is
represented by the attribute's valuedependentCapability - the name of the capability that depends on referencedCapabilitydynamicDependent - true if dependentCapability is a dynamic capability, the dynamic
portion of which comes from the name of the resource with which
the attribute is associatedpublic BUILDER setCapabilityReference(String referencedCapability, String dependentCapability)
dynamic capability.
This method is a convenience method equivalent to calling
setCapabilityReference(CapabilityReferenceRecorder)
passing in a CapabilityReferenceRecorder.DefaultCapabilityReferenceRecorder
constructed using the parameters passed to this method.
referencedCapability - the name of the dynamic capability the dynamic portion of whose name is
represented by the attribute's valuedependentCapability - the name of the capability that depends on referencedCapabilityAttributeDefinition.addCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode),
AttributeDefinition.removeCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode)public BUILDER setCapabilityReference(CapabilityReferenceRecorder referenceRecorder)
dynamic capability and assigns the
object that should be used to handle adding and removing capability requirements.referenceRecorder - recorder to handle adding and removing capability requirements. May be nullAttributeDefinition.addCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode),
AttributeDefinition.removeCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode)public BUILDER setUndefinedMetricValue(org.jboss.dmr.ModelNode undefinedMetricValue)
default value to use for the
metric if no runtime value is available (e.g. we are a server running in admin-only mode).undefinedMetricValue - the default value, or null if no default should be usedpublic String getName()
public org.jboss.dmr.ModelType getType()
public String getXmlName()
public boolean isAllowNull()
public boolean isAllowExpression()
public org.jboss.dmr.ModelNode getDefaultValue()
public MeasurementUnit getMeasurementUnit()
public String[] getAlternatives()
public String[] getRequires()
public ParameterCorrector getCorrector()
public ParameterValidator getValidator()
public int getMinSize()
public int getMaxSize()
public AttributeAccess.Flag[] getFlags()
public AttributeMarshaller getAttributeMarshaller()
public boolean isResourceOnly()
public DeprecationData getDeprecated()
public AccessConstraintDefinition[] getAccessConstraints()
public Boolean getNullSignificant()
public org.jboss.dmr.ModelNode getUndefinedMetricValue()
public AttributeParser getParser()
public String getAttributeGroup()
public org.jboss.dmr.ModelNode[] getAllowedValues()
protected final CapabilityReferenceRecorder getCapabilityReferenceRecorder()
Copyright © 2021 JBoss by Red Hat. All rights reserved.