org.sdase.commons.starter.builder.InitialPlatformBundleBuilder Maven / Gradle / Ivy
Show all versions of sda-commons-starter Show documentation
package org.sdase.commons.starter.builder;
import io.dropwizard.core.Configuration;
import org.sdase.commons.server.auth.config.AuthConfigProvider;
import org.sdase.commons.server.cors.CorsConfigProvider;
import org.sdase.commons.server.opa.config.OpaConfigProvider;
import org.sdase.commons.starter.SdaPlatformBundle;
import org.sdase.commons.starter.SdaPlatformConfiguration;
import org.sdase.commons.starter.builder.CustomConfigurationProviders.AuthConfigProviderBuilder;
import org.sdase.commons.starter.builder.OpenApiCustomizer.OpenApiInitialBuilder;
public interface InitialPlatformBundleBuilder {
/**
* Start an application that uses the {@link SdaPlatformConfiguration} as base of it's
* configuration file.
*
* @return the builder instance
*/
OpenApiInitialBuilder usingSdaPlatformConfiguration();
/**
* Start an application that uses a customized configuration which extends the {@link
* SdaPlatformConfiguration} as base of it's configuration file.
*
* The method automatically enables OPA authorization and sets therefore the authorization
* configuration via {@link AuthConfigProviderBuilder#withOpaAuthorization(AuthConfigProvider,
* OpaConfigProvider)} and the cors configuration via {@link
* org.sdase.commons.starter.builder.CustomConfigurationProviders.CorsConfigProviderBuilder#withCorsConfigProvider(CorsConfigProvider)}
*
* @param configurationClass - the customized configuration of the application
* @return the builder instance
*/
OpenApiInitialBuilder usingSdaPlatformConfiguration(
Class configurationClass);
/**
* Start an application that uses a custom configuration has to define providers for the
* configurations required by the {@link SdaPlatformBundle}.
*
* @param configurationClass the class that stores the configuration
* @param the type of the applications configuration class
* @return the builder instance
*/
AuthConfigProviderBuilder usingCustomConfig(
Class configurationClass);
}