@Internal public class JiraPropertiesImpl extends Object implements JiraProperties
Non-null values are cached. If you need the latest value of the system property, call refresh() before
you access that property. If you are changing a system property wish the changed value to be seen by this class
immediately you need to call setProperty(String, Object) or setProperties(java.util.Properties)
method of this class. Doing this often is a potential performance problem, as Boolean.getBoolean(String a)
is a blocking operation, so you should NOT do this for every SQL statement or Web request etc.
SecurityExceptions and returns null or default values provided.
However, this class will not catch such exceptions when setting system properties.| Constructor and Description |
|---|
JiraPropertiesImpl(PropertiesAccessor propertiesAccessor) |
| Modifier and Type | Method and Description |
|---|---|
Boolean |
getBoolean(String key)
Returns a cached system property as a Boolean.
|
String |
getCustomDirectoryPlugins() |
Integer |
getInteger(String key)
Returns a cached system property as an Integer.
|
Integer |
getInteger(String key,
Integer defaultInteger)
Returns a cached system property as an Integer, or a default value if property is not set.
|
Long |
getLong(String key)
Returns a cached system property as a Long.
|
Long |
getLong(String key,
Long defaultLong)
Returns a cached system property as a Long, or a default value if property is not set.
|
String |
getPluginsRosterFile() |
Properties |
getProperties()
Returns a snapshot of all the set system properties.
|
String |
getProperty(String key)
Returns a cached system property as a String.
|
String |
getProperty(String key,
String defaultString)
Returns a cached system property as a String, or a default value if property is not set.
|
Map<String,String> |
getSanitisedProperties()
Return a copy of the current properties with sensitive properties sanitised.
|
boolean |
isBundledPluginsDisabled() |
boolean |
isContextBatchingDisabled() |
boolean |
isCustomPathPluginsEnabled() |
boolean |
isDarkFeaturesDisabled() |
boolean |
isDecodeMailParameters() |
boolean |
isDevMode() |
boolean |
isI18nReloadBundles() |
boolean |
isPluginsRosterFileEnabled() |
boolean |
isResourceBundleCacheCleaningDisabled() |
boolean |
isSuperBatchingDisabled() |
boolean |
isWebSudoDisabled() |
boolean |
isXsrfDetectionCheckRequired() |
boolean |
isXsrfDiagnostics() |
void |
refresh()
Causes any previously cached values to be invalidated.
|
void |
setProperties(Properties props)
Sets the system properties and invalidates the accessor accordingly.
|
<T> void |
setProperty(String key,
T value)
Sets a system property and invalidates the accessor accordingly, or unsets the property if value is null.
|
boolean |
showPerformanceMonitor() |
void |
unsetProperty(String key)
Unsets a system property and invalidates the accessor accordingly.
|
public JiraPropertiesImpl(PropertiesAccessor propertiesAccessor)
public String getProperty(String key)
This call will not raise SecurityException, it will return null instead.
getProperty in interface JiraPropertieskey - the name of the system property.SecurityException occurs.public String getProperty(String key, String defaultString)
Note that if the property is not set, the accessor will remain unchanged.
This call will not raise SecurityException, it will return defaultString instead.
getProperty in interface JiraPropertieskey - the name of the system property.defaultString - default valueSecurityException occurs.public <T> void setProperty(String key, T value)
Object.toString() called on the value.setProperty in interface JiraPropertieskey - the name of the system property.value - the valuepublic void unsetProperty(String key)
unsetProperty in interface JiraPropertieskey - the name of the system property.public Boolean getBoolean(String key)
This call will not raise SecurityException, it will return false instead.
Because of the way system properties are read by the Boolean class, this method will never return null,
nor it is possible to provide a variant with the default value. See Boolean.getBoolean(String).
You can however use getProperty(String) and convert it to Boolean manually for that desired effect.
getBoolean in interface JiraPropertieskey - the name of the system property.SecurityException occurs.public Integer getInteger(String key)
This call will not raise SecurityException, it will return null instead.
getInteger in interface JiraPropertieskey - the name of the system property.SecurityException occurs.public Integer getInteger(String key, Integer defaultInteger)
Note that if the property is not set, the accessor will remain unchanged.
This call will not raise SecurityException, it will return defaultInteger instead.
getInteger in interface JiraPropertieskey - the name of the system property.defaultInteger - default valueSecurityException occurs.public Long getLong(String key)
This call will not raise SecurityException, it will return null instead.
getLong in interface JiraPropertieskey - the name of the system property.SecurityException occurs.public Long getLong(String key, Long defaultLong)
Note that if the property is not set, the accessor will remain unchanged.
This call will not raise SecurityException, it will return defaultLong instead.
getLong in interface JiraPropertieskey - the name of the system property.defaultLong - default valueSecurityException occurs.public Properties getProperties()
This call will not raise SecurityException, it will return an empty set of properties instead.
getProperties in interface JiraPropertiespublic Map<String,String> getSanitisedProperties()
JiraPropertiesgetSanitisedProperties in interface JiraPropertiespublic void setProperties(Properties props)
setProperties in interface JiraPropertiesprops - the properties to set.System.setProperties(Properties)public void refresh()
JiraPropertiesJiraProperties.setProperty(String, Object), JiraProperties.setProperties(java.util.Properties) or
JiraProperties.unsetProperty(String).refresh in interface JiraPropertiespublic boolean isDevMode()
isDevMode in interface JiraPropertiespublic boolean isXsrfDetectionCheckRequired()
isXsrfDetectionCheckRequired in interface JiraPropertiespublic boolean isSuperBatchingDisabled()
isSuperBatchingDisabled in interface JiraPropertiespublic boolean isContextBatchingDisabled()
isContextBatchingDisabled in interface JiraPropertiespublic boolean isDecodeMailParameters()
isDecodeMailParameters in interface JiraPropertiespublic boolean isCustomPathPluginsEnabled()
isCustomPathPluginsEnabled in interface JiraPropertiespublic String getCustomDirectoryPlugins()
getCustomDirectoryPlugins in interface JiraPropertiespublic boolean isPluginsRosterFileEnabled()
isPluginsRosterFileEnabled in interface JiraPropertiespublic String getPluginsRosterFile()
getPluginsRosterFile in interface JiraPropertiespublic boolean isWebSudoDisabled()
isWebSudoDisabled in interface JiraPropertiespublic boolean isI18nReloadBundles()
isI18nReloadBundles in interface JiraPropertiespublic boolean showPerformanceMonitor()
showPerformanceMonitor in interface JiraPropertiespublic boolean isBundledPluginsDisabled()
isBundledPluginsDisabled in interface JiraPropertiespublic boolean isDarkFeaturesDisabled()
isDarkFeaturesDisabled in interface JiraPropertiespublic boolean isXsrfDiagnostics()
isXsrfDiagnostics in interface JiraPropertiespublic boolean isResourceBundleCacheCleaningDisabled()
isResourceBundleCacheCleaningDisabled in interface JiraPropertiesCopyright © 2002-2023 Atlassian. All Rights Reserved.