Class Resource.Tools

  • Enclosing interface:
    Resource

    public static class Resource.Tools
    extends Object
    • 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 model
        level - 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 resource
        mrr - the resource registration for resource, or null
        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 model
        level - the number of levels to recurse, or -1 for no limit
        mrr - the resource registration for resource, or null
        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 given filter, and generates a DMR tree representing all of the non-ignored resources.
        Parameters:
        resource - the model
        level - the number of levels to recurse, or -1 for no limit
        filter - a resource filter
        Returns:
        the model
      • navigate

        public static Resource navigate​(Resource resource,
                                        PathAddress address)
        Navigate from a parent resource to the descendant resource at the given relative address.

        Resource.navigate(PathAddress) implementations can use this as a standard implementation.

        Parameters:
        resource - the resource the resource. Cannot be null
        address - the address the address relative to resource's address. Cannot be null
        Returns:
        the resource the descendant resource. Will not be null
        Throws:
        Resource.NoSuchResourceException - if there is no descendant resource at address