Interface JiraProperties

All Known Implementing Classes:
JiraPropertiesImpl, MockJiraProperties

@PublicApi public interface JiraProperties
Provides controlled access to system properties. Available from the container.

Default implementation provides caching of keys to minimize access to synchronized static getters such as System.getProperty(String) or Boolean.getBoolean(String).

You may obtain implementations in the following ways:

Since:
v6.1
  • Method Details

    • getProperty

      String getProperty(String key)
      Retrieves a system property of the given name
      Parameters:
      key - the name of the property.
      Returns:
      the value of the system property, or null if not defined.
    • getProperty

      String getProperty(String key, String defaultString)
      Retrieves a system property of the given name, with a default value to be returned if property is not set.
      Parameters:
      key - the name of the property.
      defaultString - the default value.
      Returns:
      the value of the system property, or defaultString, if property not defined.
    • setProperty

      <T> void setProperty(String key, T value)
      Sets the key-value pair into the system properties. The value will be set as string using the Object.toString() method
      Parameters:
      key - the name of the property
      value - the value of the property, stored as a String.
    • unsetProperty

      void unsetProperty(String key)
      Removes an entry in system properties under the given key.
      Parameters:
      key - the name of the property to be removed.
    • getBoolean

      Boolean getBoolean(String key)
      Retrieves a system property of the given name as a boolean.
      Parameters:
      key - the name of the property.
      Returns:
      the value of the system property, or false if not defined.
    • getInteger

      Integer getInteger(String key)
      Retrieves a system property of the given name as an integer.
      Parameters:
      key - the name of the property.
      Returns:
      the value of the system property, or null if not defined.
    • getInteger

      Integer getInteger(String key, Integer defaultInteger)
      Retrieves a system property of the given name as an integer, with a default value to be returned if property is not set.
      Parameters:
      key - the name of the property.
      defaultInteger - the default value.
      Returns:
      the value of the system property, or defaultInteger, if property not defined.
    • getLong

      Long getLong(String key)
      Retrieves a system property of the given name as a long.
      Parameters:
      key - the name of the property.
      Returns:
      the value of the system property, or null if not defined.
    • getLong

      Long getLong(String key, Long defaultLong)
      Retrieves a system property of the given name as a long, with a default value to be returned if property is not set.
      Parameters:
      key - the name of the property.
      defaultLong - the default value.
      Returns:
      the value of the system property, or defaultLong, if property not defined.
    • getProperties

      Properties getProperties()
      Retrieves all system properties as a properties object. Note, this is not a view of the system properties, rather a snapshot at the time of the call.
      Returns:
      system properties.
    • getSanitisedProperties

      Map<String,String> getSanitisedProperties()
      Return a copy of the current properties with sensitive properties sanitised. This should only be used when displaying properties to the user as some of the properties will not have their real values.
      Returns:
      a view of the system properties.
    • setProperties

      void setProperties(Properties props)
      Sets the given properties as system properties. Not that this will unset any properties not mentioned in the input properties object.
      Parameters:
      props - the target system properties.
      See Also:
    • refresh

      void refresh()
      Causes any previously cached values to be invalidated. As long as this object is used to set or retrieve system properties it is not necessary to call this method. Call it only if you caused a system property change in another way than setProperty(String, Object), setProperties(java.util.Properties) or unsetProperty(String).
    • isDevMode

      boolean isDevMode()
    • isXsrfDetectionCheckRequired

      boolean isXsrfDetectionCheckRequired()
    • isSuperBatchingDisabled

      boolean isSuperBatchingDisabled()
    • isContextBatchingDisabled

      boolean isContextBatchingDisabled()
    • isDecodeMailParameters

      boolean isDecodeMailParameters()
    • isCustomPathPluginsEnabled

      boolean isCustomPathPluginsEnabled()
    • getCustomDirectoryPlugins

      String getCustomDirectoryPlugins()
    • isPluginsRosterFileEnabled

      boolean isPluginsRosterFileEnabled()
    • getPluginsRosterFile

      String getPluginsRosterFile()
    • isWebSudoDisabled

      boolean isWebSudoDisabled()
    • isI18nReloadBundles

      boolean isI18nReloadBundles()
    • showPerformanceMonitor

      boolean showPerformanceMonitor()
    • isBundledPluginsDisabled

      boolean isBundledPluginsDisabled()
    • isDarkFeaturesDisabled

      boolean isDarkFeaturesDisabled()
    • isXsrfDiagnostics

      boolean isXsrfDiagnostics()
    • isResourceBundleCacheCleaningDisabled

      boolean isResourceBundleCacheCleaningDisabled()