Interface PropertyManager
- All Known Subinterfaces:
 InternalPropertyManager
- All Known Implementing Classes:
 PropertyManagerGeneric
public interface PropertyManager
API for storing and retrieving Crowd server properties.
- 
Method Summary
Modifier and TypeMethodDescriptionvoidGenerates and stores a DES key for DES encoded passwords.Retrieves the audit log configurationbooleangetBoolean(String property, boolean defaultValue) Gets a boolean property.This method returns the current build number for Crowd from the datastore.intDeprecated.intGets an integer property.Deprecated.As of release 3.3, useMailConfigurationService.getMailConfiguration()getOptionalProperty(String name) Retrieves an arbitrary property by name.getProperty(String name) Retrieves an arbitrary property by name.longDeprecated.As of release 3.3.0, usecom.atlassian.crowd.manager.mail.MailConfigurationService#getConfiguration()Deprecated.As of release 2.1, usegetProperty(String)Gets a string property.Retrieves a String that contains a list of proxy servers we trust to correctly set the X-Forwarded-For flag.booleanbooleanDeprecated.this is no longer configurable in Crowd and always returnstruebooleanShould the client IP address be included as a validation factor?booleanDeprecated.UsesetCookieConfiguration(CookieConfiguration)instead.booleanShould public services be used for user avatars?booleanWill return true if the Crowd instance is using database token storage for authenticationToken's otherwise assume we are using in-memoryvoidRemoves Look and Feel configurationvoidremoveProperty(String name) Will attempt to remove a property from the datastorevoidSaves backup configurationvoidsetAuditLogConfiguration(AuditLogConfiguration auditLogConfiguration) Persists the audit log configurationvoidsetBaseUrl(URI url) Sets the base URL for this Crowd application instancevoidsetBuildNumber(Integer buildNumber) Will set the buildNumber for the current release of Crowd.voidsetCacheEnabled(boolean enabled) voidsetCookieConfiguration(CookieConfiguration cookieConfiguration) Updates the configuration of Crowd's cookie-based SSOvoidsetCurrentLicenseResourceTotal(int total) voidsetDeploymentTitle(String title) voidDeprecated.UsesetCookieConfiguration(CookieConfiguration)instead.voidsetGzipEnabled(boolean gzip) Deprecated.this is no longer configurable in Crowd and this method has no effect.voidsetIncludeIpAddressInValidationFactors(boolean includeIpAddressInValidationFactors) voidsetLookAndFeelConfiguration(LookAndFeelConfiguration lookAndFeelConfiguration, ImageInfo updatedLogoInfo) Sets Look and Feel configurationvoidsetNotificationEmail(String notificationEmail) Deprecated.As of release 3.3, usecom.atlassian.crowd.manager.mail.MailConfigurationService#saveConfiguration()voidsetPrivateKeyCertificateToSign(long privateKeyCertificatePairId) Sets ID of private key/certificate pair used to sign assertions in SAMLvoidsetProperty(String name, String value) Sets an arbitrary property.voidsetSecureCookie(boolean secure) Deprecated.UsesetCookieConfiguration(CookieConfiguration)instead.voidsetSessionTime(long time) voidsetSMTPServer(SMTPServer server) Deprecated.As of release 3.3.0, usecom.atlassian.crowd.manager.mail.MailConfigurationService#saveConfiguration()voidsetSMTPTemplate(String template) Deprecated.As of release 2.1, usesetProperty(String, String)voidsetTrustedProxyServers(String proxyServers) Persists a String containing a list of proxy servers we trust to correctly set the X-Forwarded-For flag.voidsetUseWebAvatars(boolean useWebAvatars) voidsetUsingDatabaseTokenStorage(boolean usingDatabaseTokenStorage) Will set a property to state that this crowd instance is using database token storage, otherwise assume we are using in-memory 
- 
Method Details
- 
getDeploymentTitle
- Returns:
 - deployment title.
 - Throws:
 PropertyManagerException- property does not exist.
 - 
setDeploymentTitle
- Parameters:
 title- deployment title.
 - 
getDomain
Deprecated.UsegetCookieConfiguration()instead. Since v3.0.Will return the Domain property from the datastore or null if the domain has not been set.- Returns:
 - domain or null
 
 - 
setDomain
Deprecated.UsesetCookieConfiguration(CookieConfiguration)instead. Since v3.0.- Parameters:
 domain- SSO cookie domain.
 - 
isSecureCookie
Deprecated.UsesetCookieConfiguration(CookieConfiguration)instead. Since v3.0.- Returns:
 trueif the "secure" flag should be set on the SSO cookie.
 - 
setSecureCookie
Deprecated.UsesetCookieConfiguration(CookieConfiguration)instead. Since v3.0.- Parameters:
 secure-trueif the "secure" flag should be set on the SSO cookie.
 - 
setCacheEnabled
void setCacheEnabled(boolean enabled) - Parameters:
 enabled-trueif application authorisation caching should be used on the server-side.
 - 
isCacheEnabled
boolean isCacheEnabled()- Returns:
 trueif application authorisation caching is used on the server-side.
 - 
getSessionTime
long getSessionTime()- Returns:
 - number of minutes the session is valid.
 
 - 
setSessionTime
void setSessionTime(long time) - Parameters:
 time- number of minutes the session is valid.
 - 
getSMTPServer
Deprecated.As of release 3.3.0, usecom.atlassian.crowd.manager.mail.MailConfigurationService#getConfiguration()- Returns:
 - SMTP server config.
 - Throws:
 PropertyManagerException- property does not exist.
 - 
setSMTPServer
Deprecated.As of release 3.3.0, usecom.atlassian.crowd.manager.mail.MailConfigurationService#saveConfiguration()- Parameters:
 server- SMTP server config.
 - 
getDesEncryptionKey
- Returns:
 - DES key for DES encoded passwords.
 - Throws:
 PropertyManagerException- property does not exist.
 - 
generateDesEncryptionKey
Generates and stores a DES key for DES encoded passwords.- Throws:
 PropertyManagerException- DES algorithm does not exist.
 - 
setSMTPTemplate
Deprecated.As of release 2.1, usesetProperty(String, String)- Parameters:
 template- mail template.
 - 
getSMTPTemplate
Deprecated.As of release 2.1, usegetProperty(String)- Returns:
 - mail template.
 - Throws:
 PropertyManagerException- property does not exist.
 - 
setCurrentLicenseResourceTotal
void setCurrentLicenseResourceTotal(int total) - Parameters:
 total- license resource total.
 - 
getCurrentLicenseResourceTotal
int getCurrentLicenseResourceTotal()- Returns:
 - license resource total.
 
 - 
setNotificationEmail
Deprecated.As of release 3.3, usecom.atlassian.crowd.manager.mail.MailConfigurationService#saveConfiguration()- Parameters:
 notificationEmail- notification email.
 - 
getNotificationEmail
Deprecated.As of release 3.3, useMailConfigurationService.getMailConfiguration()- Returns:
 - notification email.
 - Throws:
 PropertyManagerException- property does not exist
 - 
isGzipEnabled
Deprecated.this is no longer configurable in Crowd and always returnstrue- Returns:
 trueif GZip compression should be used.- Throws:
 PropertyManagerException- property does not exist.
 - 
setGzipEnabled
Deprecated.this is no longer configurable in Crowd and this method has no effect.- Parameters:
 gzip-trueif GZip compression should be used.
 - 
getBuildNumber
This method returns the current build number for Crowd from the datastore. This BuildNumber may not be the same as the build number inBuildUtils.BUILD_NUMBERsince 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.- Returns:
 - an Integer representing the current build number in the database.
 - Throws:
 PropertyManagerException- if we fail to find the buildNumber
 - 
setBuildNumber
Will set the buildNumber for the current release of Crowd.- Parameters:
 buildNumber- the buildNumber to set in the database
 - 
getTrustedProxyServers
Retrieves a String that contains a list of proxy servers we trust to correctly set the X-Forwarded-For flag. Internal format of this string is the responsibility of TrustedProxyManagerImpl.- Returns:
 - list of proxy servers as a string.
 - Throws:
 PropertyManagerException- If the list of proxy servers could not be found.
 - 
setTrustedProxyServers
Persists a String containing a list of proxy servers we trust to correctly set the X-Forwarded-For flag. Internal format of this string is the responsibility of TrustedProxyManagerImpl.- Parameters:
 proxyServers- proxy servers.
 - 
setAuditLogConfiguration
Persists the audit log configuration- Parameters:
 auditLogConfiguration- new configuration
 - 
getAuditLogConfiguration
AuditLogConfiguration getAuditLogConfiguration()Retrieves the audit log configuration- Returns:
 - audit log configuration, default if not found
 
 - 
isUsingDatabaseTokenStorage
Will return true if the Crowd instance is using database token storage for authenticationToken's otherwise assume we are using in-memory- Returns:
 - true if database token storage is being used.
 - Throws:
 PropertyManagerException- property does not exist.
 - 
