Search in sources :

Example 1 with NullAuditEventSender

use of org.graylog2.audit.NullAuditEventSender in project graylog2-server by Graylog2.

the class IndicesGetAllMessageFieldsTest method setUp.

@Before
public void setUp() throws Exception {
    elasticsearchRule.getDatabaseOperation().deleteAll();
    indices = new Indices(client, new IndexMapping(), new Messages(client, new MetricRegistry()), mock(NodeId.class), new NullAuditEventSender());
}
Also used : NullAuditEventSender(org.graylog2.audit.NullAuditEventSender) IndexMapping(org.graylog2.indexer.IndexMapping) Messages(org.graylog2.indexer.messages.Messages) MetricRegistry(com.codahale.metrics.MetricRegistry) Before(org.junit.Before)

Example 2 with NullAuditEventSender

use of org.graylog2.audit.NullAuditEventSender in project graylog2-server by Graylog2.

the class IndexCreatingDatabaseOperation method insert.

@Override
public void insert(InputStream dataScript) {
    waitForGreenStatus();
    final IndicesAdminClient indicesAdminClient = client.admin().indices();
    for (String index : indexes) {
        final IndicesExistsResponse indicesExistsResponse = indicesAdminClient.prepareExists(index).execute().actionGet();
        if (indicesExistsResponse.isExists()) {
            client.admin().indices().prepareDelete(index).execute().actionGet();
        }
        final Messages messages = new Messages(client, new MetricRegistry());
        final Indices indices = new Indices(client, new IndexMapping(), messages, mock(NodeId.class), new NullAuditEventSender());
        if (!indices.create(index, indexSet)) {
            throw new IllegalStateException("Couldn't create index " + index);
        }
    }
    databaseOperation.insert(dataScript);
}
Also used : NullAuditEventSender(org.graylog2.audit.NullAuditEventSender) IndexMapping(org.graylog2.indexer.IndexMapping) Messages(org.graylog2.indexer.messages.Messages) MetricRegistry(com.codahale.metrics.MetricRegistry) IndicesExistsResponse(org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsResponse) NodeId(org.graylog2.plugin.system.NodeId) Indices(org.graylog2.indexer.indices.Indices) IndicesAdminClient(org.elasticsearch.client.IndicesAdminClient)

Example 3 with NullAuditEventSender

use of org.graylog2.audit.NullAuditEventSender in project graylog2-server by Graylog2.

the class KafkaJournalTest method setUp.

@Before
public void setUp() throws IOException {
    scheduler = new ScheduledThreadPoolExecutor(1);
    scheduler.prestartCoreThread();
    journalDirectory = temporaryFolder.newFolder();
    final File nodeId = temporaryFolder.newFile("node-id");
    Files.write(UUID.randomUUID().toString(), nodeId, StandardCharsets.UTF_8);
    final Configuration configuration = new Configuration() {

        @Override
        public String getNodeIdFile() {
            return nodeId.getAbsolutePath();
        }
    };
    serverStatus = new ServerStatus(configuration, EnumSet.of(ServerStatus.Capability.MASTER), new EventBus("KafkaJournalTest"), NullAuditEventSender::new);
}
Also used : Configuration(org.graylog2.Configuration) ScheduledThreadPoolExecutor(java.util.concurrent.ScheduledThreadPoolExecutor) ServerStatus(org.graylog2.plugin.ServerStatus) EventBus(com.google.common.eventbus.EventBus) File(java.io.File) Before(org.junit.Before)

Example 4 with NullAuditEventSender

use of org.graylog2.audit.NullAuditEventSender in project graylog2-server by Graylog2.

the class IndicesGetAllMessageFieldsIT method setUp.

@Before
public void setUp() throws Exception {
    final Node node = new Node(mock(NodeAdapter.class));
    // noinspection UnstableApiUsage
    indices = new Indices(new IndexMappingFactory(node, ImmutableMap.of(MESSAGE_TEMPLATE_TYPE, new MessageIndexTemplateProvider())), mock(NodeId.class), new NullAuditEventSender(), new EventBus(), indicesAdapter());
}
Also used : NodeAdapter(org.graylog2.indexer.cluster.NodeAdapter) NullAuditEventSender(org.graylog2.audit.NullAuditEventSender) IndexMappingFactory(org.graylog2.indexer.IndexMappingFactory) Node(org.graylog2.indexer.cluster.Node) MessageIndexTemplateProvider(org.graylog2.indexer.MessageIndexTemplateProvider) EventBus(com.google.common.eventbus.EventBus) Before(org.junit.Before)

Example 5 with NullAuditEventSender

use of org.graylog2.audit.NullAuditEventSender in project graylog2-server by Graylog2.

the class MongoIndexRangeServiceTest method setUp.

@Before
public void setUp() throws Exception {
    localEventBus = new EventBus("local-event-bus");
    indexRangeService = new MongoIndexRangeService(mongodb.mongoConnection(), objectMapperProvider, indices, indexSetRegistry, new NullAuditEventSender(), mock(NodeId.class), localEventBus);
}
Also used : NullAuditEventSender(org.graylog2.audit.NullAuditEventSender) EventBus(com.google.common.eventbus.EventBus) Before(org.junit.Before)

Aggregations

EventBus (com.google.common.eventbus.EventBus)6 NullAuditEventSender (org.graylog2.audit.NullAuditEventSender)6 Before (org.junit.Before)6 MetricRegistry (com.codahale.metrics.MetricRegistry)3 IndexMappingFactory (org.graylog2.indexer.IndexMappingFactory)3 MessageIndexTemplateProvider (org.graylog2.indexer.MessageIndexTemplateProvider)3 Node (org.graylog2.indexer.cluster.Node)3 File (java.io.File)2 ScheduledThreadPoolExecutor (java.util.concurrent.ScheduledThreadPoolExecutor)2 Configuration (org.graylog2.Configuration)2 IndexMapping (org.graylog2.indexer.IndexMapping)2 Indices (org.graylog2.indexer.indices.Indices)2 Messages (org.graylog2.indexer.messages.Messages)2 ServerStatus (org.graylog2.plugin.ServerStatus)2 NodeId (org.graylog2.plugin.system.NodeId)2 IndicesExistsResponse (org.elasticsearch.action.admin.indices.exists.indices.IndicesExistsResponse)1 IndicesAdminClient (org.elasticsearch.client.IndicesAdminClient)1 TestIndexSet (org.graylog2.indexer.TestIndexSet)1 NodeAdapter (org.graylog2.indexer.cluster.NodeAdapter)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1