Class PropertyManagerGeneric
java.lang.Object
com.atlassian.crowd.manager.property.PropertyManagerGeneric
- All Implemented Interfaces:
InternalPropertyManager,PropertyManager
@Transactional
public class PropertyManagerGeneric
extends Object
implements InternalPropertyManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final Stringstatic final Stringstatic final intstatic final Set<LookAndFeelConstants.ImageType> -
Constructor Summary
ConstructorsConstructorDescriptionPropertyManagerGeneric(PropertyDAO propertyDAO, com.atlassian.event.api.EventPublisher eventPublisher) -
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.intWill return the Domain property from the datastore or null if the domain has not been set.intGets an integer property.intgetIntOrThrowIllegalArgumentException(String property, int defaultValue) getOptionalProperty(String name) Retrieves an arbitrary property by name.getProperty(String name) Retrieves an arbitrary property by name.protected PropertygetPropertyObject(String name) Retrieves remember me configurationlongDeprecated.Gets a string property.Retrieves a String that contains a list of proxy servers we trust to correctly set the X-Forwarded-For flag.booleanbooleanbooleanShould the client IP address be included as a validation factor?booleanbooleanShould 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 newConfiguration) 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) voidvoidsetGzipEnabled(boolean gzip) voidsetIncludeIpAddressInValidationFactors(boolean includeIpAddressInValidationFactors) voidsetLookAndFeelConfiguration(LookAndFeelConfiguration lookAndFeelConfiguration, ImageInfo updatedLogoInfo) Sets Look and Feel configurationvoidsetNotificationEmail(String notificationEmail) voidsetNotificationEmails(List<String> serverAlertAddresses) Sets notification emails.voidsetPrivateKeyCertificateToSign(long privateKeyCertificatePairId) Sets ID of private key/certificate pair used to sign assertions in SAMLvoidsetProperty(String name, String value) Sets an arbitrary property.voidsetRememberMeConfiguration(CrowdSpecificRememberMeSettings configuration) Sets remember me configurationvoidsetSecureCookie(boolean secure) voidsetSessionTime(long time) voidsetSMTPServer(SMTPServer server) voidsetSMTPTemplate(String template) Deprecated.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 isUsingDatabaseTokenStorage) Will set a property to state that this crowd instance is using database token storage, otherwise assume we are using in-memory
-
Field Details
-
DEFAULT_SCHEDULED_BACKUP_HOUR
public static final int DEFAULT_SCHEDULED_BACKUP_HOUR- See Also:
-
DEFAULT_SCHEDULED_BACKUP_MINUTE
public static final int DEFAULT_SCHEDULED_BACKUP_MINUTE- See Also:
-
SUPPORTED_LOGO_TYPES
-
MAX_LOGO_SIZE_IN_BYTES
public static final int MAX_LOGO_SIZE_IN_BYTES- See Also:
-
LOGO_IMAGE_KEY
- See Also:
-
IMAGE_TOO_LARGE_ERROR_MESSAGE
- See Also:
-
-
Constructor Details
-
PropertyManagerGeneric
public PropertyManagerGeneric(PropertyDAO propertyDAO, com.atlassian.event.api.EventPublisher eventPublisher)
-
-
Method Details
-
getDeploymentTitle
- Specified by:
getDeploymentTitlein interfacePropertyManager- Returns:
- deployment title.
- Throws:
PropertyManagerException- property does not exist.
-
setDeploymentTitle
- Specified by:
setDeploymentTitlein interfacePropertyManager- Parameters:
title- deployment title.
-
getDomain
Description copied from interface:PropertyManagerWill return the Domain property from the datastore or null if the domain has not been set.- Specified by:
getDomainin interfacePropertyManager- Returns:
- domain or null
-
setDomain
- Specified by:
setDomainin interfacePropertyManager- Parameters:
domain- SSO cookie domain.
-
isSecureCookie
public boolean isSecureCookie()- Specified by:
isSecureCookiein interfacePropertyManager- Returns:
trueif the "secure" flag should be set on the SSO cookie.
-
setSecureCookie
public void setSecureCookie(boolean secure) - Specified by:
setSecureCookiein interfacePropertyManager- Parameters:
secure-trueif the "secure" flag should be set on the SSO cookie.
-
setCacheEnabled
public void setCacheEnabled(boolean enabled) - Specified by:
setCacheEnabledin interfacePropertyManager- Parameters:
enabled-trueif application authorisation caching should be used on the server-side.
-
isCacheEnabled
public boolean isCacheEnabled()- Specified by:
isCacheEnabledin interfacePropertyManager- Returns:
trueif application authorisation caching is used on the server-side.
-
getSessionTime
public long getSessionTime()- Specified by:
getSessionTimein interfacePropertyManager- Returns:
- number of minutes the session is valid.
-
setSessionTime
public void setSessionTime(long time) - Specified by:
setSessionTimein interfacePropertyManager- Parameters:
time- number of minutes the session is valid.
-
getSMTPServer
- Specified by:
getSMTPServerin interfacePropertyManager- Returns:
- SMTP server config.
- Throws:
PropertyManagerException- property does not exist.
-
setSMTPServer
- Specified by:
setSMTPServerin interfacePropertyManager- Parameters:
server- SMTP server config.
-
getDesEncryptionKey
- Specified by:
getDesEncryptionKeyin interfacePropertyManager- Returns:
- DES key for DES encoded passwords.
- Throws:
PropertyManagerException- property does not exist.
-
generateDesEncryptionKey
Description copied from interface:PropertyManagerGenerates and stores a DES key for DES encoded passwords.- Specified by:
generateDesEncryptionKeyin interfacePropertyManager- Throws:
PropertyManagerException- DES algorithm does not exist.
-
setSMTPTemplate
Deprecated.- Specified by:
setSMTPTemplatein interfacePropertyManager- Parameters:
template- mail template.
-
getSMTPTemplate
Deprecated.- Specified by:
getSMTPTemplatein interfacePropertyManager- Returns:
- mail template.
- Throws:
PropertyManagerException- property does not exist.
-
setCurrentLicenseResourceTotal
public void setCurrentLicenseResourceTotal(int total) - Specified by:
setCurrentLicenseResourceTotalin interfacePropertyManager- Parameters:
total- license resource total.
-
getCurrentLicenseResourceTotal
public int getCurrentLicenseResourceTotal()- Specified by:
getCurrentLicenseResourceTotalin interfacePropertyManager- Returns:
- license resource total.
-
setNotificationEmail
- Specified by:
setNotificationEmailin interfacePropertyManager- Parameters:
notificationEmail- notification email.
-
setNotificationEmails
Description copied from interface:InternalPropertyManagerSets notification emails.- Specified by:
setNotificationEmailsin interfaceInternalPropertyManager- Parameters:
serverAlertAddresses- list of notification emails.
-
getNotificationEmail
- Specified by:
getNotificationEmailin interfacePropertyManager- Returns:
- notification email.
- Throws:
PropertyManagerException- property does not exist
-
getNotificationEmails
- Specified by:
getNotificationEmailsin interfaceInternalPropertyManager- Returns:
- List of notification emails.
- Throws:
PropertyManagerException- property does not exist
-
isGzipEnabled
- Specified by:
isGzipEnabledin interfacePropertyManager- Returns:
trueif GZip compression should be used.- Throws:
PropertyManagerException- property does not exist.
-
setGzipEnabled
public void setGzipEnabled(boolean gzip) - Specified by:
setGzipEnabledin interfacePropertyManager- Parameters:
gzip-trueif GZip compression should be used.
-
getBuildNumber
Description copied from interface:PropertyManagerThis 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.- Specified by:
getBuildNumberin interfacePropertyManager- Returns:
- an Integer representing the current build number in the database.
- Throws:
PropertyManagerException- if we fail to find the buildNumber
-
setBuildNumber
Description copied from interface:PropertyManagerWill set the buildNumber for the current release of Crowd.- Specified by:
setBuildNumberin interfacePropertyManager- 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 ofTrustedProxyManager.- Specified by:
getTrustedProxyServersin interfacePropertyManager- Returns:
- list of proxy servers we trust
- 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 ofTrustedProxyManager.- Specified by:
setTrustedProxyServersin interfacePropertyManager- Parameters:
proxyServers- proxy servers.- Throws:
org.springframework.dao.DataAccessException- If the list of proxy servers could not be saved.
-
setAuditLogConfiguration
Description copied from interface:PropertyManagerPersists the audit log configuration- Specified by:
setAuditLogConfigurationin interfacePropertyManager- Parameters:
newConfiguration- new configuration
-
getAuditLogConfiguration
Description copied from interface:PropertyManagerRetrieves the audit log configuration- Specified by:
getAuditLogConfigurationin interfacePropertyManager- Returns:
- audit log configuration, default if not found
-
isUsingDatabaseTokenStorage
public boolean isUsingDatabaseTokenStorage()Description copied from interface:PropertyManagerWill return true if the Crowd instance is using database token storage for authenticationToken's otherwise assume we are using in-memory- Specified by:
isUsingDatabaseTokenStoragein interfacePropertyManager- Returns:
- true if database token storage is being used.
-
setUsingDatabaseTokenStorage
public void setUsingDatabaseTokenStorage(boolean isUsingDatabaseTokenStorage) Description copied from interface:PropertyManagerWill set a property to state that this crowd instance is using database token storage, otherwise assume we are using in-memory- Specified by:
setUsingDatabaseTokenStoragein interfacePropertyManager- Parameters:
isUsingDatabaseTokenStorage- true if you are switching to in-memory token storage
-
isIncludeIpAddressInValidationFactors
public boolean isIncludeIpAddressInValidationFactors()Description copied from interface:PropertyManagerShould the client IP address be included as a validation factor?- Specified by:
isIncludeIpAddressInValidationFactorsin interfacePropertyManager
-
isUseWebAvatars
public boolean isUseWebAvatars()Description copied from interface:PropertyManagerShould public services be used for user avatars?- Specified by:
isUseWebAvatarsin interfacePropertyManager
-
setUseWebAvatars
public void setUseWebAvatars(boolean useWebAvatars) - Specified by:
setUseWebAvatarsin interfacePropertyManager
-
getCookieConfiguration
- Specified by:
getCookieConfigurationin interfacePropertyManager- Returns:
- the current configuration of Crowd's cookie-based SSO
-
setCookieConfiguration
Description copied from interface:PropertyManagerUpdates the configuration of Crowd's cookie-based SSO- Specified by:
setCookieConfigurationin interfacePropertyManager- Parameters:
cookieConfiguration- the configuration to set, will replace the existing configuration
-
setIncludeIpAddressInValidationFactors
public void setIncludeIpAddressInValidationFactors(boolean includeIpAddressInValidationFactors) - Specified by:
setIncludeIpAddressInValidationFactorsin interfacePropertyManager
-
setRememberMeConfiguration
Description copied from interface:InternalPropertyManagerSets remember me configuration- Specified by:
setRememberMeConfigurationin interfaceInternalPropertyManager- Parameters:
configuration- new configuration
-
getRememberMeConfiguration
Description copied from interface:InternalPropertyManagerRetrieves remember me configuration- Specified by:
getRememberMeConfigurationin interfaceInternalPropertyManager- Returns:
- current configuration
-
removeProperty
Description copied from interface:PropertyManagerWill attempt to remove a property from the datastore- Specified by:
removePropertyin interfacePropertyManager- Parameters:
name- the name of the property.
-
getPropertyObject
- Throws:
ObjectNotFoundException
-
getProperty
Description copied from interface:PropertyManagerRetrieves an arbitrary property by name.- Specified by:
getPropertyin interfacePropertyManager- Parameters:
name- name of property.- Returns:
- value.
- Throws:
ObjectNotFoundException- property does not exist.
-
getOptionalProperty
Description copied from interface:PropertyManagerRetrieves an arbitrary property by name.- Specified by:
getOptionalPropertyin interfacePropertyManager- Parameters:
name- name of property.- Returns:
- value if found, none otherwise
-
setProperty
Description copied from interface:PropertyManagerSets an arbitrary property.- Specified by:
setPropertyin interfacePropertyManager- Parameters:
name- name of property.value- value.
-
getString
Description copied from interface:PropertyManagerGets a string property. If the property is not defined, return the supplied default value.- Specified by:
getStringin interfacePropertyManager- 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
Description copied from interface:PropertyManagerGets a boolean property. If the property is not defined, return the supplied default value.- Specified by:
getBooleanin interfacePropertyManager- 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
Description copied from interface:PropertyManagerGets an integer property. If the property is not defined, or does not contain a valid integer, return the supplied default value.- Specified by:
getIntin interfacePropertyManager- 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
-
getIntOrThrowIllegalArgumentException
-
setBaseUrl
Description copied from interface:PropertyManagerSets the base URL for this Crowd application instance- Specified by:
setBaseUrlin interfacePropertyManager- Parameters:
url- the base url to set, should be a proper absolute URL
-
getBaseUrl
- Specified by:
getBaseUrlin interfacePropertyManager- 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
- Specified by:
getPrivateKeyCertificatePairToSignin interfacePropertyManager- Returns:
- ID of private key/certificate used to sign assertions in SAML if found, none otherwise
-
setPrivateKeyCertificateToSign
public void setPrivateKeyCertificateToSign(long privateKeyCertificatePairId) Description copied from interface:PropertyManagerSets ID of private key/certificate pair used to sign assertions in SAML- Specified by:
setPrivateKeyCertificateToSignin interfacePropertyManager- Parameters:
privateKeyCertificatePairId- ID of private key/certificate pair to save
-
getBackupConfiguration
- Specified by:
getBackupConfigurationin interfacePropertyManager- Returns:
- Backup configuration
-
saveBackupConfiguration
Description copied from interface:PropertyManagerSaves backup configuration- Specified by:
saveBackupConfigurationin interfacePropertyManager- Parameters:
config- configuration of backup to save
-
getLookAndFeelConfiguration
@Nonnull public Optional<LookAndFeelConfiguration> getLookAndFeelConfiguration() throws PropertyManagerException- Specified by:
getLookAndFeelConfigurationin interfacePropertyManager- Returns:
- Look and Feel configuration if configured, none otherwise
- Throws:
PropertyManagerException- if there was an error while fetching configuration
-
setLookAndFeelConfiguration
public void setLookAndFeelConfiguration(LookAndFeelConfiguration lookAndFeelConfiguration, ImageInfo updatedLogoInfo) throws PropertyManagerException Description copied from interface:PropertyManagerSets Look and Feel configuration- Specified by:
setLookAndFeelConfigurationin interfacePropertyManager- 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
-
removeLookAndFeelConfiguration
Description copied from interface:PropertyManagerRemoves Look and Feel configuration- Specified by:
removeLookAndFeelConfigurationin interfacePropertyManager- Throws:
PropertyManagerException- if there was an error while removing configuration
-
getLogoImage
- Specified by:
getLogoImagein interfacePropertyManager- Returns:
- logo image if configured, none otherwise
- Throws:
PropertyManagerException- if there was an error while fetching a logo
-