setUsingDatabaseTokenStorage
void setUsingDatabaseTokenStorage(boolean usingDatabaseTokenStorage) Will set a property to state that this crowd instance is using database token storage, otherwise assume we are using in-memory- Parameters:
 usingDatabaseTokenStorage- true if you are switching to in-memory token storage
 - 
removeProperty
Will attempt to remove a property from the datastore- Parameters:
 name- the name of the property.
 - 
getProperty
Retrieves an arbitrary property by name.- Parameters:
 name- name of property.- Returns:
 - value.
 - Throws:
 ObjectNotFoundException- property does not exist.
 - 
getOptionalProperty
Retrieves an arbitrary property by name.- Parameters:
 name- name of property.- Returns:
 - value if found, none otherwise
 
 - 
setProperty
Sets an arbitrary property.- Parameters:
 name- name of property.value- value.
 - 
isIncludeIpAddressInValidationFactors
boolean isIncludeIpAddressInValidationFactors()Should the client IP address be included as a validation factor? - 
setIncludeIpAddressInValidationFactors
void setIncludeIpAddressInValidationFactors(boolean includeIpAddressInValidationFactors)  - 
isUseWebAvatars
boolean isUseWebAvatars()Should public services be used for user avatars? - 
setUseWebAvatars
void setUseWebAvatars(boolean useWebAvatars)  - 
getCookieConfiguration
CookieConfiguration getCookieConfiguration()- Returns:
 - the current configuration of Crowd's cookie-based SSO
 - Since:
 - v3.0
 
 - 
setCookieConfiguration
Updates the configuration of Crowd's cookie-based SSO- Parameters:
 cookieConfiguration- the configuration to set, will replace the existing configuration- Since:
 - v3.0
 
 - 
getString
Gets a string property. If the property is not defined, return the supplied default value.- Parameters:
 property- a property namedefaultValue- the default value to use if the property does not exist- Returns:
 - the value of the property, or defaultValue if the property didn't exist
 
 - 
getBoolean
Gets a boolean property. If the property is not defined, return the supplied default value.- Parameters:
 property- a property namedefaultValue- the default value to use if the property does not exist- Returns:
 - the value of the property, or defaultValue if the property didn't exist
 
 - 
getInt
Gets an integer property. If the property is not defined, or does not contain a valid integer, return the supplied default value.- Parameters:
 property- a property namedefaultValue- the default value to use if the property does not exist or is invalid- Returns:
 - the value of the property, or defaultValue if the property didn't exist or was corrupted
 
 - 
setBaseUrl
Sets the base URL for this Crowd application instance- Parameters:
 url- the base url to set, should be a proper absolute URL
 - 
getBaseUrl
- Returns:
 - the current base url for this Crowd application instance
 - Throws:
 PropertyManagerException- if the property is not configured correctly- See Also:
 - 
ApplicationProperties.getBaseUrl(com.atlassian.sal.api.UrlMode)
 
 - 
getPrivateKeyCertificatePairToSign
- Returns:
 - ID of private key/certificate used to sign assertions in SAML if found, none otherwise
 
 - 
setPrivateKeyCertificateToSign
void setPrivateKeyCertificateToSign(long privateKeyCertificatePairId) Sets ID of private key/certificate pair used to sign assertions in SAML- Parameters:
 privateKeyCertificatePairId- ID of private key/certificate pair to save
 - 
getBackupConfiguration
BackupConfiguration getBackupConfiguration()- Returns:
 - Backup configuration
 
 - 
saveBackupConfiguration
Saves backup configuration- Parameters:
 config- configuration of backup to save
 - 
setLookAndFeelConfiguration
void setLookAndFeelConfiguration(LookAndFeelConfiguration lookAndFeelConfiguration, ImageInfo updatedLogoInfo) throws PropertyManagerException Sets Look and Feel configuration- Parameters:
 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.- Throws:
 PropertyManagerException- if there was an error while saving configuration
 - 
getLookAndFeelConfiguration
- Returns:
 - Look and Feel configuration if configured, none otherwise
 - Throws:
 PropertyManagerException- if there was an error while fetching configuration
 - 
removeLookAndFeelConfiguration
Removes Look and Feel configuration- Throws:
 PropertyManagerException- if there was an error while removing configuration
 - 
getLogoImage
- Returns:
 - logo image if configured, none otherwise
 - Throws:
 PropertyManagerException- if there was an error while fetching a logo
 
 - 
 
getCookieConfiguration()instead.