use of com.google.inject.assistedinject.FactoryModuleBuilder in project graylog2-server by Graylog2.
the class PipelineProcessorModule method configure.
@Override
protected void configure() {
addPeriodical(LegacyDefaultStreamMigration.class);
addMessageProcessor(PipelineInterpreter.class, PipelineInterpreter.Descriptor.class);
addPermissions(PipelineRestPermissions.class);
addSystemRestResource(PipelineConnectionsResource.class);
addSystemRestResource(PipelineResource.class);
addSystemRestResource(RuleResource.class);
addSystemRestResource(SimulatorResource.class);
install(new ProcessorFunctionsModule());
installSearchResponseDecorator(searchResponseDecoratorBinder(), PipelineProcessorMessageDecorator.class, PipelineProcessorMessageDecorator.Factory.class);
install(new FactoryModuleBuilder().build(PipelineInterpreter.State.Factory.class));
addAuditEventTypes(PipelineProcessorAuditEventTypes.class);
}
use of com.google.inject.assistedinject.FactoryModuleBuilder in project graylog2-server by Graylog2.
the class SecurityModule method configure.
@Override
protected void configure() {
// Call the following to ensure the presence of the multi binder and avoid startup errors when no action is registered
MapBinder.newMapBinder(binder(), TypeLiteral.get(String.class), new TypeLiteral<ProvisionerAction.Factory<? extends ProvisionerAction>>() {
});
authServiceBackendBinder();
bind(BuiltinCapabilities.class).asEagerSingleton();
bind(UnboundLDAPConnector.class).in(Scopes.SINGLETON);
install(new FactoryModuleBuilder().implement(GranteeAuthorizer.class, GranteeAuthorizer.class).build(GranteeAuthorizer.Factory.class));
OptionalBinder.newOptionalBinder(binder(), PermissionAndRoleResolver.class).setDefault().to(DefaultPermissionAndRoleResolver.class);
OptionalBinder.newOptionalBinder(binder(), GranteeService.class).setDefault().to(DefaultGranteeService.class);
bind(AuthServiceBackend.class).annotatedWith(InternalAuthServiceBackend.class).to(MongoDBAuthServiceBackend.class);
addSystemRestResource(AuthServiceBackendsResource.class);
addSystemRestResource(AuthServicesResource.class);
addSystemRestResource(AuthServiceTestResource.class);
addSystemRestResource(GlobalAuthServiceConfigResource.class);
addSystemRestResource(HTTPHeaderAuthenticationConfigResource.class);
addSystemRestResource(AuthzRolesResource.class);
addSystemRestResource(EntitySharesResource.class);
addSystemRestResource(GrantsOverviewResource.class);
addAuditEventTypes(SecurityAuditEventTypes.class);
addAuthServiceBackend(LDAPAuthServiceBackend.TYPE_NAME, LDAPAuthServiceBackend.class, LDAPAuthServiceBackend.Factory.class, LDAPAuthServiceBackendConfig.class);
addAuthServiceBackend(ADAuthServiceBackend.TYPE_NAME, ADAuthServiceBackend.class, ADAuthServiceBackend.Factory.class, ADAuthServiceBackendConfig.class);
}
use of com.google.inject.assistedinject.FactoryModuleBuilder in project graylog2-server by Graylog2.
the class Graylog2Module method installLookupDataAdapter2.
protected void installLookupDataAdapter2(String name, Class<? extends LookupDataAdapter> adapterClass, Class<? extends LookupDataAdapter.Factory2> factoryClass, Class<? extends LookupDataAdapterConfiguration> configClass) {
install(new FactoryModuleBuilder().implement(LookupDataAdapter.class, adapterClass).build(factoryClass));
lookupDataAdapterBinder2().addBinding(name).to(factoryClass);
registerJacksonSubtype(configClass, name);
}
use of com.google.inject.assistedinject.FactoryModuleBuilder in project graylog2-server by Graylog2.
the class Graylog2Module method installOutput.
// This should only be used by plugins that have been built before Graylog 3.0.1.
// See comments in MessageOutput.Factory and MessageOutput.Factory2 for details
protected <T extends MessageOutput> void installOutput(MapBinder<String, MessageOutput.Factory<? extends MessageOutput>> outputMapBinder, Class<T> target, Class<? extends MessageOutput.Factory<T>> targetFactory) {
install(new FactoryModuleBuilder().implement(MessageOutput.class, target).build(targetFactory));
outputMapBinder.addBinding(target.getCanonicalName()).to(Key.get(targetFactory));
}
use of com.google.inject.assistedinject.FactoryModuleBuilder in project graylog2-server by Graylog2.
the class Graylog2Module method installLookupDataAdapter.
protected void installLookupDataAdapter(String name, Class<? extends LookupDataAdapter> adapterClass, Class<? extends LookupDataAdapter.Factory> factoryClass, Class<? extends LookupDataAdapterConfiguration> configClass) {
install(new FactoryModuleBuilder().implement(LookupDataAdapter.class, adapterClass).build(factoryClass));
lookupDataAdapterBinder().addBinding(name).to(factoryClass);
registerJacksonSubtype(configClass, name);
}
Aggregations