Class SearchDbService
java.lang.Object
org.graylog.plugins.views.search.db.SearchDbService
This class is a helper to implement a basic Mongojack-based database service that allows CRUD operations on a single DTO type.
Subclasses can add more sophisticated search methods by access the protected "db" property.
Indices can be added in the constructor.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final org.mongojack.JacksonDBCollection<Search,
org.bson.types.ObjectId> protected final org.mongojack.JacksonDBCollection<SearchSummary,
org.bson.types.ObjectId> -
Constructor Summary
ModifierConstructorDescriptionprotected
SearchDbService
(MongoConnection mongoConnection, MongoJackObjectMapperProvider mapper, SearchRequirements.Factory searchRequirementsFactory, SearchFiltersReFetcher searchFiltersRefetcher) -
Method Summary
Modifier and TypeMethodDescriptionfindPaginated
(org.mongojack.DBQuery.Query search, org.mongojack.DBSort.SortBuilder sort, int page, int perPage) getExpiredSearches
(Set<String> neverDeleteIds, org.joda.time.Instant mustNotBeOlderThan)
-
Field Details
-
db
-
summarydb
-
-
Constructor Details
-
SearchDbService
@Inject protected SearchDbService(MongoConnection mongoConnection, MongoJackObjectMapperProvider mapper, SearchRequirements.Factory searchRequirementsFactory, SearchFiltersReFetcher searchFiltersRefetcher)
-
-
Method Details
-
get
-
save
-
findPaginated
public PaginatedList<Search> findPaginated(org.mongojack.DBQuery.Query search, org.mongojack.DBSort.SortBuilder sort, int page, int perPage) -
findByIds
-
streamAll
-
getExpiredSearches
-