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 voidaddPath(Path newPath)addPathPathgetPath(String pathName)getPathMap<String,Path>getPaths()getPathsCollection<String>getTargetCommands(Path path, int index, String target)getTargetCommandsTarget[]getTargetList(int index, Path path)getTargetListprotected voidparseXML(InputStream stream)parseXMLbooleanpathHasTarget(Path path, String target)pathHasTargetvoidremovePath(String name)Removes a Path form the xml file based on its namevoidremovePath(Path path)Removes a Path from the xml file.voidreplacePath(String oldName, Path newPath)replacePathvoidsaveCurrent()saveCurrentprotected abstract voidsaveXML(String writerString)saveXMLabstract voidupdate()update 
 - 
 
- 
- 
Method Detail
- 
parseXML
protected void parseXML(InputStream stream) throws IOException
parseXML
- Parameters:
 stream- aInputStreamobject.- Throws:
 IOException
 
- 
getPath
public Path getPath(String pathName) throws IOException
getPath
- Parameters:
 pathName- aStringobject.- Returns:
 - a 
Pathobject. - Throws:
 IOException- if any.
 
- 
getPaths
public Map<String,Path> getPaths() throws IOException
getPaths
- Returns:
 - a 
Mapobject. - Throws:
 IOException- if any.
 
- 
getTargetCommands
public Collection<String> getTargetCommands(Path path, int index, String target) throws IOException
getTargetCommands
- Parameters:
 path- aPathobject.index- a int.target- aStringobject.- Returns:
 - a 
Collectionobject. - Throws:
 IOException- if any.
 
- 
getTargetList
public Target[] getTargetList(int index, Path path) throws IOException
getTargetList
- Parameters:
 index- a int.path- aPathobject.- Returns:
 - an array of 
Targetobjects. - Throws:
 IOException- if any.
 
- 
pathHasTarget
public boolean pathHasTarget(Path path, String target) throws IOException
pathHasTarget
- Parameters:
 path- aPathobject.target- aStringobject.- Returns:
 - a boolean.
 - Throws:
 IOException- if any.
 
- 
addPath
public void addPath(Path newPath) throws IOException
addPath
- Parameters:
 newPath- aPathobject.- Throws:
 IOException- if any.
 
- 
replacePath
public void replacePath(String oldName, Path newPath) throws IOException
replacePath
- Parameters:
 oldName- aStringobject.newPath- aPathobject.- 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:
 IOExceptionIOException- 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:
 IOExceptionIOException- if any.
 
- 
saveCurrent
public void saveCurrent() throws IOExceptionsaveCurrent
- Throws:
 IOException- if any.
 
- 
saveXML
protected abstract void saveXML(String writerString) throws IOException
saveXML
- Parameters:
 writerString- aStringobject.- Throws:
 IOException- if any.
 
- 
update
public abstract void update() throws IOException, FileNotFoundExceptionupdate
- Throws:
 IOException- if any.FileNotFoundException- if any.
 
 - 
 
 -