Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-26181

Improve ConfigurationService API

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 11.1, 2021.0
    • Component/s: Configuration
    • Tags:
    • Upgrade notes:
      Hide

      New APIs:

      APIs below were added on ConfigurationService, signature are key or key/defaultValue:

      • Optional<String> getString(String)
      • String getString(String, String)
      • Optional<Integer> getInteger(String)
      • int getInteger(String, int)
      • Optional<Long> getLong(String)
      • long getLong(String, long)
      • Optional<Duration> getDuration(String)
      • Duration getDuration(String, Duration)
      • Optional<Boolean> getBoolean(String)
      • boolean isBooleanTrue(String)
      • boolean isBooleanFalse(String)

      Fallback on default value occurs when property doesn't exist or is blank.

      isBooleanTrue and isBooleanFalse return true if and only if property value is true and respectively false.

      APIs below were deprecated:

      • String getProperty(String) in favor of Optional<String> getString(String)
      • String getProperty(String, String) in favor of String getString(String, String)
      • boolean isBooleanPropertyTrue(String) in favor of boolean isBooleanTrue(String) (same behavior)
      • boolean isBooleanPropertyFalse(String) in favor of boolean isBooleanFalse(String) - new API returns true if and only if property value is false, it wasn't the case for isBooleanPropertyFalse which returns true if property value is not blank and is not true.
      Show
      New APIs: APIs below were added on ConfigurationService , signature are key or key / defaultValue : Optional<String> getString(String) String getString(String, String) Optional<Integer> getInteger(String) int getInteger(String, int) Optional<Long> getLong(String) long getLong(String, long) Optional<Duration> getDuration(String) Duration getDuration(String, Duration) Optional<Boolean> getBoolean(String) boolean isBooleanTrue(String) boolean isBooleanFalse(String) Fallback on default value occurs when property doesn't exist or is blank. isBooleanTrue and isBooleanFalse return true if and only if property value is true and respectively false . APIs below were deprecated: String getProperty(String) in favor of Optional<String> getString(String) String getProperty(String, String) in favor of String getString(String, String) boolean isBooleanPropertyTrue(String) in favor of boolean isBooleanTrue(String) (same behavior) boolean isBooleanPropertyFalse(String) in favor of boolean isBooleanFalse(String) - new API returns true if and only if property value is false , it wasn't the case for isBooleanPropertyFalse which returns true if property value is not blank and is not true .
    • Sprint:
      nxcore 11.1.3
    • Story Points:
      5

      Description

      We want to add new API on ConfigurationService to handle primitive like types.

      API to introduce would be:

      • Integer getInteger(String key) (TBC)
      • int getInteger(String key, int defaultValue) (TBC)
      • Long getLong(String key)
      • long getLong(String key, long defaultValue)
      • Boolean getBoolean(String key)
      • boolean getBoolean(String key, boolean defaultValue)
      • Duration getDuration(String key)
      • Duration getDuration(String key, Duration defaultValue)
      • String getString(String key)
      • String getString(String key, String defaultValue)

      Fallback on defaultValue will be done if the property doesn't exist or it it's empty.

      Duration handling should follow what was done in NXP-25402.

      We want to hunt every usage in Nuxeo Platform to replace them by the appropriate API.

      We also want to deprecate isBooleanPropertyTrue and isBooleanPropertyFalse because their usage is error prone. Be careful about their implementation and their usage to be iso-functional, because true API doesn't have the exact same behavior than false API.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 4 hours
                  1d 4h