public static class SdaPlatformBundle.Builder<C extends io.dropwizard.Configuration> extends java.lang.Object implements InitialPlatformBundleBuilder, CustomConfigurationProviders.AuthConfigProviderBuilder<C>, CustomConfigurationProviders.CorsConfigProviderBuilder<C>, CustomConfigurationProviders.ConsumerTokenConfigBuilder<C>, CustomConfigurationProviders.ConsumerTokenRequiredConfigBuilder<C>, CustomConfigurationProviders.SwaggerTitleBuilder<C>, CustomConfigurationProviders.SwaggerDetailsBuilder<C>, CustomConfigurationProviders.SwaggerFinalBuilder<C>, PlatformBundleBuilder<C>
Modifier and Type | Method and Description |
---|---|
CustomConfigurationProviders.SwaggerFinalBuilder<C> |
addSwaggerResourcePackage(java.lang.String resourcePackage)
Adds a package to the packages Swagger should scan to pick up resources.
|
PlatformBundleBuilder<C> |
alwaysWriteZonedDateTimeWithMillisInJson()
Registers a default serializer for
ZonedDateTime that renders 3 digits of milliseconds. |
PlatformBundleBuilder<C> |
alwaysWriteZonedDateTimeWithoutMillisInJson()
Registers a default serializer for
ZonedDateTime that renders no milliseconds. |
SdaPlatformBundle<C> |
build()
Builds the configured
SdaPlatformBundle which must be added to the Bootstrap in
Application.initialize(Bootstrap) . |
PlatformBundleBuilder<C> |
disableBufferLimitValidationSecurityFeature()
Switches from suppressing the application start to a warn logging for violated buffer limits.
|
CustomConfigurationProviders.SwaggerDetailsBuilder<C> |
disableSwaggerEmbedParameter()
Disables automatic addition of the embed query parameter if embeddable resources are
discovered.
|
CustomConfigurationProviders.SwaggerDetailsBuilder<C> |
disableSwaggerJsonExamples()
Disables automatic rendering of Json examples in Swagger
property examples and response examples . |
<T extends io.dropwizard.Configuration> |
usingCustomConfig(java.lang.Class<T> configurationClass)
Start an application that uses a custom configuration has to define providers for the
configurations required by the
SdaPlatformBundle . |
CustomConfigurationProviders.ConsumerTokenConfigBuilder<SdaPlatformConfiguration> |
usingSdaPlatformConfiguration()
Start an application that uses the
SdaPlatformConfiguration as base of it's
configuration file. |
CustomConfigurationProviders.CorsConfigProviderBuilder<C> |
withAuthConfigProvider(org.sdase.commons.server.auth.config.AuthConfigProvider<C> authConfigProvider)
Enables authentication (i.e.
|
CustomConfigurationProviders.SwaggerTitleBuilder<C> |
withConsumerTokenConfigProvider(org.sdase.commons.server.consumer.ConsumerTokenBundle.ConsumerTokenConfigProvider<C> consumerTokenConfigProvider)
Configure consumer token support based on provided configuration per instance.
|
PlatformBundleBuilder<C> |
withCorsAdditionalAllowedHeaders(java.lang.String... additionalAllowedHeaders)
Defines additional HTTP headers that clients may send to the application.
|
PlatformBundleBuilder<C> |
withCorsAdditionalExposedHeaders(java.lang.String... additionalExposedHeaders)
Defines additional HTTP headers that can be exposed to clients.
|
PlatformBundleBuilder<C> |
withCorsAllowedMethods(java.lang.String... httpMethods)
Defines the HTTP methods that are used in the application and should be allowed for cross
origin clients.
|
CustomConfigurationProviders.ConsumerTokenConfigBuilder<C> |
withCorsConfigProvider(org.sdase.commons.server.cors.CorsConfigProvider<C> corsConfigProvider) |
CustomConfigurationProviders.SwaggerTitleBuilder<C> |
withExcludePatternsForRequiredConsumerToken(java.lang.String... regex)
Define paths by regex patterns that do not require a consumer token from the client.
|
PlatformBundleBuilder<C> |
withObjectMapperCustomization(java.util.function.Consumer<com.fasterxml.jackson.databind.ObjectMapper> customizer)
Allows customization of the used
ObjectMapper . |
CustomConfigurationProviders.CorsConfigProviderBuilder<C> |
withOpaAuthorization(org.sdase.commons.server.auth.config.AuthConfigProvider<C> authConfigProvider,
org.sdase.commons.server.opa.config.OpaConfigProvider<C> opaConfigProvider)
Enables authentication (i.e.
|
CustomConfigurationProviders.SwaggerTitleBuilder<C> |
withOptionalConsumerToken()
Disable consumer token support.
|
CustomConfigurationProviders.CorsConfigProviderBuilder<C> |
withoutAuthentication()
Disable authentication entirely.
|
CustomConfigurationProviders.SwaggerTitleBuilder<C> |
withoutConsumerTokenSupport()
Disable consumer token support.
|
CustomConfigurationProviders.ConsumerTokenConfigBuilder<C> |
withoutCorsSupport()
Disable CORS support.
|
PlatformBundleBuilder<C> |
withoutFieldFilter()
Disables the field filter entirely.
|
PlatformBundleBuilder<C> |
withoutHalSupport()
Skips registration of the HAL module.
|
PlatformBundleBuilder<C> |
withoutSwagger()
Disables the Swagger support for this application.
|
CustomConfigurationProviders.ConsumerTokenRequiredConfigBuilder<C> |
withRequiredConsumerToken()
Enable consumer token support.
|
CustomConfigurationProviders.SwaggerDetailsBuilder<C> |
withSwaggerInfoContact(java.lang.String name,
java.lang.String email,
java.lang.String url)
Sets the contact of the API.
|
CustomConfigurationProviders.SwaggerDetailsBuilder<C> |
withSwaggerInfoDescription(java.lang.String description)
Sets the description of the API.
|
CustomConfigurationProviders.SwaggerDetailsBuilder<C> |
withSwaggerInfoLicense(java.lang.String name,
java.lang.String url)
Sets the license of the API.
|
CustomConfigurationProviders.SwaggerDetailsBuilder<C> |
withSwaggerInfoTermsOfServiceUrl(java.lang.String termsOfServiceUrl)
Sets the Terms of Service URL of the API.
|
CustomConfigurationProviders.SwaggerDetailsBuilder<C> |
withSwaggerInfoTitle(java.lang.String title)
Sets the title of the API in the swagger documentation.
|
CustomConfigurationProviders.SwaggerDetailsBuilder<C> |
withSwaggerInfoVersion(java.lang.String version)
Sets the version of the API.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
withSwaggerInfoContact, withSwaggerInfoContact, withSwaggerInfoLicense
addSwaggerResourcePackageClass
public SdaPlatformBundle<C> build()
PlatformBundleBuilder
SdaPlatformBundle
which must be added to the Bootstrap
in
Application.initialize(Bootstrap)
.build
in interface PlatformBundleBuilder<C extends io.dropwizard.Configuration>
SdaPlatformBundle
public CustomConfigurationProviders.ConsumerTokenConfigBuilder<SdaPlatformConfiguration> usingSdaPlatformConfiguration()
InitialPlatformBundleBuilder
SdaPlatformConfiguration
as base of it's
configuration file.usingSdaPlatformConfiguration
in interface InitialPlatformBundleBuilder
public <T extends io.dropwizard.Configuration> CustomConfigurationProviders.AuthConfigProviderBuilder<T> usingCustomConfig(java.lang.Class<T> configurationClass)
InitialPlatformBundleBuilder
SdaPlatformBundle
.usingCustomConfig
in interface InitialPlatformBundleBuilder
T
- the type of the applications configuration classconfigurationClass
- the class that stores the configurationpublic CustomConfigurationProviders.CorsConfigProviderBuilder<C> withoutAuthentication()
CustomConfigurationProviders.AuthConfigProviderBuilder
withoutAuthentication
in interface CustomConfigurationProviders.AuthConfigProviderBuilder<C extends io.dropwizard.Configuration>
public CustomConfigurationProviders.CorsConfigProviderBuilder<C> withAuthConfigProvider(org.sdase.commons.server.auth.config.AuthConfigProvider<C> authConfigProvider)
CustomConfigurationProviders.AuthConfigProviderBuilder
withAuthConfigProvider
in interface CustomConfigurationProviders.AuthConfigProviderBuilder<C extends io.dropwizard.Configuration>
authConfigProvider
- a provider, for the AuthConfig
, e.g. MyAppConfig::getAuth
public CustomConfigurationProviders.CorsConfigProviderBuilder<C> withOpaAuthorization(org.sdase.commons.server.auth.config.AuthConfigProvider<C> authConfigProvider, org.sdase.commons.server.opa.config.OpaConfigProvider<C> opaConfigProvider)
CustomConfigurationProviders.AuthConfigProviderBuilder
OpaBundle
to authorize the requests. Requests without
Authorization header will not be rejected but need to be handled in the Authorization
policy.withOpaAuthorization
in interface CustomConfigurationProviders.AuthConfigProviderBuilder<C extends io.dropwizard.Configuration>
authConfigProvider
- a provider, for the AuthConfig
, e.g. MyAppConfig::getAuth
opaConfigProvider
- a provider, for the OpaConfig
, e.g. MyAppConfig::getOpa
public CustomConfigurationProviders.ConsumerTokenConfigBuilder<C> withoutCorsSupport()
CustomConfigurationProviders.CorsConfigProviderBuilder
withoutCorsSupport
in interface CustomConfigurationProviders.CorsConfigProviderBuilder<C extends io.dropwizard.Configuration>
public CustomConfigurationProviders.ConsumerTokenConfigBuilder<C> withCorsConfigProvider(org.sdase.commons.server.cors.CorsConfigProvider<C> corsConfigProvider)
withCorsConfigProvider
in interface CustomConfigurationProviders.CorsConfigProviderBuilder<C extends io.dropwizard.Configuration>
corsConfigProvider
- a provider, for the CorsConfiguration
, e.g. MyAppConfig::getCors
public CustomConfigurationProviders.SwaggerTitleBuilder<C> withoutConsumerTokenSupport()
CustomConfigurationProviders.ConsumerTokenConfigBuilder
withoutConsumerTokenSupport
in interface CustomConfigurationProviders.ConsumerTokenConfigBuilder<C extends io.dropwizard.Configuration>
public CustomConfigurationProviders.SwaggerTitleBuilder<C> withOptionalConsumerToken()
CustomConfigurationProviders.ConsumerTokenConfigBuilder
withOptionalConsumerToken
in interface CustomConfigurationProviders.ConsumerTokenConfigBuilder<C extends io.dropwizard.Configuration>
public CustomConfigurationProviders.ConsumerTokenRequiredConfigBuilder<C> withRequiredConsumerToken()
CustomConfigurationProviders.ConsumerTokenConfigBuilder
withRequiredConsumerToken
in interface CustomConfigurationProviders.ConsumerTokenConfigBuilder<C extends io.dropwizard.Configuration>
public CustomConfigurationProviders.SwaggerTitleBuilder<C> withConsumerTokenConfigProvider(org.sdase.commons.server.consumer.ConsumerTokenBundle.ConsumerTokenConfigProvider<C> consumerTokenConfigProvider)
CustomConfigurationProviders.ConsumerTokenConfigBuilder
withConsumerTokenConfigProvider
in interface CustomConfigurationProviders.ConsumerTokenConfigBuilder<C extends io.dropwizard.Configuration>
consumerTokenConfigProvider
- the provider of the configuration, e.g. MyConfig::getConsumerToken
public CustomConfigurationProviders.SwaggerTitleBuilder<C> withExcludePatternsForRequiredConsumerToken(java.lang.String... regex)
CustomConfigurationProviders.ConsumerTokenRequiredConfigBuilder
withExcludePatternsForRequiredConsumerToken
in interface CustomConfigurationProviders.ConsumerTokenRequiredConfigBuilder<C extends io.dropwizard.Configuration>
regex
- regex that matches paths that do not require a consumer token from the clientpublic PlatformBundleBuilder<C> withoutSwagger()
CustomConfigurationProviders.SwaggerTitleBuilder
SwaggerBundle
should be configured manually of if the
OpenApiBundle is used instead.withoutSwagger
in interface CustomConfigurationProviders.SwaggerTitleBuilder<C extends io.dropwizard.Configuration>
public CustomConfigurationProviders.SwaggerDetailsBuilder<C> withSwaggerInfoTitle(java.lang.String title)
CustomConfigurationProviders.SwaggerTitleBuilder
withSwaggerInfoTitle
in interface CustomConfigurationProviders.SwaggerTitleBuilder<C extends io.dropwizard.Configuration>
title
- the title; not null or emptypublic CustomConfigurationProviders.SwaggerDetailsBuilder<C> disableSwaggerEmbedParameter()
CustomConfigurationProviders.SwaggerDetailsBuilder
disableSwaggerEmbedParameter
in interface CustomConfigurationProviders.SwaggerDetailsBuilder<C extends io.dropwizard.Configuration>
public CustomConfigurationProviders.SwaggerDetailsBuilder<C> disableSwaggerJsonExamples()
CustomConfigurationProviders.SwaggerDetailsBuilder
property examples
and response examples
. If disabled, only
String
and Integer
are recognized as special types.disableSwaggerJsonExamples
in interface CustomConfigurationProviders.SwaggerDetailsBuilder<C extends io.dropwizard.Configuration>
public CustomConfigurationProviders.SwaggerDetailsBuilder<C> withSwaggerInfoVersion(java.lang.String version)
CustomConfigurationProviders.SwaggerDetailsBuilder
Note: If no version is given (i.e. this method is not used) 1.0
is used.
withSwaggerInfoVersion
in interface CustomConfigurationProviders.SwaggerDetailsBuilder<C extends io.dropwizard.Configuration>
version
- the version; not null or emptypublic CustomConfigurationProviders.SwaggerDetailsBuilder<C> withSwaggerInfoDescription(java.lang.String description)
CustomConfigurationProviders.SwaggerDetailsBuilder
withSwaggerInfoDescription
in interface CustomConfigurationProviders.SwaggerDetailsBuilder<C extends io.dropwizard.Configuration>
description
- the description; not null or emptypublic CustomConfigurationProviders.SwaggerDetailsBuilder<C> withSwaggerInfoTermsOfServiceUrl(java.lang.String termsOfServiceUrl)
CustomConfigurationProviders.SwaggerDetailsBuilder
withSwaggerInfoTermsOfServiceUrl
in interface CustomConfigurationProviders.SwaggerDetailsBuilder<C extends io.dropwizard.Configuration>
termsOfServiceUrl
- the Terms of Service URL; not null or emptypublic CustomConfigurationProviders.SwaggerDetailsBuilder<C> withSwaggerInfoContact(java.lang.String name, java.lang.String email, java.lang.String url)
CustomConfigurationProviders.SwaggerDetailsBuilder
withSwaggerInfoContact
in interface CustomConfigurationProviders.SwaggerDetailsBuilder<C extends io.dropwizard.Configuration>
name
- the contact's name; not null or emptyemail
- the contact's email; not null or emptyurl
- the contact's url; not null or emptypublic CustomConfigurationProviders.SwaggerDetailsBuilder<C> withSwaggerInfoLicense(java.lang.String name, java.lang.String url)
CustomConfigurationProviders.SwaggerDetailsBuilder
withSwaggerInfoLicense
in interface CustomConfigurationProviders.SwaggerDetailsBuilder<C extends io.dropwizard.Configuration>
name
- the license's name; not null or emptyurl
- the license's url; not null or emptypublic CustomConfigurationProviders.SwaggerFinalBuilder<C> addSwaggerResourcePackage(java.lang.String resourcePackage)
CustomConfigurationProviders.SwaggerScanningBuilder
addSwaggerResourcePackage
in interface CustomConfigurationProviders.SwaggerScanningBuilder<C extends io.dropwizard.Configuration>
resourcePackage
- the package to be scanned; not nullpublic PlatformBundleBuilder<C> disableBufferLimitValidationSecurityFeature()
SecurityCustomizer
disableBufferLimitValidationSecurityFeature
in interface SecurityCustomizer<C extends io.dropwizard.Configuration>
public PlatformBundleBuilder<C> withCorsAllowedMethods(java.lang.String... httpMethods)
CorsCustomizer
httpMethods
overwrite the default methods
.
"PATCH"
withCorsAllowedMethods
in interface CorsCustomizer<C extends io.dropwizard.Configuration>
httpMethods
- all HTTP methods that will be allowed by the CORS filter.public PlatformBundleBuilder<C> withCorsAdditionalAllowedHeaders(java.lang.String... additionalAllowedHeaders)
CorsCustomizer
CorsBundle.FinalBuilder#ALWAYS_ALLOWED_HEADERS
are always allowed to be send and
must not be added here.withCorsAdditionalAllowedHeaders
in interface CorsCustomizer<C extends io.dropwizard.Configuration>
additionalAllowedHeaders
- additional HTTP headers that clients may send to the
application.public PlatformBundleBuilder<C> withCorsAdditionalExposedHeaders(java.lang.String... additionalExposedHeaders)
CorsCustomizer
CorsBundle.FinalBuilder#ALWAYS_EXPOSED_HEADERS
can always be exposed and must not be added
here.withCorsAdditionalExposedHeaders
in interface CorsCustomizer<C extends io.dropwizard.Configuration>
additionalExposedHeaders
- additional HTTP headers that can be exposed.public PlatformBundleBuilder<C> withoutHalSupport()
JacksonCustomizer
withoutHalSupport
in interface JacksonCustomizer<C extends io.dropwizard.Configuration>
public PlatformBundleBuilder<C> withoutFieldFilter()
JacksonCustomizer
EnableFieldFilter
for each resource.withoutFieldFilter
in interface JacksonCustomizer<C extends io.dropwizard.Configuration>
public PlatformBundleBuilder<C> withObjectMapperCustomization(java.util.function.Consumer<com.fasterxml.jackson.databind.ObjectMapper> customizer)
JacksonCustomizer
ObjectMapper
. More customizers may be added by calling
this method multiple times.withObjectMapperCustomization
in interface JacksonCustomizer<C extends io.dropwizard.Configuration>
customizer
- receives the used ObjectMapper
for customization, e.g. to enable or
disable specific features or configure formatting.public PlatformBundleBuilder<C> alwaysWriteZonedDateTimeWithMillisInJson()
JacksonCustomizer
ZonedDateTime
that renders 3 digits of milliseconds.
The same serializer may be configured per field as documented in Iso8601Serializer.WithMillis
.
This setting overwrites the default behaviour of Jackson which omits milliseconds if they are zero or adds nanoseconds if they are set.
alwaysWriteZonedDateTimeWithMillisInJson
in interface JacksonCustomizer<C extends io.dropwizard.Configuration>
public PlatformBundleBuilder<C> alwaysWriteZonedDateTimeWithoutMillisInJson()
JacksonCustomizer
ZonedDateTime
that renders no milliseconds. The same
serializer may be configured per field as documented in Iso8601Serializer
.
This setting overwrites the default behaviour of Jackson which omits milliseconds if they are zero or adds nanoseconds if they are set.
alwaysWriteZonedDateTimeWithoutMillisInJson
in interface JacksonCustomizer<C extends io.dropwizard.Configuration>