All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.plugins.spincast-config.spincast-config.html Maven / Gradle / Ivy

{#==========================================
Spincast Config plugin
==========================================#}
{% extends "../../layout.html" %}

{% block sectionClasses %}plugins plugins-spincast-config{% endblock %}
{% block meta_title %}Plugins - Spincast Config{% endblock %}
{% block meta_description %}Spincast Config plugin provides the default configurations required by Spincast.{% endblock %}

{% block scripts %}

{% endblock %}

{% block body %}

Overview

The Spincast Config plugin provides an implementation of the ISpincastConfig interface to provide default values to the configurations required by Spincast.

The current implementation is very simple: the values are simply hardcoded.

Installation

If you use the spincast-default artifact, this plugin is already installed so you have nothing more to do!

If you start from scratch using the spincast-core artifact, you can use the plugin by adding this artifact to your project:

<dependency>
    <groupId>org.spincast</groupId>
    <artifactId>spincast-plugins-config</artifactId>
    <version>{{spincastCurrrentVersion}}</version>
</dependency>

You then install the plugin's Guice module, by passing it to the Guice.createInjector(...) method:

Injector guice = Guice.createInjector(
        new SpincastCoreGuiceModule(args),
        new SpincastConfigPluginGuiceModule(IAppRequestContext.class)
        // other modules...
        );

... or by using the install(...) method from your custom Guice module:

public class AppModule extends SpincastCoreGuiceModule {

    @Override
    protected void configure() {
        super.configure();
        install(new SpincastConfigPluginGuiceModule(getRequestContextType()));
        // other modules...
    }
    
    // ...
}

The ISpincastConfig interface

Methods :

  • boolean isDebugEnabled()
    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.
    @return true if debug mode is enabled.
  • String getServerHost()
    The host/IP on which the server will listen to.
    The default value is 0.0.0.0.
    @return the host/IP
  • int getHttpServerPort()
    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.
    @return the HTTP port
  • int getHttpsServerPort()
    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.
    @return the HTTPS port
  • String getHttpsKeyStorePath()
    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.
    @return the path to the KeyStore
  • String getHttpsKeyStoreType()
    The type of the KeyStore, for SSL.
    For example: "JKS".
    Only used if getHttpsServerPort() returns a port > 0.
    The default value is null.
    @return the type of the KeyStore
  • String getHttpsKeyStoreStorePass()
    The "storepass" of the KeyStore, for SSL.
    Only used if getHttpsServerPort() returns a port > 0.
    The default value is null.
    @return the "storepass" of the KeyStore
  • String getHttpsKeyStoreKeypass()
    The "keypass" of the KeyStore, for SSL.
    Only used if getHttpsServerPort() returns a port > 0.
    The default value is null.
    @return the "keypass" of the KeyStore
  • boolean isRoutesCaseSensitive()
    Are the URLS case-sensitive or not, during the route matching process?
    The default value is false.
    @return if they are case-sensitive
    @see Should URL be case sensitive?
  • String getEnvironmentName()
    Returns the name of the environment.
    The default value is local.
    @return the name of the environment
  • long getServerMaxRequestBodyBytes()
    Maximum number of bytes a request's body can have. "-1" means no limit.
    The default value is 104857600 (100MB).
    @return the maximum number of bytes
  • List<String> getContentTypesToSkipGziping()
    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 ";".
    @return the Content-Types that shouldn't be gzipped.
  • File getSpincastWritableDir()
    A directory where generated files and temporary files can be written by Spincast.
    The default value uses System.getProperty("java.io.tmpdir") to create a temporary directory.
    @return a directory with write permissions for Spincast.
  • Locale getDefaultLocale()
    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.
    @return the default Locale
  • int getRouteForwardingMaxNumber()
    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.
    @return the maximum number of time

{% endblock %}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy