public class SpincastConfigDefault extends ConfigFinder implements SpincastConfig
ConfigFinder.ConfigFinderBuilder| Modifier and Type | Field and Description |
|---|---|
static String |
ENVIRONMENT_NAME_DEFAULT |
configs, logger, rawConfigs| Modifier | Constructor and Description |
|---|---|
protected |
SpincastConfigDefault(SpincastConfigPluginConfig spincastConfigPluginConfig)
Constructor
|
| 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 |
getCookieNameTimeZoneId()
Name of the Cookie to use to
save the id of the user
TimeZone. |
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
returns true, then this is the position at
which the filter will be added. |
TimeZone |
getDefaultTimeZone()
The default TimeZone to use if no other TimeZone can be found
as a "best match", for the current request.
|
DictionaryEntryNotFoundBehavior |
getDictionaryEntryNotFoundBehavior()
If a dictionary key is not found, how must Spincast react?
|
String |
getEnvironmentName()
Returns the name of the environment.
|
protected String |
getHostForDefaultPublicServerSchemeHostPort() |
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()
Three of the rare "final" methods in Spincast!
|
protected URI |
getPublicURI() |
String |
getPublicUrlBase()
You should override this config!!!!
|
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.
|
protected String |
getSpincastWritableDirPath()
The path to the writable directory.
|
File |
getTempDir()
A directory where temp files can be written by Spincast.
|
String |
getValidationElementDefaultName()
The default name to use for the validation element
that will be available on the response's model when
Form elements are added. |
File |
getWritableRootDir()
Will call
getSpincastWritableDirPath() to get
the path to use for the writable directory. |
protected void |
init() |
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 |
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
SpincastConfig.getPublicServerHost() returns
"localhost", SpincastConfig.getEnvironmentName() is
not "local" and SpincastConfig.isDebugEnabled() is false,
an exception is thrown when the application starts. |
boolean |
isWriteToDiskDynamicStaticResource()
If
true, the dynamic resources (static resource
which have a generator in case they don't exist) won't be
saved to disk. |
clearPrefixes, configure, expandMap, getAppJarDirectory, getAppRootDirectoryNoJar, getBigDecimal, getBigDecimal, getBigDecimalFromElement, getBigDecimalList, getBigDecimalList, getBoolean, getBoolean, getBooleanFromElement, getBooleanList, getBooleanList, getClasspathFilePath, getConfig, getConfig, getConfigFromMap, getConfigFromMap, getConfigList, getConfigList, getConfigs, getDate, getDate, getDateFromElement, getDateList, getDateList, getEnvironmentVariables, getEnvironmentVariablesConfigs, getEnvironmentVariablesPrefixes, getExternalFilePath, getInteger, getInteger, getIntegerFromElement, getIntegerList, getIntegerList, getLong, getLong, getLongFromElement, getLongList, getLongList, getMap, getMap, getMapList, getMapList, getRawConfig, getRawConfigs, getString, getString, getStringList, getStringList, getSystemPropertiesConfigs, getSystemPropertiesPrefixes, isEnvironmentVariablesStripPrefix, isExternalFileConfigsOverrideEnvironmentVariables, isSystemPropertiesStripPrefix, isThrowExceptionIfSpecifiedClasspathConfigFileIsNotFound, isThrowExceptionIfSpecifiedExternalConfigFileIsNotFound, loadYamlFileConfigs, mergeMapspublic static final String ENVIRONMENT_NAME_DEFAULT
@Inject protected SpincastConfigDefault(SpincastConfigPluginConfig spincastConfigPluginConfig)
@Inject protected void init()
public String getEnvironmentName()
SpincastConfiglocal.getEnvironmentName in interface SpincastConfigpublic int getHttpServerPort()
SpincastConfig44419 so HTTP
is enabled by default.getHttpServerPort in interface SpincastConfigpublic int getHttpsServerPort()
SpincastConfig-1 so HTTPS
is not enabled by default.getHttpsServerPort in interface SpincastConfigpublic String getHttpsKeyStorePath()
SpincastConfigKeyStore, 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.getHttpsKeyStorePath in interface SpincastConfigKeyStorepublic String getHttpsKeyStoreType()
SpincastConfigKeyStore, for SSL.
For example: "JKS".
Only used if getHttpsServerPort() returns a port > 0.
The default value is null.getHttpsKeyStoreType in interface SpincastConfigKeyStorepublic String getHttpsKeyStoreStorePass()
SpincastConfigKeyStore, for SSL.
Only used if getHttpsServerPort() returns a port > 0.
The default value is null.getHttpsKeyStoreStorePass in interface SpincastConfigKeyStorepublic String getHttpsKeyStoreKeyPass()
SpincastConfigKeyStore, for SSL.
Only used if getHttpsServerPort() returns a port > 0.
The default value is null.getHttpsKeyStoreKeyPass in interface SpincastConfigKeyStoreprotected URI getPublicURI()
public final String getPublicServerScheme()
getPublicServerScheme in interface SpincastConfigpublic final String getPublicServerHost()
SpincastConfiggetPublicServerHost in interface SpincastConfigpublic final int getPublicServerPort()
SpincastConfiggetPublicServerPort in interface SpincastConfigpublic String getPublicUrlBase()
getPublicUrlBase in interface SpincastConfigprotected String getHostForDefaultPublicServerSchemeHostPort()
public String getServerHost()
SpincastConfig0.0.0.0.getServerHost in interface SpincastConfigpublic boolean isDebugEnabled()
SpincastConfigtrue 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.isDebugEnabled in interface SpincastConfigtrue if debug mode is enabled.public boolean isRoutesCaseSensitive()
SpincastConfigfalse.isRoutesCaseSensitive in interface SpincastConfigpublic long getServerMaxRequestBodyBytes()
SpincastConfig104857600 (100MB).getServerMaxRequestBodyBytes in interface SpincastConfigpublic List<String> getContentTypesToSkipGziping()
SpincastConfiggetContentTypesToSkipGziping in interface SpincastConfigpublic File getWritableRootDir()
getSpincastWritableDirPath() to get
the path to use for the writable directory. If this
method returns null, a directory will be
created under the java.io.tmpdir directory.getWritableRootDir in interface SpincastConfigpublic File getTempDir()
SpincastConfigThis directory will be emptied each time the application starts!
getTempDir in interface SpincastConfigprotected String getSpincastWritableDirPath()
The path can be relative or absolute.
null to use the
default location (using the "java.io.tmpdir" folder).public Locale getDefaultLocale()
SpincastConfigLocale.US.getDefaultLocale in interface SpincastConfigpublic TimeZone getDefaultTimeZone()
SpincastConfigUTC.getDefaultTimeZone in interface SpincastConfigpublic int getRouteForwardingMaxNumber()
SpincastConfig2.getRouteForwardingMaxNumber in interface SpincastConfigpublic int getDefaultRouteCacheFilterSecondsNbr()
SpincastConfig.cache() method on
a route builder, this is the default number of
seconds to use.getDefaultRouteCacheFilterSecondsNbr in interface SpincastConfigpublic boolean isDefaultRouteCacheFilterPrivate()
SpincastConfig.cache() method on
a route builder, is the cache private by default?isDefaultRouteCacheFilterPrivate in interface SpincastConfigpublic Integer getDefaultRouteCacheFilterSecondsNbrCdns()
SpincastConfig.cache() method on
a route builder, this is the default number of
seconds to use by the CDNs.getDefaultRouteCacheFilterSecondsNbrCdns in interface SpincastConfigpublic boolean isWriteToDiskDynamicStaticResource()
SpincastConfigtrue, the dynamic resources (static resource
which have a generator in case they don't exist) won't be
saved to disk. This means that the generator will always be called,
so changes during development will be picked up.isWriteToDiskDynamicStaticResource in interface SpincastConfigpublic boolean isAddDefaultTemplateVariablesFilter()
SpincastConfigThis filter bind some default variables to be used by the templating engine.
isAddDefaultTemplateVariablesFilter in interface SpincastConfigpublic int getDefaultTemplateVariablesFilterPosition()
SpincastConfigaddGlobalTemplateVariablesAdderFilter
returns true, then this is the position at
which the filter will be added.getDefaultTemplateVariablesFilterPosition in interface SpincastConfigpublic StaticResourceCacheConfig getDefaultStaticResourceCacheConfig(boolean isDynamicResource)
SpincastConfig
This will be used if no cache(...) method is
used when building the static resource's route.
getDefaultStaticResourceCacheConfig in interface SpincastConfigisDynamicResource - 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.public int getMaxNumberOfKeysWhenConvertingMapToJsonObject()
SpincastConfigkeys 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.
getMaxNumberOfKeysWhenConvertingMapToJsonObject in interface SpincastConfigpublic int getKeyMaxLengthWhenConvertingMapToJsonObject()
SpincastConfigkey 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.
getKeyMaxLengthWhenConvertingMapToJsonObject in interface SpincastConfigpublic int getJsonPathArrayIndexMax()
SpincastConfigJsonPath.getJsonPathArrayIndexMax in interface SpincastConfigpublic boolean isValidateLocalhostHost()
SpincastConfigSpincastConfig.getPublicServerHost() returns
"localhost", SpincastConfig.getEnvironmentName() is
not "local" and SpincastConfig.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 SpincastConfig.getPublicUrlBase()
method when they release to a non local environment.
You can disable this validation if you want.
isValidateLocalhostHost in interface SpincastConfigpublic boolean isEnableCookiesValidator()
SpincastConfigtrue, Spincast will always try to set a cookie
to validate if cookies are enabled on the client.
This is enabled by default
isEnableCookiesValidator in interface SpincastConfigpublic String getQueryParamFlashMessageId()
SpincastConfiggetQueryParamFlashMessageId in interface SpincastConfigpublic String getCookieNameFlashMessage()
SpincastConfiggetCookieNameFlashMessage in interface SpincastConfigpublic String getCookieNameLocale()
SpincastConfigLocale.
The default is "spincast_locale"
getCookieNameLocale in interface SpincastConfigpublic String getCookieNameTimeZoneId()
SpincastConfigTimeZone.
The default is "spincast_timezone"
getCookieNameTimeZoneId in interface SpincastConfigpublic String getCookiesValidatorCookieName()
SpincastConfigThe default is "spincast_cookies_enabled".
getCookiesValidatorCookieName in interface SpincastConfigpublic String getSpincastModelRootVariableName()
SpincastConfiggetSpincastModelRootVariableName in interface SpincastConfigpublic String getValidationElementDefaultName()
SpincastConfigForm elements are added.getValidationElementDefaultName in interface SpincastConfigpublic DictionaryEntryNotFoundBehavior getDictionaryEntryNotFoundBehavior()
SpincastConfigNote that if the key is not found for the current Locale, Spincast will first check if it exists for the fallback Locale (the empty Locale).
By default, in debug mode an exception is thrown. Otherwise, an empty string is returned but an error is logged.
getDictionaryEntryNotFoundBehavior in interface SpincastConfigCopyright © 2018. All rights reserved.