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);
}
Aggregations