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.
|
List<IndexSetConfig> |
findMany(org.mongojack.DBQuery.Query query) |
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 IndexSetService
IndexSetService.get(ObjectId)
public Optional<IndexSetConfig> get(org.bson.types.ObjectId id)
get
in interface IndexSetService
id
- The ID of the index set.Optional
with the retrieved index set, an empty Optional
otherwise.public IndexSetConfig getDefault()
IndexSetService
IllegalStateException
if the default index set does not exist.getDefault
in interface IndexSetService
Optional
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 IndexSetService
public List<IndexSetConfig> findAll()
findAll
in interface IndexSetService
public List<IndexSetConfig> findByIds(Set<String> ids)
IndexSetService
findByIds
in interface IndexSetService
public List<IndexSetConfig> findMany(org.mongojack.DBQuery.Query query)
findMany
in interface IndexSetService
public List<IndexSetConfig> findPaginated(Set<String> indexSetIds, int limit, int skip)
findPaginated
in interface IndexSetService
indexSetIds
- 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 IndexSetService
indexSetConfig
- 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 IndexSetService
IndexSetService.delete(ObjectId)
public int delete(org.bson.types.ObjectId id)
delete
in interface IndexSetService
id
- The ID of the index set.Copyright © 2012–2021 Graylog, Inc.. All rights reserved.