Package org.opennms.netmgt.config
Class DefaultEventConfDao
- java.lang.Object
-
- org.opennms.netmgt.config.DefaultEventConfDao
-
- All Implemented Interfaces:
EventConfDao
,org.springframework.beans.factory.InitializingBean
public class DefaultEventConfDao extends Object implements EventConfDao, org.springframework.beans.factory.InitializingBean
-
-
Constructor Summary
Constructors Constructor Description DefaultEventConfDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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()
Event
findByEvent(Event matchingEvent)
findByEventEvent
findByUei(String uei)
findByUeiList<Event>
getAllEvents()
String
getEventLabel(String uei)
getEventLabelMap<String,String>
getEventLabels()
getEventLabelsList<Event>
getEvents(String uei)
getEventsList<Event>
getEventsByLabel()
getEventsByLabelList<String>
getEventUEIs()
getEventUEIsString
getProgrammaticStoreRelativeUrl()
Events
getRootEvents()
getRootEventsboolean
isSecureTag(String tag)
isSecureTagvoid
reload()
reloadboolean
removeEventFromProgrammaticStore(Event event)
Removes the given event from the programmatic event store.void
saveCurrent()
saveCurrentvoid
setConfigResource(org.springframework.core.io.Resource configResource)
void
setProgrammaticStoreRelativeUrl(String programmaticStoreRelativeUrl)
-
-
-
Method Detail
-
getProgrammaticStoreRelativeUrl
public String getProgrammaticStoreRelativeUrl()
-
setProgrammaticStoreRelativeUrl
public void setProgrammaticStoreRelativeUrl(String programmaticStoreRelativeUrl)
-
reload
public void reload() throws org.springframework.dao.DataAccessException
Description copied from interface:EventConfDao
reload
- Specified by:
reload
in interfaceEventConfDao
- Throws:
org.springframework.dao.DataAccessException
- if any.
-
getEvents
public List<Event> getEvents(String uei)
Description copied from interface:EventConfDao
getEvents
- Specified by:
getEvents
in interfaceEventConfDao
- Parameters:
uei
- aString
object.- Returns:
- a
List
object.
-
getEventUEIs
public List<String> getEventUEIs()
Description copied from interface:EventConfDao
getEventUEIs
- Specified by:
getEventUEIs
in interfaceEventConfDao
- Returns:
- a
List
object.
-
getEventLabels
public Map<String,String> getEventLabels()
Description copied from interface:EventConfDao
getEventLabels
- Specified by:
getEventLabels
in interfaceEventConfDao
- Returns:
- a
Map
object.
-
getEventLabel
public String getEventLabel(String uei)
Description copied from interface:EventConfDao
getEventLabel
- Specified by:
getEventLabel
in interfaceEventConfDao
- Parameters:
uei
- aString
object.- Returns:
- a
String
object.
-
saveCurrent
public void saveCurrent()
Description copied from interface:EventConfDao
saveCurrent
- Specified by:
saveCurrent
in interfaceEventConfDao
-
getEventsByLabel
public List<Event> getEventsByLabel()
Description copied from interface:EventConfDao
getEventsByLabel
- Specified by:
getEventsByLabel
in interfaceEventConfDao
- Returns:
- a
List
object.
-
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 interfaceEventConfDao
- 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 interfaceEventConfDao
- 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 interfaceEventConfDao
- Parameters:
event
- The fully configured Event object to remove.- Returns:
- a boolean.
-
isSecureTag
public boolean isSecureTag(String tag)
Description copied from interface:EventConfDao
isSecureTag
- Specified by:
isSecureTag
in interfaceEventConfDao
- Parameters:
tag
- aString
object.- Returns:
- a boolean.
-
findByUei
public Event findByUei(String uei)
Description copied from interface:EventConfDao
findByUei
- Specified by:
findByUei
in interfaceEventConfDao
- Parameters:
uei
- aString
object.- Returns:
- a
Event
object.
-
findByEvent
public Event findByEvent(Event matchingEvent)
Description copied from interface:EventConfDao
findByEvent
- Specified by:
findByEvent
in interfaceEventConfDao
- Parameters:
matchingEvent
- aEvent
object.- Returns:
- a
Event
object.
-
getRootEvents
public Events getRootEvents()
Description copied from interface:EventConfDao
getRootEvents
- Specified by:
getRootEvents
in interfaceEventConfDao
- Returns:
- a
Events
object.
-
setConfigResource
public void setConfigResource(org.springframework.core.io.Resource configResource) throws IOException
- Throws:
IOException
-
afterPropertiesSet
public void afterPropertiesSet() throws org.springframework.dao.DataAccessException
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
- Throws:
org.springframework.dao.DataAccessException
-
-