Class ViewService
java.lang.Object
org.graylog2.database.PaginatedDbService<ViewDTO>
org.graylog.plugins.views.search.views.ViewService
-
Field Summary
Fields inherited from class org.graylog2.database.PaginatedDbService
db -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedViewService(MongoConnection mongoConnection, MongoJackObjectMapperProvider mongoJackObjectMapperProvider, com.fasterxml.jackson.databind.ObjectMapper mapper, ClusterConfigService clusterConfigService, ViewRequirements.Factory viewRequirementsFactory, EntityOwnershipService entityOwnerShipService, ViewSummaryService viewSummaryService) -
Method Summary
Modifier and TypeMethodDescriptioncom.mongodb.client.MongoCollection<org.bson.Document>intDeletes thePaginatedDbServicefor the given ID from the database.protected PaginatedList<ViewDTO>findPaginatedWithQueryFilterAndSortWithGrandTotal(SearchUser searchUser, SearchQuery dbQuery, Predicate<ViewDTO> filter, org.mongojack.DBSort.SortBuilder sort, org.mongojack.DBQuery.Query grandTotalQuery, int page, int perPage) Get thePaginatedDbServicefor the given ID.get(SearchUser searchUser, String id) com.fasterxml.jackson.databind.ObjectMappermapper()requirementsForView(ViewDTO view) Stores the givenPaginatedDbServicein the database.voidsaveDefault(ViewDTO dto) saveWithOwner(ViewDTO viewDTO, User user) searchPaginated(SearchUser searchUser, SearchQuery query, Predicate<ViewDTO> filter, String order, String sortField, int page, int perPage) searchPaginatedByType(ViewDTO.Type type, SearchQuery query, Predicate<ViewDTO> filter, String order, String sortField, int page, int perPage) searchSummariesPaginatedByType(SearchUser searchUser, ViewDTO.Type type, org.bson.conversions.Bson dbQuery, Predicate<ViewSummaryDTO> predicate, String order, String sortField, int page, int perPage) Returns an unordered stream of all entries in the database.streamByIds(Set<String> idSet) Returns an unordered stream of all entries in the database for the given IDs.type()Methods inherited from class org.graylog2.database.PaginatedDbService
asImmutableList, findPaginatedWithQueryAndSort, findPaginatedWithQueryFilterAndSort, findPaginatedWithQueryFilterAndSortWithGrandTotal, getMultiFieldSortBuilder, getPage, getSortBuilder, streamQuery, streamQueryWithSortMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.graylog.plugins.views.search.views.ViewUtils
deserialize, findViews
-
Constructor Details
-
ViewService
@Inject protected ViewService(MongoConnection mongoConnection, MongoJackObjectMapperProvider mongoJackObjectMapperProvider, com.fasterxml.jackson.databind.ObjectMapper mapper, ClusterConfigService clusterConfigService, ViewRequirements.Factory viewRequirementsFactory, EntityOwnershipService entityOwnerShipService, ViewSummaryService viewSummaryService)
-
-
Method Details
-
get
-
findPaginatedWithQueryFilterAndSortWithGrandTotal
protected PaginatedList<ViewDTO> findPaginatedWithQueryFilterAndSortWithGrandTotal(SearchUser searchUser, SearchQuery dbQuery, Predicate<ViewDTO> filter, org.mongojack.DBSort.SortBuilder sort, org.mongojack.DBQuery.Query grandTotalQuery, int page, int perPage) -
searchPaginated
public PaginatedList<ViewDTO> searchPaginated(SearchUser searchUser, SearchQuery query, Predicate<ViewDTO> filter, String order, String sortField, int page, int perPage) -
searchPaginatedByType
public PaginatedList<ViewDTO> searchPaginatedByType(ViewDTO.Type type, SearchQuery query, Predicate<ViewDTO> filter, String order, String sortField, int page, int perPage) -
searchSummariesPaginatedByType
public PaginatedList<ViewSummaryDTO> searchSummariesPaginatedByType(SearchUser searchUser, ViewDTO.Type type, org.bson.conversions.Bson dbQuery, Predicate<ViewSummaryDTO> predicate, String order, String sortField, int page, int perPage) -
saveDefault
-
getDefault
-
forSearch
-
get
Description copied from class:PaginatedDbServiceGet thePaginatedDbServicefor the given ID.- Overrides:
getin classPaginatedDbService<ViewDTO>- Parameters:
id- the ID of the object- Returns:
- an Optional containing the found object or an empty Optional if no object can be found for the given ID
-
streamAll
Description copied from class:PaginatedDbServiceReturns an unordered stream of all entries in the database.The returned stream needs to be closed to free the underlying database resources.
- Overrides:
streamAllin classPaginatedDbService<ViewDTO>- Returns:
- stream of all database entries
-
streamByIds
Description copied from class:PaginatedDbServiceReturns an unordered stream of all entries in the database for the given IDs.The returned stream needs to be closed to free the underlying database resources.
- Overrides:
streamByIdsin classPaginatedDbService<ViewDTO>- Parameters:
idSet- set of IDs to query- Returns:
- stream of database entries for the given IDs
-
saveWithOwner
-
save
Description copied from class:PaginatedDbServiceStores the givenPaginatedDbServicein the database.- Overrides:
savein classPaginatedDbService<ViewDTO>- Parameters:
viewDTO- thePaginatedDbServiceto save- Returns:
- the newly saved
PaginatedDbService
-
delete
Description copied from class:PaginatedDbServiceDeletes thePaginatedDbServicefor the given ID from the database.- Overrides:
deletein classPaginatedDbService<ViewDTO>- Parameters:
id- ID of thePaginatedDbServiceto delete- Returns:
- the number of deleted documents
-
update
-
requirementsForView
-
mapper
public com.fasterxml.jackson.databind.ObjectMapper mapper() -
collection
public com.mongodb.client.MongoCollection<org.bson.Document> collection()- Specified by:
collectionin interfaceViewUtils<ViewDTO>
-
type
-