Skip to content

Latest commit

 

History

History
308 lines (230 loc) · 12.1 KB

CHANGELOG.md

File metadata and controls

308 lines (230 loc) · 12.1 KB

Changelog

All notable changes to kb-util will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Unreleased]

Changed

  • Marked JSONWrapper deprecated for removal; dependency on org.json will probably be removed too

Updated

  • Upgraded org.json version from 20231013 to 20240303

Fixed

  • Fixed order of datetime repairing.

Changed

  • Changed DatetimeParser to also fix UTC datetimes, where seconds are missing from timestamp.

Fixed

  • Nullpointer in ImplBase logging by adding a check for null.

1.5.10 [YANKED]

Changed

  • Changed logging in ImplBase to not include mapping and endpoint, when they are identical.

Added

  • Added TimeMap class that are used when enabling OAuth2 on services.
  • Added class DatetimeParser, which parses wrongly defined DOMS dates.

Changed

  • Changed logging in YAML class as it extrapolates by default since kb-util 1.5.0

Changed

  • Changed how OpenApiResource handles substitution of multiple values. Now substitutinos using placeholders in yaml paths can be used in OpenAPI enums. Related to Jira DRA-327

Added

  • Added option to CallbackReplacer for replacing the full capture when using Pattern with 1 group
  • Added the class OpenApiResource which handles dynamic updating of OpenAPI specifications in JAX-RS webapps.

Fixed

  • Timing.toString now allows child-specific display elements instead of using the parent elements

Added

  • Extended YAML-path syntax: ** for matching any key at any depth (DRA-99)
  • YAML-path supporting Visitor pattern for YAML (DRA-99, DRA-134)
  • Fully generic getMultiple method, utilizing the Visitor implementation (DRA-99)

Changed

  • Leaf-key based getMultipleFromSubYaml in YAML is now deprecated as the extended YAML syntax cover these scenarios (DRA-99)
  • Breaking: Leaf-key based getMultiple has changed behaviour to generic yPath expansion (DRA-99)
  • Breaking: Default behaviour for YAML is now to extrapolate. Alternate constructors are provided to disable extrapolation (DRA-145)

Fixed

  • Timing.measure and Timing.getAllChrildren are now thread safe (DRA-165)

Added

  • Added support for the Paging-Record-Count header in the ContinuationStream

Fixed

  • The method getRecordCount in ContinuationUtil returned the value of getMore. Has been fixed to return actual record count for the stream.

Added

  • Support for extracting multiple values from a YAML file that share the same key. The getMultiple method works for YAMLs that are not overly complicated.

Added

  • Support for fetching git information through BuildInfoManager. Commit hash, deployed branch, time of latest commit and closest git tag is extracted.

Added

  • Support for request headers when creating HeaderInputStreams from URIs
  • Support for Paging-Record-Count headers for continuations

Added

  • Helper classes for HTTP header based continuation tokens for paging through datasets through webservices

Bugfix

  • Wrong dependency for @Nullable

Changed

  • Bump of practically all dependencies to latest compatible version

Added

  • XMLStepper.serializeSubElements for streaming serialization (aka extraction) of XML sub elements.
  • Extension of the Timing class with several helper methods for lambda and streaming
  • Make HttpServletResponse optional in wrap for StreamingExportFactory

Bugfix

  • Path-substitution still failed when using YAML.getSubMap(...) and requesting a key with a substitution using value.

Added

  • Path-substitution in YAML, allowing for YAML entries like dburl: ${path:databases.primary.url}
  • Conditionals in path in YAML, allowing for Java calls like myYAML.get("databases.[default=true].url");
  • Combining path substitution and conditional paths, allowing for YAML entries like dburl: ${path:databases.[default=true].url}

Added

  • Support for positioning an XMLStreamReader at a given XPath, so that the path-matching sub-XML can be processed or extracted
  • Exception throwing on unfulfillable expansion in YAML configs

Added

  • Large port from sb-util: The full replacer-suite and XML-utilities plus profiling tools

Added

  • ExtractionUtils focused on sampling and extracting minimum or maximum values from Streams and Collections.
  • Splitting of an incoming Stream to multiple partitions

Added

  • Auto updating YAML based config
  • Streaming export, used by webservices
  • HTTP Exceptions used by webservices
  • OpenAPI implementation super class used by OpenAPI applications
  • build.properties programmatic access (application-ID, version, build-time)
  • kbutil.build.properties file in the kb-util JAR

Added

  • Support for quoting keys in YAML paths to allow for keys with dots (.)
  • Expansion of system properties in YAML
  • Fully flattening (single line) XML.domToString method

