Interface ImmutableManagementResourceRegistration
-
- All Known Subinterfaces:
ManagementResourceRegistration
- All Known Implementing Classes:
DelegatingImmutableManagementResourceRegistration
,DelegatingManagementResourceRegistration
public interface ImmutableManagementResourceRegistration
Read-only view of aManagementResourceRegistration
.- Author:
- Brian Stansberry (c) 2011 Red Hat Inc.
-
-
Field Summary
Fields Modifier and Type Field Description static Permission
ACCESS_PERMISSION
AControllerPermission
needed to create aImmutableManagementResourceRegistration
or invoke one of its methods.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description List<AccessConstraintDefinition>
getAccessConstraints()
Set<RuntimePackageDependency>
getAdditionalRuntimePackages()
Returns additional packages provided by this resource.AliasEntry
getAliasEntry()
Gets the alias entry for this registration if it is an aliasAttributeAccess
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 nodeMap<String,AttributeAccess>
getAttributes(PathAddress address)
Get the information about all attributes for a node.Set<RuntimeCapability>
getCapabilities()
Returns all capabilities provided by this resource.Set<PathElement>
getChildAddresses(PathAddress address)
Gets the set of direct child address elements under the node at the passed in PathAddressSet<String>
getChildNames(PathAddress address)
Get the names of the types of children for a nodedefault String
getFeature()
Set<RuntimeCapability>
getIncorporatingCapabilities()
Returns all capabilities provided by parents of this resource, to which this resource contributes.default 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.)default 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, ornull
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, ornull
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, ornull
if none exists.Set<OperationEntry.Flag>
getOperationFlags(PathAddress address, String operationName)
Get the special characteristic flags for the operation at the given address, ornull
if none exist.OperationStepHandler
getOperationHandler(PathAddress address, String operationName)
Get the operation handler at the given address, ornull
if none exists.Set<String>
getOrderedChildTypes()
Return the names of the child types registered to be ordered.ImmutableManagementResourceRegistration
getParent()
Gets the registration for this resource type's parent, if there is one.PathAddress
getPathAddress()
Gets the address under which we are registered.ProcessType
getProcessType()
Gets the type of process in which this management resource type is 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.Set<CapabilityReferenceRecorder>
getRequirements()
Returns all capability reference recorders provided by this resource.ImmutableManagementResourceRegistration
getSubModel(PathAddress address)
Get a sub model registration.boolean
isAlias()
Gets whether this resource registration is an alias to another resource.default boolean
isFeature()
boolean
isOrderedChildResource()
Return @code true} if a child resource registration was registered usingManagementResourceRegistration.registerSubModel(ResourceDefinition)
, andfalse
otherwiseboolean
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.
-
-
-
Field Detail
-
ACCESS_PERMISSION
static final Permission ACCESS_PERMISSION
AControllerPermission
needed to create aImmutableManagementResourceRegistration
or invoke one of its methods. The name of the permission is "canAccessImmutableManagementResourceRegistration
."
-
-
Method Detail
-
getPathAddress
PathAddress getPathAddress()
Gets the address under which we are registered.- Returns:
- the address. Will not be
null
-
getProcessType
ProcessType getProcessType()
Gets the type of process in which this management resource type is registered.- Returns:
- the process type. Will not return
null
-
getParent
ImmutableManagementResourceRegistration getParent()
Gets the registration for this resource type's parent, if there is one.- Returns:
- the parent, or
null
ifgetPathAddress()
returns an address with asize
of0
-
getMaxOccurs
default 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.)- Returns:
- the minimum number of occurrences
-
getMinOccurs
default 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.)- Returns:
- the minimum number of occurrences
-
isFeature
default boolean isFeature()
-
getFeature
default String getFeature()
-
isRuntimeOnly
boolean isRuntimeOnly()
Gets whether this model node only exists in the runtime and has no representation in the persistent configuration model.- Returns:
true
if the model node has no representation in the persistent configuration model;false
otherwise- Throws:
SecurityException
- if the caller does not haveACCESS_PERMISSION
-
isRemote
boolean isRemote()
Gets whether operations against the resource represented by this registration will be proxied to a remote process.- Returns:
true
if this registration represents a remote resource;false
otherwise- Throws:
SecurityException
- if the caller does not haveACCESS_PERMISSION
-
isAlias
boolean isAlias()
Gets whether this resource registration is an alias to another resource.- Returns:
true
if this registration represents an alias;false
otherwise- Throws:
SecurityException
- if the caller does not haveACCESS_PERMISSION
-
getAliasEntry
AliasEntry getAliasEntry()
Gets the alias entry for this registration if it is an alias- Returns:
- the alias entry if this registration represents an aliased resource;
null
otherwise - Throws:
IllegalStateException
- ifisAlias()
returnsfalse
SecurityException
- if the caller does not haveACCESS_PERMISSION
-
getOperationHandler
OperationStepHandler getOperationHandler(PathAddress address, String operationName)
Get the operation handler at the given address, ornull
if none exists.- Parameters:
address
- the address, relative to this nodeoperationName
- the operation name- Returns:
- the operation handler
- Throws:
SecurityException
- if the caller does not haveACCESS_PERMISSION
-
getOperationDescription
DescriptionProvider getOperationDescription(PathAddress address, String operationName)
Get the operation description at the given address, ornull
if none exists.- Parameters:
address
- the address, relative to this nodeoperationName
- the operation name- Returns:
- the operation description
- Throws:
SecurityException
- if the caller does not haveACCESS_PERMISSION
-
getOperationFlags
Set<OperationEntry.Flag> getOperationFlags(PathAddress address, String operationName)
Get the special characteristic flags for the operation at the given address, ornull
if none exist.- Parameters:
address
- the address, relative to this nodeoperationName
- the operation name- Returns:
- the operation entry flags or
null
- Throws:
SecurityException
- if the caller does not haveACCESS_PERMISSION
-
getOperationEntry
OperationEntry getOperationEntry(PathAddress address, String operationName)
Get the entry representing an operation registered with the given name at the given address, ornull
if none exists.- Parameters:
address
- the address, relative to this nodeoperationName
- the operation name- Returns:
- the operation entry or
null
- Throws:
SecurityException
- if the caller does not haveACCESS_PERMISSION
-
getAttributeNames
Set<String> getAttributeNames(PathAddress address)
Get the names of the attributes for a node- Parameters:
address
- the address, relative to this node- Returns:
- the attribute names. If there are none an empty set is returned
- Throws:
SecurityException
- if the caller does not haveACCESS_PERMISSION
-
getAttributes
Map<String,AttributeAccess> getAttributes(PathAddress address)
Get the information about all attributes for a node.- Parameters:
address
- the address, relative to this node- Returns:
- the attribute information, in a map keyed by attribute name. If there are none an empty map is returned
- Throws:
SecurityException
- if the caller does not haveACCESS_PERMISSION
-
getAttributeAccess
AttributeAccess getAttributeAccess(PathAddress address, String attributeName)
Gets the information on how to read from or write to the given attribute.- Parameters:
address
- the address of the resourceattributeName
- the name of the attribute- Returns:
- the handling information, or
null
if the attribute or address is unknown - Throws:
SecurityException
- if the caller does not haveACCESS_PERMISSION
-
getNotificationDescriptions
Map<String,NotificationEntry> getNotificationDescriptions(PathAddress address, boolean inherited)
Get a map of descriptions of all notifications emitted by the resources at an address.- Parameters:
address
- the addressinherited
- true to include inherited notifications- Returns:
- the notifications map
- Throws:
SecurityException
- if the caller does not haveACCESS_PERMISSION
-
getChildNames
Set<String> getChildNames(PathAddress address)
Get the names of the types of children for a node- Parameters:
address
- the address, relative to this node- Returns:
- the child type names. If there are none an empty set is returned
- Throws:
SecurityException
- if the caller does not haveACCESS_PERMISSION
-
getChildAddresses
Set<PathElement> getChildAddresses(PathAddress address)
Gets the set of direct child address elements under the node at the passed in PathAddress- Parameters:
address
- the address we want to find children for- Returns:
- the set of direct child elements
- Throws:
SecurityException
- if the caller does not haveACCESS_PERMISSION
-
getModelDescription
DescriptionProvider getModelDescription(PathAddress address)
Get the model description at the given address, ornull
if none exists.- Parameters:
address
- the address, relative to this node- Returns:
- the model description
- Throws:
SecurityException
- if the caller does not haveACCESS_PERMISSION
-
getOperationDescriptions
Map<String,OperationEntry> getOperationDescriptions(PathAddress address, boolean inherited)
Get a map of descriptions of all operations available at an address.- Parameters:
address
- the addressinherited
- true to include inherited operations- Returns:
- the operation map
- Throws:
SecurityException
- if the caller does not haveACCESS_PERMISSION
-
getProxyController
ProxyController getProxyController(PathAddress address)
If there is a proxy controller registered under any part of the registered address it will be returned. E.g. if the address passed in is[a=b,c=d,e=f]
and there is a proxy registered under[a=b,c=d]
that proxy will be returned.- Parameters:
address
- the address to look for a proxy under- Returns:
- the found proxy controller, or
null
if there is none - Throws:
SecurityException
- if the caller does not haveACCESS_PERMISSION
-
getProxyControllers
Set<ProxyController> getProxyControllers(PathAddress address)
Finds all proxy controllers registered at the passed in address, or at lower levels. E.g. if the address passed in isa=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.- Parameters:
address
- the address to start looking for proxies under- Returns:
- the found proxy controllers, or an empty set if there are none
- Throws:
SecurityException
- if the caller does not haveACCESS_PERMISSION
-
getSubModel
ImmutableManagementResourceRegistration getSubModel(PathAddress address)
Get a sub model registration.- Parameters:
address
- the address, relative to this node- Returns:
- the node registration,
null
if there is none - Throws:
SecurityException
- if the caller does not haveACCESS_PERMISSION
-
getAccessConstraints
List<AccessConstraintDefinition> getAccessConstraints()
-
isOrderedChildResource
boolean isOrderedChildResource()
Return @code true} if a child resource registration was registered usingManagementResourceRegistration.registerSubModel(ResourceDefinition)
, andfalse
otherwise- Returns:
- whether this is an ordered child or not
-
getOrderedChildTypes
Set<String> getOrderedChildTypes()
Return the names of the child types registered to be ordered.- Returns:
- the set of ordered child types, and and empty set if there are none
-
getCapabilities
Set<RuntimeCapability> getCapabilities()
Returns all capabilities provided by this resource. This will only include capabilities for which this resource controls the registration of the capability. If any children of this resource are involved in providing the capability, the registration for the children must not include the capability in the value they return from this method.- Returns:
- Set of capabilities if any registered otherwise an empty set
- See Also:
getIncorporatingCapabilities()
-
getIncorporatingCapabilities
Set<RuntimeCapability> getIncorporatingCapabilities()
Returns all capabilities provided by parents of this resource, to which this resource contributes. This will only include capabilities for which this resource does not control the registration of the capability. Any capabilities registered by this resource will instead be included in the return value forgetCapabilities()
.Often, this method will return
null
, which has a special meaning. Anull
value means this resource contributes to any capabilities provided by resources higher in its branch of the resource tree, with the search for such capabilities continuing through ancestor resources until:- The ancestor has registered a capability; i.e. once a capability is identified, higher levels are not searched
- The ancestor returns a non-null value from this method; i.e. once an ancestor declares an incorporating capability or that there are no incorporating capabilities, higher levels are not searched
- The ancestor is a root resource. Child resources do not contribute to root capabilities unless they specifically declare they do so
- The ancestor has single element address whose key is
host
. Child resources do not contribute to host root capabilities unless they specifically declare they do so - For subsystem resources, the ancestor resource is not provided by the subsystem. Subsystem resources do not contribute to capabilities provided by the kernel
A non-
null
value indicates no search of parent resources for capabilities should be performed, and only those capabilities included in the return set should be considered as incorporating this resource (or none at all if the return set is empty.)An instance of this interface that returns a non-empty set from
getCapabilities()
must not returnnull
from this method. If a resource itself provides a capability but also contributes to a different capability provided by a parent, that relationship must be specifically noted in the return value from this method.Note that providing a capability that is in turn a requirement of a parent resource's capability is not the kind of "contributing" to the parent resource's capability that is being considered here. The relationship between a capability and its requirements is separately tracked by the
RuntimeCapability
itself. A typical "contributing" resource would be one that represents a chunk of configuration directly used by the parent resource's capability.- Returns:
- set of capabilities, or
null
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. Will not returnnull
ifgetCapabilities()
returns a non-empty set. - See Also:
getCapabilities()
-
getRequirements
Set<CapabilityReferenceRecorder> getRequirements()
Returns all capability reference recorders provided by this resource.- Returns:
- Set of CapabilityReferenceRecorder if any registered otherwise an empty set.
-
getAdditionalRuntimePackages
Set<RuntimePackageDependency> getAdditionalRuntimePackages()
Returns additional packages provided by this resource.- Returns:
- Set of
RuntimePackageDependency
if any registered otherwise an empty set.
-
-