public class MongoIndexSetService extends Object implements IndexSetService
| Modifier | Constructor and Description |
|---|---|
protected |
MongoIndexSetService(org.mongojack.JacksonDBCollection<IndexSetConfig,org.bson.types.ObjectId> collection,
StreamService streamService,
ClusterConfigService clusterConfigService,
ClusterEventBus clusterEventBus) |
|
MongoIndexSetService(MongoConnection mongoConnection,
MongoJackObjectMapperProvider objectMapperProvider,
StreamService streamService,
ClusterConfigService clusterConfigService,
ClusterEventBus clusterEventBus) |
| Modifier and Type | Method and Description |
|---|---|
int |
delete(org.bson.types.ObjectId id)
Delete the index set with the given ID.
|
int |
delete(String id) |
List<IndexSetConfig> |
findAll()
Retrieve all index sets.
|
List<IndexSetConfig> |
findByIds(Set<String> ids)
Retrieve all index sets which match one of the specified IDs.
|
Optional<IndexSetConfig> |
findOne(org.mongojack.DBQuery.Query query)
Retrieve an index set based on the given
DBQuery.Query. |
List<IndexSetConfig> |
findPaginated(Set<String> indexSetIds,
int limit,
int skip)
Retrieve a paginated set of index set.
|
Optional<IndexSetConfig> |
get(org.bson.types.ObjectId id)
Retrieve index set with the given ID.
|
Optional<IndexSetConfig> |
get(String id) |
IndexSetConfig |
getDefault()
Retrieve the default index set.
|
IndexSetConfig |
save(IndexSetConfig indexSetConfig)
Save the given index set.
|
@Inject public MongoIndexSetService(MongoConnection mongoConnection, MongoJackObjectMapperProvider objectMapperProvider, StreamService streamService, ClusterConfigService clusterConfigService, ClusterEventBus clusterEventBus)
protected MongoIndexSetService(org.mongojack.JacksonDBCollection<IndexSetConfig,org.bson.types.ObjectId> collection, StreamService streamService, ClusterConfigService clusterConfigService, ClusterEventBus clusterEventBus)
public Optional<IndexSetConfig> get(String id)
get in interface IndexSetServiceIndexSetService.get(ObjectId)public Optional<IndexSetConfig> get(org.bson.types.ObjectId id)
get in interface IndexSetServiceid - The ID of the index set.Optional with the retrieved index set, an empty Optional otherwise.public IndexSetConfig getDefault()
IndexSetServiceIllegalStateException if the default index set does not exist.getDefault in interface IndexSetServiceOptional with the default index set, an empty Optional if there is no default.public Optional<IndexSetConfig> findOne(org.mongojack.DBQuery.Query query)
DBQuery.Query.findOne in interface IndexSetServicepublic List<IndexSetConfig> findAll()
findAll in interface IndexSetServicepublic List<IndexSetConfig> findByIds(Set<String> ids)
IndexSetServicefindByIds in interface IndexSetServicepublic List<IndexSetConfig> findPaginated(Set<String> indexSetIds, int limit, int skip)
findPaginated in interface IndexSetServiceindexSetIds - List of inde set ids to returnlimit - Maximum number of index setsskip - Number of index sets to skippublic IndexSetConfig save(IndexSetConfig indexSetConfig)
save in interface IndexSetServiceindexSetConfig - The index set to save.IndexSetConfig instance of the saved index set (with non-null id field).public int delete(String id)
delete in interface IndexSetServiceIndexSetService.delete(ObjectId)public int delete(org.bson.types.ObjectId id)
delete in interface IndexSetServiceid - The ID of the index set.Copyright © 2012–2021 Graylog, Inc.. All rights reserved.