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

DefaultEventConfDao class.

Version:
$Id: $
Author:
ranger

Nested Class Summary
 
Nested classes/interfaces inherited from class org.opennms.netmgt.dao.castor.AbstractCastorConfigDao
AbstractCastorConfigDao.CastorReloadCallback
 
Constructor Summary
DefaultEventConfDao()
          Constructor for 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()
          afterPropertiesSet
protected  String createLoadedLogMessage(org.opennms.netmgt.config.EventConfiguration translatedConfig, long diffTime)
          createLoadedLogMessage
 Event findByEvent(Event matchingEvent)
          findByEvent
 Event findByUei(String uei)
          findByUei
 String getEventLabel(String uei)
          getEventLabel
 Map<String,String> getEventLabels()
          getEventLabels
 List<Event> getEvents(String uei)
          getEvents
 List<Event> getEventsByLabel()
          getEventsByLabel
 List<String> getEventUEIs()
          getEventUEIs
 String getProgrammaticStoreRelativeUrl()
          getProgrammaticStoreRelativeUrl
 boolean isSecureTag(String tag)
          isSecureTag
 void reload()
          reload
 boolean removeEventFromProgrammaticStore(Event event)
          Removes the given event from the programmatic event store.
 void saveCurrent()
          saveCurrent
 void setProgrammaticStoreRelativeUrl(String programmaticStoreRelativeUrl)
          setProgrammaticStoreRelativeUrl
 org.opennms.netmgt.config.EventConfiguration translateConfig(Events events)
          translateConfig
 
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()

Constructor for DefaultEventConfDao.

Method Detail

createLoadedLogMessage

protected String createLoadedLogMessage(org.opennms.netmgt.config.EventConfiguration translatedConfig,
                                        long diffTime)

createLoadedLogMessage

Overrides:
createLoadedLogMessage in class AbstractCastorConfigDao<Events,org.opennms.netmgt.config.EventConfiguration>
Parameters:
translatedConfig - a V object.
diffTime - a long.
Returns:
a String object.

reload

public void reload()
            throws org.springframework.dao.DataAccessException

reload

Specified by:
reload in interface EventConfDao
Throws:
org.springframework.dao.DataAccessException - if any.

afterPropertiesSet

public void afterPropertiesSet()
                        throws org.springframework.dao.DataAccessException

afterPropertiesSet

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

translateConfig

Specified by:
translateConfig in class AbstractCastorConfigDao<Events,org.opennms.netmgt.config.EventConfiguration>
Parameters:
events - a K object.
Returns:
a V object.
Throws:
org.springframework.dao.DataAccessException

getEvents

public List<Event> getEvents(String uei)

getEvents

Specified by:
getEvents in interface EventConfDao
Parameters:
uei - a String object.
Returns:
a List object.

getEventUEIs

public List<String> getEventUEIs()

getEventUEIs

Specified by:
getEventUEIs in interface EventConfDao
Returns:
a List object.

getEventLabels

public Map<String,String> getEventLabels()

getEventLabels

Specified by:
getEventLabels in interface EventConfDao
Returns:
a Map object.

getEventLabel

public String getEventLabel(String uei)

getEventLabel

Specified by:
getEventLabel in interface EventConfDao
Parameters:
uei - a String object.
Returns:
a String object.

saveCurrent

public void saveCurrent()

saveCurrent

Specified by:
saveCurrent in interface EventConfDao

getEventsByLabel

public List<Event> getEventsByLabel()

getEventsByLabel

Specified by:
getEventsByLabel in interface EventConfDao
Returns:
a List object.

addEvent

public void addEvent(Event event)
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)
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)
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.
Returns:
a boolean.

isSecureTag

public boolean isSecureTag(String tag)

isSecureTag

Specified by:
isSecureTag in interface EventConfDao
Parameters:
tag - a String object.
Returns:
a boolean.

findByUei

public Event findByUei(String uei)

findByUei

Specified by:
findByUei in interface EventConfDao
Parameters:
uei - a String object.
Returns:
a Event object.

findByEvent

public Event findByEvent(Event matchingEvent)

findByEvent

Specified by:
findByEvent in interface EventConfDao
Parameters:
matchingEvent - a Event object.
Returns:
a Event object.

getProgrammaticStoreRelativeUrl

public String getProgrammaticStoreRelativeUrl()

getProgrammaticStoreRelativeUrl

Returns:
a String object.

setProgrammaticStoreRelativeUrl

public void setProgrammaticStoreRelativeUrl(String programmaticStoreRelativeUrl)

setProgrammaticStoreRelativeUrl

Parameters:
programmaticStoreRelativeUrl - a String object.


Copyright © 2011. All Rights Reserved.