Search in sources :

Example 1 with ArlasServerConfiguration

use of io.arlas.server.core.app.ArlasServerConfiguration in project ARLAS-server by gisaia.

the class ArlasServer method initialize.

@Override
public void initialize(Bootstrap<ArlasServerConfiguration> bootstrap) {
    bootstrap.registerMetrics();
    bootstrap.getObjectMapper().enable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES);
    bootstrap.setConfigurationSourceProvider(new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)));
    bootstrap.addBundle(new SwaggerBundle<ArlasServerConfiguration>() {

        @Override
        protected SwaggerBundleConfiguration getSwaggerBundleConfiguration(ArlasServerConfiguration configuration) {
            return configuration.swaggerBundleConfiguration;
        }
    });
    bootstrap.addBundle(new ZipkinBundle<ArlasServerConfiguration>(getName()) {

        @Override
        public ZipkinFactory getZipkinFactory(ArlasServerConfiguration configuration) {
            return configuration.zipkinConfiguration;
        }
    });
    bootstrap.addBundle(new AssetsBundle("/assets/", "/", "index.html"));
    bootstrap.addBundle(new JdbiExceptionsBundle());
}
Also used : SubstitutingSourceProvider(io.dropwizard.configuration.SubstitutingSourceProvider) ArlasServerConfiguration(io.arlas.server.core.app.ArlasServerConfiguration) JdbiExceptionsBundle(io.dropwizard.jdbi3.bundles.JdbiExceptionsBundle) EnvironmentVariableSubstitutor(io.dropwizard.configuration.EnvironmentVariableSubstitutor) AssetsBundle(io.dropwizard.assets.AssetsBundle) SwaggerBundleConfiguration(io.federecio.dropwizard.swagger.SwaggerBundleConfiguration) ZipkinFactory(com.smoketurner.dropwizard.zipkin.ZipkinFactory)

Aggregations

ZipkinFactory (com.smoketurner.dropwizard.zipkin.ZipkinFactory)1 ArlasServerConfiguration (io.arlas.server.core.app.ArlasServerConfiguration)1 AssetsBundle (io.dropwizard.assets.AssetsBundle)1 EnvironmentVariableSubstitutor (io.dropwizard.configuration.EnvironmentVariableSubstitutor)1 SubstitutingSourceProvider (io.dropwizard.configuration.SubstitutingSourceProvider)1 JdbiExceptionsBundle (io.dropwizard.jdbi3.bundles.JdbiExceptionsBundle)1 SwaggerBundleConfiguration (io.federecio.dropwizard.swagger.SwaggerBundleConfiguration)1