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:
- Injected through this interface,
-
JiraSystemProperties.getInstance()
- Since:
- v6.1
-
Method Summary
Modifier and TypeMethodDescriptiongetBoolean
(String key) Retrieves a system property of the given name as a boolean.getInteger
(String key) Retrieves a system property of the given name as an 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.Retrieves a system property of the given name as a long.Retrieves a system property of the given name as a long, with a default value to be returned if property is not set.Retrieves all system properties as a properties object.getProperty
(String key) Retrieves a system property of the given namegetProperty
(String key, String defaultString) Retrieves a system property of the given name, with a default value to be returned if property is not set.Return a copy of the current properties with sensitive properties sanitised.boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
void
refresh()
Causes any previously cached values to be invalidated.void
setProperties
(Properties props) Sets the given properties as system properties.<T> void
setProperty
(String key, T value) Sets the key-value pair into the system properties.boolean
void
unsetProperty
(String key) Removes an entry in system properties under the given key.
-
Method Details
-
getProperty
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
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
Sets the key-value pair into the system properties. The value will be set as string using theObject.toString()
method- Parameters:
key
- the name of the propertyvalue
- the value of the property, stored as a String.
-
unsetProperty
Removes an entry in system properties under the given key.- Parameters:
key
- the name of the property to be removed.
-
getBoolean
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
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
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
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
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
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
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 thansetProperty(String, Object)
,setProperties(java.util.Properties)
orunsetProperty(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()
-