Package org.jboss.as.controller.registry
Class Resource.Tools
- java.lang.Object
-
- org.jboss.as.controller.registry.Resource.Tools
-
-
Field Summary
Fields Modifier and Type Field Description static ResourceFilter
ALL_BUT_RUNTIME_AND_PROXIES_FILTER
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Resource
navigate(Resource resource, PathAddress address)
Navigate from a parentresource
to the descendant resource at the given relativeaddress
.static org.jboss.dmr.ModelNode
readModel(Resource resource)
Recursively reads an entire resource tree, ignoring runtime-only and proxy resources, and generates a DMR tree representing all of the non-ignored resources.static org.jboss.dmr.ModelNode
readModel(Resource resource, int level)
Reads a resource tree, recursing up to the given number of levels but ignoring runtime-only and proxy resources, and generates a DMR tree representing all of the non-ignored resources.static org.jboss.dmr.ModelNode
readModel(Resource resource, int level, ImmutableManagementResourceRegistration mrr)
Reads a resource tree, recursing up to the given number of levels but ignoring runtime-only and proxy resources, and generates a DMR tree representing all of the non-ignored resources.static org.jboss.dmr.ModelNode
readModel(Resource resource, int level, ResourceFilter filter)
Reads a resource tree, recursing up to the given number of levels but ignoring resources not accepted by the givenfilter
, and generates a DMR tree representing all of the non-ignored resources.static org.jboss.dmr.ModelNode
readModel(Resource resource, ImmutableManagementResourceRegistration mrr)
Recursively reads an entire resource tree, ignoring runtime-only and proxy resources, and generates a DMR tree representing all of the non-ignored resources.
-
-
-
Field Detail
-
ALL_BUT_RUNTIME_AND_PROXIES_FILTER
public static final ResourceFilter ALL_BUT_RUNTIME_AND_PROXIES_FILTER
-
-
Method Detail
-
readModel
public static org.jboss.dmr.ModelNode readModel(Resource resource)
Recursively reads an entire resource tree, ignoring runtime-only and proxy resources, and generates a DMR tree representing all of the non-ignored resources.- Parameters:
resource
- the root resource- Returns:
- the DMR tree
-
readModel
public static org.jboss.dmr.ModelNode readModel(Resource resource, int level)
Reads a resource tree, recursing up to the given number of levels but ignoring runtime-only and proxy resources, and generates a DMR tree representing all of the non-ignored resources.- Parameters:
resource
- the modellevel
- the number of levels to recurse, or-1
for no limit- Returns:
- the DMR tree
-
readModel
public static org.jboss.dmr.ModelNode readModel(Resource resource, ImmutableManagementResourceRegistration mrr)
Recursively reads an entire resource tree, ignoring runtime-only and proxy resources, and generates a DMR tree representing all of the non-ignored resources. This variant can use a resource registration to help identify runtime-only and proxy resources more efficiently.- Parameters:
resource
- the root resourcemrr
- the resource registration forresource
, ornull
- Returns:
- the DMR tree
-
readModel
public static org.jboss.dmr.ModelNode readModel(Resource resource, int level, ImmutableManagementResourceRegistration mrr)
Reads a resource tree, recursing up to the given number of levels but ignoring runtime-only and proxy resources, and generates a DMR tree representing all of the non-ignored resources. This variant can use a resource registration to help identify runtime-only and proxy resources more efficiently.- Parameters:
resource
- the modellevel
- the number of levels to recurse, or-1
for no limitmrr
- the resource registration forresource
, ornull
- Returns:
- the DMR tree
-
readModel
public static org.jboss.dmr.ModelNode readModel(Resource resource, int level, ResourceFilter filter)
Reads a resource tree, recursing up to the given number of levels but ignoring resources not accepted by the givenfilter
, and generates a DMR tree representing all of the non-ignored resources.- Parameters:
resource
- the modellevel
- the number of levels to recurse, or-1
for no limitfilter
- a resource filter- Returns:
- the model
-
navigate
public static Resource navigate(Resource resource, PathAddress address)
Navigate from a parentresource
to the descendant resource at the given relativeaddress
.Resource.navigate(PathAddress)
implementations can use this as a standard implementation.- Parameters:
resource
- the resource the resource. Cannot benull
address
- the address the address relative toresource
's address. Cannot benull
- Returns:
- the resource the descendant resource. Will not be
null
- Throws:
Resource.NoSuchResourceException
- if there is no descendant resource ataddress
-
-