Modifier and Type | Method and Description |
---|---|
void |
addNode(Node node)
Adds a node.
|
Node |
getNode(String name)
Returns the named node.
|
List<Node> |
getNodes()
Returns the list of nodes.
|
boolean |
isLegacy()
Returns
true if and only if the list of nodes is stored in the legacy location. |
void |
load()
Loads the nodes from disk.
|
void |
removeNode(Node node)
Removes a node.
|
boolean |
replaceNode(Node oldOne,
Node newOne)
Replace node of given name.
|
void |
save()
Persists the state of this object into XML.
|
void |
setNodes(Collection<? extends Node> nodes)
Sets the list of nodes.
|
boolean |
updateNode(Node node)
Updates an existing node on disk.
|
@NonNull public List<Node> getNodes()
public void setNodes(@NonNull Collection<? extends Node> nodes) throws IOException
nodes
- the new list of nodes.IOException
- if the new list of nodes could not be persisted.public void addNode(@NonNull Node node) throws IOException
node
- the new node.IOException
- if the list of nodes could not be persisted.public boolean updateNode(@NonNull Node node) throws IOException
Node.getNodeName()
.node
- the node to be updated.true
, if the node was updated. false
, if the node was not in the list of nodes.IOException
- if the node could not be persisted.public boolean replaceNode(Node oldOne, @NonNull Node newOne) throws IOException
true
if node was replaced.IOException
public void removeNode(@NonNull Node node) throws IOException
Node.getNodeName()
.node
- the node instance to remove.IOException
- if the list of nodes could not be persisted.public void save() throws IOException
Saveable
For making a bulk change efficiently, see BulkChange
.
To support listeners monitoring changes to this object, call SaveableListener.fireOnChange(hudson.model.Saveable, hudson.XmlFile)
save
in interface Saveable
IOException
- if the persistence failed.@CheckForNull public Node getNode(String name)
name
- the Node.getNodeName()
of the node to retrieve.Node
or null
if the node could not be found.public void load() throws IOException
IOException
- if the nodes could not be deserialized.public boolean isLegacy()
true
if and only if the list of nodes is stored in the legacy location.true
if and only if the list of nodes is stored in the legacy location.Copyright © 2004–2021. All rights reserved.