Package org.opennms.netmgt.config
Class DestinationPathManager
- java.lang.Object
-
- org.opennms.netmgt.config.DestinationPathManager
-
- Direct Known Subclasses:
DestinationPathFactory
,MockDestinationPathManager
public abstract class DestinationPathManager extends Object
Abstract DestinationPathManager class.
- Version:
- $Id: $
- Author:
- David Hustace
-
-
Constructor Summary
Constructors Constructor Description DestinationPathManager()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addPath(Path newPath)
addPathPath
getPath(String pathName)
getPathMap<String,Path>
getPaths()
getPathsCollection<String>
getTargetCommands(Path path, int index, String target)
getTargetCommandsTarget[]
getTargetList(int index, Path path)
getTargetListprotected void
parseXML(InputStream stream)
parseXMLboolean
pathHasTarget(Path path, String target)
pathHasTargetvoid
removePath(String name)
Removes a Path form the xml file based on its namevoid
removePath(Path path)
Removes a Path from the xml file.void
replacePath(String oldName, Path newPath)
replacePathvoid
saveCurrent()
saveCurrentprotected abstract void
saveXML(String writerString)
saveXMLabstract void
update()
update
-
-
-
Method Detail
-
parseXML
protected void parseXML(InputStream stream) throws IOException
parseXML
- Parameters:
stream
- aInputStream
object.- Throws:
IOException
-
getPath
public Path getPath(String pathName) throws IOException
getPath
- Parameters:
pathName
- aString
object.- Returns:
- a
Path
object. - Throws:
IOException
- if any.
-
getPaths
public Map<String,Path> getPaths() throws IOException
getPaths
- Returns:
- a
Map
object. - Throws:
IOException
- if any.
-
getTargetCommands
public Collection<String> getTargetCommands(Path path, int index, String target) throws IOException
getTargetCommands
- Parameters:
path
- aPath
object.index
- a int.target
- aString
object.- Returns:
- a
Collection
object. - Throws:
IOException
- if any.
-
getTargetList
public Target[] getTargetList(int index, Path path) throws IOException
getTargetList
- Parameters:
index
- a int.path
- aPath
object.- Returns:
- an array of
Target
objects. - Throws:
IOException
- if any.
-
pathHasTarget
public boolean pathHasTarget(Path path, String target) throws IOException
pathHasTarget
- Parameters:
path
- aPath
object.target
- aString
object.- Returns:
- a boolean.
- Throws:
IOException
- if any.
-
addPath
public void addPath(Path newPath) throws IOException
addPath
- Parameters:
newPath
- aPath
object.- Throws:
IOException
- if any.
-
replacePath
public void replacePath(String oldName, Path newPath) throws IOException
replacePath
- Parameters:
oldName
- aString
object.newPath
- aPath
object.- Throws:
IOException
- if any.
-
removePath
public void removePath(Path path) throws IOException
Removes a Path from the xml file.- Parameters:
path
- the path to remove- Throws:
IOException
IOException
- if any.
-
removePath
public void removePath(String name) throws IOException
Removes a Path form the xml file based on its name- Parameters:
name
- the name of the path to remove- Throws:
IOException
IOException
- if any.
-
saveCurrent
public void saveCurrent() throws IOException
saveCurrent
- Throws:
IOException
- if any.
-
saveXML
protected abstract void saveXML(String writerString) throws IOException
saveXML
- Parameters:
writerString
- aString
object.- Throws:
IOException
- if any.
-
update
public abstract void update() throws IOException, FileNotFoundException
update
- Throws:
IOException
- if any.FileNotFoundException
- if any.
-
-