org.opennms.netmgt.config
Class DestinationPathManager

java.lang.Object
  extended by org.opennms.netmgt.config.DestinationPathManager
Direct Known Subclasses:
DestinationPathFactory

public abstract class DestinationPathManager
extends Object

Author:
David Hustace

Field Summary
protected  InputStream configIn
           
 
Constructor Summary
DestinationPathManager()
           
 
Method Summary
 void addPath(Path newPath)
           
 Path getPath(String pathName)
           
 Map<String,Path> getPaths()
           
 Collection<String> getTargetCommands(Path path, int index, String target)
           
 Target[] getTargetList(int index, Path path)
           
protected  void parseXML(Reader reader)
           
 boolean pathHasTarget(Path path, String target)
           
 void removePath(Path path)
          Removes a Path from the xml file.
 void removePath(String name)
          Removes a Path form the xml file based on its name
 void replacePath(String oldName, Path newPath)
           
 void saveCurrent()
           
protected abstract  void saveXML(String writerString)
           
abstract  void update()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

configIn

protected InputStream configIn
Constructor Detail

DestinationPathManager

public DestinationPathManager()
Method Detail

parseXML

protected void parseXML(Reader reader)
                 throws org.exolab.castor.xml.MarshalException,
                        org.exolab.castor.xml.ValidationException
Parameters:
reader -
Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

getPath

public Path getPath(String pathName)
             throws IOException,
                    org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException
Throws:
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

getPaths

public Map<String,Path> getPaths()
                          throws IOException,
                                 org.exolab.castor.xml.MarshalException,
                                 org.exolab.castor.xml.ValidationException
Throws:
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

getTargetCommands

public Collection<String> getTargetCommands(Path path,
                                            int index,
                                            String target)
                                     throws IOException,
                                            org.exolab.castor.xml.MarshalException,
                                            org.exolab.castor.xml.ValidationException
Throws:
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

getTargetList

public Target[] getTargetList(int index,
                              Path path)
                       throws IOException,
                              org.exolab.castor.xml.MarshalException,
                              org.exolab.castor.xml.ValidationException
Throws:
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

pathHasTarget

public boolean pathHasTarget(Path path,
                             String target)
                      throws IOException,
                             org.exolab.castor.xml.MarshalException,
                             org.exolab.castor.xml.ValidationException
Throws:
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException

addPath

public void addPath(Path newPath)
             throws org.exolab.castor.xml.MarshalException,
                    org.exolab.castor.xml.ValidationException,
                    IOException
Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
IOException

replacePath

public void replacePath(String oldName,
                        Path newPath)
                 throws org.exolab.castor.xml.MarshalException,
                        org.exolab.castor.xml.ValidationException,
                        IOException
Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
IOException

removePath

public void removePath(Path path)
                throws org.exolab.castor.xml.MarshalException,
                       org.exolab.castor.xml.ValidationException,
                       IOException
Removes a Path from the xml file.

Parameters:
path - the path to remove
Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
IOException

removePath

public void removePath(String name)
                throws org.exolab.castor.xml.MarshalException,
                       org.exolab.castor.xml.ValidationException,
                       IOException
Removes a Path form the xml file based on its name

Parameters:
name - the name of the path to remove
Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
IOException

saveCurrent

public void saveCurrent()
                 throws org.exolab.castor.xml.MarshalException,
                        org.exolab.castor.xml.ValidationException,
                        IOException
Throws:
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
IOException

saveXML

protected abstract void saveXML(String writerString)
                         throws IOException
Parameters:
writerString -
Throws:
IOException

update

public abstract void update()
                     throws IOException,
                            org.exolab.castor.xml.MarshalException,
                            org.exolab.castor.xml.ValidationException,
                            FileNotFoundException
Throws:
IOException
org.exolab.castor.xml.MarshalException
org.exolab.castor.xml.ValidationException
FileNotFoundException


Copyright © 2009. All Rights Reserved.