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.ObjectAbstract 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 voidaddPath(Path newPath)addPathPathgetPath(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 voidparseXML(java.io.InputStream stream)parseXMLbooleanpathHasTarget(Path path, java.lang.String target)pathHasTargetvoidremovePath(java.lang.String name)Removes a Path form the xml file based on its namevoidremovePath(Path path)Removes a Path from the xml file.voidreplacePath(java.lang.String oldName, Path newPath)replacePathvoidsaveCurrent()saveCurrentprotected abstract voidsaveXML(java.lang.String writerString)saveXMLabstract voidupdate()update
-
-
-
Method Detail
-
parseXML
protected void parseXML(java.io.InputStream stream) throws java.io.IOExceptionparseXML
- Parameters:
stream- aInputStreamobject.- Throws:
java.io.IOException
-
getPath
public Path getPath(java.lang.String pathName) throws java.io.IOException
getPath
- Parameters:
pathName- aStringobject.- Returns:
- a
Pathobject. - Throws:
java.io.IOException- if any.
-
getPaths
public java.util.Map<java.lang.String,Path> getPaths() throws java.io.IOException
getPaths
- Returns:
- a
Mapobject. - 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- aPathobject.index- a int.target- aStringobject.- Returns:
- a
Collectionobject. - 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- aPathobject.target- aStringobject.- Returns:
- a boolean.
- Throws:
java.io.IOException- if any.
-
addPath
public void addPath(Path newPath) throws java.io.IOException
addPath
- Parameters:
newPath- aPathobject.- Throws:
java.io.IOException- if any.
-
replacePath
public void replacePath(java.lang.String oldName, Path newPath) throws java.io.IOExceptionreplacePath
- Parameters:
oldName- aStringobject.newPath- aPathobject.- 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.IOExceptionjava.io.IOException- if any.
-
removePath
public void removePath(java.lang.String name) throws java.io.IOExceptionRemoves a Path form the xml file based on its name- Parameters:
name- the name of the path to remove- Throws:
java.io.IOExceptionjava.io.IOException- if any.
-
saveCurrent
public void saveCurrent() throws java.io.IOExceptionsaveCurrent
- Throws:
java.io.IOException- if any.
-
saveXML
protected abstract void saveXML(java.lang.String writerString) throws java.io.IOExceptionsaveXML
- Parameters:
writerString- aStringobject.- Throws:
java.io.IOException- if any.
-
update
public abstract void update() throws java.io.IOException, java.io.FileNotFoundExceptionupdate
- Throws:
java.io.IOException- if any.java.io.FileNotFoundException- if any.
-
-