Package org.wildfly.subsystem.resource
Interface ResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>
-
- Type Parameters:
C- the configurator type
- All Known Subinterfaces:
ResourceDescriptor.Builder
- All Known Implementing Classes:
ResourceDescriptor.AbstractConfigurator,ResourceDescriptor.DefaultBuilder
- Enclosing interface:
- ResourceDescriptor
public static interface ResourceDescriptor.Configurator<C extends ResourceDescriptor.Configurator<C>>Configures the characteristics of aResourceDescriptor.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description CaddAttribute(AttributeDefinition attribute, OperationStepHandler writeAttributeHandler)Adds the attribute with the specified custom "write-attribute" operation handler.CaddAttributes(Collection<AttributeDefinition> attributes)Adds the specified attributes to this resource descriptor.default CaddCapabilities(Collection<RuntimeCapability<?>> capabilities)Adds the specified runtime capabilities to this resource.CaddCapabilities(Collection<RuntimeCapability<?>> capabilities, BiPredicate<OperationContext,Resource> filter)Adds the specified runtime capabilities to this resource.default CaddCapability(RuntimeCapability<?> capability)Adds the specified runtime capability to this resource.CaddCapability(RuntimeCapability<?> capability, BiPredicate<OperationContext,Resource> filter)Adds the specified conditionally-registered runtime capability to this resourceCaddModelOnlyAttributes(Collection<AttributeDefinition> attributes)Adds the specified model-only attributes (i.e.CaddReadOnlyAttributes(Collection<AttributeDefinition> attributes)Adds the specified read-only attributes to this resource descriptor.default CaddResourceCapabilityReference(ResourceCapabilityReferenceRecorder<?> reference)Adds a capability reference that records a requirement for this resource.CaddResourceCapabilityReferences(Collection<ResourceCapabilityReferenceRecorder<?>> references)Adds a number of capability references that records requirements for this resource.<P extends Supplier<AttributeDefinition>>
CprovideAttributes(Collection<P> providers)Adds the specified attribute providers to this resource descriptor.default <P extends Supplier<RuntimeCapability<?>>>
CprovideCapabilities(Collection<P> providers)Adds the specified runtime capability providers to this resource descriptor.<P extends Supplier<RuntimeCapability<?>>>
CprovideCapabilities(Collection<P> providers, BiPredicate<OperationContext,Resource> filter)Adds the specified conditionally-registered runtime capability providers to this resource descriptor.<P extends Supplier<AttributeDefinition>>
CprovideModelOnlyAttributes(Collection<P> providers)Adds the specified model-only attribute providers to this resource descriptor.<P extends Supplier<AttributeDefinition>>
CprovideReadOnlyAttributes(Collection<P> providers)Adds the specified read-only attribute providers to this resource descriptor.<P extends Supplier<PathElement>>
CprovideRequiredChildren(Collection<P> providers)Defines a set of required children of this resource.<P extends Supplier<PathElement>>
CprovideRequiredSingletonChildren(Collection<P> providers)Defines a set of required singleton children of this resource.default CrenameAttribute(AttributeDefinition attribute, AttributeDefinition targetAttribute)Specifies an attribute alias to another attribute of this resource.default CrequireChild(PathElement path)Defines a required child of this resource.CrequireChildren(Set<PathElement> paths)Defines a set of required children of this resource.default CrequireSingletonChild(PathElement path)Defines a required singleton child of this resource.CrequireSingletonChildren(Set<PathElement> paths)Defines a set of required singleton children of this resource.CtranslateAttribute(AttributeDefinition attribute, AttributeTranslation translation)Specifies an attribute alias to another attribute of a potentially different resource.CwithAddOperationRestartFlag(OperationEntry.Flag restartFlag)Overrides the default restart flag for the "add" operation of this resource.CwithAddResourceOperationTransformation(UnaryOperator<OperationStepHandler> transformation)Applies the specified transformation to the "add" operation of this resource.CwithDeploymentChainContributor(Consumer<DeploymentProcessorTarget> contributor)Applies the specified deployment chain contributor to this resource's "add" operation.CwithOperationTransformation(UnaryOperator<OperationStepHandler> transformation)Applies the specified transformation to the "remove" and all global operations of this resource.CwithRemoveOperationRestartFlag(OperationEntry.Flag restartFlag)Overrides the default restart flag for the "remove" operation of this resource.CwithResourceTransformation(UnaryOperator<Resource> transformation)CwithRuntimeHandler(ResourceOperationRuntimeHandler runtimeHandler)Applies the specified runtime handler to the operations of this resource.
-
-
-
Method Detail
-
withRuntimeHandler
C withRuntimeHandler(ResourceOperationRuntimeHandler runtimeHandler)
Applies the specified runtime handler to the operations of this resource.- Parameters:
runtimeHandler- a runtime handler.- Returns:
- a reference to this configurator
-
withAddOperationRestartFlag
C withAddOperationRestartFlag(OperationEntry.Flag restartFlag)
Overrides the default restart flag for the "add" operation of this resource.- Parameters:
restartFlag- a restart flag- Returns:
- a reference to this configurator
-
withRemoveOperationRestartFlag
C withRemoveOperationRestartFlag(OperationEntry.Flag restartFlag)
Overrides the default restart flag for the "remove" operation of this resource.- Parameters:
restartFlag- a restart flag- Returns:
- a reference to this configurator
-
addAttributes
C addAttributes(Collection<AttributeDefinition> attributes)
Adds the specified attributes to this resource descriptor.- Parameters:
attributes- a collection of attributes- Returns:
- a reference to this configurator
-
addAttribute
C addAttribute(AttributeDefinition attribute, OperationStepHandler writeAttributeHandler)
Adds the attribute with the specified custom "write-attribute" operation handler.- Parameters:
attribute- an attributewriteAttributeHandler- custom "write-attribute" operation handler- Returns:
- a reference to this configurator
-
addModelOnlyAttributes
C addModelOnlyAttributes(Collection<AttributeDefinition> attributes)
Adds the specified model-only attributes (i.e. with no runtime handling) to this resource descriptor.- Parameters:
attributes- a collection of attributes- Returns:
- a reference to this configurator
-
addReadOnlyAttributes
C addReadOnlyAttributes(Collection<AttributeDefinition> attributes)
Adds the specified read-only attributes to this resource descriptor.- Parameters:
attributes- a collection of attributes- Returns:
- a reference to this configurator
-
renameAttribute
default C renameAttribute(AttributeDefinition attribute, AttributeDefinition targetAttribute)
Specifies an attribute alias to another attribute of this resource.- Parameters:
attribute- the alias attributetargetAttribute- the target attribute- Returns:
- a reference to this configurator
-
translateAttribute
C translateAttribute(AttributeDefinition attribute, AttributeTranslation translation)
Specifies an attribute alias to another attribute of a potentially different resource.- Parameters:
attribute- the alias attributetranslation- a description of the attribute translation- Returns:
- a reference to this configurator
-
addCapability
default C addCapability(RuntimeCapability<?> capability)
Adds the specified runtime capability to this resource.- Parameters:
capability- a runtime capability- Returns:
- a reference to this configurator
-
addCapability
C addCapability(RuntimeCapability<?> capability, BiPredicate<OperationContext,Resource> filter)
Adds the specified conditionally-registered runtime capability to this resource- Parameters:
capability- a runtime capabilityfilter- a predicate used to determine when the specified capability should be registered- Returns:
- a reference to this configurator
-
addCapabilities
default C addCapabilities(Collection<RuntimeCapability<?>> capabilities)
Adds the specified runtime capabilities to this resource.- Parameters:
capabilities- a collection of runtime capabilities- Returns:
- a reference to this configurator
-
addCapabilities
C addCapabilities(Collection<RuntimeCapability<?>> capabilities, BiPredicate<OperationContext,Resource> filter)
Adds the specified runtime capabilities to this resource.- Parameters:
capabilities- a collection of runtime capabilitiesfilter- a predicate used to determine when the specified capability should be registered- Returns:
- a reference to this configurator
-
requireChild
default C requireChild(PathElement path)
Defines a required child of this resource. Required children will be automatically added, if no child resource exists with the specified path.- Parameters:
path- the path of the required child resource- Returns:
- a reference to this configurator
-
requireChildren
C requireChildren(Set<PathElement> paths)
Defines a set of required children of this resource. Required children will be automatically added, if no child resource exists with the specified path.- Parameters:
paths- a set of paths of the required child resources- Returns:
- a reference to this configurator
-
requireSingletonChild
default C requireSingletonChild(PathElement path)
Defines a required singleton child of this resource. Required singleton children will be automatically added, if no child resource exists with the same path key.- Parameters:
path- the path of the required singleton child resource- Returns:
- a reference to this configurator
-
requireSingletonChildren
C requireSingletonChildren(Set<PathElement> paths)
Defines a set of required singleton children of this resource. Required singleton children will be automatically added, if no child resource exists with the same path key.- Parameters:
paths- a set of paths of the required singleton child resources- Returns:
- a reference to this configurator
-
addResourceCapabilityReference
default C addResourceCapabilityReference(ResourceCapabilityReferenceRecorder<?> reference)
Adds a capability reference that records a requirement for this resource.- Parameters:
reference- a capability reference recorder- Returns:
- a reference to this configurator
-
addResourceCapabilityReferences
C addResourceCapabilityReferences(Collection<ResourceCapabilityReferenceRecorder<?>> references)
Adds a number of capability references that records requirements for this resource.- Parameters:
references- a collection of capability reference recorders- Returns:
- a reference to this configurator
-
withAddResourceOperationTransformation
C withAddResourceOperationTransformation(UnaryOperator<OperationStepHandler> transformation)
Applies the specified transformation to the "add" operation of this resource.- Parameters:
transformation- an operation handler transformation- Returns:
- a reference to this configurator
-
withOperationTransformation
C withOperationTransformation(UnaryOperator<OperationStepHandler> transformation)
Applies the specified transformation to the "remove" and all global operations of this resource.- Parameters:
transformation- an operation handler transformation- Returns:
- a reference to this configurator
-
withResourceTransformation
C withResourceTransformation(UnaryOperator<Resource> transformation)
- Parameters:
transformation- an operation handler transformation- Returns:
- a reference to this configurator
-
withDeploymentChainContributor
C withDeploymentChainContributor(Consumer<DeploymentProcessorTarget> contributor)
Applies the specified deployment chain contributor to this resource's "add" operation.- Parameters:
contributor- a deployment chain contribution- Returns:
- a reference to this configurator
-
provideAttributes
<P extends Supplier<AttributeDefinition>> C provideAttributes(Collection<P> providers)
Adds the specified attribute providers to this resource descriptor.- Parameters:
providers- a collection of attribute providers- Returns:
- a reference to this configurator
-
provideModelOnlyAttributes
<P extends Supplier<AttributeDefinition>> C provideModelOnlyAttributes(Collection<P> providers)
Adds the specified model-only attribute providers to this resource descriptor.- Parameters:
providers- a collection of attribute providers- Returns:
- a reference to this configurator
-
provideReadOnlyAttributes
<P extends Supplier<AttributeDefinition>> C provideReadOnlyAttributes(Collection<P> providers)
Adds the specified read-only attribute providers to this resource descriptor.- Parameters:
providers- a collection of attribute providers- Returns:
- a reference to this configurator
-
provideCapabilities
default <P extends Supplier<RuntimeCapability<?>>> C provideCapabilities(Collection<P> providers)
Adds the specified runtime capability providers to this resource descriptor.- Parameters:
providers- a collection of runtime capability providers- Returns:
- a reference to this configurator
-
provideCapabilities
<P extends Supplier<RuntimeCapability<?>>> C provideCapabilities(Collection<P> providers, BiPredicate<OperationContext,Resource> filter)
Adds the specified conditionally-registered runtime capability providers to this resource descriptor.- Parameters:
providers- a collection of runtime capability providersfilter- a predicate used to determine when the specified capability should be registered- Returns:
- a reference to this configurator
-
provideRequiredChildren
<P extends Supplier<PathElement>> C provideRequiredChildren(Collection<P> providers)
Defines a set of required children of this resource. Required children will be automatically added, if no child resource exists with the specified path.- Parameters:
providers- a set of providers of the required child resource paths- Returns:
- a reference to this configurator
-
provideRequiredSingletonChildren
<P extends Supplier<PathElement>> C provideRequiredSingletonChildren(Collection<P> providers)
Defines a set of required singleton children of this resource. Required singleton children will be automatically added, if no child resource exists with the same path key.- Parameters:
providers- a set of providers of the required singleton child resource paths- Returns:
- a reference to this configurator
-
-