@Transactional public class PropertyManagerGeneric extends Object implements InternalPropertyManager
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SCHEDULED_BACKUP_HOUR |
static int |
DEFAULT_SCHEDULED_BACKUP_MINUTE |
static String |
LOGO_IMAGE_KEY |
Constructor and Description |
---|
PropertyManagerGeneric(PropertyDAO propertyDAO,
com.atlassian.event.api.EventPublisher eventPublisher) |
Modifier and Type | Method and Description |
---|---|
void |
generateDesEncryptionKey()
Generates and stores a DES key for DES encoded passwords.
|
AuditLogConfiguration |
getAuditLogConfiguration()
Retrieves the audit log configuration
|
BackupConfiguration |
getBackupConfiguration() |
URI |
getBaseUrl() |
boolean |
getBoolean(String property,
boolean defaultValue)
Gets a boolean property.
|
Integer |
getBuildNumber()
This method returns the current build number for Crowd from the datastore.
|
CookieConfiguration |
getCookieConfiguration() |
int |
getCurrentLicenseResourceTotal() |
String |
getDeploymentTitle() |
Key |
getDesEncryptionKey() |
String |
getDomain()
Will return the Domain property from the datastore or null if the domain has
not been set.
|
int |
getInt(String property,
int defaultValue)
Gets an integer property.
|
int |
getIntOrThrowIllegalArgumentException(String property,
int defaultValue) |
Optional<ImageInfo> |
getLogoImage() |
Optional<LookAndFeelConfiguration> |
getLookAndFeelConfiguration() |
String |
getNotificationEmail() |
List<String> |
getNotificationEmails() |
Optional<String> |
getOptionalProperty(String name)
Retrieves an arbitrary property by name.
|
Optional<Long> |
getPrivateKeyCertificatePairToSign() |
String |
getProperty(String name)
Retrieves an arbitrary property by name.
|
protected Property |
getPropertyObject(String name) |
CrowdSpecificRememberMeSettings |
getRememberMeConfiguration()
Retrieves remember me configuration
|
long |
getSessionTime() |
SMTPServer |
getSMTPServer() |
String |
getSMTPTemplate()
Deprecated.
|
String |
getString(String property,
String defaultValue)
Gets a string property.
|
String |
getTrustedProxyServers()
Retrieves a String that contains a list of proxy servers we trust to correctly set the X-Forwarded-For flag.
|
boolean |
isCacheEnabled() |
boolean |
isGzipEnabled() |
boolean |
isIncludeIpAddressInValidationFactors()
Should the client IP address be included as a validation factor?
|
boolean |
isSecureCookie() |
boolean |
isUseWebAvatars()
Should public services be used for user avatars?
|
boolean |
isUsingDatabaseTokenStorage()
Will return true if the Crowd instance is using database token storage for authentication
Token 's
otherwise assume we are using in-memory |
void |
removeLookAndFeelConfiguration()
Removes Look and Feel configuration
|
void |
removeProperty(String name)
Will attempt to remove a property from the datastore
|
void |
saveBackupConfiguration(BackupConfiguration config)
Saves backup configuration
|
void |
setAuditLogConfiguration(AuditLogConfiguration newConfiguration)
Persists the audit log configuration
|
void |
setBaseUrl(URI url)
Sets the base URL for this Crowd application instance
|
void |
setBuildNumber(Integer buildNumber)
Will set the buildNumber for the current release of Crowd.
|
void |
setCacheEnabled(boolean enabled) |
void |
setCookieConfiguration(CookieConfiguration cookieConfiguration)
Updates the configuration of Crowd's cookie-based SSO
|
void |
setCurrentLicenseResourceTotal(int total) |
void |
setDeploymentTitle(String title) |
void |
setDomain(String domain) |
void |
setGzipEnabled(boolean gzip) |
void |
setIncludeIpAddressInValidationFactors(boolean includeIpAddressInValidationFactors) |
void |
setLookAndFeelConfiguration(LookAndFeelConfiguration lookAndFeelConfiguration,
ImageInfo updatedLogoInfo)
Sets Look and Feel configuration
|
void |
setNotificationEmail(String notificationEmail) |
void |
setNotificationEmails(List<String> serverAlertAddresses)
Sets notification emails.
|
void |
setPrivateKeyCertificateToSign(long privateKeyCertificatePairId)
Sets ID of private key/certificate pair used to sign assertions in SAML
|
void |
setProperty(String name,
String value)
Sets an arbitrary property.
|
void |
setRememberMeConfiguration(CrowdSpecificRememberMeSettings configuration)
Sets remember me configuration
|
void |
setSecureCookie(boolean secure) |
void |
setSessionTime(long time) |
void |
setSMTPServer(SMTPServer server) |
void |
setSMTPTemplate(String template)
Deprecated.
|
void |
setTrustedProxyServers(String proxyServers)
Persists a String containing a list of proxy servers we trust to correctly set the X-Forwarded-For flag.
|
void |
setUseWebAvatars(boolean useWebAvatars) |
void |
setUsingDatabaseTokenStorage(boolean isUsingDatabaseTokenStorage)
Will set a property to state that this crowd instance is using database token storage, otherwise assume we are using in-memory
|
public static final int DEFAULT_SCHEDULED_BACKUP_HOUR
public static final int DEFAULT_SCHEDULED_BACKUP_MINUTE
public static final String LOGO_IMAGE_KEY
public PropertyManagerGeneric(PropertyDAO propertyDAO, com.atlassian.event.api.EventPublisher eventPublisher)
public String getDeploymentTitle() throws PropertyManagerException
getDeploymentTitle
in interface PropertyManager
PropertyManagerException
- property does not exist.public void setDeploymentTitle(String title)
setDeploymentTitle
in interface PropertyManager
title
- deployment title.public String getDomain()
PropertyManager
getDomain
in interface PropertyManager
public void setDomain(String domain)
setDomain
in interface PropertyManager
domain
- SSO cookie domain.public boolean isSecureCookie()
isSecureCookie
in interface PropertyManager
true
if the "secure" flag should be set on the SSO cookie.public void setSecureCookie(boolean secure)
setSecureCookie
in interface PropertyManager
secure
- true
if the "secure" flag should be set on the SSO cookie.public void setCacheEnabled(boolean enabled)
setCacheEnabled
in interface PropertyManager
enabled
- true
if application authorisation caching should be used on the server-side.public boolean isCacheEnabled()
isCacheEnabled
in interface PropertyManager
true
if application authorisation caching is used on the server-side.public long getSessionTime()
getSessionTime
in interface PropertyManager
public void setSessionTime(long time)
setSessionTime
in interface PropertyManager
time
- number of minutes the session is valid.public SMTPServer getSMTPServer() throws PropertyManagerException
getSMTPServer
in interface PropertyManager
PropertyManagerException
- property does not exist.public void setSMTPServer(SMTPServer server)
setSMTPServer
in interface PropertyManager
server
- SMTP server config.public Key getDesEncryptionKey() throws PropertyManagerException
getDesEncryptionKey
in interface PropertyManager
PropertyManagerException
- property does not exist.public void generateDesEncryptionKey() throws PropertyManagerException
PropertyManager
generateDesEncryptionKey
in interface PropertyManager
PropertyManagerException
- DES algorithm does not exist.@Deprecated public void setSMTPTemplate(String template)
setSMTPTemplate
in interface PropertyManager
template
- mail template.@Deprecated public String getSMTPTemplate() throws PropertyManagerException
getSMTPTemplate
in interface PropertyManager
PropertyManagerException
- property does not exist.public void setCurrentLicenseResourceTotal(int total)
setCurrentLicenseResourceTotal
in interface PropertyManager
total
- license resource total.public int getCurrentLicenseResourceTotal()
getCurrentLicenseResourceTotal
in interface PropertyManager
public void setNotificationEmail(String notificationEmail)
setNotificationEmail
in interface PropertyManager
notificationEmail
- notification email.public void setNotificationEmails(List<String> serverAlertAddresses)
InternalPropertyManager
setNotificationEmails
in interface InternalPropertyManager
serverAlertAddresses
- list of notification emails.public String getNotificationEmail() throws PropertyManagerException
getNotificationEmail
in interface PropertyManager
PropertyManagerException
- property does not existpublic List<String> getNotificationEmails() throws PropertyManagerException
getNotificationEmails
in interface InternalPropertyManager
PropertyManagerException
- property does not existpublic boolean isGzipEnabled() throws PropertyManagerException
isGzipEnabled
in interface PropertyManager
true
if GZip compression should be used.PropertyManagerException
- property does not exist.public void setGzipEnabled(boolean gzip)
setGzipEnabled
in interface PropertyManager
gzip
- true
if GZip compression should be used.public Integer getBuildNumber() throws PropertyManagerException
PropertyManager
BuildUtils.BUILD_NUMBER
since this number is for the
current release of Crowd, while the number in the database may still be set to a previous version if the UpgradeManager
has not been run.getBuildNumber
in interface PropertyManager
PropertyManagerException
- if we fail to find the buildNumberpublic void setBuildNumber(Integer buildNumber)
PropertyManager
setBuildNumber
in interface PropertyManager
buildNumber
- the buildNumber to set in the databasepublic String getTrustedProxyServers() throws PropertyManagerException
TrustedProxyManager
.getTrustedProxyServers
in interface PropertyManager
PropertyManagerException
- If the list of proxy servers could not be found.public void setTrustedProxyServers(String proxyServers)
TrustedProxyManager
.setTrustedProxyServers
in interface PropertyManager
proxyServers
- proxy servers.org.springframework.dao.DataAccessException
- If the list of proxy servers could not be saved.public void setAuditLogConfiguration(AuditLogConfiguration newConfiguration)
PropertyManager
setAuditLogConfiguration
in interface PropertyManager
newConfiguration
- new configurationpublic AuditLogConfiguration getAuditLogConfiguration()
PropertyManager
getAuditLogConfiguration
in interface PropertyManager
public boolean isUsingDatabaseTokenStorage()
PropertyManager
Token
's
otherwise assume we are using in-memoryisUsingDatabaseTokenStorage
in interface PropertyManager
public void setUsingDatabaseTokenStorage(boolean isUsingDatabaseTokenStorage)
PropertyManager
setUsingDatabaseTokenStorage
in interface PropertyManager
isUsingDatabaseTokenStorage
- true if you are switching to in-memory token storagepublic boolean isIncludeIpAddressInValidationFactors()
PropertyManager
isIncludeIpAddressInValidationFactors
in interface PropertyManager
public boolean isUseWebAvatars()
PropertyManager
isUseWebAvatars
in interface PropertyManager
public void setUseWebAvatars(boolean useWebAvatars)
setUseWebAvatars
in interface PropertyManager
public CookieConfiguration getCookieConfiguration()
getCookieConfiguration
in interface PropertyManager
public void setCookieConfiguration(CookieConfiguration cookieConfiguration)
PropertyManager
setCookieConfiguration
in interface PropertyManager
cookieConfiguration
- the configuration to set, will replace the existing configurationpublic void setIncludeIpAddressInValidationFactors(boolean includeIpAddressInValidationFactors)
setIncludeIpAddressInValidationFactors
in interface PropertyManager
public void setRememberMeConfiguration(CrowdSpecificRememberMeSettings configuration)
InternalPropertyManager
setRememberMeConfiguration
in interface InternalPropertyManager
configuration
- new configurationpublic CrowdSpecificRememberMeSettings getRememberMeConfiguration()
InternalPropertyManager
getRememberMeConfiguration
in interface InternalPropertyManager
public void removeProperty(String name)
PropertyManager
removeProperty
in interface PropertyManager
name
- the name of the property.protected Property getPropertyObject(String name) throws ObjectNotFoundException
ObjectNotFoundException
public String getProperty(String name) throws ObjectNotFoundException
PropertyManager
getProperty
in interface PropertyManager
name
- name of property.ObjectNotFoundException
- property does not exist.public Optional<String> getOptionalProperty(String name)
PropertyManager
getOptionalProperty
in interface PropertyManager
name
- name of property.public void setProperty(String name, String value)
PropertyManager
setProperty
in interface PropertyManager
name
- name of property.value
- value.public String getString(String property, String defaultValue)
PropertyManager
getString
in interface PropertyManager
property
- a property namedefaultValue
- the default value to use if the property does not existpublic boolean getBoolean(String property, boolean defaultValue)
PropertyManager
getBoolean
in interface PropertyManager
property
- a property namedefaultValue
- the default value to use if the property does not existpublic int getInt(String property, int defaultValue)
PropertyManager
getInt
in interface PropertyManager
property
- a property namedefaultValue
- the default value to use if the property does not exist or is invalidpublic int getIntOrThrowIllegalArgumentException(String property, int defaultValue)
public void setBaseUrl(URI url)
PropertyManager
setBaseUrl
in interface PropertyManager
url
- the base url to set, should be a proper absolute URLpublic URI getBaseUrl() throws PropertyManagerException
getBaseUrl
in interface PropertyManager
PropertyManagerException
- if the property is not configured correctlyApplicationProperties.getBaseUrl(com.atlassian.sal.api.UrlMode)
public Optional<Long> getPrivateKeyCertificatePairToSign()
getPrivateKeyCertificatePairToSign
in interface PropertyManager
public void setPrivateKeyCertificateToSign(long privateKeyCertificatePairId)
PropertyManager
setPrivateKeyCertificateToSign
in interface PropertyManager
privateKeyCertificatePairId
- ID of private key/certificate pair to savepublic BackupConfiguration getBackupConfiguration()
getBackupConfiguration
in interface PropertyManager
public void saveBackupConfiguration(BackupConfiguration config)
PropertyManager
saveBackupConfiguration
in interface PropertyManager
config
- configuration of backup to save@Nonnull public Optional<LookAndFeelConfiguration> getLookAndFeelConfiguration() throws PropertyManagerException
getLookAndFeelConfiguration
in interface PropertyManager
PropertyManagerException
- if there was an error while fetching configurationpublic void setLookAndFeelConfiguration(LookAndFeelConfiguration lookAndFeelConfiguration, ImageInfo updatedLogoInfo) throws PropertyManagerException
PropertyManager
setLookAndFeelConfiguration
in interface PropertyManager
lookAndFeelConfiguration
- look and feel configurationupdatedLogoInfo
- information about custom logo. If custom logo was already set
and new value is not null then old logo will be overridden by new one.PropertyManagerException
- if there was an error while saving configurationpublic void removeLookAndFeelConfiguration() throws PropertyManagerException
PropertyManager
removeLookAndFeelConfiguration
in interface PropertyManager
PropertyManagerException
- if there was an error while removing configurationpublic Optional<ImageInfo> getLogoImage() throws PropertyManagerException
getLogoImage
in interface PropertyManager
PropertyManagerException
- if there was an error while fetching a logoCopyright © 2021 Atlassian. All rights reserved.