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()
Creates and returns a copy of this resource.
|
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.
|
Set<String> |
getOrderedChildTypes()
Return the child types for which the order matters.
|
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()
Gets whether operations against this resource will be proxied to a remote process.
|
boolean |
isRuntime()
Gets whether this resource only exists in the runtime and has no representation in the
persistent configuration model.
|
Resource |
navigate(PathAddress address)
Navigate the resource tree.
|
void |
registerChild(PathElement address,
int index,
Resource resource)
Register a child resource
|
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.
|
default Resource |
shallowCopy()
Creates a shallow copy of this resource, which will only have placeholder resources
for immediate children.
|
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 elementResource.NoSuchResourceException - if the child does not existboolean hasChildren(String childType)
childType - the child typetrue if there is any child of the given typeResource navigate(PathAddress address)
address - the addressResource.NoSuchResourceException - if any resource in the path does not existSet<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 entryvoid registerChild(PathElement address, int index, Resource resource)
address - the addressindex - the index at which to add the resource. Existing children with this index and higher will be shifted one uoresource - the resourceIllegalStateException - for a duplicate entry or if the resource does not support ordered childrenResource removeChild(PathElement address)
address - the addressSet<String> getOrderedChildTypes()
true if the order of the children matters. If there are no ordered
children and empty set is returned. This method should never return nullboolean isRuntime()
true if the resource has no representation in the
persistent configuration model; false otherwiseboolean isProxy()
true if this resource represents a remote resource; false otherwiseResource clone()
nulldefault Resource shallowCopy()
model and will not themselves have any children.
Their presence, however, allows the caller to see what immediate children exist under the target resource.nullCopyright © 2021 JBoss by Red Hat. All rights reserved.