Changed

  • Fix resource leak in Resolver#walkMatches

Added

  • CallbackReplacer and XMLEscapeSanitiser: Regexp-based replacements with callbacks

Added

  • Added StringListUtils.toModifiableList(list) utility to check, and, if nessesary, wrap your list as a modifiable list

Changed

  • Fixed JSON.java to correctly handle java 8 datetime objects

Added

Changed jaxb to use

<!--Nessesary for jaxb-xml with java 11-->
<!-- https://mvnrepository.com/artifact/jakarta.xml.bind/jakarta.xml.bind-api -->
<dependency>
    <groupId>jakarta.xml.bind</groupId>
    <artifactId>jakarta.xml.bind-api</artifactId>
    <version>2.3.2</version>
</dependency>
<!-- https://mvnrepository.com/artifact/jakarta.activation/jakarta.activation-api -->
<dependency>
    <groupId>jakarta.activation</groupId>
    <artifactId>jakarta.activation-api</artifactId>
    <version>1.2.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.glassfish.jaxb/jaxb-runtime -->
<dependency>
    <groupId>org.glassfish.jaxb</groupId>
    <artifactId>jaxb-runtime</artifactId>
    <version>2.3.2</version>
    <scope>runtime</scope>
</dependency>
<!--XML end-->

as this prevents the nasty

java.lang.module.FindException: Two versions of module jakarta.activation found in /home/abr/Projects/java-xcorrsound/java-xcorrsound-cli/target/java-xcorrsound-cli-0.1-SNAPSHOT/bin/../lib (jakarta.activation-api-1.2.2.jar and jakarta.activation-1.2.2.jar)

when used in a module-based projekt

Added

Added

  • Better exceptions when creating a YAML from non-existing resources
  • Choice between loading multiple YAML-files as a single reference-supporting stream or as multiple overwriting streams

Bugfix

  • Globbing now supports . and .. (foo/bar/../bar/./boom.txt)

Added

  • YAML.parse methods that takes a Path or File as input, rather than a classpath Name or InputStream. Just for more flexibility in how to read your YAML file.
  • Globbing (resolving of files with wildcards) to the Resolver
  • Default globbing when resolving YAML configs

Added

  • Shadow-class dk.kb.util.YAML introduced to compensate for breaking backwards compatibility in 1.2.0.

  • Dependency for jaxb runtime (org.glassfish.jaxb:jaxb-runtime) to make xml classes not throw runtime exceptions due to missing implementation

Updated

  • Dependencies updated:
    • snakeyaml: 1.23 -> 1.26
    • slf4j-api: 1.7.25 -> 1.7.30
    • jackson-databind: 2.9.10 -> 2.11.2
    • jakarta.ws.rs-api: 2.1.5 -> 2.1.6

Added

  • YAML.java supports indexed lists in getter methods

  • Generic utils from alma-client ported to kb-utils

    • JSON
      • fromJson(String/File) parses json to java object
      • toJson(Object) serialize java object to json
    • AutochainingIterator: Class to automatically chain generated iterators
    • NamedThread: Autoclosable thread namer
    • StringListUtils: Utility String and Stream methods
    • Resolver
      • GetPathFromClasspath -> Path
      • ReadFileFromClasspath -> String
      • OpenFileFromClasspath -> InputStream
    • XML (ported and adapted from sbutil)
      • String/Stream to/from Document
      • Java Object to/from Xml String
      • XPath support
  • Apache Commons Utilities that we should use

    • commons-io:2.7
    • commons-collections4:4.4
    • commons-codec:1.14
    • commons-lang3:3.11
    • commons-text:1.9
  • Xml libraries for java 11+

    • jakarta.xml.bind-api 2.3.3
    • com.sun.xml.bind:jaxb-impl:2.3.3
  • JSON libraries

    • com.fasterxml.jackson.core:jackson-databind:2.11.0
    • jakarta.ws.rs:jakarta.ws.rs-api:2.1.5
  • Other libraries

    • org.hamcrest:hamcrest-core:2.1 for assertThat in tests
    • jakarta.validation:jakarta.validation-api:2.0.2 for @NotNull annotations in method contracts

Added

  • Changelog
  • Release procedure in the README.md
  • Fail-early for missing values when using YAML get-methods without default value
  • Key-value based recursive extraction of YAML leaf entries
  • YAMLUtils with toProperties method for conversion to flat Java Properties

Added

  • The kb-util-project itself
  • YAML: Parse from file or URL, path-based getters of elements