public class ViewService extends PaginatedDbService<ViewDTO>
db
Modifier | Constructor and Description |
---|---|
protected |
ViewService(MongoConnection mongoConnection,
MongoJackObjectMapperProvider mapper,
ClusterConfigService clusterConfigService,
ViewRequirements.Factory viewRequirementsFactory,
EntityOwnershipService entityOwnerShipService,
ViewSummaryService viewSummaryService) |
Modifier and Type | Method and Description |
---|---|
int |
delete(String id)
Deletes the
DTO for the given ID from the database. |
Collection<ViewDTO> |
forSearch(String searchId) |
Optional<ViewDTO> |
get(String id)
Get the
DTO for the given ID. |
Optional<ViewDTO> |
getDefault() |
ViewDTO |
save(ViewDTO viewDTO)
Stores the given
DTO in the database. |
void |
saveDefault(ViewDTO dto) |
ViewDTO |
saveWithOwner(ViewDTO viewDTO,
User user) |
PaginatedList<ViewDTO> |
searchPaginated(SearchQuery query,
Predicate<ViewDTO> filter,
String order,
String sortField,
int page,
int perPage) |
PaginatedList<ViewDTO> |
searchPaginatedByType(ViewDTO.Type type,
SearchQuery query,
Predicate<ViewDTO> filter,
String order,
String sortField,
int page,
int perPage) |
PaginatedList<ViewSummaryDTO> |
searchSummariesPaginatedByType(ViewDTO.Type type,
SearchQuery query,
Predicate<ViewSummaryDTO> filter,
String order,
String sortField,
int page,
int perPage) |
Stream<ViewDTO> |
streamAll()
Returns an unordered stream of all entries in the database.
|
Stream<ViewDTO> |
streamByIds(Set<String> idSet)
Returns an unordered stream of all entries in the database for the given IDs.
|
ViewDTO |
update(ViewDTO viewDTO) |
asImmutableList, findPaginatedWithQueryAndSort, findPaginatedWithQueryFilterAndSort, findPaginatedWithQueryFilterAndSortWithGrandTotal, getSortBuilder, streamQuery, streamQueryWithSort
@Inject protected ViewService(MongoConnection mongoConnection, MongoJackObjectMapperProvider mapper, ClusterConfigService clusterConfigService, ViewRequirements.Factory viewRequirementsFactory, EntityOwnershipService entityOwnerShipService, ViewSummaryService viewSummaryService)
public PaginatedList<ViewDTO> searchPaginated(SearchQuery query, Predicate<ViewDTO> filter, String order, String sortField, int page, int perPage)
public PaginatedList<ViewDTO> searchPaginatedByType(ViewDTO.Type type, SearchQuery query, Predicate<ViewDTO> filter, String order, String sortField, int page, int perPage)
public PaginatedList<ViewSummaryDTO> searchSummariesPaginatedByType(ViewDTO.Type type, SearchQuery query, Predicate<ViewSummaryDTO> filter, String order, String sortField, int page, int perPage)
public void saveDefault(ViewDTO dto)
public Collection<ViewDTO> forSearch(String searchId)
public Optional<ViewDTO> get(String id)
PaginatedDbService
DTO
for the given ID.get
in class PaginatedDbService<ViewDTO>
id
- the ID of the objectpublic Stream<ViewDTO> streamAll()
PaginatedDbService
The returned stream needs to be closed to free the underlying database resources.
streamAll
in class PaginatedDbService<ViewDTO>
public Stream<ViewDTO> streamByIds(Set<String> idSet)
PaginatedDbService
The returned stream needs to be closed to free the underlying database resources.
streamByIds
in class PaginatedDbService<ViewDTO>
idSet
- set of IDs to querypublic ViewDTO save(ViewDTO viewDTO)
PaginatedDbService
DTO
in the database.save
in class PaginatedDbService<ViewDTO>
viewDTO
- the DTO
to saveDTO
public int delete(String id)
PaginatedDbService
DTO
for the given ID from the database.delete
in class PaginatedDbService<ViewDTO>
id
- ID of the DTO
to deleteCopyright © 2012–2021 Graylog, Inc.. All rights reserved.