Interface PropertyManager

All Known Subinterfaces:
InternalPropertyManager
All Known Implementing Classes:
PropertyManagerGeneric

public interface PropertyManager
API for storing and retrieving Crowd server properties.
  • Method Details

    • getDeploymentTitle

      String getDeploymentTitle() throws PropertyManagerException
      Returns:
      deployment title.
      Throws:
      PropertyManagerException - property does not exist.
    • setDeploymentTitle

      void setDeploymentTitle(String title)
      Parameters:
      title - deployment title.
    • getDomain

      @Deprecated String getDomain()
      Deprecated.
      Use getCookieConfiguration() 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 void setDomain(String domain)
      Deprecated.
      Parameters:
      domain - SSO cookie domain.
    • isSecureCookie

      @Deprecated boolean isSecureCookie()
      Deprecated.
      Returns:
      true if the "secure" flag should be set on the SSO cookie.
    • setSecureCookie

      @Deprecated void setSecureCookie(boolean secure)
      Deprecated.
      Parameters:
      secure - true if the "secure" flag should be set on the SSO cookie.
    • setCacheEnabled

      void setCacheEnabled(boolean enabled)
      Parameters:
      enabled - true if application authorisation caching should be used on the server-side.
    • isCacheEnabled

      boolean isCacheEnabled()
      Returns:
      true if 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, use com.atlassian.crowd.manager.mail.MailConfigurationService#getConfiguration()
      Returns:
      SMTP server config.
      Throws:
      PropertyManagerException - property does not exist.
    • setSMTPServer

      @Deprecated void setSMTPServer(SMTPServer server)
      Deprecated.
      As of release 3.3.0, use com.atlassian.crowd.manager.mail.MailConfigurationService#saveConfiguration()
      Parameters:
      server - SMTP server config.
    • getDesEncryptionKey

      Key getDesEncryptionKey() throws PropertyManagerException
      Returns:
      DES key for DES encoded passwords.
      Throws:
      PropertyManagerException - property does not exist.
    • generateDesEncryptionKey

      void generateDesEncryptionKey() throws PropertyManagerException
      Generates and stores a DES key for DES encoded passwords.
      Throws:
      PropertyManagerException - DES algorithm does not exist.
    • setSMTPTemplate

      @Deprecated void setSMTPTemplate(String template)
      Deprecated.
      As of release 2.1, use setProperty(String, String)
      Parameters:
      template - mail template.
    • getSMTPTemplate

      @Deprecated String getSMTPTemplate() throws PropertyManagerException
      Deprecated.
      As of release 2.1, use getProperty(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 void setNotificationEmail(String notificationEmail)
      Deprecated.
      As of release 3.3, use com.atlassian.crowd.manager.mail.MailConfigurationService#saveConfiguration()
      Parameters:
      notificationEmail - notification email.
    • getNotificationEmail

      @Deprecated String getNotificationEmail() throws PropertyManagerException
      Deprecated.
      Returns:
      notification email.
      Throws:
      PropertyManagerException - property does not exist
    • isGzipEnabled

      @Deprecated boolean isGzipEnabled() throws PropertyManagerException
      Deprecated.
      this is no longer configurable in Crowd and always returns true
      Returns:
      true if GZip compression should be used.
      Throws:
      PropertyManagerException - property does not exist.
    • setGzipEnabled

      @Deprecated void setGzipEnabled(boolean gzip)
      Deprecated.
      this is no longer configurable in Crowd and this method has no effect.
      Parameters:
      gzip - true if GZip compression should be used.
    • getBuildNumber

      Integer getBuildNumber() throws PropertyManagerException
      This method returns the current build number for Crowd from the datastore. This BuildNumber may not be the same as the build number in 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.
      Returns:
      an Integer representing the current build number in the database.
      Throws:
      PropertyManagerException - if we fail to find the buildNumber
    • setBuildNumber

      void setBuildNumber(Integer buildNumber)
      Will set the buildNumber for the current release of Crowd.
      Parameters:
      buildNumber - the buildNumber to set in the database
    • getTrustedProxyServers

      String getTrustedProxyServers() throws PropertyManagerException
      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

      void setTrustedProxyServers(String proxyServers)
      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

      void setAuditLogConfiguration(AuditLogConfiguration auditLogConfiguration)
      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

      boolean isUsingDatabaseTokenStorage() throws PropertyManagerException
      Will return true if the Crowd instance is using database token storage for authentication Token'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

      void removeProperty(String name)
      Will attempt to remove a property from the datastore
      Parameters:
      name - the name of the property.
    • getProperty

      String getProperty(String name) throws ObjectNotFoundException
      Retrieves an arbitrary property by name.
      Parameters:
      name - name of property.
      Returns:
      value.
      Throws:
      ObjectNotFoundException - property does not exist.
    • getOptionalProperty

      Optional<String> getOptionalProperty(String name)
      Retrieves an arbitrary property by name.
      Parameters:
      name - name of property.
      Returns:
      value if found, none otherwise
    • setProperty

      void setProperty(String name, String value)
      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

      void setCookieConfiguration(CookieConfiguration cookieConfiguration)
      Updates the configuration of Crowd's cookie-based SSO
      Parameters:
      cookieConfiguration - the configuration to set, will replace the existing configuration
      Since:
      v3.0
    • getString

      String getString(String property, String defaultValue)
      Gets a string property. If the property is not defined, return the supplied default value.
      Parameters:
      property - a property name
      defaultValue - 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

      boolean getBoolean(String property, boolean defaultValue)
      Gets a boolean property. If the property is not defined, return the supplied default value.
      Parameters:
      property - a property name
      defaultValue - 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

      int getInt(String property, int defaultValue)
      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 name
      defaultValue - 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

      void setBaseUrl(URI url)
      Sets the base URL for this Crowd application instance
      Parameters:
      url - the base url to set, should be a proper absolute URL
    • getBaseUrl

      URI getBaseUrl() throws PropertyManagerException
      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

      Optional<Long> 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

      void saveBackupConfiguration(BackupConfiguration config)
      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 configuration
      updatedLogoInfo - 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

      Optional<LookAndFeelConfiguration> getLookAndFeelConfiguration() throws PropertyManagerException
      Returns:
      Look and Feel configuration if configured, none otherwise
      Throws:
      PropertyManagerException - if there was an error while fetching configuration
    • removeLookAndFeelConfiguration

      void removeLookAndFeelConfiguration() throws PropertyManagerException
      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