public interface SpincastConfig
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getContentTypesToSkipGziping()
Even if gziping of the response is enabled, those Content-Types
still won't be gzipped.
|
String |
getCookieNameFlashMessage()
Name of the Cookie to to use save a
Flash Message id.
|
String |
getCookieNameLocale()
Name of the Cookie to use to
save the user
Locale. |
String |
getCookiesValidatorCookieName()
Name of the Cookie to use to validate if
cookies are enabled.
|
Locale |
getDefaultLocale()
The default Locale to use if no other Locale can be found
as a "best match", for the current request.
|
int |
getDefaultRouteCacheFilterSecondsNbr()
When using the
.cache() method on
a route builder, this is the default number of
seconds to use. |
Integer |
getDefaultRouteCacheFilterSecondsNbrCdns()
When using the
.cache() method on
a route builder, this is the default number of
seconds to use by the CDNs. |
StaticResourceCacheConfig |
getDefaultStaticResourceCacheConfig(boolean isDynamicResource)
The default cache configurations for the static resource.
|
int |
getDefaultTemplateVariablesFilterPosition()
If
addGlobalTemplateVariablesAdderFilter
erturns true, then this is the position at
which the filter will be added. |
String |
getEnvironmentName()
Returns the name of the environment.
|
int |
getHttpServerPort()
The HTTP (unsecure) port on which the server will listen on.
|
String |
getHttpsKeyStoreKeypass()
The "keypass" of the
KeyStore, for SSL. |
String |
getHttpsKeyStorePath()
The path to the
KeyStore, for SSL. |
String |
getHttpsKeyStoreStorePass()
The "storepass" of the
KeyStore, for SSL. |
String |
getHttpsKeyStoreType()
The type of the
KeyStore, for SSL. |
int |
getHttpsServerPort()
The HTTPS (secure) port on which the server will listen on.
|
int |
getJsonPathArrayIndexMax()
Gets the maximum index of an element of an array, when parsing
a
JsonPath. |
int |
getKeyMaxLengthWhenConvertingMapToJsonObject()
|
int |
getMaxNumberOfKeysWhenConvertingMapToJsonObject()
Gets the maximum number of
keys in a Map that
can be parsed as JsonPaths to create a
JsonObject. |
String |
getPublicServerHost()
The public host
|
int |
getPublicServerPort()
The public port
|
String |
getPublicServerScheme()
The public scheme
|
String |
getPublicServerSchemeHostPort()
The application can't know by itself on which
scheme/host/port it is served publicly.
|
String |
getQueryParamFlashMessageId()
The name of the queryString parameter to use
for a Flash Message id, when cookies are not
available.
|
int |
getRouteForwardingMaxNumber()
The maximum number of time a request can be forwarded to another
route.
|
String |
getServerHost()
The host/IP on which the server will listen to.
|
long |
getServerMaxRequestBodyBytes()
Maximum number of bytes a request's body can have.
|
String |
getSpincastModelRootVariableName()
Name of the root variables reserved for
Spincast in the response's model.
|
File |
getSpincastWritableDir()
A directory where temporary generated files
can be written by Spincast.
|
boolean |
isAddDefaultTemplateVariablesFilter()
Should the GlobalTemplateVariablesAdderFilter be automatically
added to all routes?
|
boolean |
isDebugEnabled()
Let this to
true on development environment,
where errors can be publicly displayed, where cache can
be disabled, etc. |
boolean |
isDefaultRouteCacheFilterPrivate()
When using the
.cache() method on
a route builder, is the cache private by default? |
boolean |
isDisableWriteToDiskDynamicStaticResource()
If
true, the dynamic resources (static resource
which have a generator in case they don't exist) won't be
saved to disk. |
boolean |
isEnableCookiesValidator()
If
true, Spincast will always try to set a cookie
to validate if cookies are enabled on the client. |
boolean |
isRoutesCaseSensitive()
Are the URLS case-sensitive or not, during the route matching
process?
The default value is
false. |
boolean |
isValidateLocalhostHost()
By default, if
getPublicServerHost() returns
"localhost", getEnvironmentName() is
not "local" and isDebugEnabled() is false,
an exception is thrown when the application starts. |
boolean isDebugEnabled()
true on development environment,
where errors can be publicly displayed, where cache can
be disabled, etc. In production set it to false
The default value is true.true if debug mode is enabled.String getPublicServerSchemeHostPort()
For example, the server can be started using host
"0.0.0.0", but the public URL to reach the application
will be http://www.example.com. The port can also
be different, for example if a reverse-proxy is used.
We need the public informations, for example :
domain,
when none is specified.
String getPublicServerScheme()
String getPublicServerHost()
int getPublicServerPort()
String getServerHost()
0.0.0.0.int getHttpServerPort()
44419 so HTTP
is enabled by default.int getHttpsServerPort()
-1 so HTTPS
is not enabled by default.String getHttpsKeyStorePath()
KeyStore, for SSL. Can be a
classpath path or and absolute path.
The classpath will be checked first.
Only used if getHttpsServerPort() returns a port > 0.
The default value is null.KeyStoreString getHttpsKeyStoreType()
KeyStore, for SSL.
For example: "JKS".
Only used if getHttpsServerPort() returns a port > 0.
The default value is null.KeyStoreString getHttpsKeyStoreStorePass()
KeyStore, for SSL.
Only used if getHttpsServerPort() returns a port > 0.
The default value is null.KeyStoreString getHttpsKeyStoreKeypass()
KeyStore, for SSL.
Only used if getHttpsServerPort() returns a port > 0.
The default value is null.KeyStoreboolean isRoutesCaseSensitive()
false.String getEnvironmentName()
local.long getServerMaxRequestBodyBytes()
104857600 (100MB).List<String> getContentTypesToSkipGziping()
File getSpincastWritableDir()
This directory will be emptied each time the application starts.
The default value uses System.getProperty("java.io.tmpdir")
to create the directory.
Locale getDefaultLocale()
Locale.US.int getRouteForwardingMaxNumber()
2.int getDefaultRouteCacheFilterSecondsNbr()
.cache() method on
a route builder, this is the default number of
seconds to use.boolean isDefaultRouteCacheFilterPrivate()
.cache() method on
a route builder, is the cache private by default?Integer getDefaultRouteCacheFilterSecondsNbrCdns()
.cache() method on
a route builder, this is the default number of
seconds to use by the CDNs.StaticResourceCacheConfig getDefaultStaticResourceCacheConfig(boolean isDynamicResource)
This will be used if no cache(...) method is
used when building the static resource's route.
isDynamicResource - if true, a generator is
use when the resource doesn't exist. Those kind of generated resources
may be modified more often then trully static resources, so we may
want to use a different caching period.null
so no cache headers are sent at all.boolean isDisableWriteToDiskDynamicStaticResource()
true, the dynamic resources (static resource
which have a generator in case they don't exist) won't be
saved to disk. THhis means that the generator will always be called,
so chnages during development will be picked up.boolean isAddDefaultTemplateVariablesFilter()
This filter bind some default variables to be used by the templating engine.
int getDefaultTemplateVariablesFilterPosition()
addGlobalTemplateVariablesAdderFilter
erturns true, then this is the position at
which the filter will be added.int getMaxNumberOfKeysWhenConvertingMapToJsonObject()
keys in a Map that
can be parsed as JsonPaths to create a
JsonObject.
This maximum is to prevent malicious user to POST
a very big number of keys and harm
the server.
int getKeyMaxLengthWhenConvertingMapToJsonObject()
key in a Map that
can be parsed as JsonPaths using the
create
method.
This maximum is to prevent malicious user to POST
very long and complex keys and harm
the server.
int getJsonPathArrayIndexMax()
JsonPath.boolean isValidateLocalhostHost()
getPublicServerHost() returns
"localhost", getEnvironmentName() is
not "local" and isDebugEnabled() is false,
an exception is thrown when the application starts.
This validation is to make sure the developers
didn't forget to override the getPublicServerSchemeHostPort()
method when they release to a non local environment.
You can disable this validation if you want.
boolean isEnableCookiesValidator()
true, Spincast will always try to set a cookie
to validate if cookies are enabled on the client.
This is enabled by default
String getCookiesValidatorCookieName()
The default is "spincast_cookies_enabled".
String getCookieNameFlashMessage()
String getQueryParamFlashMessageId()
String getCookieNameLocale()
Locale.
The default is "spincast_locale"
String getSpincastModelRootVariableName()
Copyright © 2017. All rights reserved.