public interface ApplicationPropertiesService extends ApplicationModeSupplier
Modifier and Type | Method and Description |
---|---|
void |
deleteMailHostConfiguration()
Remove the mail host configuration.
|
URI |
getBaseUrl()
Retrieves the configured base URL for the instance.
|
String |
getBuildNumber() |
Date |
getBuildTimestamp() |
String |
getBuildVersion() |
String |
getCommitHash() |
DatabaseType |
getDatabaseType() |
String |
getDatabaseVersion() |
String |
getDisplayName()
Gets the display name of the current instance.
|
String |
getJdbcDriver() |
String |
getJdbcDriverVersion() |
String |
getJdbcUrl() |
Locale |
getLocale() |
URI |
getLoginUri(URI redirectUri)
Gets the login page URI for the current instance.
|
MailHostConfiguration |
getMailHostConfiguration()
Retrieves the mail host configuration
|
int |
getMaxCaptchaAttempts() |
ApplicationMode |
getMode() |
String |
getPluginProperty(String propertyName)
Return a value of a property as defined in the applications configuration files.
|
boolean |
getPluginProperty(String propertyName,
boolean defaultValue)
|
double |
getPluginProperty(String propertyName,
double defaultValue)
|
int |
getPluginProperty(String propertyName,
int defaultValue)
|
long |
getPluginProperty(String propertyName,
long defaultValue)
|
String |
getPluginProperty(String propertyName,
String defaultValue)
|
String |
getServerEmailAddress()
Gets the email address used in the 'sender' field for any email notification.
|
String |
getServerId()
Retrieves the server ID used for licensing.
|
boolean |
isAllowPublicSignUp() |
boolean |
isDebugLoggingEnabled() |
boolean |
isDisasterRecovery() |
boolean |
isHttpScmHostingEnabled() |
boolean |
isJmxEnabled() |
boolean |
isProfilingEnabled() |
boolean |
isSetup() |
boolean |
isShowCaptchaOnSignUp() |
void |
setAllowPublicSignUp(boolean publicSignUp)
Sets whether public signup is allowed for external users.
|
void |
setBaseURL(URI baseUrl)
Sets the base URL of the current instance.
|
void |
setDisplayName(String name)
Sets the display name of the current instance.
|
void |
setHttpScmHostingEnabled(boolean enabled)
Sets whether the SCM requests are allowed over HTTP(S).
|
void |
setMailHostConfiguration(MailHostConfiguration mailHostConfiguration)
Sets the mail host configuration, replacing any existing configuration.
|
void |
setMaxCaptchaAttempts(int maxCaptchaAttempts)
Sets the number of failed login attempts before the user is required to enter a CAPTCHA verification.
|
void |
setServerEmailAddress(String emailAddress)
Sets the email address used in the 'sender' field for any email notification.
|
void |
setShowCaptchaOnSignUp(boolean captchaOnSignUp)
Sets whether a CAPTCHA verification is required for signing up.
|
@Nullable URI getBaseUrl()
null
it is guaranteed
to not end with a trailing slash.null
if one has not been configured@Nullable String getDisplayName()
null
if the display name is not configuredvoid setBaseURL(@Nonnull URI baseUrl)
The URL will be persisted without a trailing slash, if present.
Ex: given http://server/stash/
, the property will be saved as http://server/stash
baseUrl
- publicly accessible URL for the current instance@Nonnull URI getLoginUri(URI redirectUri)
redirectUri
- the URI the user should be redirected to after a successful login@Nonnull String getBuildVersion()
void setDisplayName(@Nonnull String name)
name
- display name for the current instance@Nonnull Date getBuildTimestamp()
@Nonnull String getCommitHash()
@Nonnull DatabaseType getDatabaseType()
@Nonnull String getDatabaseVersion()
@Nonnull String getJdbcDriver()
@Nonnull String getJdbcDriverVersion()
"Unknown"
is returned.int getMaxCaptchaAttempts()
void setMaxCaptchaAttempts(int maxCaptchaAttempts)
maxCaptchaAttempts
- maximum number of failed CAPTCHA@Nullable String getServerEmailAddress()
void setServerEmailAddress(String emailAddress)
emailAddress
- sender address for email notifications@Nullable String getServerId()
boolean isAllowPublicSignUp()
void setAllowPublicSignUp(boolean publicSignUp)
publicSignUp
- whether to allow public signupboolean isDisasterRecovery()
boolean isDebugLoggingEnabled()
boolean isProfilingEnabled()
boolean isHttpScmHostingEnabled()
boolean isJmxEnabled()
boolean isShowCaptchaOnSignUp()
void setHttpScmHostingEnabled(boolean enabled)
enabled
- whether to enable HTTP(S) accessvoid setShowCaptchaOnSignUp(boolean captchaOnSignUp)
captchaOnSignUp
- whether to enable CAPTCHA on signupboolean isSetup()
@Nonnull ApplicationMode getMode()
getMode
in interface ApplicationModeSupplier
mode
of this instance@Nullable MailHostConfiguration getMailHostConfiguration()
null
if undefined.void setMailHostConfiguration(@Nonnull MailHostConfiguration mailHostConfiguration)
mailHostConfiguration
- the configuration to storevoid deleteMailHostConfiguration()
@Nullable String getPluginProperty(@Nonnull String propertyName)
This method should be used only by plugins.
propertyName
- name of the property, which must start with "plugin."IllegalArgumentException
- if the property name is null,
or if the property name does not start with "plugin."@Nullable String getPluginProperty(@Nonnull String propertyName, @Nullable String defaultValue)
propertyName
- name of the propertydefaultValue
- the default value to return if it is not presentint getPluginProperty(@Nonnull String propertyName, int defaultValue) throws NumberFormatException
propertyName
- name of the propertydefaultValue
- the default value to return if it is not presentNumberFormatException
long getPluginProperty(@Nonnull String propertyName, long defaultValue) throws NumberFormatException
propertyName
- name of the propertydefaultValue
- the default value to return if it is not presentNumberFormatException
boolean getPluginProperty(@Nonnull String propertyName, boolean defaultValue)
propertyName
- name of the propertydefaultValue
- the default value to return if it is not presentdouble getPluginProperty(@Nonnull String propertyName, double defaultValue) throws NumberFormatException
propertyName
- name of the propertydefaultValue
- the default value to return if it is not presentNumberFormatException
Copyright © 2022 Atlassian. All rights reserved.