org.graylog.aws.inputs.cloudtrail.CloudTrailInput Maven / Gradle / Ivy
/*
* Copyright (C) 2020 Graylog, Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the Server Side Public License, version 1,
* as published by MongoDB, Inc.
*
* This program 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
* Server Side Public License for more details.
*
* You should have received a copy of the Server Side Public License
* along with this program. If not, see
* .
*/
package org.graylog.aws.inputs.cloudtrail;
import com.codahale.metrics.MetricRegistry;
import com.google.inject.assistedinject.Assisted;
import org.graylog2.plugin.LocalMetricRegistry;
import org.graylog2.plugin.ServerStatus;
import org.graylog2.plugin.configuration.Configuration;
import org.graylog2.plugin.inputs.MessageInput;
import org.graylog2.plugin.inputs.annotations.ConfigClass;
import org.graylog2.plugin.inputs.annotations.FactoryClass;
import javax.inject.Inject;
public class CloudTrailInput extends MessageInput {
private static final String NAME = "AWS CloudTrail";
@Inject
public CloudTrailInput(@Assisted Configuration configuration,
MetricRegistry metricRegistry,
CloudTrailTransport.Factory transport,
LocalMetricRegistry localRegistry,
CloudTrailCodec.Factory codec,
Config config,
Descriptor descriptor,
ServerStatus serverStatus) {
super(
metricRegistry,
configuration,
transport.create(configuration),
localRegistry,
codec.create(configuration),
config,
descriptor,
serverStatus);
}
@FactoryClass
public interface Factory extends MessageInput.Factory {
@Override
CloudTrailInput create(Configuration configuration);
@Override
Config getConfig();
@Override
Descriptor getDescriptor();
}
public static class Descriptor extends MessageInput.Descriptor {
public Descriptor() {
super(NAME, false, "");
}
@Override
public boolean isCloudCompatible() {
return true;
}
@Override
public boolean isForwarderCompatible() {
return false;
}
}
@ConfigClass
public static class Config extends MessageInput.Config {
@Inject
public Config(CloudTrailTransport.Factory transport, CloudTrailCodec.Factory codec) {
super(transport.getConfig(), codec.getConfig());
}
}
@Override
public boolean onlyOnePerCluster() {
return true;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy