Package org.infinispan.cli.resources
Interface Resource
-
- All Known Implementing Classes:
AbstractResource,CacheKeyResource,CacheResource,CachesResource,ClusterResource,ConfigurationsResource,ContainerResource,ContainersResource,CounterResource,CountersResource,NodeResource,RootResource,SchemasResource,ServerResource,TaskResource,TasksResource
public interface Resource- Since:
- 10.0
- Author:
- Tristan Tarrant <tristan@infinispan.org>
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classResource.ListFormat
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description Stringdescribe()Returns a textual representation of this resource<T extends Resource>
TfindAncestor(Class<T> resourceClass)Finds the resource of the specified type within the ancestors of this resourceResourcegetChild(String name)Returns a resource representing the named childResourcegetChild(String... name)Returns a resource representing the named childIterable<String>getChildrenNames()Returns an iterable over the children of this resourceStringgetName()Returns the name of this resourceResourcegetParent()Returns the parent resource of this resource.ResourcegetResource(String path)static ResourcegetRootResource(Connection connection)Returns a root resource configured against the supplied configurationbooleanisLeaf()Returns whether this resource is a leaf resource (i.e.<T extends Resource>
Optional<T>optionalFindAncestor(Class<T> resourceClass)Finds the resource of the specified type within the ancestors of this resourcevoidprintChildren(Resource.ListFormat format, int limit, PrettyPrinter.PrettyPrintMode prettyPrintMode, org.aesh.command.shell.Shell shell)
-
-
-
Field Detail
-
THIS
static final String THIS
- See Also:
- Constant Field Values
-
PARENT
static final String PARENT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
String getName()
Returns the name of this resource
-
getParent
Resource getParent()
Returns the parent resource of this resource. This is null if the resource represents the root.
-
getChildrenNames
Iterable<String> getChildrenNames() throws IOException
Returns an iterable over the children of this resource- Throws:
IOException
-
printChildren
void printChildren(Resource.ListFormat format, int limit, PrettyPrinter.PrettyPrintMode prettyPrintMode, org.aesh.command.shell.Shell shell) throws IOException
- Throws:
IOException
-
getChild
Resource getChild(String name) throws IOException
Returns a resource representing the named child- Throws:
IOException
-
getChild
Resource getChild(String... name) throws IOException
Returns a resource representing the named child- Throws:
IOException
-
findAncestor
<T extends Resource> T findAncestor(Class<T> resourceClass)
Finds the resource of the specified type within the ancestors of this resource
-
optionalFindAncestor
<T extends Resource> Optional<T> optionalFindAncestor(Class<T> resourceClass)
Finds the resource of the specified type within the ancestors of this resource
-
isLeaf
boolean isLeaf()
Returns whether this resource is a leaf resource (i.e. it has no children, or the children are not navigable)
-
describe
String describe() throws IOException
Returns a textual representation of this resource- Throws:
IOException
-
getRootResource
static Resource getRootResource(Connection connection)
Returns a root resource configured against the supplied configuration
-
getResource
Resource getResource(String path) throws IOException
- Throws:
IOException
-
-