Search in sources :

Example 1 with PluginConfigBuilder

use of io.vertigo.app.config.PluginConfigBuilder in project vertigo by KleeGroup.

the class VegaFeatures method buildFeatures.

/**
 * {@inheritDoc}
 */
@Override
protected void buildFeatures() {
    final PluginConfigBuilder corsAllowerPluginConfigBuilder = PluginConfig.builder(CorsAllowerWebServiceHandlerPlugin.class);
    if (myOriginCORSFilter != null) {
        corsAllowerPluginConfigBuilder.addParam(Param.of("originCORSFilter", myOriginCORSFilter));
    }
    getModuleConfigBuilder().addComponent(WebServiceManager.class, WebServiceManagerImpl.class).addPlugin(AnnotationsWebServiceScannerPlugin.class).addComponent(SwaggerWebServices.class).addComponent(CatalogWebServices.class).addPlugin(ExceptionWebServiceHandlerPlugin.class).addPlugin(corsAllowerPluginConfigBuilder.build()).addPlugin(AnalyticsWebServiceHandlerPlugin.class).addPlugin(JsonConverterWebServiceHandlerPlugin.class);
    if (mySearchApiVersion != null) {
        getModuleConfigBuilder().addComponent(JsonEngine.class, GoogleJsonEngine.class, Param.of("searchApiVersion", mySearchApiVersion));
    } else {
        getModuleConfigBuilder().addComponent(JsonEngine.class, GoogleJsonEngine.class);
    }
    if (securityEnabled) {
        getModuleConfigBuilder().addPlugin(SessionInvalidateWebServiceHandlerPlugin.class).addPlugin(SessionWebServiceHandlerPlugin.class).addPlugin(SecurityWebServiceHandlerPlugin.class);
    }
    if (tokensEnabled) {
        getModuleConfigBuilder().addPlugin(ServerSideStateWebServiceHandlerPlugin.class).addPlugin(AccessTokenWebServiceHandlerPlugin.class).addPlugin(PaginatorAndSortWebServiceHandlerPlugin.class).addComponent(TokenManager.class, TokenManagerImpl.class, Param.of("collection", myTokens));
    }
    if (miscEnabled) {
        getModuleConfigBuilder().addPlugin(RateLimitingWebServiceHandlerPlugin.class);
    }
    if (myPort != null) {
        final ListBuilder<Param> params = new ListBuilder().add(Param.of("port", Integer.toString(myPort)));
        if (myApiPrefix != null) {
            params.add(Param.of("apiPrefix", myApiPrefix));
        }
        getModuleConfigBuilder().addPlugin(new PluginConfig(SparkJavaEmbeddedWebServerPlugin.class, params.build()));
    }
    getModuleConfigBuilder().addPlugin(ValidatorWebServiceHandlerPlugin.class).addPlugin(RestfulServiceWebServiceHandlerPlugin.class);
}
Also used : WebServiceManagerImpl(io.vertigo.vega.impl.webservice.WebServiceManagerImpl) SessionWebServiceHandlerPlugin(io.vertigo.vega.plugins.webservice.handler.SessionWebServiceHandlerPlugin) ExceptionWebServiceHandlerPlugin(io.vertigo.vega.plugins.webservice.handler.ExceptionWebServiceHandlerPlugin) SwaggerWebServices(io.vertigo.vega.impl.webservice.catalog.SwaggerWebServices) PaginatorAndSortWebServiceHandlerPlugin(io.vertigo.vega.plugins.webservice.handler.PaginatorAndSortWebServiceHandlerPlugin) ServerSideStateWebServiceHandlerPlugin(io.vertigo.vega.plugins.webservice.handler.ServerSideStateWebServiceHandlerPlugin) PluginConfigBuilder(io.vertigo.app.config.PluginConfigBuilder) PluginConfig(io.vertigo.app.config.PluginConfig) SparkJavaEmbeddedWebServerPlugin(io.vertigo.vega.plugins.webservice.webserver.sparkjava.SparkJavaEmbeddedWebServerPlugin) WebServiceManager(io.vertigo.vega.webservice.WebServiceManager) Param(io.vertigo.core.param.Param) ListBuilder(io.vertigo.util.ListBuilder) ValidatorWebServiceHandlerPlugin(io.vertigo.vega.plugins.webservice.handler.ValidatorWebServiceHandlerPlugin) AnalyticsWebServiceHandlerPlugin(io.vertigo.vega.plugins.webservice.handler.AnalyticsWebServiceHandlerPlugin)

Aggregations

PluginConfig (io.vertigo.app.config.PluginConfig)1 PluginConfigBuilder (io.vertigo.app.config.PluginConfigBuilder)1 Param (io.vertigo.core.param.Param)1 ListBuilder (io.vertigo.util.ListBuilder)1 WebServiceManagerImpl (io.vertigo.vega.impl.webservice.WebServiceManagerImpl)1 SwaggerWebServices (io.vertigo.vega.impl.webservice.catalog.SwaggerWebServices)1 AnalyticsWebServiceHandlerPlugin (io.vertigo.vega.plugins.webservice.handler.AnalyticsWebServiceHandlerPlugin)1 ExceptionWebServiceHandlerPlugin (io.vertigo.vega.plugins.webservice.handler.ExceptionWebServiceHandlerPlugin)1 PaginatorAndSortWebServiceHandlerPlugin (io.vertigo.vega.plugins.webservice.handler.PaginatorAndSortWebServiceHandlerPlugin)1 ServerSideStateWebServiceHandlerPlugin (io.vertigo.vega.plugins.webservice.handler.ServerSideStateWebServiceHandlerPlugin)1 SessionWebServiceHandlerPlugin (io.vertigo.vega.plugins.webservice.handler.SessionWebServiceHandlerPlugin)1 ValidatorWebServiceHandlerPlugin (io.vertigo.vega.plugins.webservice.handler.ValidatorWebServiceHandlerPlugin)1 SparkJavaEmbeddedWebServerPlugin (io.vertigo.vega.plugins.webservice.webserver.sparkjava.SparkJavaEmbeddedWebServerPlugin)1 WebServiceManager (io.vertigo.vega.webservice.WebServiceManager)1