Package org.opennms.netmgt.dao.mock
Class MockEventConfDao
- java.lang.Object
-
- org.opennms.netmgt.dao.mock.MockEventConfDao
-
- All Implemented Interfaces:
EventConfDao
,org.springframework.beans.factory.InitializingBean
public class MockEventConfDao extends Object implements EventConfDao, org.springframework.beans.factory.InitializingBean
-
-
Constructor Summary
Constructors Constructor Description MockEventConfDao()
-
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)
findByUeiString
getEventLabel(String uei)
getEventLabelMap<String,String>
getEventLabels()
getEventLabelsList<Event>
getEvents(String uei)
getEventsList<Event>
getEventsByLabel()
getEventsByLabelList<String>
getEventUEIs()
getEventUEIsorg.springframework.core.io.Resource
getResource()
Events
getRootEvents()
getRootEventsboolean
isSecureTag(String tag)
isSecureTagvoid
reload()
reloadboolean
removeEventFromProgrammaticStore(Event event)
Removes the given event from the programmatic event store.void
saveCurrent()
saveCurrentvoid
setResource(org.springframework.core.io.Resource resource)
-
-
-
Method Detail
-
setResource
public void setResource(org.springframework.core.io.Resource resource)
-
getResource
public org.springframework.core.io.Resource getResource()
-
afterPropertiesSet
public void afterPropertiesSet()
- Specified by:
afterPropertiesSet
in interfaceorg.springframework.beans.factory.InitializingBean
-
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.
-
-