public.javadoc.org.spincast.plugins.config.SpincastConfig.html Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spincast-website Show documentation
Show all versions of spincast-website Show documentation
Source code for the https://www.spincast.org website.
The newest version!
SpincastConfig (org.spincast:spincast-framework 0.9.28 API)
org.spincast.plugins.config
Class SpincastConfig
- java.lang.Object
-
- org.spincast.plugins.config.SpincastConfig
-
- All Implemented Interfaces:
- ISpincastConfig
- Direct Known Subclasses:
- SpincastConfigPropsFileBased, SpincastTestConfig
public class SpincastConfig
extends Object
implements ISpincastConfig
-
-
Constructor Summary
Constructors
Constructor and Description
SpincastConfig()
-
Method Summary
All Methods Instance Methods Concrete Methods
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, 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.
-
-
Method Detail
-
getEnvironmentName
public String getEnvironmentName()
Description copied from interface: ISpincastConfig
Returns the name of the environment.
The default value is local.
- Specified by:
getEnvironmentName in interface ISpincastConfig
- Returns:
- the name of the environment
-
getHttpServerPort
public int getHttpServerPort()
Description copied from interface: ISpincastConfig
The HTTP (unsecure) port on which the server will listen on.
If <= 0, it won't be used.
The default value is 44419 so HTTP
is enabled by default.
- Specified by:
getHttpServerPort in interface ISpincastConfig
- Returns:
- the HTTP port
-
getHttpsServerPort
public int getHttpsServerPort()
Description copied from interface: ISpincastConfig
The HTTPS (secure) port on which the server will listen on.
If <= 0, it won't be used.
The default value is -1 so HTTPS
is not enabled by default.
- Specified by:
getHttpsServerPort in interface ISpincastConfig
- Returns:
- the HTTPS port
-
getHttpsKeyStorePath
public String getHttpsKeyStorePath()
Description copied from interface: ISpincastConfig
The path to the 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.
- Specified by:
getHttpsKeyStorePath in interface ISpincastConfig
- Returns:
- the path to the
KeyStore
-
getHttpsKeyStoreType
public String getHttpsKeyStoreType()
Description copied from interface: ISpincastConfig
The type of the KeyStore, for SSL.
For example: "JKS".
Only used if getHttpsServerPort() returns a port > 0.
The default value is null.
- Specified by:
getHttpsKeyStoreType in interface ISpincastConfig
- Returns:
- the type of the
KeyStore
-
getHttpsKeyStoreStorePass
public String getHttpsKeyStoreStorePass()
Description copied from interface: ISpincastConfig
The "storepass" of the KeyStore, for SSL.
Only used if getHttpsServerPort() returns a port > 0.
The default value is null.
- Specified by:
getHttpsKeyStoreStorePass in interface ISpincastConfig
- Returns:
- the "storepass" of the
KeyStore
-
getHttpsKeyStoreKeypass
public String getHttpsKeyStoreKeypass()
Description copied from interface: ISpincastConfig
The "keypass" of the KeyStore, for SSL.
Only used if getHttpsServerPort() returns a port > 0.
The default value is null.
- Specified by:
getHttpsKeyStoreKeypass in interface ISpincastConfig
- Returns:
- the "keypass" of the
KeyStore
-
getServerHost
public String getServerHost()
Description copied from interface: ISpincastConfig
The host/IP on which the server will listen to.
The default value is 0.0.0.0.
- Specified by:
getServerHost in interface ISpincastConfig
- Returns:
- the host/IP
-
isDebugEnabled
public boolean isDebugEnabled()
Description copied from interface: ISpincastConfig
Let this to 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.
- Specified by:
isDebugEnabled in interface ISpincastConfig
- Returns:
true if debug mode is enabled.
-
isRoutesCaseSensitive
public boolean isRoutesCaseSensitive()
Description copied from interface: ISpincastConfig
Are the URLS case-sensitive or not, during the route matching
process?
The default value is false.
- Specified by:
isRoutesCaseSensitive in interface ISpincastConfig
- Returns:
- if they are case-sensitive
- See Also:
- Should URL be case sensitive?
-
getServerMaxRequestBodyBytes
public long getServerMaxRequestBodyBytes()
Description copied from interface: ISpincastConfig
Maximum number of bytes a request's body can have.
"-1" means no limit.
The default value is 104857600 (100MB).
- Specified by:
getServerMaxRequestBodyBytes in interface ISpincastConfig
- Returns:
- the maximum number of bytes
-
getContentTypesToSkipGziping
public List<String> getContentTypesToSkipGziping()
Description copied from interface: ISpincastConfig
Even if gziping of the response is enabled, those Content-Types
still won't be gzipped.
If an entry ends with "*", it will be considered as a prefix
(ex: "image/*" will match all Content-Types starting with "image/").
Otherwise, the current response Content-Type will have to exactly
match the entry (case insensitive), or being followed by a " " or
a ";".
- Specified by:
getContentTypesToSkipGziping in interface ISpincastConfig
- Returns:
- the Content-Types that shouldn't be gzipped.
-
getSpincastWritableDir
public File getSpincastWritableDir()
Description copied from interface: ISpincastConfig
A directory where temporary generated files
can be written by Spincast.
This directory will be emptied each time the application starts.
The default value uses System.getProperty("java.io.tmpdir")
to create the directory.
- Specified by:
getSpincastWritableDir in interface ISpincastConfig
- Returns:
- a directory with write permissions for Spincast.
-
getSpincastTempDirName
protected String getSpincastTempDirName()
-
cleanWritableSpincastDir
protected void cleanWritableSpincastDir(File spincastTempDir)
-
getDefaultLocale
public Locale getDefaultLocale()
Description copied from interface: ISpincastConfig
The default Locale to use if no other Locale can be found
as a "best match", for the current request.
The default value is Locale.US.
- Specified by:
getDefaultLocale in interface ISpincastConfig
- Returns:
- the default Locale
-
getRouteForwardingMaxNumber
public int getRouteForwardingMaxNumber()
Description copied from interface: ISpincastConfig
The maximum number of time a request can be forwarded to another
route. After this number, an exception will be thrown.
The default value is 2.
- Specified by:
getRouteForwardingMaxNumber in interface ISpincastConfig
- Returns:
- the maximum number of time
-
getDefaultRouteCacheFilterSecondsNbr
public int getDefaultRouteCacheFilterSecondsNbr()
Description copied from interface: ISpincastConfig
When using the .cache() method on
a route builder, this is the default number of
seconds to use.
- Specified by:
getDefaultRouteCacheFilterSecondsNbr in interface ISpincastConfig
-
isDefaultRouteCacheFilterPrivate
public boolean isDefaultRouteCacheFilterPrivate()
Description copied from interface: ISpincastConfig
When using the .cache() method on
a route builder, is the cache private by default?
- Specified by:
isDefaultRouteCacheFilterPrivate in interface ISpincastConfig
-
getDefaultRouteCacheFilterSecondsNbrCdns
public Integer getDefaultRouteCacheFilterSecondsNbrCdns()
Description copied from interface: ISpincastConfig
When using the .cache() method on
a route builder, this is the default number of
seconds to use by the CDNs.
- Specified by:
getDefaultRouteCacheFilterSecondsNbrCdns in interface ISpincastConfig
-
isDisableWriteToDiskDynamicStaticResource
public boolean isDisableWriteToDiskDynamicStaticResource()
Description copied from interface: ISpincastConfig
If 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.
- Specified by:
isDisableWriteToDiskDynamicStaticResource in interface ISpincastConfig
-
isAddDefaultTemplateVariablesFilter
public boolean isAddDefaultTemplateVariablesFilter()
Description copied from interface: ISpincastConfig
Should the GlobalTemplateVariablesAdderFilter be automatically
added to all routes?
This filter bind some default variables to be used by the
templating engine.
- Specified by:
isAddDefaultTemplateVariablesFilter in interface ISpincastConfig
-
getDefaultTemplateVariablesFilterPosition
public int getDefaultTemplateVariablesFilterPosition()
Description copied from interface: ISpincastConfig
If addGlobalTemplateVariablesAdderFilter
erturns true, then this is the position at
which the filter will be added.
- Specified by:
getDefaultTemplateVariablesFilterPosition in interface ISpincastConfig
-
getDefaultStaticResourceCacheConfig
public IStaticResourceCacheConfig getDefaultStaticResourceCacheConfig(boolean isDynamicResource)
Description copied from interface: ISpincastConfig
The default cache configurations for the static resource.
This will be used if no cache(...) method is
used when building the static resource's route.
- Specified by:
getDefaultStaticResourceCacheConfig in interface ISpincastConfig
- Parameters:
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.
- Returns:
- the default cache configuration to use or
null
so no cache headers are sent at all.
Copyright © 2016. All rights reserved.
© 2015 - 2025 Weber Informatics LLC | Privacy Policy