public class SpincastConfig extends Object implements ISpincastConfig
| Constructor and Description |
|---|
SpincastConfig() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cleanWritableSpincastDir(File spincastTempDir) |
List<String> |
getContentTypesToSkipGziping()
Even if gziping of the response is enabled, those Content-Types
still won't be gzipped.
|
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. |
IStaticResourceCacheConfig |
getDefaultStaticResourceCacheConfig(boolean isDynamicResource)
The default cache configurations for the static resource.
|
int |
getDefaultTemplateVariablesFilterPosition()
If
addGlobalTemplateVariablesAdderFilter
erturns true/code>, 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 |
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.
|
protected String |
getSpincastTempDirName() |
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 |
isRoutesCaseSensitive()
Are the URLS case-sensitive or not, during the route matching
process?
The default value is
false. |
public String getEnvironmentName()
ISpincastConfiglocal.getEnvironmentName in interface ISpincastConfigpublic int getHttpServerPort()
ISpincastConfig44419 so HTTP
is enabled by default.getHttpServerPort in interface ISpincastConfigpublic int getHttpsServerPort()
ISpincastConfig-1 so HTTPS
is not enabled by default.getHttpsServerPort in interface ISpincastConfigpublic String getHttpsKeyStorePath()
ISpincastConfigKeyStore, 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 ISpincastConfigKeyStorepublic String getHttpsKeyStoreType()
ISpincastConfigKeyStore, for SSL.
For example: "JKS".
Only used if getHttpsServerPort() returns a port > 0.
The default value is null.getHttpsKeyStoreType in interface ISpincastConfigKeyStorepublic String getHttpsKeyStoreStorePass()
ISpincastConfigKeyStore, for SSL.
Only used if getHttpsServerPort() returns a port > 0.
The default value is null.getHttpsKeyStoreStorePass in interface ISpincastConfigKeyStorepublic String getHttpsKeyStoreKeypass()
ISpincastConfigKeyStore, for SSL.
Only used if getHttpsServerPort() returns a port > 0.
The default value is null.getHttpsKeyStoreKeypass in interface ISpincastConfigKeyStorepublic String getServerHost()
ISpincastConfig0.0.0.0.getServerHost in interface ISpincastConfigpublic boolean isDebugEnabled()
ISpincastConfigtrue 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 ISpincastConfigtrue if debug mode is enabled.public boolean isRoutesCaseSensitive()
ISpincastConfigfalse.isRoutesCaseSensitive in interface ISpincastConfigpublic long getServerMaxRequestBodyBytes()
ISpincastConfig104857600 (100MB).getServerMaxRequestBodyBytes in interface ISpincastConfigpublic List<String> getContentTypesToSkipGziping()
ISpincastConfiggetContentTypesToSkipGziping in interface ISpincastConfigpublic File getSpincastWritableDir()
ISpincastConfigThis directory will be emptied each time the application starts.
The default value uses System.getProperty("java.io.tmpdir")
to create the directory.
getSpincastWritableDir in interface ISpincastConfigprotected String getSpincastTempDirName()
protected void cleanWritableSpincastDir(File spincastTempDir)
public Locale getDefaultLocale()
ISpincastConfigLocale.US.getDefaultLocale in interface ISpincastConfigpublic int getRouteForwardingMaxNumber()
ISpincastConfig2.getRouteForwardingMaxNumber in interface ISpincastConfigpublic int getDefaultRouteCacheFilterSecondsNbr()
ISpincastConfig.cache() method on
a route builder, this is the default number of
seconds to use.getDefaultRouteCacheFilterSecondsNbr in interface ISpincastConfigpublic boolean isDefaultRouteCacheFilterPrivate()
ISpincastConfig.cache() method on
a route builder, is the cache private by default?isDefaultRouteCacheFilterPrivate in interface ISpincastConfigpublic Integer getDefaultRouteCacheFilterSecondsNbrCdns()
ISpincastConfig.cache() method on
a route builder, this is the default number of
seconds to use by the CDNs.getDefaultRouteCacheFilterSecondsNbrCdns in interface ISpincastConfigpublic boolean isDisableWriteToDiskDynamicStaticResource()
ISpincastConfigtrue, 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.isDisableWriteToDiskDynamicStaticResource in interface ISpincastConfigpublic boolean isAddDefaultTemplateVariablesFilter()
ISpincastConfigThis filter bind some default variables to be used by the templating engine.
isAddDefaultTemplateVariablesFilter in interface ISpincastConfigpublic int getDefaultTemplateVariablesFilterPosition()
ISpincastConfigaddGlobalTemplateVariablesAdderFilter
erturns true/code>, then this is the position at
which the filter will be added.getDefaultTemplateVariablesFilterPosition in interface ISpincastConfigpublic IStaticResourceCacheConfig getDefaultStaticResourceCacheConfig(boolean isDynamicResource)
ISpincastConfig
This will be used if no cache(...) method is
used when building the static resource's route.
getDefaultStaticResourceCacheConfig in interface ISpincastConfigisDynamicResource - 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.Copyright © 2016. All rights reserved.