org.opennms.netmgt.config
Class DefaultEventConfDao

java.lang.Object
  extended by org.opennms.netmgt.config.DefaultEventConfDao
All Implemented Interfaces:
EventConfDao

public class DefaultEventConfDao
extends Object
implements EventConfDao


Constructor Summary
DefaultEventConfDao()
           
DefaultEventConfDao(File rootConfigFile)
           
DefaultEventConfDao(File rootConfigFile, File programmaticStoreFile)
           
 
Method Summary
 void addEvent(org.opennms.netmgt.xml.eventconf.Event event)
          Adds the event to the root level event config storage (file).
 void addEventToProgrammaticStore(org.opennms.netmgt.xml.eventconf.Event event)
          Adds the given event to the programmatic event store.
 org.opennms.netmgt.xml.eventconf.Event findByEvent(org.opennms.netmgt.xml.event.Event matchingEvent)
           
 org.opennms.netmgt.xml.eventconf.Event findByUei(String uei)
           
 String getEventLabel(String uei)
           
 Map<String,String> getEventLabels()
           
 List<org.opennms.netmgt.xml.eventconf.Event> getEvents(String uei)
           
 List<org.opennms.netmgt.xml.eventconf.Event> getEventsByLabel()
           
 List<String> getEventUEIs()
           
 boolean isSecureTag(String tag)
           
 void loadConfiguration(File file)
          This method is used to load the passed configuration into the currently managed configuration instance.
protected  void loadConfiguration(Reader rdr, File rootConfigFile)
           
 void reload()
           
 boolean removeEventFromProgrammaticStore(org.opennms.netmgt.xml.eventconf.Event event)
          Removes the given event from the programmatic event store.
 void saveCurrent()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultEventConfDao

public DefaultEventConfDao()

DefaultEventConfDao

public DefaultEventConfDao(File rootConfigFile)

DefaultEventConfDao

public DefaultEventConfDao(File rootConfigFile,
                           File programmaticStoreFile)
Method Detail

reload

public void reload()
            throws org.springframework.dao.DataAccessException
Specified by:
reload in interface EventConfDao
Throws:
org.springframework.dao.DataAccessException

loadConfiguration

public void loadConfiguration(File file)
                       throws org.springframework.dao.DataAccessException
This method is used to load the passed configuration into the currently managed configuration instance. Any events that previously existed are cleared.

Parameters:
file - The file to load.
Throws:
org.exolab.castor.xml.MarshalException - Thrown if the file does not conform to the schema.
org.exolab.castor.xml.ValidationException - Thrown if the contents do not match the required schema.
java.lang.IOException - Thrown if the file cannot be opened for reading.
org.springframework.dao.DataAccessException

loadConfiguration

protected void loadConfiguration(Reader rdr,
                                 File rootConfigFile)
                          throws org.springframework.dao.DataAccessException
Throws:
org.springframework.dao.DataAccessException

getEvents

public List<org.opennms.netmgt.xml.eventconf.Event> getEvents(String uei)
Specified by:
getEvents in interface EventConfDao

getEventUEIs

public List<String> getEventUEIs()
Specified by:
getEventUEIs in interface EventConfDao

getEventLabels

public Map<String,String> getEventLabels()
Specified by:
getEventLabels in interface EventConfDao

getEventLabel

public String getEventLabel(String uei)
Specified by:
getEventLabel in interface EventConfDao

saveCurrent

public void saveCurrent()
Specified by:
saveCurrent in interface EventConfDao

getEventsByLabel

public List<org.opennms.netmgt.xml.eventconf.Event> getEventsByLabel()
Specified by:
getEventsByLabel in interface EventConfDao

addEvent

public void addEvent(org.opennms.netmgt.xml.eventconf.Event event)
Description copied from interface: EventConfDao
Adds the event to the root level event config storage (file). Does not save (you must save independently with saveCurrent)

Specified by:
addEvent in interface EventConfDao
Parameters:
event - The fully configured Event object to add.

addEventToProgrammaticStore

public void addEventToProgrammaticStore(org.opennms.netmgt.xml.eventconf.Event event)
Description copied from interface: EventConfDao
Adds the given event to the programmatic event store. This store currently implemented as a file (referenced from eventconf.xml) The programmatic store is a separate storage area, so that incidental programmatic editing of events (e.g. custom UEIs for thresholds, edited through the Web-UI) does not clutter up the otherwise carefully maintained event files. This method does not save (persist) the changes

Specified by:
addEventToProgrammaticStore in interface EventConfDao
Parameters:
event - The fully configured Event object to add.

removeEventFromProgrammaticStore

public boolean removeEventFromProgrammaticStore(org.opennms.netmgt.xml.eventconf.Event event)
Description copied from interface: EventConfDao
Removes the given event from the programmatic event store. This store currently implemented as a file (referenced from eventconf.xml) The programmatic store is a separate storage area, so that incidental programmatic editing of events (e.g. custom UEIs for thresholds, edited through the Web-UI) does not clutter up the otherwise carefully maintained event files. This method does not save (persist) the changes

Specified by:
removeEventFromProgrammaticStore in interface EventConfDao
Parameters:
event - The fully configured Event object to remove.

isSecureTag

public boolean isSecureTag(String tag)
Specified by:
isSecureTag in interface EventConfDao

findByUei

public org.opennms.netmgt.xml.eventconf.Event findByUei(String uei)
Specified by:
findByUei in interface EventConfDao

findByEvent

public org.opennms.netmgt.xml.eventconf.Event findByEvent(org.opennms.netmgt.xml.event.Event matchingEvent)
Specified by:
findByEvent in interface EventConfDao


Copyright ? 2008. All Rights Reserved.