Interface ManagementResourceRegistration
-
- All Superinterfaces:
ImmutableManagementResourceRegistration
- All Known Implementing Classes:
DelegatingManagementResourceRegistration
public interface ManagementResourceRegistration extends ImmutableManagementResourceRegistration
A registration for a management resource which consists of a resource description plus registered operation handlers.- Author:
- David M. Lloyd
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ManagementResourceRegistration.Factory
A factory for creating a new, root model node registration.
-
Field Summary
-
Fields inherited from interface org.jboss.as.controller.registry.ImmutableManagementResourceRegistration
ACCESS_PERMISSION
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ManagementResourceRegistration
getOverrideModel(String name)
Get a specifically named resource that overrides thiswildcard registration
by adding additional attributes, operations or child types.ManagementResourceRegistration
getSubModel(PathAddress address)
Get a sub model registration.boolean
isAllowsOverride()
Gets whether this registration will always throw an exception ifregisterOverrideModel(String, OverrideDescriptionProvider)
is invoked.void
registerAdditionalRuntimePackages(RuntimePackageDependency... pkgs)
RegisterRuntimePackageDependency
additional packages.void
registerAlias(PathElement address, AliasEntry aliasEntry)
Register an alias registration to another part of the modelvoid
registerCapability(RuntimeCapability capability)
Registers passed capability on resourcevoid
registerIncorporatingCapabilities(Set<RuntimeCapability> capabilities)
Registers a set of capabilities that this resource does not directly provide but to which it contributes.void
registerMetric(AttributeDefinition definition, OperationStepHandler metricHandler)
Records that the given attribute is a metric.void
registerNotification(NotificationDefinition notification)
Record that the given notification can be emitted by this resource.void
registerNotification(NotificationDefinition notification, boolean inherited)
Record that the given notification can be emitted by this resource.void
registerOperationHandler(OperationDefinition definition, OperationStepHandler handler)
Register an operation handler for this resource.void
registerOperationHandler(OperationDefinition definition, OperationStepHandler handler, boolean inherited)
Register an operation handler for this resource.ManagementResourceRegistration
registerOverrideModel(String name, OverrideDescriptionProvider descriptionProvider)
Register a specifically named resource that overrides thiswildcard registration
by adding additional attributes, operations or child types.void
registerProxyController(PathElement address, ProxyController proxyController)
Register a proxy controller.void
registerReadOnlyAttribute(AttributeDefinition definition, OperationStepHandler readHandler)
Records that the given attribute can be read from but not written to, and optionally provides an operation handler for the read.void
registerReadWriteAttribute(AttributeDefinition definition, OperationStepHandler readHandler, OperationStepHandler writeHandler)
Records that the given attribute can be both read from and written to, and provides operation handlers for the read and the write.void
registerRequirements(Set<CapabilityReferenceRecorder> requirements)
Registers a set of CapabilityReferenceRecorder.ManagementResourceRegistration
registerSubModel(ResourceDefinition resourceDefinition)
Register the existence of an addressable sub-resource of this resource.void
unregisterAlias(PathElement address)
Unregister an aliasvoid
unregisterAttribute(String attributeName)
Remove that the given attribute if present.void
unregisterNotification(String notificationType)
Remove that the given notification can be emitted by this resource.void
unregisterOperationHandler(String operationName)
Unregister an operation handler for this resource.void
unregisterOverrideModel(String name)
Unregister a specifically named resource that overrides awildcard registration
by adding additional attributes, operations or child types.void
unregisterProxyController(PathElement address)
Unregister a proxy controllervoid
unregisterSubModel(PathElement address)
Unregister the existence of an addressable sub-resource of this resource.-
Methods inherited from interface org.jboss.as.controller.registry.ImmutableManagementResourceRegistration
getAccessConstraints, getAdditionalRuntimePackages, getAliasEntry, getAttributeAccess, getAttributeNames, getAttributes, getCapabilities, getChildAddresses, getChildNames, getFeature, getIncorporatingCapabilities, getMaxOccurs, getMinOccurs, getModelDescription, getNotificationDescriptions, getOperationDescription, getOperationDescriptions, getOperationEntry, getOperationFlags, getOperationHandler, getOrderedChildTypes, getParent, getPathAddress, getProcessType, getProxyController, getProxyControllers, getRequirements, isAlias, isFeature, isOrderedChildResource, isRemote, isRuntimeOnly
-
-
-
-
Method Detail
-
getOverrideModel
ManagementResourceRegistration getOverrideModel(String name)
Get a specifically named resource that overrides thiswildcard registration
by adding additional attributes, operations or child types.- Parameters:
name
- the specific name of the resource. Cannot benull
orPathElement.WILDCARD_VALUE
- Returns:
- the resource registration,
null
if there is none - Throws:
SecurityException
- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
getSubModel
ManagementResourceRegistration getSubModel(PathAddress address)
Get a sub model registration.This method overrides the superinterface method of the same name in order to require that the returned registration be mutable.
- Specified by:
getSubModel
in interfaceImmutableManagementResourceRegistration
- Parameters:
address
- the address, relative to this node- Returns:
- the resource registration,
null
if there is none - Throws:
SecurityException
- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerSubModel
ManagementResourceRegistration registerSubModel(ResourceDefinition resourceDefinition)
Register the existence of an addressable sub-resource of this resource. Before this method returns the providedresourceDefinition
will be given the opportunity toregister attributes
,register operations
, andregister notifications
- Parameters:
resourceDefinition
- source for descriptive information describing this portion of the model (must not benull
)- Returns:
- a resource registration which may be used to add attributes, operations, notifications and sub-models
- Throws:
IllegalArgumentException
- if a submodel is already registered ataddress
IllegalStateException
- ifImmutableManagementResourceRegistration.isRuntimeOnly()
returnstrue
SecurityException
- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
unregisterSubModel
void unregisterSubModel(PathElement address)
Unregister the existence of an addressable sub-resource of this resource.- Parameters:
address
- the child of this registry that should no longer be available- Throws:
SecurityException
- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
isAllowsOverride
boolean isAllowsOverride()
Gets whether this registration will always throw an exception ifregisterOverrideModel(String, OverrideDescriptionProvider)
is invoked. An exception will always be thrown for root resource registrations,non-wildcard registrations
, orremote registrations
.- Returns:
true
if an exception will not always be thrown;false
if it will- Throws:
SecurityException
- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerOverrideModel
ManagementResourceRegistration registerOverrideModel(String name, OverrideDescriptionProvider descriptionProvider)
Register a specifically named resource that overrides thiswildcard registration
by adding additional attributes, operations or child types.- Parameters:
name
- the specific name of the resource. Cannot benull
orPathElement.WILDCARD_VALUE
descriptionProvider
- provider for descriptions of the additional attributes or child types- Returns:
- a resource registration which may be used to add attributes, operations and sub-models
- Throws:
IllegalArgumentException
- if either parameter is null or if there is already a registration undername
IllegalStateException
- ifImmutableManagementResourceRegistration.isRuntimeOnly()
returnstrue
or ifisAllowsOverride()
returns falseSecurityException
- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
unregisterOverrideModel
void unregisterOverrideModel(String name)
Unregister a specifically named resource that overrides awildcard registration
by adding additional attributes, operations or child types.- Parameters:
name
- the specific name of the resource. Cannot benull
orPathElement.WILDCARD_VALUE
- Throws:
SecurityException
- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerOperationHandler
void registerOperationHandler(OperationDefinition definition, OperationStepHandler handler)
Register an operation handler for this resource.- Parameters:
definition
- the definition of operationhandler
- the operation handler- Throws:
SecurityException
- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerOperationHandler
void registerOperationHandler(OperationDefinition definition, OperationStepHandler handler, boolean inherited)
Register an operation handler for this resource.- Parameters:
definition
- the definition of operationhandler
- the operation handlerinherited
-true
if the operation is inherited to child nodes,false
otherwise- Throws:
SecurityException
- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
unregisterOperationHandler
void unregisterOperationHandler(String operationName)
Unregister an operation handler for this resource.- Parameters:
operationName
- the operation name- Throws:
IllegalArgumentException
- if operationName is not registeredSecurityException
- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerReadWriteAttribute
void registerReadWriteAttribute(AttributeDefinition definition, OperationStepHandler readHandler, OperationStepHandler writeHandler)
Records that the given attribute can be both read from and written to, and provides operation handlers for the read and the write. The attribute is assumed to beAttributeAccess.Storage.CONFIGURATION
unless parameterflags
includesAttributeAccess.Flag.STORAGE_RUNTIME
.- Parameters:
definition
- the attribute definition. Cannot benull
readHandler
- the handler for attribute reads. May benull
in which case the default handling is usedwriteHandler
- the handler for attribute writes. Cannot benull
- Throws:
IllegalArgumentException
- ifdefinition
orwriteHandler
arenull
SecurityException
- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerReadOnlyAttribute
void registerReadOnlyAttribute(AttributeDefinition definition, OperationStepHandler readHandler)
Records that the given attribute can be read from but not written to, and optionally provides an operation handler for the read. The attribute is assumed to beAttributeAccess.Storage.CONFIGURATION
unless parameterflags
includesAttributeAccess.Flag.STORAGE_RUNTIME
.- Parameters:
definition
- the attribute definition. Cannot benull
readHandler
- the handler for attribute reads. May benull
in which case the default handling is used- Throws:
IllegalArgumentException
- ifdefinition
isnull
SecurityException
- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerMetric
void registerMetric(AttributeDefinition definition, OperationStepHandler metricHandler)
Records that the given attribute is a metric.- Parameters:
definition
- the attribute definition. Cannot benull
metricHandler
- the handler for attribute reads. Cannot benull
- Throws:
IllegalArgumentException
- ifdefinition
ormetricHandler
arenull
SecurityException
- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
unregisterAttribute
void unregisterAttribute(String attributeName)
Remove that the given attribute if present.- Parameters:
attributeName
- the name of the attribute. Cannot benull
- Throws:
SecurityException
- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerProxyController
void registerProxyController(PathElement address, ProxyController proxyController)
Register a proxy controller.- Parameters:
address
- the child of this registry that should be proxiedproxyController
- the proxy controller- Throws:
SecurityException
- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
unregisterProxyController
void unregisterProxyController(PathElement address)
Unregister a proxy controller- Parameters:
address
- the child of this registry that should no longer be proxied- Throws:
SecurityException
- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerAlias
void registerAlias(PathElement address, AliasEntry aliasEntry)
Register an alias registration to another part of the model- Parameters:
address
- the child of this registry that is an aliasaliasEntry
- the target model- Throws:
SecurityException
- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
unregisterAlias
void unregisterAlias(PathElement address)
Unregister an alias- Parameters:
address
- the child of this registry that is an alias- Throws:
SecurityException
- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerNotification
void registerNotification(NotificationDefinition notification, boolean inherited)
Record that the given notification can be emitted by this resource.- Parameters:
notification
- the definition of the notification. Cannot benull
inherited
-true
if the notification is inherited to child nodes,false
otherwise- Throws:
IllegalArgumentException
- ifnotification
isnull
SecurityException
- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerNotification
void registerNotification(NotificationDefinition notification)
Record that the given notification can be emitted by this resource. The notification is not inherited by child nodes.- Parameters:
notification
- the definition of the notification. Cannot benull
- Throws:
IllegalArgumentException
- ifnotificationType
ornotificationEntry
isnull
SecurityException
- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
unregisterNotification
void unregisterNotification(String notificationType)
Remove that the given notification can be emitted by this resource.- Parameters:
notificationType
- the type of the notification. Cannot benull
- Throws:
SecurityException
- if the caller does not haveImmutableManagementResourceRegistration.ACCESS_PERMISSION
-
registerCapability
void registerCapability(RuntimeCapability capability)
Registers passed capability on resource- Parameters:
capability
- a capability to register
-
registerIncorporatingCapabilities
void registerIncorporatingCapabilities(Set<RuntimeCapability> capabilities)
Registers a set of capabilities that this resource does not directly provide but to which it contributes. This will only include capabilities for which this resource does not control theregistration of the capability
. Any capabilities registered by this resource will instead be included in the return value forImmutableManagementResourceRegistration.getCapabilities()
.Use of this method is only necessary if the caller wishes to specifically record capability incorporation, instead of relying on the default resolution mechanism detailed in
ImmutableManagementResourceRegistration.getIncorporatingCapabilities()
, or if it wishes disable the default resolution mechanism and specifically declare that this resource does not contribute to parent capabilities. It does the latter by passing an empty set as thecapabilities
parameter. Passing an empty set is not necessary if this resource itself directlyprovides a capability
, as it is the contract ofImmutableManagementResourceRegistration.getIncorporatingCapabilities()
that in that case it must return an empty set.- Parameters:
capabilities
- set of capabilities, ornull
if default resolution of capabilities to which this resource contributes should be used; an empty set can be used to indicate this resource does not contribute to capabilities provided by its parent
-
registerRequirements
void registerRequirements(Set<CapabilityReferenceRecorder> requirements)
Registers a set of CapabilityReferenceRecorder. Each recorder is a link between acapability requirement and the resource capability requiring it.- Parameters:
requirements
- a set of CapabilityReferenceRecorder.
-
registerAdditionalRuntimePackages
void registerAdditionalRuntimePackages(RuntimePackageDependency... pkgs)
RegisterRuntimePackageDependency
additional packages.- Parameters:
pkgs
- The packages.
-
-