org.opennms.netmgt.config
Class DefaultEventConfDao

java.lang.Object
  extended by org.opennms.netmgt.dao.castor.AbstractCastorConfigDao<Events,org.opennms.netmgt.config.EventConfiguration>
      extended by org.opennms.netmgt.config.DefaultEventConfDao
All Implemented Interfaces:
EventConfDao, org.springframework.beans.factory.InitializingBean

public class DefaultEventConfDao
extends AbstractCastorConfigDao<Events,org.opennms.netmgt.config.EventConfiguration>
implements EventConfDao, org.springframework.beans.factory.InitializingBean


Nested Class Summary
 
Nested classes/interfaces inherited from class org.opennms.netmgt.dao.castor.AbstractCastorConfigDao
AbstractCastorConfigDao.CastorReloadCallback
 
Constructor Summary
DefaultEventConfDao()
           
 
Method Summary
 void addEvent(Event event)
          Adds the event to the root level event config storage (file).
 void addEventToProgrammaticStore(Event event)
          Adds the given event to the programmatic event store.
 void afterPropertiesSet()
           
protected  String createLoadedLogMessage(org.opennms.netmgt.config.EventConfiguration translatedConfig, long diffTime)
           
 Event findByEvent(Event matchingEvent)
           
 Event findByUei(String uei)
           
 String getEventLabel(String uei)
           
 Map<String,String> getEventLabels()
           
 List<Event> getEvents(String uei)
           
 List<Event> getEventsByLabel()
           
 List<String> getEventUEIs()
           
 String getProgrammaticStoreRelativeUrl()
           
 boolean isSecureTag(String tag)
           
 void reload()
           
 boolean removeEventFromProgrammaticStore(Event event)
          Removes the given event from the programmatic event store.
 void saveCurrent()
           
 void setProgrammaticStoreRelativeUrl(String programmaticStoreRelativeUrl)
           
 org.opennms.netmgt.config.EventConfiguration translateConfig(Events events)
           
 
Methods inherited from class org.opennms.netmgt.dao.castor.AbstractCastorConfigDao
getConfigResource, getContainer, getDescription, getReloadCheckInterval, loadConfig, log, setConfigResource, setReloadCheckInterval
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultEventConfDao

public DefaultEventConfDao()
Method Detail

createLoadedLogMessage

protected String createLoadedLogMessage(org.opennms.netmgt.config.EventConfiguration translatedConfig,
                                        long diffTime)
Overrides:
createLoadedLogMessage in class AbstractCastorConfigDao<Events,org.opennms.netmgt.config.EventConfiguration>

reload

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

afterPropertiesSet

public void afterPropertiesSet()
                        throws org.springframework.dao.DataAccessException
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Overrides:
afterPropertiesSet in class AbstractCastorConfigDao<Events,org.opennms.netmgt.config.EventConfiguration>
Throws:
org.springframework.dao.DataAccessException

translateConfig

public org.opennms.netmgt.config.EventConfiguration translateConfig(Events events)
                                                             throws org.springframework.dao.DataAccessException
Specified by:
translateConfig in class AbstractCastorConfigDao<Events,org.opennms.netmgt.config.EventConfiguration>
Throws:
org.springframework.dao.DataAccessException

getEvents

public List<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<Event> getEventsByLabel()
Specified by:
getEventsByLabel in interface EventConfDao

addEvent

public void addEvent(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(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(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 Event findByUei(String uei)
Specified by:
findByUei in interface EventConfDao

findByEvent

public Event findByEvent(Event matchingEvent)
Specified by:
findByEvent in interface EventConfDao

getProgrammaticStoreRelativeUrl

public String getProgrammaticStoreRelativeUrl()

setProgrammaticStoreRelativeUrl

public void setProgrammaticStoreRelativeUrl(String programmaticStoreRelativeUrl)


Copyright © 2009. All Rights Reserved.