Search in sources :

Example 1 with DatarouterStorageGuiceModule

use of io.datarouter.storage.config.guice.DatarouterStorageGuiceModule in project datarouter by hotpads.

the class DatarouterWebGuiceModule method configureServlets.

@Override
protected void configureServlets() {
    install(new DatarouterSecretPluginBuilderImpl().build().getAsDefaultBinderModule());
    install(new DatarouterStorageGuiceModule());
    bind(ServletContextSupplier.class).toInstance(new ServletContextProvider(getServletContext()));
    bind(JsonSerializer.class).annotatedWith(Names.named(HandlerEncoder.DEFAULT_HANDLER_SERIALIZER)).to(GsonJsonSerializer.class);
    bind(PortIdentifier.class).annotatedWith(Names.named(CompoundPortIdentifier.COMPOUND_PORT_IDENTIFIER)).to(CompoundPortIdentifier.class);
    bindDefault(DatarouterAuthenticationConfig.class, BaseDatarouterAuthenticationConfig.class);
    bindDefaultInstance(ServiceName.class, new ServiceName(""));
    bindDefaultInstance(PublicDomain.class, new PublicDomain(""));
    bindDefaultInstance(PrivateDomain.class, new PrivateDomain(""));
    bindDefaultInstance(ContextName.class, new ContextName(""));
    bindDefault(BaseDatarouterSessionDao.class, NoOpDatarouterSessionDao.class);
    bindDefault(BaseDatarouterSamlDao.class, NoOpDatarouterSamlDao.class);
    bindDefault(ExceptionRecorder.class, NoOpExceptionRecorder.class);
    optionalBinder(AppNavBar.class);
    bindDefault(RoleManager.class, DatarouterRoleManager.class);
    optionalBinder(SamlRegistrar.class);
    bindDefault(SettingFinder.class, MemorySettingFinder.class);
    bindDefault(UserSessionService.class, NoOpUserSessionService.class);
    bindDefault(CurrentSessionInfo.class, NoOpCurrentSessionInfo.class);
    bindDefault(LatencyMonitoringGraphLink.class, NoOpLatencyMonitoringGraphLink.class);
    bindDefault(AppNavBarRegistrySupplier.class, NoOpAppNavBarRegistry.class);
    bindDefault(ChangelogRecorder.class, NoOpChangelogRecorder.class);
    // define as singleton for everybody
    bind(Gson.class).toInstance(GsonTool.GSON);
    bindDefaultInstance(DefaultEmailDistributionListZoneId.class, new DefaultEmailDistributionListZoneId(ZoneId.systemDefault()));
}
Also used : DefaultEmailDistributionListZoneId(io.datarouter.web.config.properties.DefaultEmailDistributionListZoneId) ServiceName(io.datarouter.web.config.service.ServiceName) DatarouterStorageGuiceModule(io.datarouter.storage.config.guice.DatarouterStorageGuiceModule) Gson(com.google.gson.Gson) DatarouterSecretPluginBuilderImpl(io.datarouter.secret.config.DatarouterSecretPlugin.DatarouterSecretPluginBuilder.DatarouterSecretPluginBuilderImpl) PrivateDomain(io.datarouter.web.config.service.PrivateDomain) PublicDomain(io.datarouter.web.config.service.PublicDomain) ContextName(io.datarouter.web.config.service.ContextName)

Aggregations

Gson (com.google.gson.Gson)1 DatarouterSecretPluginBuilderImpl (io.datarouter.secret.config.DatarouterSecretPlugin.DatarouterSecretPluginBuilder.DatarouterSecretPluginBuilderImpl)1 DatarouterStorageGuiceModule (io.datarouter.storage.config.guice.DatarouterStorageGuiceModule)1 DefaultEmailDistributionListZoneId (io.datarouter.web.config.properties.DefaultEmailDistributionListZoneId)1 ContextName (io.datarouter.web.config.service.ContextName)1 PrivateDomain (io.datarouter.web.config.service.PrivateDomain)1 PublicDomain (io.datarouter.web.config.service.PublicDomain)1 ServiceName (io.datarouter.web.config.service.ServiceName)1