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

public.javadoc.org.spincast.plugins.configpropsfile.SpincastConfigPropsFileBased.html Maven / Gradle / Ivy

There is a newer version: 0.9.28
Show newest version






SpincastConfigPropsFileBased (org.spincast:spincast-framework 0.9.21 API)












org.spincast.plugins.configpropsfile

Class SpincastConfigPropsFileBased

    • Field Detail

      • logger

        protected final org.slf4j.Logger logger
      • APP_PROPERTIES_KEY_ENVIRONMENT_IS_DEBUG

        public static final String APP_PROPERTIES_KEY_ENVIRONMENT_IS_DEBUG
        See Also:
        Constant Field Values
      • APP_PROPERTIES_KEY_HTTPS_SERVER_PORT

        public static final String APP_PROPERTIES_KEY_HTTPS_SERVER_PORT
        See Also:
        Constant Field Values
      • APP_PROPERTIES_KEY_HTTPS_SERVER_KEYSTORE_PATH

        public static final String APP_PROPERTIES_KEY_HTTPS_SERVER_KEYSTORE_PATH
        See Also:
        Constant Field Values
      • APP_PROPERTIES_KEY_HTTPS_SERVER_KEYSTORE_TYPE

        public static final String APP_PROPERTIES_KEY_HTTPS_SERVER_KEYSTORE_TYPE
        See Also:
        Constant Field Values
      • APP_PROPERTIES_KEY_HTTPS_SERVER_KEYSTORE_STOREPASS

        public static final String APP_PROPERTIES_KEY_HTTPS_SERVER_KEYSTORE_STOREPASS
        See Also:
        Constant Field Values
      • APP_PROPERTIES_KEY_HTTPS_SERVER_KEYSTORE_KEYPASS

        public static final String APP_PROPERTIES_KEY_HTTPS_SERVER_KEYSTORE_KEYPASS
        See Also:
        Constant Field Values
    • Method Detail

      • getMainArgs

        protected String[] getMainArgs()
      • getSpecificAppPropertiesFilePath

        protected String getSpecificAppPropertiesFilePath()
      • lookForPropsFileSpecificPath

        protected String lookForPropsFileSpecificPath()
        Look for a specific .properties file. You can override this to implement your own strategy to locate the .properties file to use.
      • getFoundPropertiesFilePath

        protected String getFoundPropertiesFilePath()
        The path to the acutally found .properties file.
        Returns:
        the path of the file or null if none was found.
      • getConfigKeyEnvironmentName

        protected String getConfigKeyEnvironmentName()
      • getConfigKeyEnvironmentIsDebug

        protected String getConfigKeyEnvironmentIsDebug()
      • getConfigKeyServerHost

        protected String getConfigKeyServerHost()
      • getConfigKeyHttpServerPort

        protected String getConfigKeyHttpServerPort()
      • getConfigKeyHttpsServerPort

        protected String getConfigKeyHttpsServerPort()
      • getConfigKeyHttpsServerKeystorePath

        protected String getConfigKeyHttpsServerKeystorePath()
      • getConfigKeyHttpsServerKeystoreType

        protected String getConfigKeyHttpsServerKeystoreType()
      • getConfigKeyHttpsServerKeystoreStorePass

        protected String getConfigKeyHttpsServerKeystoreStorePass()
      • getConfigKeyHttpsServerKeystoreKeyPass

        protected String getConfigKeyHttpsServerKeystoreKeyPass()
      • getAppProperties

        protected Properties getAppProperties()
        Here is the algorithm used to find the configuration file : 1) If getSpecificAppPropertiesFilePath() is not null, we use it as the path. 2) Otherwise, we try to find the configuration file next to the ".jar" itself. 3) It we didn't found the configuration file next to the ".jar" file, or if there is no .jar file (the code is running from an IDE, for example), then we fallback to the default configurations which are defined in the SpincastConfig base class.
      • getConfig

        public String getConfig(String key)
        Gets a String configuration and throws an exception if the specified key is not found.
        Specified by:
        getConfig in interface IFreeKeyConfig
      • getConfig

        public String getConfig(String key,
                                String defaultValue)
        Gets a String configuration and uses the specified default value if the key is not found.
        Specified by:
        getConfig in interface IFreeKeyConfig
      • getConfig

        protected Object getConfig(String key,
                                   Object defaultValue,
                                   boolean useDefaultValue)
        Gets a configuration. If 'useDefaultValue' is false, throws an exception if the key is not found. Otherwise, returns the 'defaultValue'.
      • 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
        Overrides:
        isDebugEnabled in class SpincastConfig
        Returns:
        true if debug mode is enabled.
      • 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
        Overrides:
        getHttpServerPort in class SpincastConfig
        Returns:
        the HTTP 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
        Overrides:
        getHttpsKeyStorePath in class SpincastConfig
        Returns:
        the path to the KeyStore

Copyright © 2016. All rights reserved.





© 2015 - 2025 Weber Informatics LLC | Privacy Policy