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 java.lang.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(java.lang.String pathName)
getPathjava.util.Map<java.lang.String,Path>
getPaths()
getPathsjava.util.Collection<java.lang.String>
getTargetCommands(Path path, int index, java.lang.String target)
getTargetCommandsTarget[]
getTargetList(int index, Path path)
getTargetListprotected void
parseXML(java.io.InputStream stream)
parseXMLboolean
pathHasTarget(Path path, java.lang.String target)
pathHasTargetvoid
removePath(java.lang.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(java.lang.String oldName, Path newPath)
replacePathvoid
saveCurrent()
saveCurrentprotected abstract void
saveXML(java.lang.String writerString)
saveXMLabstract void
update()
update
-
-
-
Method Detail
-
parseXML
protected void parseXML(java.io.InputStream stream) throws java.io.IOException
parseXML
- Parameters:
stream
- aInputStream
object.- Throws:
java.io.IOException
-
getPath
public Path getPath(java.lang.String pathName) throws java.io.IOException
getPath
- Parameters:
pathName
- aString
object.- Returns:
- a
Path
object. - Throws:
java.io.IOException
- if any.
-
getPaths
public java.util.Map<java.lang.String,Path> getPaths() throws java.io.IOException
getPaths
- Returns:
- a
Map
object. - Throws:
java.io.IOException
- if any.
-
getTargetCommands
public java.util.Collection<java.lang.String> getTargetCommands(Path path, int index, java.lang.String target) throws java.io.IOException
getTargetCommands
- Parameters:
path
- aPath
object.index
- a int.target
- aString
object.- Returns:
- a
Collection
object. - Throws:
java.io.IOException
- if any.
-
getTargetList
public Target[] getTargetList(int index, Path path) throws java.io.IOException
getTargetList
-
pathHasTarget
public boolean pathHasTarget(Path path, java.lang.String target) throws java.io.IOException
pathHasTarget
- Parameters:
path
- aPath
object.target
- aString
object.- Returns:
- a boolean.
- Throws:
java.io.IOException
- if any.
-
addPath
public void addPath(Path newPath) throws java.io.IOException
addPath
- Parameters:
newPath
- aPath
object.- Throws:
java.io.IOException
- if any.
-
replacePath
public void replacePath(java.lang.String oldName, Path newPath) throws java.io.IOException
replacePath
- Parameters:
oldName
- aString
object.newPath
- aPath
object.- Throws:
java.io.IOException
- if any.
-
removePath
public void removePath(Path path) throws java.io.IOException
Removes a Path from the xml file.- Parameters:
path
- the path to remove- Throws:
java.io.IOException
java.io.IOException
- if any.
-
removePath
public void removePath(java.lang.String name) throws java.io.IOException
Removes a Path form the xml file based on its name- Parameters:
name
- the name of the path to remove- Throws:
java.io.IOException
java.io.IOException
- if any.
-
saveCurrent
public void saveCurrent() throws java.io.IOException
saveCurrent
- Throws:
java.io.IOException
- if any.
-
saveXML
protected abstract void saveXML(java.lang.String writerString) throws java.io.IOException
saveXML
- Parameters:
writerString
- aString
object.- Throws:
java.io.IOException
- if any.
-
update
public abstract void update() throws java.io.IOException, java.io.FileNotFoundException
update
- Throws:
java.io.IOException
- if any.java.io.FileNotFoundException
- if any.
-
-