org.graylog2.bootstrap.commands.journal.AbstractJournalCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of graylog2 Show documentation
Show all versions of graylog2 Show documentation
Graylog Single Binary Bootstrapper
The newest version!
/**
* This file is part of Graylog.
*
* Graylog is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Graylog is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Graylog. If not, see .
*/
package org.graylog2.bootstrap.commands.journal;
import com.google.inject.Module;
import org.graylog2.Configuration;
import org.graylog2.bootstrap.CmdLineTool;
import org.graylog2.plugin.KafkaJournalConfiguration;
import org.graylog2.shared.bindings.SchedulerBindings;
import org.graylog2.shared.journal.KafkaJournal;
import org.graylog2.shared.journal.KafkaJournalModule;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Arrays;
import java.util.List;
public abstract class AbstractJournalCommand extends CmdLineTool {
protected static final Logger log = LoggerFactory.getLogger(AbstractJournalCommand.class);
protected static final Configuration configuration = new Configuration();
protected final KafkaJournalConfiguration kafkaJournalConfiguration = new KafkaJournalConfiguration();
protected KafkaJournal journal;
public AbstractJournalCommand() {
this(null);
}
public AbstractJournalCommand(String commandName) {
super(commandName, configuration);
}
@Override
protected boolean validateConfiguration() {
if (kafkaJournalConfiguration.getMessageJournalDir() == null) {
log.error("No message journal path set. Please define message_journal_dir in your graylog2.conf.");
return false;
}
return true;
}
@Override
protected List getCommandBindings() {
return Arrays.asList(new SchedulerBindings(),
new KafkaJournalModule());
}
@Override
protected List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy