public class DelegatingManagementResourceRegistration extends Object implements ManagementResourceRegistration
ManagementResourceRegistration
implementation that simply delegates to another
ManagementResourceRegistration
. Intended as a convenience class to allow overriding
of standard behaviors and also as a means to support a copy-on-write/publish-on-commit
semantic for the management resource tree.Modifier and Type | Class and Description |
---|---|
static interface |
DelegatingManagementResourceRegistration.RegistrationDelegateProvider
Provides a delegate for use by a
DelegatingManagementResourceRegistration . |
ManagementResourceRegistration.Factory
ACCESS_PERMISSION
Constructor and Description |
---|
DelegatingManagementResourceRegistration(DelegatingManagementResourceRegistration.RegistrationDelegateProvider delegateProvider)
Creates a new DelegatingManagementResourceRegistration with a possibly changing delegate.
|
DelegatingManagementResourceRegistration(ManagementResourceRegistration delegate)
Creates a new DelegatingManagementResourceRegistration with a fixed delegate.
|
Modifier and Type | Method and Description |
---|---|
List<AccessConstraintDefinition> |
getAccessConstraints() |
AliasEntry |
getAliasEntry()
Gets the alias entry for this registration if it is an alias
|
AttributeAccess |
getAttributeAccess(PathAddress address,
String attributeName)
Gets the information on how to read from or write to the given attribute.
|
Set<String> |
getAttributeNames(PathAddress address)
Get the names of the attributes for a node
|
Set<RuntimeCapability> |
getCapabilities()
Returns all capabilities defined for this resource.
|
Set<PathElement> |
getChildAddresses(PathAddress address)
Gets the set of direct child address elements under the node at the passed in PathAddress
|
Set<String> |
getChildNames(PathAddress address)
Get the names of the types of children for a node
|
int |
getMaxOccurs()
Gets the maximum number of times a resource of the type described by this registration
can occur under its parent resource (or, for a root resource, the minimum number of times it can
occur at all.)
|
int |
getMinOccurs()
Gets the minimum number of times a resource of the type described by this registration
can occur under its parent resource (or, for a root resource, the number of times it can
occur at all.)
|
DescriptionProvider |
getModelDescription(PathAddress address)
Get the model description at the given address, or
null if none exists. |
Map<String,NotificationEntry> |
getNotificationDescriptions(PathAddress address,
boolean inherited)
Get a map of descriptions of all notifications emitted by the resources at an address.
|
DescriptionProvider |
getOperationDescription(PathAddress address,
String operationName)
Get the operation description at the given address, or
null if none exists. |
Map<String,OperationEntry> |
getOperationDescriptions(PathAddress address,
boolean inherited)
Get a map of descriptions of all operations available at an address.
|
OperationEntry |
getOperationEntry(PathAddress address,
String operationName)
Get the entry representing an operation registered with the given name at the given address, or
null if none exists. |
Set<OperationEntry.Flag> |
getOperationFlags(PathAddress address,
String operationName)
Get the special characteristic flags for the operation at the given address, or
null if none exist. |
OperationStepHandler |
getOperationHandler(PathAddress address,
String operationName)
Get the operation handler at the given address, or
null if none exists. |
Set<String> |
getOrderedChildTypes()
Return the names of the child types registered to be ordered.
|
ManagementResourceRegistration |
getOverrideModel(String name)
Get a specifically named resource that overrides this
wildcard registration
by adding additional attributes, operations or child types. |
PathAddress |
getPathAddress()
Gets the address under which we are registered.
|
ProxyController |
getProxyController(PathAddress address)
If there is a proxy controller registered under any part of the registered address it will be returned.
|
Set<ProxyController> |
getProxyControllers(PathAddress address)
Finds all proxy controllers registered at the passed in address, or at lower levels.
|
ManagementResourceRegistration |
getSubModel(PathAddress address)
Get a sub model registration.
|
boolean |
isAlias()
Gets whether this resource registration is an alias to another resource.
|
boolean |
isAllowsOverride()
Gets whether this registration will always throw an exception if
ManagementResourceRegistration.registerOverrideModel(String, OverrideDescriptionProvider) is invoked. |
boolean |
isOrderedChildResource()
Return @code true} if a child resource registration was registered using
ManagementResourceRegistration.registerSubModel(ResourceDefinition) , and false otherwise |
boolean |
isRemote()
Gets whether operations against the resource represented by this registration will be proxied to
a remote process.
|
boolean |
isRuntimeOnly()
Gets whether this model node only exists in the runtime and has no representation in the
persistent configuration model.
|
void |
registerAlias(PathElement address,
AliasEntry aliasEntry)
Register an alias registration to another part of the model
|
void |
registerCapability(RuntimeCapability capability)
Registers passed capability on resource
|
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 this
wildcard 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.
|
ManagementResourceRegistration |
registerSubModel(ResourceDefinition resourceDefinition)
Register the existence of an addressable sub-resource of this resource.
|
void |
setRuntimeOnly(boolean runtimeOnly)
Sets whether this model node only exists in the runtime and has no representation in the
persistent configuration model.
|
void |
unregisterAlias(PathElement address)
Unregister an alias
|
void |
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 a
wildcard registration
by adding additional attributes, operations or child types. |
void |
unregisterProxyController(PathElement address)
Unregister a proxy controller
|
void |
unregisterSubModel(PathElement address)
Unregister the existence of an addressable sub-resource of this resource.
|
public DelegatingManagementResourceRegistration(ManagementResourceRegistration delegate)
delegate
- the delegate. Cannot be null
public DelegatingManagementResourceRegistration(DelegatingManagementResourceRegistration.RegistrationDelegateProvider delegateProvider)
delegateProvider
- provider of the delegate. Cannot be null
public PathAddress getPathAddress()
ImmutableManagementResourceRegistration
getPathAddress
in interface ImmutableManagementResourceRegistration
null
public int getMaxOccurs()
ImmutableManagementResourceRegistration
getMaxOccurs
in interface ImmutableManagementResourceRegistration
public int getMinOccurs()
ImmutableManagementResourceRegistration
getMinOccurs
in interface ImmutableManagementResourceRegistration
public boolean isRuntimeOnly()
ImmutableManagementResourceRegistration
isRuntimeOnly
in interface ImmutableManagementResourceRegistration
true
if the model node has no representation in the
persistent configuration model; false
otherwisepublic boolean isRemote()
ImmutableManagementResourceRegistration
isRemote
in interface ImmutableManagementResourceRegistration
true
if this registration represents a remote resource; false
otherwisepublic boolean isAlias()
ImmutableManagementResourceRegistration
isAlias
in interface ImmutableManagementResourceRegistration
true
if this registration represents an alias; false
otherwisepublic OperationEntry getOperationEntry(PathAddress address, String operationName)
ImmutableManagementResourceRegistration
null
if none exists.getOperationEntry
in interface ImmutableManagementResourceRegistration
address
- the address, relative to this nodeoperationName
- the operation namenull
public OperationStepHandler getOperationHandler(PathAddress address, String operationName)
ImmutableManagementResourceRegistration
null
if none exists.getOperationHandler
in interface ImmutableManagementResourceRegistration
address
- the address, relative to this nodeoperationName
- the operation namepublic DescriptionProvider getOperationDescription(PathAddress address, String operationName)
ImmutableManagementResourceRegistration
null
if none exists.getOperationDescription
in interface ImmutableManagementResourceRegistration
address
- the address, relative to this nodeoperationName
- the operation namepublic Set<OperationEntry.Flag> getOperationFlags(PathAddress address, String operationName)
ImmutableManagementResourceRegistration
null
if none exist.getOperationFlags
in interface ImmutableManagementResourceRegistration
address
- the address, relative to this nodeoperationName
- the operation namenull
public Set<String> getAttributeNames(PathAddress address)
ImmutableManagementResourceRegistration
getAttributeNames
in interface ImmutableManagementResourceRegistration
address
- the address, relative to this nodepublic AttributeAccess getAttributeAccess(PathAddress address, String attributeName)
ImmutableManagementResourceRegistration
getAttributeAccess
in interface ImmutableManagementResourceRegistration
address
- the address of the resourceattributeName
- the name of the attributenull
if the attribute or address is unknownpublic Set<String> getChildNames(PathAddress address)
ImmutableManagementResourceRegistration
getChildNames
in interface ImmutableManagementResourceRegistration
address
- the address, relative to this nodepublic Set<PathElement> getChildAddresses(PathAddress address)
ImmutableManagementResourceRegistration
getChildAddresses
in interface ImmutableManagementResourceRegistration
address
- the address we want to find children forpublic DescriptionProvider getModelDescription(PathAddress address)
ImmutableManagementResourceRegistration
null
if none exists.getModelDescription
in interface ImmutableManagementResourceRegistration
address
- the address, relative to this nodepublic Map<String,OperationEntry> getOperationDescriptions(PathAddress address, boolean inherited)
ImmutableManagementResourceRegistration
getOperationDescriptions
in interface ImmutableManagementResourceRegistration
address
- the addressinherited
- true to include inherited operationspublic Map<String,NotificationEntry> getNotificationDescriptions(PathAddress address, boolean inherited)
ImmutableManagementResourceRegistration
getNotificationDescriptions
in interface ImmutableManagementResourceRegistration
address
- the addressinherited
- true to include inherited notificationspublic ProxyController getProxyController(PathAddress address)
ImmutableManagementResourceRegistration
[a=b,c=d,e=f]
and there is a proxy registered under
[a=b,c=d]
that proxy will be returned.getProxyController
in interface ImmutableManagementResourceRegistration
address
- the address to look for a proxy undernull
if there is nonepublic Set<ProxyController> getProxyControllers(PathAddress address)
ImmutableManagementResourceRegistration
a=b
and there are proxies registered at
[a=b,c=d]
, [a=b,e=f]
and [g-h]
, the proxies for
[a=b,c=d]
and [a=b,e=f]
will be returned.getProxyControllers
in interface ImmutableManagementResourceRegistration
address
- the address to start looking for proxies underpublic ManagementResourceRegistration getOverrideModel(String name)
ManagementResourceRegistration
wildcard registration
by adding additional attributes, operations or child types.getOverrideModel
in interface ManagementResourceRegistration
name
- the specific name of the resource. Cannot be null
or PathElement.WILDCARD_VALUE
null
if there is nonepublic ManagementResourceRegistration getSubModel(PathAddress address)
ManagementResourceRegistration
This method overrides the superinterface method of the same name in order to require that the returned registration be mutable.
getSubModel
in interface ImmutableManagementResourceRegistration
getSubModel
in interface ManagementResourceRegistration
address
- the address, relative to this nodenull
if there is nonepublic ManagementResourceRegistration registerSubModel(ResourceDefinition resourceDefinition)
ManagementResourceRegistration
resourceDefinition
will be given the opportunity to
register attributes
,
register operations
,
and register notifications
registerSubModel
in interface ManagementResourceRegistration
resourceDefinition
- source for descriptive information describing this
portion of the model (must not be null
)public void unregisterSubModel(PathElement address)
ManagementResourceRegistration
unregisterSubModel
in interface ManagementResourceRegistration
address
- the child of this registry that should no longer be availablepublic boolean isAllowsOverride()
ManagementResourceRegistration
ManagementResourceRegistration.registerOverrideModel(String, OverrideDescriptionProvider)
is invoked. An exception will always
be thrown for root resource registrations, non-wildcard registrations
, or
remote registrations
.isAllowsOverride
in interface ManagementResourceRegistration
true
if an exception will not always be thrown; false
if it willpublic void setRuntimeOnly(boolean runtimeOnly)
ManagementResourceRegistration
setRuntimeOnly
in interface ManagementResourceRegistration
runtimeOnly
- true
if the model node will have no representation in the
persistent configuration model; false
otherwisepublic ManagementResourceRegistration registerOverrideModel(String name, OverrideDescriptionProvider descriptionProvider)
ManagementResourceRegistration
wildcard registration
by adding additional attributes, operations or child types.registerOverrideModel
in interface ManagementResourceRegistration
name
- the specific name of the resource. Cannot be null
or PathElement.WILDCARD_VALUE
descriptionProvider
- provider for descriptions of the additional attributes or child typespublic void unregisterOverrideModel(String name)
ManagementResourceRegistration
wildcard registration
by adding additional attributes, operations or child types.unregisterOverrideModel
in interface ManagementResourceRegistration
name
- the specific name of the resource. Cannot be null
or PathElement.WILDCARD_VALUE
public void registerOperationHandler(OperationDefinition definition, OperationStepHandler handler)
ManagementResourceRegistration
registerOperationHandler
in interface ManagementResourceRegistration
definition
- the definition of operationhandler
- the operation handlerpublic void registerOperationHandler(OperationDefinition definition, OperationStepHandler handler, boolean inherited)
ManagementResourceRegistration
registerOperationHandler
in interface ManagementResourceRegistration
definition
- the definition of operationhandler
- the operation handlerinherited
- true
if the operation is inherited to child nodes, false
otherwisepublic void unregisterOperationHandler(String operationName)
ManagementResourceRegistration
unregisterOperationHandler
in interface ManagementResourceRegistration
operationName
- the operation namepublic void registerReadWriteAttribute(AttributeDefinition definition, OperationStepHandler readHandler, OperationStepHandler writeHandler)
ManagementResourceRegistration
AttributeAccess.Storage.CONFIGURATION
unless parameter
flags
includes AttributeAccess.Flag.STORAGE_RUNTIME
.registerReadWriteAttribute
in interface ManagementResourceRegistration
definition
- the attribute definition. Cannot be null
readHandler
- the handler for attribute reads. May be null
in which case the default handling is usedwriteHandler
- the handler for attribute writes. Cannot be null
public void registerReadOnlyAttribute(AttributeDefinition definition, OperationStepHandler readHandler)
ManagementResourceRegistration
AttributeAccess.Storage.CONFIGURATION
unless parameter
flags
includes AttributeAccess.Flag.STORAGE_RUNTIME
.registerReadOnlyAttribute
in interface ManagementResourceRegistration
definition
- the attribute definition. Cannot be null
readHandler
- the handler for attribute reads. May be null
in which case the default handling is usedpublic void registerMetric(AttributeDefinition definition, OperationStepHandler metricHandler)
ManagementResourceRegistration
registerMetric
in interface ManagementResourceRegistration
definition
- the attribute definition. Cannot be null
metricHandler
- the handler for attribute reads. Cannot be null
public void unregisterAttribute(String attributeName)
ManagementResourceRegistration
unregisterAttribute
in interface ManagementResourceRegistration
attributeName
- the name of the attribute. Cannot be null
public void registerNotification(NotificationDefinition notification, boolean inherited)
ManagementResourceRegistration
registerNotification
in interface ManagementResourceRegistration
notification
- the definition of the notification. Cannot be null
inherited
- true
if the notification is inherited to child nodes, false
otherwisepublic void registerNotification(NotificationDefinition notification)
ManagementResourceRegistration
registerNotification
in interface ManagementResourceRegistration
notification
- the definition of the notification. Cannot be null
public void unregisterNotification(String notificationType)
ManagementResourceRegistration
unregisterNotification
in interface ManagementResourceRegistration
notificationType
- the type of the notification. Cannot be null
public void registerProxyController(PathElement address, ProxyController proxyController)
ManagementResourceRegistration
registerProxyController
in interface ManagementResourceRegistration
address
- the child of this registry that should be proxiedproxyController
- the proxy controllerpublic void unregisterProxyController(PathElement address)
ManagementResourceRegistration
unregisterProxyController
in interface ManagementResourceRegistration
address
- the child of this registry that should no longer be proxiedpublic void registerAlias(PathElement address, AliasEntry aliasEntry)
ManagementResourceRegistration
registerAlias
in interface ManagementResourceRegistration
address
- the child of this registry that is an aliasaliasEntry
- the target modelpublic void unregisterAlias(PathElement address)
ManagementResourceRegistration
unregisterAlias
in interface ManagementResourceRegistration
address
- the child of this registry that is an aliaspublic List<AccessConstraintDefinition> getAccessConstraints()
getAccessConstraints
in interface ImmutableManagementResourceRegistration
public AliasEntry getAliasEntry()
ImmutableManagementResourceRegistration
getAliasEntry
in interface ImmutableManagementResourceRegistration
null
otherwisepublic Set<String> getOrderedChildTypes()
ImmutableManagementResourceRegistration
getOrderedChildTypes
in interface ImmutableManagementResourceRegistration
public boolean isOrderedChildResource()
ImmutableManagementResourceRegistration
ManagementResourceRegistration.registerSubModel(ResourceDefinition)
, and false
otherwiseisOrderedChildResource
in interface ImmutableManagementResourceRegistration
public void registerCapability(RuntimeCapability capability)
ManagementResourceRegistration
registerCapability
in interface ManagementResourceRegistration
capability
- a capability to registerpublic Set<RuntimeCapability> getCapabilities()
ImmutableManagementResourceRegistration
getCapabilities
in interface ImmutableManagementResourceRegistration
Copyright © 2023 JBoss by Red Hat. All rights reserved.