Added
This commit is contained in:
parent
960e38039e
commit
5eeabceea3
|
|
@ -16,9 +16,14 @@
|
||||||
*/
|
*/
|
||||||
package org.graylog.plugins.custom;
|
package org.graylog.plugins.custom;
|
||||||
|
|
||||||
|
import com.google.inject.Binder;
|
||||||
|
import com.google.inject.TypeLiteral;
|
||||||
|
import com.google.inject.multibindings.MapBinder;
|
||||||
|
import org.graylog.plugins.pipelineprocessor.ast.functions.Function;
|
||||||
import org.graylog2.plugin.PluginConfigBean;
|
import org.graylog2.plugin.PluginConfigBean;
|
||||||
import org.graylog2.plugin.PluginModule;
|
import org.graylog2.plugin.PluginModule;
|
||||||
|
|
||||||
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
|
@ -31,6 +36,7 @@ public class Base64InflateFunctionModule extends PluginModule {
|
||||||
*
|
*
|
||||||
* Implementing this method is optional. The default method returns an empty {@link Set}.
|
* Implementing this method is optional. The default method returns an empty {@link Set}.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Set<? extends PluginConfigBean> getConfigBeans() {
|
public Set<? extends PluginConfigBean> getConfigBeans() {
|
||||||
return Collections.emptySet();
|
return Collections.emptySet();
|
||||||
|
|
@ -38,23 +44,17 @@ public class Base64InflateFunctionModule extends PluginModule {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void configure() {
|
protected void configure() {
|
||||||
/*
|
addMessageProcessorFunction(Base64InflateFunction.NAME, Base64InflateFunction.class);
|
||||||
* Register your plugin types here.
|
}
|
||||||
*
|
protected void addMessageProcessorFunction(String name, Class<? extends Function<?>> functionClass) {
|
||||||
* Examples:
|
addMessageProcessorFunction(binder(), name, functionClass);
|
||||||
*
|
}
|
||||||
* addMessageInput(Class<? extends MessageInput>);
|
|
||||||
* addMessageFilter(Class<? extends MessageFilter>);
|
public static MapBinder<String, Function<?>> processorFunctionBinder(Binder binder) {
|
||||||
* addMessageOutput(Class<? extends MessageOutput>);
|
return MapBinder.newMapBinder(binder, TypeLiteral.get(String.class), new TypeLiteral<Function<?>>() {});
|
||||||
* addPeriodical(Class<? extends Periodical>);
|
}
|
||||||
* addAlarmCallback(Class<? extends AlarmCallback>);
|
|
||||||
* addInitializer(Class<? extends Service>);
|
public static void addMessageProcessorFunction(Binder binder, String name, Class<? extends Function<?>> functionClass) {
|
||||||
* addRestResource(Class<? extends PluginRestResource>);
|
processorFunctionBinder(binder).addBinding(name).to(functionClass);
|
||||||
*
|
|
||||||
*
|
|
||||||
* Add all configuration beans returned by getConfigBeans():
|
|
||||||
*
|
|
||||||
* addConfigBeans();
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue