@Singleton public class MongoInputStatusService extends Object implements InputStatusService
| Modifier and Type | Field and Description |
|---|---|
static String |
COLLECTION_NAME |
| Constructor and Description |
|---|
MongoInputStatusService(MongoConnection mongoConnection,
MongoJackObjectMapperProvider objectMapperProvider,
InputService inputService,
com.google.common.eventbus.EventBus eventBus) |
| Modifier and Type | Method and Description |
|---|---|
int |
delete(String inputId)
Remove the status record for a given Input
|
Optional<InputStatusRecord> |
get(String inputId)
Get the saved status record for an Input.
|
void |
handleInputDeleted(InputDeleted event)
Clean up MongoDB records when Inputs are deleted
At the moment, Graylog uses the InputDeleted event both when an Input is stopped
and when it is deleted.
|
InputStatusRecord |
save(InputStatusRecord statusRecord)
Save the status record for an Input.
|
public static final String COLLECTION_NAME
@Inject public MongoInputStatusService(MongoConnection mongoConnection, MongoJackObjectMapperProvider objectMapperProvider, InputService inputService, com.google.common.eventbus.EventBus eventBus)
public Optional<InputStatusRecord> get(String inputId)
InputStatusServiceget in interface InputStatusServiceinputId - ID of the input whose status you want to getpublic InputStatusRecord save(InputStatusRecord statusRecord)
InputStatusServicesave in interface InputStatusServicestatusRecord - The Input status record to savepublic int delete(String inputId)
InputStatusServicedelete in interface InputStatusServiceinputId - ID of the input whose status you want to deletepublic void handleInputDeleted(InputDeleted event)
event - ID of the input being deletedCopyright © 2012–2021 Graylog, Inc.. All rights reserved.