public interface Resource extends Cloneable
Instances of this class are not thread-safe and need to be synchronized externally.
Modifier and Type | Interface and Description |
---|---|
static class |
Resource.Factory |
static class |
Resource.NoSuchResourceException
A
NoSuchElementException variant that can be thrown by requireChild(PathElement) and
navigate(PathAddress) implementations to indicate a client error when invoking a
management operation. |
static interface |
Resource.ResourceEntry |
static class |
Resource.Tools |
Modifier and Type | Method and Description |
---|---|
Resource |
clone() |
Resource |
getChild(PathElement element)
Get a single child of this resource with the given address.
|
Set<Resource.ResourceEntry> |
getChildren(String childType)
Get the children for a given type.
|
Set<String> |
getChildrenNames(String childType)
Get the children names for a given type.
|
Set<String> |
getChildTypes()
Get a list of registered child types for this resource.
|
org.jboss.dmr.ModelNode |
getModel()
Get the local model.
|
boolean |
hasChild(PathElement element)
Determine whether this resource has a child with the given address.
|
boolean |
hasChildren(String childType)
Determine whether this resource has any child of a given type.
|
boolean |
isModelDefined()
Determine whether the model of this resource is defined.
|
boolean |
isProxy() |
boolean |
isRuntime() |
Resource |
navigate(PathAddress address)
Navigate the resource tree.
|
void |
registerChild(PathElement address,
Resource resource)
Register a child resource.
|
Resource |
removeChild(PathElement address)
Remove a child resource.
|
Resource |
requireChild(PathElement element)
Get a single child of this resource with the given address.
|
void |
writeModel(org.jboss.dmr.ModelNode newModel)
Write the model.
|
org.jboss.dmr.ModelNode getModel()
void writeModel(org.jboss.dmr.ModelNode newModel)
newModel
- the new modelboolean isModelDefined()
true
if the local model is definedboolean hasChild(PathElement element)
PathElement
has
a wildcard as value, it will determine whether this resource has any resources of a given type.element
- the path elementtrue
if there is child with the given addressResource getChild(PathElement element)
null
.element
- the path elementnull
if there is no such child resourceResource requireChild(PathElement element)
element
- the path elementNoSuchElementException
- if the child does not existResource.NoSuchResourceException
boolean hasChildren(String childType)
childType
- the child typetrue
if there is any child of the given typeResource navigate(PathAddress address)
address
- the addressNoSuchElementException
- if any resource in the path does not existResource.NoSuchResourceException
Set<String> getChildTypes()
Set<String> getChildrenNames(String childType)
childType
- the child typeSet<Resource.ResourceEntry> getChildren(String childType)
childType
- the child typevoid registerChild(PathElement address, Resource resource)
address
- the addressresource
- the resourceIllegalStateException
- for a duplicate entryResource removeChild(PathElement address)
address
- the addressboolean isRuntime()
boolean isProxy()
Resource clone()
Copyright © 2015 JBoss by Red Hat. All rights reserved.