Class SpincastConfigDefault

java.lang.Object
org.spincast.plugins.config.ConfigFinder
org.spincast.plugins.config.SpincastConfigDefault
All Implemented Interfaces:
org.spincast.core.config.SpincastConfig

public class SpincastConfigDefault extends ConfigFinder implements org.spincast.core.config.SpincastConfig
If you extend this class (which is recommended to implement your configuration), beware that causing circular dependencies is very easy if you inject more dependencies than SpincastConfigPluginConfig! Indeed, most components depend on the config components.

Also, don't forget to annotated the testingMode parameter with @TestingMode!

  • Field Details

  • Constructor Details

    • SpincastConfigDefault

      @Inject protected SpincastConfigDefault(SpincastConfigPluginConfig spincastConfigPluginConfig, boolean testingMode)
      Constructor
  • Method Details

    • init

      @Inject protected void init()
    • getEnvironmentName

      public String getEnvironmentName()
      Specified by:
      getEnvironmentName in interface org.spincast.core.config.SpincastConfig
    • getHttpServerPort

      public int getHttpServerPort()
      Specified by:
      getHttpServerPort in interface org.spincast.core.config.SpincastConfig
    • getHttpsServerPort

      public int getHttpsServerPort()
      Specified by:
      getHttpsServerPort in interface org.spincast.core.config.SpincastConfig
    • getHttpsKeyStorePath

      public String getHttpsKeyStorePath()
      Specified by:
      getHttpsKeyStorePath in interface org.spincast.core.config.SpincastConfig
    • getHttpsKeyStoreType

      public String getHttpsKeyStoreType()
      Specified by:
      getHttpsKeyStoreType in interface org.spincast.core.config.SpincastConfig
    • getHttpsKeyStoreStorePass

      public String getHttpsKeyStoreStorePass()
      Specified by:
      getHttpsKeyStoreStorePass in interface org.spincast.core.config.SpincastConfig
    • getHttpsKeyStoreKeyPass

      public String getHttpsKeyStoreKeyPass()
      Specified by:
      getHttpsKeyStoreKeyPass in interface org.spincast.core.config.SpincastConfig
    • getPublicURI

      protected URI getPublicURI()
    • getPublicServerScheme

      public final String getPublicServerScheme()
      Three of the rare "final" methods in Spincast!
      Specified by:
      getPublicServerScheme in interface org.spincast.core.config.SpincastConfig
    • getPublicServerHost

      public final String getPublicServerHost()
      Specified by:
      getPublicServerHost in interface org.spincast.core.config.SpincastConfig
    • getPublicServerPort

      public final int getPublicServerPort()
      Specified by:
      getPublicServerPort in interface org.spincast.core.config.SpincastConfig
    • getPublicUrlBase

      public String getPublicUrlBase()
      You should override this config!!!!
      Specified by:
      getPublicUrlBase in interface org.spincast.core.config.SpincastConfig
    • getHostForDefaultPublicServerSchemeHostPort

      protected String getHostForDefaultPublicServerSchemeHostPort()
    • getServerHost

      public String getServerHost()
      Specified by:
      getServerHost in interface org.spincast.core.config.SpincastConfig
    • isDevelopmentMode

      public boolean isDevelopmentMode()
      Specified by:
      isDevelopmentMode in interface org.spincast.core.config.SpincastConfig
    • isTestingMode

      public boolean isTestingMode()
      Specified by:
      isTestingMode in interface org.spincast.core.config.SpincastConfig
    • isRoutesCaseSensitive

      public boolean isRoutesCaseSensitive()
      Specified by:
      isRoutesCaseSensitive in interface org.spincast.core.config.SpincastConfig
    • getServerMaxRequestBodyBytes

      public long getServerMaxRequestBodyBytes()
      Specified by:
      getServerMaxRequestBodyBytes in interface org.spincast.core.config.SpincastConfig
    • isEnableHttp2

      public boolean isEnableHttp2()
      Specified by:
      isEnableHttp2 in interface org.spincast.core.config.SpincastConfig
    • getContentTypesToSkipGziping

      public List<String> getContentTypesToSkipGziping()
      Specified by:
      getContentTypesToSkipGziping in interface org.spincast.core.config.SpincastConfig
    • getWritableRootDir

      public File getWritableRootDir()
      Will call 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.
      Specified by:
      getWritableRootDir in interface org.spincast.core.config.SpincastConfig
    • getTempDir

      public File getTempDir()
      Specified by:
      getTempDir in interface org.spincast.core.config.SpincastConfig
    • getSpincastWritableDirPath

      protected String getSpincastWritableDirPath()
      The path to the writable directory.

      The path can be relative or absolute.

      Returns:
      the path or null to use the default location (using the "java.io.tmpdir" folder).
    • getDefaultLocale

      public Locale getDefaultLocale()
      Specified by:
      getDefaultLocale in interface org.spincast.core.config.SpincastConfig
    • getDefaultTimeZone

      public TimeZone getDefaultTimeZone()
      Specified by:
      getDefaultTimeZone in interface org.spincast.core.config.SpincastConfig
    • getRouteForwardingMaxNumber

      public int getRouteForwardingMaxNumber()
      Specified by:
      getRouteForwardingMaxNumber in interface org.spincast.core.config.SpincastConfig
    • getDefaultRouteCacheFilterSecondsNbr

      public int getDefaultRouteCacheFilterSecondsNbr()
      Specified by:
      getDefaultRouteCacheFilterSecondsNbr in interface org.spincast.core.config.SpincastConfig
    • isDefaultRouteCacheFilterPrivate

      public boolean isDefaultRouteCacheFilterPrivate()
      Specified by:
      isDefaultRouteCacheFilterPrivate in interface org.spincast.core.config.SpincastConfig
    • getDefaultRouteCacheFilterSecondsNbrCdns

      public Integer getDefaultRouteCacheFilterSecondsNbrCdns()
      Specified by:
      getDefaultRouteCacheFilterSecondsNbrCdns in interface org.spincast.core.config.SpincastConfig
    • isWriteToDiskDynamicStaticResource

      public boolean isWriteToDiskDynamicStaticResource()
      Specified by:
      isWriteToDiskDynamicStaticResource in interface org.spincast.core.config.SpincastConfig
    • isAddDefaultTemplateVariablesFilter

      public boolean isAddDefaultTemplateVariablesFilter()
      Specified by:
      isAddDefaultTemplateVariablesFilter in interface org.spincast.core.config.SpincastConfig
    • getDefaultTemplateVariablesFilterPosition

      public int getDefaultTemplateVariablesFilterPosition()
      Specified by:
      getDefaultTemplateVariablesFilterPosition in interface org.spincast.core.config.SpincastConfig
    • getDefaultStaticResourceCacheConfig

      public org.spincast.core.routing.StaticResourceCacheConfig getDefaultStaticResourceCacheConfig(boolean isDynamicResource)
      Specified by:
      getDefaultStaticResourceCacheConfig in interface org.spincast.core.config.SpincastConfig
    • getMaxNumberOfKeysWhenConvertingMapToJsonObject

      public int getMaxNumberOfKeysWhenConvertingMapToJsonObject()
      Specified by:
      getMaxNumberOfKeysWhenConvertingMapToJsonObject in interface org.spincast.core.config.SpincastConfig
    • getKeyMaxLengthWhenConvertingMapToJsonObject

      public int getKeyMaxLengthWhenConvertingMapToJsonObject()
      Specified by:
      getKeyMaxLengthWhenConvertingMapToJsonObject in interface org.spincast.core.config.SpincastConfig
    • getJsonPathArrayIndexMax

      public int getJsonPathArrayIndexMax()
      Specified by:
      getJsonPathArrayIndexMax in interface org.spincast.core.config.SpincastConfig
    • isValidateLocalhostHost

      public boolean isValidateLocalhostHost()
      Specified by:
      isValidateLocalhostHost in interface org.spincast.core.config.SpincastConfig
    • isEnableCookiesValidator

      public boolean isEnableCookiesValidator()
      Specified by:
      isEnableCookiesValidator in interface org.spincast.core.config.SpincastConfig
    • getQueryParamFlashMessageId

      public String getQueryParamFlashMessageId()
      Specified by:
      getQueryParamFlashMessageId in interface org.spincast.core.config.SpincastConfig
    • getCookieNameFlashMessage

      public String getCookieNameFlashMessage()
      Specified by:
      getCookieNameFlashMessage in interface org.spincast.core.config.SpincastConfig
    • getCookieNameLocale

      public String getCookieNameLocale()
      Specified by:
      getCookieNameLocale in interface org.spincast.core.config.SpincastConfig
    • getCookieNameTimeZoneId

      public String getCookieNameTimeZoneId()
      Specified by:
      getCookieNameTimeZoneId in interface org.spincast.core.config.SpincastConfig
    • getCookiesValidatorCookieName

      public String getCookiesValidatorCookieName()
      Specified by:
      getCookiesValidatorCookieName in interface org.spincast.core.config.SpincastConfig
    • getSpincastModelRootVariableName

      public String getSpincastModelRootVariableName()
      Specified by:
      getSpincastModelRootVariableName in interface org.spincast.core.config.SpincastConfig
    • getValidationElementDefaultName

      public String getValidationElementDefaultName()
      Specified by:
      getValidationElementDefaultName in interface org.spincast.core.config.SpincastConfig
    • getDictionaryEntryNotFoundBehavior

      public org.spincast.core.dictionary.DictionaryEntryNotFoundBehavior getDictionaryEntryNotFoundBehavior()
      Specified by:
      getDictionaryEntryNotFoundBehavior in interface org.spincast.core.config.SpincastConfig