Class ElasticFeedbackRepository
- java.lang.Object
-
- org.opennms.features.situationfeedback.elastic.ElasticFeedbackRepository
-
- All Implemented Interfaces:
FeedbackRepository
public class ElasticFeedbackRepository extends Object implements FeedbackRepository
-
-
Constructor Summary
Constructors Constructor Description ElasticFeedbackRepository(io.searchbox.client.JestClient jestClient, IndexStrategy indexStrategy, int bulkRetryCount, ElasticFeedbackRepositoryInitializer initializer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<AlarmFeedback>
getAllFeedback()
Collection<AlarmFeedback>
getFeedback(String situationKey)
List<String>
getTags(String prefix)
void
onBind(AlarmFeedbackListener alarmFeedbackListener, Map properties)
Add listeners toalarmFeedbackListeners
during runtime as they become available.void
onUnbind(AlarmFeedbackListener alarmFeedbackListener, Map properties)
Remove listeners fromalarmFeedbackListeners
during runtime as they become unavailable.void
persist(List<AlarmFeedback> feedback)
-
-
-
Constructor Detail
-
ElasticFeedbackRepository
public ElasticFeedbackRepository(io.searchbox.client.JestClient jestClient, IndexStrategy indexStrategy, int bulkRetryCount, ElasticFeedbackRepositoryInitializer initializer)
-
-
Method Detail
-
persist
public void persist(List<AlarmFeedback> feedback) throws FeedbackException
Description copied from interface:FeedbackRepository
- Specified by:
persist
in interfaceFeedbackRepository
- Parameters:
feedback
- the feedback to persist- Throws:
FeedbackException
- if the feedback could not be persisted
-
getFeedback
public Collection<AlarmFeedback> getFeedback(String situationKey) throws FeedbackException
- Specified by:
getFeedback
in interfaceFeedbackRepository
- Parameters:
situationKey
- the reduction key of the situation to get feedback for- Returns:
- all of the feedback applicable to the given situation
- Throws:
FeedbackException
-
getAllFeedback
public List<AlarmFeedback> getAllFeedback() throws FeedbackException
- Specified by:
getAllFeedback
in interfaceFeedbackRepository
- Returns:
- all of the feedback present in the repository
- Throws:
FeedbackException
-
getTags
public List<String> getTags(String prefix) throws FeedbackException
- Specified by:
getTags
in interfaceFeedbackRepository
- Returns:
- a list of unique SituationFeedback Tags filtered to include only those beginning with @prefix
- Throws:
FeedbackException
-
onBind
public void onBind(AlarmFeedbackListener alarmFeedbackListener, Map properties)
Add listeners toalarmFeedbackListeners
during runtime as they become available.
-
onUnbind
public void onUnbind(AlarmFeedbackListener alarmFeedbackListener, Map properties)
Remove listeners fromalarmFeedbackListeners
during runtime as they become unavailable.
-
-