Search in sources :

Example 36 with FactoryModuleBuilder

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);
}
Also used : ProcessorFunctionsModule(org.graylog.plugins.pipelineprocessor.functions.ProcessorFunctionsModule) FactoryModuleBuilder(com.google.inject.assistedinject.FactoryModuleBuilder) PipelineInterpreter(org.graylog.plugins.pipelineprocessor.processors.PipelineInterpreter)

Example 37 with FactoryModuleBuilder

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);
}
Also used : InternalAuthServiceBackend(org.graylog.security.authservice.InternalAuthServiceBackend) FactoryModuleBuilder(com.google.inject.assistedinject.FactoryModuleBuilder) LDAPAuthServiceBackend(org.graylog.security.authservice.backend.LDAPAuthServiceBackend) ProvisionerAction(org.graylog.security.authservice.ProvisionerAction) UnboundLDAPConnector(org.graylog.security.authservice.ldap.UnboundLDAPConnector) ADAuthServiceBackend(org.graylog.security.authservice.backend.ADAuthServiceBackend)

Example 38 with FactoryModuleBuilder

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);
}
Also used : FactoryModuleBuilder(com.google.inject.assistedinject.FactoryModuleBuilder)

Example 39 with FactoryModuleBuilder

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));
}
Also used : FactoryModuleBuilder(com.google.inject.assistedinject.FactoryModuleBuilder)

Example 40 with FactoryModuleBuilder

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);
}
Also used : FactoryModuleBuilder(com.google.inject.assistedinject.FactoryModuleBuilder)

Aggregations

FactoryModuleBuilder (com.google.inject.assistedinject.FactoryModuleBuilder)85 AbstractModule (com.google.inject.AbstractModule)20 Injector (com.google.inject.Injector)12 ConfigModule (co.cask.cdap.common.guice.ConfigModule)10 PrivateModule (com.google.inject.PrivateModule)10 DatasetDefinitionRegistry (co.cask.cdap.api.dataset.module.DatasetDefinitionRegistry)8 DefaultDatasetDefinitionRegistry (co.cask.cdap.data2.dataset2.DefaultDatasetDefinitionRegistry)8 InMemoryDatasetFramework (co.cask.cdap.data2.dataset2.InMemoryDatasetFramework)8 TypeLiteral (com.google.inject.TypeLiteral)8 DatasetFramework (co.cask.cdap.data2.dataset2.DatasetFramework)7 DiscoveryRuntimeModule (co.cask.cdap.common.guice.DiscoveryRuntimeModule)6 LocationRuntimeModule (co.cask.cdap.common.guice.LocationRuntimeModule)6 SystemDatasetRuntimeModule (co.cask.cdap.data.runtime.SystemDatasetRuntimeModule)6 DatasetOpExecutor (co.cask.cdap.data2.datafabric.dataset.service.executor.DatasetOpExecutor)6 DatasetDefinitionRegistryFactory (co.cask.cdap.data2.dataset2.DatasetDefinitionRegistryFactory)6 Singleton (com.google.inject.Singleton)6 TransactionManager (org.apache.tephra.TransactionManager)6 DatasetService (co.cask.cdap.data2.datafabric.dataset.service.DatasetService)5 DatasetAdminOpHTTPHandler (co.cask.cdap.data2.datafabric.dataset.service.executor.DatasetAdminOpHTTPHandler)5 CConfiguration (co.cask.cdap.common.conf.CConfiguration)4