Class AbstractAttributeDefinitionBuilder<BUILDER extends AbstractAttributeDefinitionBuilder,ATTRIBUTE extends AttributeDefinition>
- java.lang.Object
-
- org.jboss.as.controller.AbstractAttributeDefinitionBuilder<BUILDER,ATTRIBUTE>
-
- Type Parameters:
BUILDER
- the specific subclass type returned by the various builder API methodsATTRIBUTE
- the type ofAttributeDefinition
produced by thebuild()
method
- Direct Known Subclasses:
ListAttributeDefinition.Builder
,MapAttributeDefinition.Builder
,ObjectTypeAttributeDefinition.Builder
,SimpleAttributeDefinitionBuilder
public abstract class AbstractAttributeDefinitionBuilder<BUILDER extends AbstractAttributeDefinitionBuilder,ATTRIBUTE extends AttributeDefinition> extends Object
Provides a builder API for creating anAttributeDefinition
.- Author:
- Tomaz Cerar
-
-
Constructor Summary
Constructors Constructor Description 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.AbstractAttributeDefinitionBuilder(AttributeDefinition basis)
Creates a builder populated with the values of an existing attribute definition.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description BUILDER
addAccessConstraint(AccessConstraintDefinition accessConstraint)
Adds an access constraint to the set used with the attributeBUILDER
addAlternatives(String... alternatives)
Addsnames of alternative attributes
that should not be defined if this attribute is defined.BUILDER
addArbitraryDescriptor(String arbitraryDescriptor, org.jboss.dmr.ModelNode value)
Addsarbitrary descriptor
.BUILDER
addFlag(AttributeAccess.Flag flag)
Adds aspecial purpose flag
that is relevant to the attributeabstract ATTRIBUTE
build()
Create theAttributeDefinition
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()
protected boolean
isFlagPresent(AttributeAccess.Flag flag)
Checks if aspecial purpose flag
has been recorded as relevant to the attributeboolean
isNillable()
boolean
isResourceOnly()
BUILDER
removeAlternatives(String... alternatives)
Removesnames of alternative attributes
from the set of those that should not be defined if this attribute is defined.BUILDER
removeFlag(AttributeAccess.Flag flag)
Removes aspecial purpose flag
from the set of those relevant to the attributeBUILDER
setAccessConstraints(AccessConstraintDefinition... accessConstraints)
Sets access constraints to use with the attributeBUILDER
setAllowedValues(int... allowedValues)
Sets allowed values for attributeBUILDER
setAllowedValues(String... allowedValues)
Sets allowed values for attributeBUILDER
setAllowedValues(org.jboss.dmr.ModelNode... allowedValues)
Sets allowed values for attributeBUILDER
setAllowExpression(boolean allowExpression)
Sets whether the attribute shouldallow expressions
If not set the default value isfalse
.BUILDER
setAlternatives(String... alternatives)
Setsnames 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 customAttributeMarshaller
to use for marshalling the attribute to xml.BUILDER
setAttributeParser(AttributeParser parser)
Sets a customAttributeParser
to use for parsing attribute from xml.BUILDER
setCapabilityReference(String referencedCapability)
Records that this attribute's value represents a reference to an instance of adynamic capability
.BUILDER
setCapabilityReference(String referencedCapability, String dependentCapability)
Records that this attribute's value represents a reference to an instance of adynamic capability
.BUILDER
setCapabilityReference(String referencedCapability, AttributeDefinition... dependantAttributes)
Records that this attribute's value represents a reference to an instance of adynamic capability
.BUILDER
setCapabilityReference(String referencedCapability, RuntimeCapability<?> dependentCapability)
Records that this attribute's value represents a reference to an instance of adynamic capability
.BUILDER
setCapabilityReference(RuntimeCapability capability, String referencedCapability, AttributeDefinition... dependantAttributes)
Records that this attribute's value represents a reference to an instance of adynamic capability
.BUILDER
setCapabilityReference(CapabilityReferenceRecorder referenceRecorder)
Records that this attribute's value represents a reference to an instance of adynamic capability
and assigns the object that should be used to handle adding and removing capability requirements.BUILDER
setCorrector(ParameterCorrector corrector)
Sets aParameterCorrector
to use to adjust any user provided values beforevalidation
occurs.BUILDER
setDefaultValue(org.jboss.dmr.ModelNode defaultValue)
Sets adefault 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 thespecial purpose flags
that are relevant to the attributeBUILDER
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 ameasurement 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 toundefined
in a resource "add" operation.BUILDER
setRequired(boolean required)
Sets whether the attribute shouldrequire a defined value
in the absence ofalternatives
.BUILDER
setRequires(String... requires)
Setsnames 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 theAttributeAccess.Flag.RESTART_ALL_SERVICES
flag and removes any conflicting flag.BUILDER
setRestartJVM()
Adds theAttributeAccess.Flag.RESTART_JVM
flag and removes any conflicting flag.BUILDER
setRuntimeServiceNotRequired()
Adds theAttributeAccess.Flag.RUNTIME_SERVICE_NOT_REQUIRED
flag.BUILDER
setStorageRuntime()
Adds theAttributeAccess.Flag.STORAGE_RUNTIME
flag and removes any conflicting flag.BUILDER
setUndefinedMetricValue(org.jboss.dmr.ModelNode undefinedMetricValue)
Sets adefault 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 thexml name
for the attribute, which is only needed if the name used for the attribute is different from its ordinaryname in the model
.
-
-
-
Constructor Detail
-
AbstractAttributeDefinitionBuilder
public AbstractAttributeDefinitionBuilder(String attributeName, org.jboss.dmr.ModelType type)
Creates a builder for an attribute with the give name and type. Equivalent toAbstractAttributeDefinitionBuilder(attributeName, type, false
-
AbstractAttributeDefinitionBuilder
public 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.- Parameters:
attributeName
- thename
of the attribute. Cannot benull
type
- thetype
of the attribute. Cannot benull
optional
-true
if the attributeallows undefined values
in the absence ofalternatives
-
AbstractAttributeDefinitionBuilder
public AbstractAttributeDefinitionBuilder(AttributeDefinition basis)
Creates a builder populated with the values of an existing attribute definition.- Parameters:
basis
- the existing attribute definition. Cannot benull
-
AbstractAttributeDefinitionBuilder
public 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.- Parameters:
attributeName
- thename
of the attribute, ornull
if the name frombasis
should be usedbasis
- the existing attribute definition. Cannot benull
-
-
Method Detail
-
build
public abstract ATTRIBUTE build()
Create theAttributeDefinition
- Returns:
- the attribute definition. Will not return
null
-
setXmlName
public BUILDER setXmlName(String xmlName)
Sets thexml name
for the attribute, which is only needed if the name used for the attribute is different from its ordinaryname in the model
. If not set the default value is the name passed to the builder constructor.- Parameters:
xmlName
- the xml name.null
is allowed- Returns:
- a builder that can be used to continue building the attribute definition
-
setRequired
public BUILDER setRequired(boolean required)
Sets whether the attribute shouldrequire a defined value
in the absence ofalternatives
. If not set the default value is the value provided to the builder constructor, ortrue
if no value is provided.- Parameters:
required
-true
if undefined values should not be allowed in the absence of alternatives- Returns:
- a builder that can be used to continue building the attribute definition
-
setAllowExpression
public BUILDER setAllowExpression(boolean allowExpression)
Sets whether the attribute shouldallow expressions
If not set the default value isfalse
.- Parameters:
allowExpression
-true
if expression values should be allowed- Returns:
- a builder that can be used to continue building the attribute definition
-
setDefaultValue
public BUILDER setDefaultValue(org.jboss.dmr.ModelNode defaultValue)
Sets adefault value
to use for the attribute if no user-provided value is available.- Parameters:
defaultValue
- the default value, ornull
if no default should be used- Returns:
- a builder that can be used to continue building the attribute definition
-
setMeasurementUnit
public BUILDER setMeasurementUnit(MeasurementUnit unit)
Sets ameasurement unit
to describe the unit in which a numeric attribute is expressed.- Parameters:
unit
- the unit.null
is allowed- Returns:
- a builder that can be used to continue building the attribute definition
-
setCorrector
public BUILDER setCorrector(ParameterCorrector corrector)
Sets aParameterCorrector
to use to adjust any user provided values beforevalidation
occurs.- Parameters:
corrector
- the corrector. May benull
- Returns:
- a builder that can be used to continue building the attribute definition
-
setValidator
public BUILDER setValidator(ParameterValidator validator)
Sets the validator that should be used to validate attribute values. The resulting attribute definition will wrap this validator in one that enforces the attribute'sallow null
andallow expression
settings, so the givenvalidator
need not be properly configured for those validations.- Parameters:
validator
- the validator.null
is allowed- Returns:
- a builder that can be used to continue building the attribute definition
-
setAlternatives
public BUILDER setAlternatives(String... alternatives)
Setsnames of alternative attributes
that should not be defined if this attribute is defined.- Parameters:
alternatives
- the attribute names- Returns:
- a builder that can be used to continue building the attribute definition
-
addAlternatives
public BUILDER addAlternatives(String... alternatives)
Addsnames of alternative attributes
that should not be defined if this attribute is defined.- Parameters:
alternatives
- the attribute names- Returns:
- a builder that can be used to continue building the attribute definition
-
removeAlternatives
public final BUILDER removeAlternatives(String... alternatives)
Removesnames of alternative attributes
from the set of those that should not be defined if this attribute is defined.- Parameters:
alternatives
- the attribute names- Returns:
- a builder that can be used to continue building the attribute definition
-
addArbitraryDescriptor
public BUILDER addArbitraryDescriptor(String arbitraryDescriptor, org.jboss.dmr.ModelNode value)
Addsarbitrary descriptor
.- Parameters:
arbitraryDescriptor
- the arbitrary descriptor name.value
- the value of the arbitrary descriptor.- Returns:
- a builder that can be used to continue building the attribute definition
-
setRequires
public BUILDER setRequires(String... requires)
Setsnames of required attributes
that must be defined if this attribute is defined.- Parameters:
requires
- the attribute names- Returns:
- a builder that can be used to continue building the attribute definition
-
setFlags
public BUILDER setFlags(AttributeAccess.Flag... flags)
Sets thespecial purpose flags
that are relevant to the attribute- Parameters:
flags
- the flags- Returns:
- a builder that can be used to continue building the attribute definition
-
addFlag
public BUILDER addFlag(AttributeAccess.Flag flag)
Adds aspecial purpose flag
that is relevant to the attribute- Parameters:
flag
- the flag- Returns:
- a builder that can be used to continue building the attribute definition
-
removeFlag
public BUILDER removeFlag(AttributeAccess.Flag flag)
Removes aspecial purpose flag
from the set of those relevant to the attribute- Parameters:
flag
- the flag- Returns:
- a builder that can be used to continue building the attribute definition
-
isFlagPresent
protected boolean isFlagPresent(AttributeAccess.Flag flag)
Checks if aspecial purpose flag
has been recorded as relevant to the attribute- Parameters:
flag
- the flag- Returns:
- a builder that can be used to continue building the attribute definition
-
setStorageRuntime
public BUILDER setStorageRuntime()
Adds theAttributeAccess.Flag.STORAGE_RUNTIME
flag and removes any conflicting flag.- Returns:
- a builder that can be used to continue building the attribute definition
-
setRuntimeServiceNotRequired
public BUILDER setRuntimeServiceNotRequired()
Adds theAttributeAccess.Flag.RUNTIME_SERVICE_NOT_REQUIRED
flag.- Returns:
- a builder that can be used to continue building the attribute definition
-
setRestartAllServices
public BUILDER setRestartAllServices()
Adds theAttributeAccess.Flag.RESTART_ALL_SERVICES
flag and removes any conflicting flag.- Returns:
- a builder that can be used to continue building the attribute definition
-
setRestartJVM
public BUILDER setRestartJVM()
Adds theAttributeAccess.Flag.RESTART_JVM
flag and removes any conflicting flag.- Returns:
- a builder that can be used to continue building the attribute definition
-
setMaxSize
public BUILDER setMaxSize(int maxSize)
Sets a maximum size for a collection-type attribute or one whose value is a string or byte[]. The value represents the maximum number of elements in the collection, or the maximum length of the string or array. It does not represent a maximum value for a numeric attribute and should not be configured for numeric attributes.- Parameters:
maxSize
- the maximum size- Returns:
- a builder that can be used to continue building the attribute definition
-
setMinSize
public BUILDER setMinSize(int minSize)
Sets a minimum size description for a collection-type attribute or one whose value is a string or byte[]. The value represents the minimum number of elements in the collection, or the minimum length of the string or array. It does not represent a minimum value for a numeric attribute and should not be configured for numeric attributes.- Parameters:
minSize
- the minimum size- Returns:
- a builder that can be used to continue building the attribute definition
-
setAttributeMarshaller
public BUILDER setAttributeMarshaller(AttributeMarshaller marshaller)
Sets a customAttributeMarshaller
to use for marshalling the attribute to xml. If not set, aDefaultAttributeMarshaller
will be used.- Parameters:
marshaller
- the marshaller. Can benull
- Returns:
- a builder that can be used to continue building the attribute definition
-
setAttributeParser
public BUILDER setAttributeParser(AttributeParser parser)
Sets a customAttributeParser
to use for parsing attribute from xml. If not set, aAttributeParser.SIMPLE
will be used.- Parameters:
parser
- the parser. Can benull
- Returns:
- a builder that can be used to continue building the attribute definition
-
setResourceOnly
public BUILDER setResourceOnly()
Marks an attribute as only relevant to a resource, and not a valid parameter to an "add" operation that creates that resource. Typically used for legacy "name" attributes that display the final value in the resource's address as an attribute.- Returns:
- a builder that can be used to continue building the attribute definition
-
setDeprecated
public BUILDER setDeprecated(ModelVersion since)
Marks the attribute as deprecated since the given API version. This is equivalent to callingsetDeprecated(ModelVersion, boolean)
with thenotificationUseful
parameter set totrue
.- Parameters:
since
- the API version, with the API being the one (core or a subsystem) in which the attribute is used- Returns:
- a builder that can be used to continue building the attribute definition
-
setDeprecated
public 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. via a log message) about deprecation of the attribute should not be emitted. Notifying the user should only be done if the user can take some action in response. Advising that something will be removed in a later release is not useful if there is no alternative in the current release. If thenotificationUseful
param istrue
the text description of the attribute deprecation available from theread-resource-description
management operation should provide useful information about how the user can avoid using the attribute.- Parameters:
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 useful- Returns:
- a builder that can be used to continue building the attribute definition
-
setExpressionsDeprecated
public final 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.- Returns:
- a builder that can be used to continue building the attribute definition
-
setAccessConstraints
public BUILDER setAccessConstraints(AccessConstraintDefinition... accessConstraints)
Sets access constraints to use with the attribute- Parameters:
accessConstraints
- the constraints- Returns:
- a builder that can be used to continue building the attribute definition
-
addAccessConstraint
public BUILDER addAccessConstraint(AccessConstraintDefinition accessConstraint)
Adds an access constraint to the set used with the attribute- Parameters:
accessConstraint
- the constraint- Returns:
- a builder that can be used to continue building the attribute definition
-
setNullSignificant
public BUILDER setNullSignificant(boolean nullSignificant)
Sets whether an access control check is required to implicitly set an attribute toundefined
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 attributeAttributeDefinition.isRequired()
() is not required} and has adefault value
.- Parameters:
nullSignificant
-true
if an undefined value is significant;false
if it is not significant, even if a default value is configured- Returns:
- a builder that can be used to continue building the attribute definition
-
setAttributeGroup
public BUILDER setAttributeGroup(String attributeGroup)
Sets the name of the attribute group with which this attribute is associated.- Parameters:
attributeGroup
- the attribute group name. Cannot be an empty string but can benull
if the attribute is not associated with a group.- Returns:
- a builder that can be used to continue building the attribute definition
-
setAllowedValues
public BUILDER setAllowedValues(org.jboss.dmr.ModelNode... allowedValues)
Sets allowed values for attribute- Parameters:
allowedValues
- values that are legal as part in this attribute- Returns:
- a builder that can be used to continue building the attribute definition
-
setAllowedValues
public BUILDER setAllowedValues(String... allowedValues)
Sets allowed values for attribute- Parameters:
allowedValues
- values that are legal as part in this attribute- Returns:
- a builder that can be used to continue building the attribute definition
-
setAllowedValues
public BUILDER setAllowedValues(int... allowedValues)
Sets allowed values for attribute- Parameters:
allowedValues
- values that are legal as part in this attribute- Returns:
- a builder that can be used to continue building the attribute definition
-
setCapabilityReference
public BUILDER setCapabilityReference(String referencedCapability, RuntimeCapability<?> dependentCapability)
Records that this attribute's value represents a reference to an instance of adynamic capability
.This method is a convenience method equivalent to calling
setCapabilityReference(CapabilityReferenceRecorder)
passing in aCapabilityReferenceRecorder.DefaultCapabilityReferenceRecorder
constructed using the parameters passed to this method.- Parameters:
referencedCapability
- the name of the dynamic capability the dynamic portion of whose name is represented by the attribute's valuedependentCapability
- the capability that depends onreferencedCapability
- Returns:
- the builder
- See Also:
AttributeDefinition.addCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode)
,AttributeDefinition.removeCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode)
-
setCapabilityReference
public BUILDER setCapabilityReference(String referencedCapability)
Records that this attribute's value represents a reference to an instance of adynamic capability
.This method is a convenience method equivalent to calling
setCapabilityReference(CapabilityReferenceRecorder)
passing in aCapabilityReferenceRecorder.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.- Parameters:
referencedCapability
- the name of the dynamic capability the dynamic portion of whose name is represented by the attribute's value- Returns:
- the builder
- See Also:
AttributeDefinition.addCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode)
,AttributeDefinition.removeCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode)
-
setCapabilityReference
public BUILDER setCapabilityReference(String referencedCapability, AttributeDefinition... dependantAttributes)
Records that this attribute's value represents a reference to an instance of adynamic capability
.This method is a convenience method equivalent to calling *
setCapabilityReference(CapabilityReferenceRecorder)
passing in aCapabilityReferenceRecorder.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.- Parameters:
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 capability- Returns:
- the builder
- See Also:
AttributeDefinition.addCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode)
,AttributeDefinition.removeCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode)
-
setCapabilityReference
public BUILDER setCapabilityReference(RuntimeCapability capability, String referencedCapability, AttributeDefinition... dependantAttributes)
Records that this attribute's value represents a reference to an instance of adynamic capability
.This method is a convenience method equivalent to calling
setCapabilityReference(CapabilityReferenceRecorder)
passing in aCapabilityReferenceRecorder.CompositeAttributeDependencyRecorder
constructed using the parameters passed to this method.When the capability requirement is registered, the dependent capability will be that capability.
- Parameters:
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.- Returns:
- the builder
- See Also:
AttributeDefinition.addCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode)
,AttributeDefinition.removeCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode)
-
setCapabilityReference
public BUILDER setCapabilityReference(String referencedCapability, String dependentCapability)
Records that this attribute's value represents a reference to an instance of adynamic capability
.This method is a convenience method equivalent to calling
setCapabilityReference(CapabilityReferenceRecorder)
passing in aCapabilityReferenceRecorder.DefaultCapabilityReferenceRecorder
constructed using the parameters passed to this method.- Parameters:
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 onreferencedCapability
- Returns:
- the builder
- See Also:
AttributeDefinition.addCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode)
,AttributeDefinition.removeCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode)
-
setCapabilityReference
public BUILDER setCapabilityReference(CapabilityReferenceRecorder referenceRecorder)
Records that this attribute's value represents a reference to an instance of adynamic capability
and assigns the object that should be used to handle adding and removing capability requirements.- Parameters:
referenceRecorder
- recorder to handle adding and removing capability requirements. May benull
- Returns:
- the builder
- See Also:
AttributeDefinition.addCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode)
,AttributeDefinition.removeCapabilityRequirements(OperationContext, org.jboss.as.controller.registry.Resource, ModelNode)
-
setUndefinedMetricValue
public BUILDER setUndefinedMetricValue(org.jboss.dmr.ModelNode undefinedMetricValue)
Sets adefault value
to use for the metric if no runtime value is available (e.g. we are a server running in admin-only mode).- Parameters:
undefinedMetricValue
- the default value, ornull
if no default should be used- Returns:
- a builder that can be used to continue building the attribute definition
-
getName
public String getName()
-
getType
public org.jboss.dmr.ModelType getType()
-
getXmlName
public String getXmlName()
-
isNillable
public boolean isNillable()
-
isAllowExpression
public boolean isAllowExpression()
-
getDefaultValue
public org.jboss.dmr.ModelNode getDefaultValue()
-
getMeasurementUnit
public MeasurementUnit getMeasurementUnit()
-
getAlternatives
public String[] getAlternatives()
-
getRequires
public String[] getRequires()
-
getCorrector
public ParameterCorrector getCorrector()
-
getValidator
public ParameterValidator getValidator()
-
getMinSize
public int getMinSize()
-
getMaxSize
public int getMaxSize()
-
getFlags
public AttributeAccess.Flag[] getFlags()
-
getAttributeMarshaller
public AttributeMarshaller getAttributeMarshaller()
-
isResourceOnly
public boolean isResourceOnly()
-
getDeprecated
public DeprecationData getDeprecated()
-
getAccessConstraints
public AccessConstraintDefinition[] getAccessConstraints()
-
getNullSignificant
public Boolean getNullSignificant()
-
getUndefinedMetricValue
public org.jboss.dmr.ModelNode getUndefinedMetricValue()
-
getParser
public AttributeParser getParser()
-
getAttributeGroup
public String getAttributeGroup()
-
getAllowedValues
public org.jboss.dmr.ModelNode[] getAllowedValues()
-
getCapabilityReferenceRecorder
protected final CapabilityReferenceRecorder getCapabilityReferenceRecorder()
-
-