Package org.graylog2.indexer.indexset
Class MongoIndexSetService
java.lang.Object
org.graylog2.indexer.indexset.MongoIndexSetService
- All Implemented Interfaces:
IndexSetService
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionMongoIndexSetService(MongoConnection mongoConnection, MongoJackObjectMapperProvider objectMapperProvider, StreamService streamService, ClusterConfigService clusterConfigService, ClusterEventBus clusterEventBus) protectedMongoIndexSetService(org.mongojack.JacksonDBCollection<IndexSetConfig, org.bson.types.ObjectId> collection, StreamService streamService, ClusterConfigService clusterConfigService, ClusterEventBus clusterEventBus) -
Method Summary
Modifier and TypeMethodDescriptionintintdelete(org.bson.types.ObjectId id) Delete the index set with the given ID.findAll()Retrieve all index sets.Retrieve all index sets which match one of the specified IDs.findMany(org.mongojack.DBQuery.Query query) findOne(org.mongojack.DBQuery.Query query) Retrieve an index set based on the givenDBQuery.Query.findPaginated(Set<String> indexSetIds, int limit, int skip) Retrieve a paginated set of index set.get(org.bson.types.ObjectId id) Retrieve index set with the given ID.Retrieve the default index set.save(IndexSetConfig indexSetConfig) Save the given index set.
-
Field Details
-
COLLECTION_NAME
- See Also:
-
-
Constructor Details
-
MongoIndexSetService
@Inject public MongoIndexSetService(MongoConnection mongoConnection, MongoJackObjectMapperProvider objectMapperProvider, StreamService streamService, ClusterConfigService clusterConfigService, ClusterEventBus clusterEventBus) -
MongoIndexSetService
protected MongoIndexSetService(org.mongojack.JacksonDBCollection<IndexSetConfig, org.bson.types.ObjectId> collection, StreamService streamService, ClusterConfigService clusterConfigService, ClusterEventBus clusterEventBus)
-
-
Method Details
-
get
- Specified by:
getin interfaceIndexSetService- See Also:
-
get
Retrieve index set with the given ID.- Specified by:
getin interfaceIndexSetService- Parameters:
id- The ID of the index set.- Returns:
- A filled
Optionalwith the retrieved index set, an emptyOptionalotherwise.
-
getDefault
Description copied from interface:IndexSetServiceRetrieve the default index set. Throws anIllegalStateExceptionif the default index set does not exist.- Specified by:
getDefaultin interfaceIndexSetService- Returns:
- A filled
Optionalwith the default index set, an emptyOptionalif there is no default.
-
findOne
Retrieve an index set based on the givenDBQuery.Query.- Specified by:
findOnein interfaceIndexSetService- Returns:
- index set
-
findAll
Retrieve all index sets.- Specified by:
findAllin interfaceIndexSetService- Returns:
- All index sets.
-
findByIds
Description copied from interface:IndexSetServiceRetrieve all index sets which match one of the specified IDs.- Specified by:
findByIdsin interfaceIndexSetService- Returns:
- All index sets matching one of the given IDs.
-
findMany
- Specified by:
findManyin interfaceIndexSetService
-
findPaginated
Retrieve a paginated set of index set.- Specified by:
findPaginatedin interfaceIndexSetService- Parameters:
indexSetIds- List of inde set ids to returnlimit- Maximum number of index setsskip- Number of index sets to skip- Returns:
- Paginated index sets
-
save
Save the given index set.- Specified by:
savein interfaceIndexSetService- Parameters:
indexSetConfig- The index set to save.- Returns:
- The
IndexSetConfiginstance of the saved index set (with non-nullidfield).
-
delete
- Specified by:
deletein interfaceIndexSetService- See Also:
-
delete
public int delete(org.bson.types.ObjectId id) Delete the index set with the given ID.- Specified by:
deletein interfaceIndexSetService- Parameters:
id- The ID of the index set.- Returns:
- The number of deleted index sets.
-