From d75a34c4e7a79155bb6450498f8d8834221b7e6e Mon Sep 17 00:00:00 2001 From: Jakub Bednar Date: Thu, 7 Jul 2022 11:13:26 +0200 Subject: [PATCH 01/87] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index cd2e4b65..71e43c74 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.influxdb influxdb-java jar - 2.23 + 2.24-SNAPSHOT influxdb java bindings Java API to access the InfluxDB REST API http://www.influxdb.org @@ -24,7 +24,7 @@ scm:git:git@github.com:influxdata/influxdb-java.git scm:git:git@github.com:influxdata/influxdb-java.git git@github.com:influxdata/influxdb-java.git - influxdb-java-2.23 + HEAD From e1b8fc49ddb3ebeba4ff245e47f6d9eafb716a74 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Jul 2022 07:02:04 +0200 Subject: [PATCH 02/87] chore(deps): bump maven-install-plugin from 3.0.0-M1 to 3.0.1 (#855) Bumps [maven-install-plugin](https://github.com/apache/maven-install-plugin) from 3.0.0-M1 to 3.0.1. - [Release notes](https://github.com/apache/maven-install-plugin/releases) - [Commits](https://github.com/apache/maven-install-plugin/compare/maven-install-plugin-3.0.0-M1...maven-install-plugin-3.0.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-install-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 71e43c74..1078f408 100644 --- a/pom.xml +++ b/pom.xml @@ -109,7 +109,7 @@ org.apache.maven.plugins maven-install-plugin - 3.0.0-M1 + 3.0.1 org.apache.maven.plugins From aaf2cb6f6a8d987ed49fa5ec014fd1e96e4197a2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Jul 2022 07:02:26 +0200 Subject: [PATCH 03/87] chore(deps): bump maven-deploy-plugin from 3.0.0-M2 to 3.0.0 (#856) Bumps [maven-deploy-plugin](https://github.com/apache/maven-deploy-plugin) from 3.0.0-M2 to 3.0.0. - [Release notes](https://github.com/apache/maven-deploy-plugin/releases) - [Commits](https://github.com/apache/maven-deploy-plugin/compare/maven-deploy-plugin-3.0.0-M2...maven-deploy-plugin-3.0.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-deploy-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1078f408..5b54f361 100644 --- a/pom.xml +++ b/pom.xml @@ -104,7 +104,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.0.0-M2 + 3.0.0 org.apache.maven.plugins From 7cb413a1b2b9ee227ad0a6ef1db12e82b60031d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 07:11:30 +0200 Subject: [PATCH 04/87] chore(deps): bump maven-site-plugin from 3.12.0 to 3.12.1 (#863) Bumps [maven-site-plugin](https://github.com/apache/maven-site-plugin) from 3.12.0 to 3.12.1. - [Release notes](https://github.com/apache/maven-site-plugin/releases) - [Commits](https://github.com/apache/maven-site-plugin/compare/maven-site-plugin-3.12.0...maven-site-plugin-3.12.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-site-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5b54f361..917be9a6 100644 --- a/pom.xml +++ b/pom.xml @@ -94,7 +94,7 @@ org.apache.maven.plugins maven-site-plugin - 3.12.0 + 3.12.1 org.apache.maven.plugins From 4174231b65d3c855d960c64b9e83c95410c85dd4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 07:12:40 +0200 Subject: [PATCH 05/87] chore(deps): bump maven-resources-plugin from 3.2.0 to 3.3.0 (#861) Bumps [maven-resources-plugin](https://github.com/apache/maven-resources-plugin) from 3.2.0 to 3.3.0. - [Release notes](https://github.com/apache/maven-resources-plugin/releases) - [Commits](https://github.com/apache/maven-resources-plugin/compare/maven-resources-plugin-3.2.0...maven-resources-plugin-3.3.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-resources-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 917be9a6..dcc07343 100644 --- a/pom.xml +++ b/pom.xml @@ -126,7 +126,7 @@ org.apache.maven.plugins maven-resources-plugin - 3.2.0 + 3.3.0 org.apache.maven.plugins @@ -333,7 +333,7 @@ maven-resources-plugin - 3.2.0 + 3.3.0 copy-resources From f0e92e2b3ba725d6d7af8f0faa135e1661472d23 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 07:21:19 +0200 Subject: [PATCH 06/87] chore(deps-dev): bump mockito-core from 4.6.1 to 4.7.0 (#865) Bumps [mockito-core](https://github.com/mockito/mockito) from 4.6.1 to 4.7.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v4.6.1...v4.7.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index dcc07343..a38a05e6 100644 --- a/pom.xml +++ b/pom.xml @@ -280,7 +280,7 @@ org.mockito mockito-core - 4.6.1 + 4.7.0 test From 32cd31f5c3b66841c368b0323e431fb7b308fae7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 07:21:45 +0200 Subject: [PATCH 07/87] chore(deps-dev): bump junit-jupiter-engine from 5.8.2 to 5.9.0 (#860) Bumps [junit-jupiter-engine](https://github.com/junit-team/junit5) from 5.8.2 to 5.9.0. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.8.2...r5.9.0) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-engine dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a38a05e6..e728c5ed 100644 --- a/pom.xml +++ b/pom.xml @@ -256,7 +256,7 @@ org.junit.jupiter junit-jupiter-engine - 5.8.2 + 5.9.0 test From dd4405bda97787fecb5be198f7b6ef427c5bd3dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 07:22:07 +0200 Subject: [PATCH 08/87] chore(deps-dev): bump junit-platform-runner from 1.8.2 to 1.9.0 (#858) Bumps [junit-platform-runner](https://github.com/junit-team/junit5) from 1.8.2 to 1.9.0. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/commits) --- updated-dependencies: - dependency-name: org.junit.platform:junit-platform-runner dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index e728c5ed..43bdd30f 100644 --- a/pom.xml +++ b/pom.xml @@ -262,7 +262,7 @@ org.junit.platform junit-platform-runner - 1.8.2 + 1.9.0 test From ae212ffaeeb512ba561ef6730199d29ca22cd94c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Aug 2022 07:22:26 +0200 Subject: [PATCH 09/87] chore(deps): bump maven-javadoc-plugin from 3.4.0 to 3.4.1 (#866) Bumps [maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.4.0 to 3.4.1. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.4.0...maven-javadoc-plugin-3.4.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 43bdd30f..b302ccdd 100644 --- a/pom.xml +++ b/pom.xml @@ -183,7 +183,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.4.0 + 3.4.1 8 From daba8e62480eae8ca944b4ec566f96ae289272e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bedn=C3=A1=C5=99?= Date: Fri, 2 Sep 2022 09:39:26 +0200 Subject: [PATCH 10/87] chore(ci): add InfluxDB 2.4 to CI pipeline (#867) --- .github/workflows/master.yml | 4 ++-- .github/workflows/pr.yml | 4 ++-- CHANGELOG.md | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 51af9c56..47c777cc 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: jdk: [3-openjdk-17-slim, 3-jdk-14, 3-jdk-8-slim] - influxdb: ['1.1', '1.6', '1.8', '2.1', '2.2', '2.3'] + influxdb: ['1.1', '1.6', '1.8', '2.2', '2.3', '2.4'] steps: - name: Checkout @@ -36,7 +36,7 @@ jobs: shasum -a 256 -c codecov.SHA256SUM chmod +x ./codecov ./codecov - if: matrix.influxdb != '2.1' && matrix.influxdb != '2.2' && matrix.influxdb != '2.3' + if: matrix.influxdb != '2.2' && matrix.influxdb != '2.3' && matrix.influxdb != '2.4' # deploy: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index cf74ce6b..796189ea 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: jdk: [3-openjdk-17-slim, 3-jdk-14, 3-jdk-8-slim] - influxdb: ['1.1', '1.6', '1.8', '2.1', '2.2', '2.3'] + influxdb: ['1.1', '1.6', '1.8', '2.2', '2.3', '2.4'] steps: - name: Checkout @@ -40,4 +40,4 @@ jobs: shasum -a 256 -c codecov.SHA256SUM chmod +x ./codecov ./codecov - if: matrix.influxdb != '2.1' && matrix.influxdb != '2.2' && matrix.influxdb != '2.3' + if: matrix.influxdb != '2.2' && matrix.influxdb != '2.3' && matrix.influxdb != '2.4' diff --git a/CHANGELOG.md b/CHANGELOG.md index 847bd95a..026d4d09 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -## 2.23 [unreleased] +## 2.23 [2022-07-07] ### Improvements - Add implementation information to `Jar` manifest [PR #847](https://github.com/influxdata/influxdb-java/pull/847) From c029ec16880ea1a415aee566b67c57d5b51bbcd3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Sep 2022 15:15:57 +0200 Subject: [PATCH 11/87] chore(deps): bump maven-checkstyle-plugin from 3.1.2 to 3.2.0 (#868) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b302ccdd..906d7c08 100644 --- a/pom.xml +++ b/pom.xml @@ -218,7 +218,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.1.2 + 3.2.0 com.puppycrawl.tools From 6fda74aacf8950a46ae03b75393071fd2b945f1b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Sep 2022 07:24:09 +0200 Subject: [PATCH 12/87] chore(deps-dev): bump mockito-core from 4.7.0 to 4.8.0 (#870) Bumps [mockito-core](https://github.com/mockito/mockito) from 4.7.0 to 4.8.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v4.7.0...v4.8.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 906d7c08..16f5bdd0 100644 --- a/pom.xml +++ b/pom.xml @@ -280,7 +280,7 @@ org.mockito mockito-core - 4.7.0 + 4.8.0 test From b60c7c364271bc21c4f46b8a35bb840cac8a32e0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 13 Sep 2022 07:24:35 +0200 Subject: [PATCH 13/87] chore(deps): bump versions-maven-plugin from 2.11.0 to 2.12.0 (#869) Bumps [versions-maven-plugin](https://github.com/mojohaus/versions-maven-plugin) from 2.11.0 to 2.12.0. - [Release notes](https://github.com/mojohaus/versions-maven-plugin/releases) - [Changelog](https://github.com/mojohaus/versions-maven-plugin/blob/master/ReleaseNotes.md) - [Commits](https://github.com/mojohaus/versions-maven-plugin/compare/versions-maven-plugin-2.11.0...versions-maven-plugin-2.12.0) --- updated-dependencies: - dependency-name: org.codehaus.mojo:versions-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 16f5bdd0..19a19689 100644 --- a/pom.xml +++ b/pom.xml @@ -75,7 +75,7 @@ org.codehaus.mojo versions-maven-plugin - 2.11.0 + 2.12.0 org.apache.maven.plugins From bb6c04e851ee5b39a93293f49186791e858c349e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Sep 2022 07:31:57 +0200 Subject: [PATCH 14/87] chore(deps): bump maven-jar-plugin from 3.2.2 to 3.3.0 (#871) Bumps [maven-jar-plugin](https://github.com/apache/maven-jar-plugin) from 3.2.2 to 3.3.0. - [Release notes](https://github.com/apache/maven-jar-plugin/releases) - [Commits](https://github.com/apache/maven-jar-plugin/compare/maven-jar-plugin-3.2.2...maven-jar-plugin-3.3.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-jar-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 19a19689..3925acba 100644 --- a/pom.xml +++ b/pom.xml @@ -114,7 +114,7 @@ org.apache.maven.plugins maven-jar-plugin - 3.2.2 + 3.3.0 From 6bf6f881036ffbed74709585fbc326c4a2ef4a50 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 08:51:38 +0200 Subject: [PATCH 15/87] chore(deps-dev): bump junit-jupiter-engine from 5.9.0 to 5.9.1 (#872) Bumps [junit-jupiter-engine](https://github.com/junit-team/junit5) from 5.9.0 to 5.9.1. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.9.0...r5.9.1) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-engine dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3925acba..08fe6afe 100644 --- a/pom.xml +++ b/pom.xml @@ -256,7 +256,7 @@ org.junit.jupiter junit-jupiter-engine - 5.9.0 + 5.9.1 test From bd59d49c64f93bc72e5b388da3b3b50620981c00 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 08:52:01 +0200 Subject: [PATCH 16/87] chore(deps-dev): bump junit-platform-runner from 1.9.0 to 1.9.1 (#873) Bumps [junit-platform-runner](https://github.com/junit-team/junit5) from 1.9.0 to 1.9.1. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/commits) --- updated-dependencies: - dependency-name: org.junit.platform:junit-platform-runner dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 08fe6afe..f930be46 100644 --- a/pom.xml +++ b/pom.xml @@ -262,7 +262,7 @@ org.junit.platform junit-platform-runner - 1.9.0 + 1.9.1 test From c8b58f8f59313bf5b0e7881e19b341873dbfcb95 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Oct 2022 06:56:22 +0200 Subject: [PATCH 17/87] chore(deps-dev): bump mockito-core from 4.8.0 to 4.8.1 (#876) Bumps [mockito-core](https://github.com/mockito/mockito) from 4.8.0 to 4.8.1. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v4.8.0...v4.8.1) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f930be46..ed38da3c 100644 --- a/pom.xml +++ b/pom.xml @@ -280,7 +280,7 @@ org.mockito mockito-core - 4.8.0 + 4.8.1 test From 0b786a9dda4749b77df8c3eb216696fb43cbfc52 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Oct 2022 06:56:57 +0200 Subject: [PATCH 18/87] chore(deps): bump versions-maven-plugin from 2.12.0 to 2.13.0 (#875) Bumps [versions-maven-plugin](https://github.com/mojohaus/versions-maven-plugin) from 2.12.0 to 2.13.0. - [Release notes](https://github.com/mojohaus/versions-maven-plugin/releases) - [Changelog](https://github.com/mojohaus/versions-maven-plugin/blob/master/ReleaseNotes.md) - [Commits](https://github.com/mojohaus/versions-maven-plugin/compare/versions-maven-plugin-2.12.0...2.13.0) --- updated-dependencies: - dependency-name: org.codehaus.mojo:versions-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ed38da3c..65e9021d 100644 --- a/pom.xml +++ b/pom.xml @@ -75,7 +75,7 @@ org.codehaus.mojo versions-maven-plugin - 2.12.0 + 2.13.0 org.apache.maven.plugins From dd635514c365332cbc2fa9a765085d5722cf10ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Bedn=C3=A1=C5=99?= Date: Wed, 2 Nov 2022 10:41:01 +0100 Subject: [PATCH 19/87] chore(ci): add InfluxDB 2.5 to CI pipeline (#878) --- .github/workflows/master.yml | 4 ++-- .github/workflows/pr.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index 47c777cc..8571e573 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: jdk: [3-openjdk-17-slim, 3-jdk-14, 3-jdk-8-slim] - influxdb: ['1.1', '1.6', '1.8', '2.2', '2.3', '2.4'] + influxdb: ['1.1', '1.6', '1.8', '2.3', '2.4', '2.5'] steps: - name: Checkout @@ -36,7 +36,7 @@ jobs: shasum -a 256 -c codecov.SHA256SUM chmod +x ./codecov ./codecov - if: matrix.influxdb != '2.2' && matrix.influxdb != '2.3' && matrix.influxdb != '2.4' + if: matrix.influxdb != '2.3' && matrix.influxdb != '2.4' && matrix.influxdb != '2.5' # deploy: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 796189ea..5b70f5e1 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -12,7 +12,7 @@ jobs: strategy: matrix: jdk: [3-openjdk-17-slim, 3-jdk-14, 3-jdk-8-slim] - influxdb: ['1.1', '1.6', '1.8', '2.2', '2.3', '2.4'] + influxdb: ['1.1', '1.6', '1.8', '2.3', '2.4', '2.5'] steps: - name: Checkout @@ -40,4 +40,4 @@ jobs: shasum -a 256 -c codecov.SHA256SUM chmod +x ./codecov ./codecov - if: matrix.influxdb != '2.2' && matrix.influxdb != '2.3' && matrix.influxdb != '2.4' + if: matrix.influxdb != '2.3' && matrix.influxdb != '2.4' && matrix.influxdb != '2.5' From 916e1a0c36f3c51fca94b1118e75e01adfc3e6a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 09:30:06 +0100 Subject: [PATCH 20/87] chore(deps-dev): bump mockito-core from 4.8.1 to 4.10.0 (#884) Bumps [mockito-core](https://github.com/mockito/mockito) from 4.8.1 to 4.10.0. - [Release notes](https://github.com/mockito/mockito/releases) - [Commits](https://github.com/mockito/mockito/compare/v4.8.1...v4.10.0) --- updated-dependencies: - dependency-name: org.mockito:mockito-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 65e9021d..7d792e50 100644 --- a/pom.xml +++ b/pom.xml @@ -280,7 +280,7 @@ org.mockito mockito-core - 4.8.1 + 4.10.0 test From 2b48bd48b4398c38626f9a38e363835fb8d1cb65 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 09:30:30 +0100 Subject: [PATCH 21/87] chore(deps): bump versions-maven-plugin from 2.13.0 to 2.14.1 (#883) Bumps [versions-maven-plugin](https://github.com/mojohaus/versions) from 2.13.0 to 2.14.1. - [Release notes](https://github.com/mojohaus/versions/releases) - [Changelog](https://github.com/mojohaus/versions/blob/master/ReleaseNotes.md) - [Commits](https://github.com/mojohaus/versions/compare/2.13.0...2.14.1) --- updated-dependencies: - dependency-name: org.codehaus.mojo:versions-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7d792e50..3ce26a08 100644 --- a/pom.xml +++ b/pom.xml @@ -75,7 +75,7 @@ org.codehaus.mojo versions-maven-plugin - 2.13.0 + 2.14.1 org.apache.maven.plugins From a0f09f8a3086ea34bfce1754f5445e4b50301a98 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Dec 2022 09:07:59 +0100 Subject: [PATCH 22/87] chore(deps): bump versions-maven-plugin from 2.14.1 to 2.14.2 (#885) Bumps [versions-maven-plugin](https://github.com/mojohaus/versions) from 2.14.1 to 2.14.2. - [Release notes](https://github.com/mojohaus/versions/releases) - [Changelog](https://github.com/mojohaus/versions/blob/master/ReleaseNotes.md) - [Commits](https://github.com/mojohaus/versions/compare/2.14.1...2.14.2) --- updated-dependencies: - dependency-name: org.codehaus.mojo:versions-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 3ce26a08..6987a753 100644 --- a/pom.xml +++ b/pom.xml @@ -75,7 +75,7 @@ org.codehaus.mojo versions-maven-plugin - 2.14.1 + 2.14.2 org.apache.maven.plugins From c71a3d010891ef44247ad7e7635ef7257ff0115b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jan 2023 07:07:49 +0100 Subject: [PATCH 23/87] chore(deps-dev): bump assertj-core from 3.23.1 to 3.24.1 (#888) Bumps assertj-core from 3.23.1 to 3.24.1. --- updated-dependencies: - dependency-name: org.assertj:assertj-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6987a753..c5c3efea 100644 --- a/pom.xml +++ b/pom.xml @@ -274,7 +274,7 @@ org.assertj assertj-core - 3.23.1 + 3.24.1 test From 9e7fc7f8512448253202ceee43aca3bf448117b2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jan 2023 06:43:42 +0100 Subject: [PATCH 24/87] chore(deps-dev): bump junit-jupiter-engine from 5.9.1 to 5.9.2 (#890) Bumps [junit-jupiter-engine](https://github.com/junit-team/junit5) from 5.9.1 to 5.9.2. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.9.1...r5.9.2) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-engine dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c5c3efea..7b9e7e54 100644 --- a/pom.xml +++ b/pom.xml @@ -256,7 +256,7 @@ org.junit.jupiter junit-jupiter-engine - 5.9.1 + 5.9.2 test From 80f0f1adad5e2298b345e98974510a642c73c8bd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jan 2023 06:44:14 +0100 Subject: [PATCH 25/87] chore(deps): bump maven-surefire-plugin from 3.0.0-M7 to 3.0.0-M8 (#891) Bumps [maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.0.0-M7 to 3.0.0-M8. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.0.0-M7...surefire-3.0.0-M8) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7b9e7e54..9bb27e6f 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M7 + 3.0.0-M8 org.apache.maven.plugins From 5a34be841a485a82537a570edb876b6dd4b2ac80 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jan 2023 06:44:43 +0100 Subject: [PATCH 26/87] chore(deps): bump maven-install-plugin from 3.0.1 to 3.1.0 (#880) Bumps [maven-install-plugin](https://github.com/apache/maven-install-plugin) from 3.0.1 to 3.1.0. - [Release notes](https://github.com/apache/maven-install-plugin/releases) - [Commits](https://github.com/apache/maven-install-plugin/compare/maven-install-plugin-3.0.1...maven-install-plugin-3.1.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-install-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9bb27e6f..c3338d41 100644 --- a/pom.xml +++ b/pom.xml @@ -109,7 +109,7 @@ org.apache.maven.plugins maven-install-plugin - 3.0.1 + 3.1.0 org.apache.maven.plugins From 2c7825c078bad14cb7da80a0399f31cea0505e83 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Jan 2023 07:08:56 +0100 Subject: [PATCH 27/87] chore(deps-dev): bump junit-platform-runner from 1.9.1 to 1.9.2 (#893) Bumps [junit-platform-runner](https://github.com/junit-team/junit5) from 1.9.1 to 1.9.2. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/commits) --- updated-dependencies: - dependency-name: org.junit.platform:junit-platform-runner dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c3338d41..0d7afd45 100644 --- a/pom.xml +++ b/pom.xml @@ -262,7 +262,7 @@ org.junit.platform junit-platform-runner - 1.9.1 + 1.9.2 test From 7baa819949abfd53cc0d8189d3d0b8ee21f19c0f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Jan 2023 07:09:22 +0100 Subject: [PATCH 28/87] chore(deps-dev): bump assertj-core from 3.24.1 to 3.24.2 (#894) Bumps assertj-core from 3.24.1 to 3.24.2. --- updated-dependencies: - dependency-name: org.assertj:assertj-core dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0d7afd45..0f9859a3 100644 --- a/pom.xml +++ b/pom.xml @@ -274,7 +274,7 @@ org.assertj assertj-core - 3.24.1 + 3.24.2 test From 141c65e528cbff3a5ea2f07c4310773f2bd1ad4b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Jan 2023 07:10:24 +0100 Subject: [PATCH 29/87] chore(deps): bump maven-checkstyle-plugin from 3.2.0 to 3.2.1 (#895) Bumps [maven-checkstyle-plugin](https://github.com/apache/maven-checkstyle-plugin) from 3.2.0 to 3.2.1. - [Release notes](https://github.com/apache/maven-checkstyle-plugin/releases) - [Commits](https://github.com/apache/maven-checkstyle-plugin/compare/maven-checkstyle-plugin-3.2.0...maven-checkstyle-plugin-3.2.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-checkstyle-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0f9859a3..29dcc222 100644 --- a/pom.xml +++ b/pom.xml @@ -218,7 +218,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.2.0 + 3.2.1 com.puppycrawl.tools From fa2a4bfa917f4edc596833afb6bd233a3eba0bca Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Feb 2023 08:06:54 +0100 Subject: [PATCH 30/87] chore(deps): bump maven-enforcer-plugin from 3.1.0 to 3.2.1 (#899) Bumps [maven-enforcer-plugin](https://github.com/apache/maven-enforcer) from 3.1.0 to 3.2.1. - [Release notes](https://github.com/apache/maven-enforcer/releases) - [Commits](https://github.com/apache/maven-enforcer/compare/enforcer-3.1.0...enforcer-3.2.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-enforcer-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 29dcc222..60bcc21a 100644 --- a/pom.xml +++ b/pom.xml @@ -139,7 +139,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.1.0 + 3.2.1 enforce-maven From c5218d96973fdc10cd2450ab599ea4e3bf3a5435 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Feb 2023 07:22:23 +0100 Subject: [PATCH 31/87] chore(deps): bump maven-deploy-plugin from 3.0.0 to 3.1.0 (#901) Bumps [maven-deploy-plugin](https://github.com/apache/maven-deploy-plugin) from 3.0.0 to 3.1.0. - [Release notes](https://github.com/apache/maven-deploy-plugin/releases) - [Commits](https://github.com/apache/maven-deploy-plugin/compare/maven-deploy-plugin-3.0.0...maven-deploy-plugin-3.1.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-deploy-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 60bcc21a..f44f27e3 100644 --- a/pom.xml +++ b/pom.xml @@ -104,7 +104,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.0.0 + 3.1.0 org.apache.maven.plugins From 7b167869e22439fe8bea29afc7eb633ecc42ec7a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Feb 2023 07:11:19 +0100 Subject: [PATCH 32/87] chore(deps): bump maven-surefire-plugin from 3.0.0-M8 to 3.0.0-M9 (#903) Bumps [maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.0.0-M8 to 3.0.0-M9. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.0.0-M8...surefire-3.0.0-M9) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f44f27e3..0fe85a50 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M8 + 3.0.0-M9 org.apache.maven.plugins From 870655753028c002af75ce450b98c35e01ac130c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Feb 2023 07:11:44 +0100 Subject: [PATCH 33/87] chore(deps): bump maven-javadoc-plugin from 3.4.1 to 3.5.0 (#904) Bumps [maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.4.1 to 3.5.0. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.4.1...maven-javadoc-plugin-3.5.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0fe85a50..c3cc423e 100644 --- a/pom.xml +++ b/pom.xml @@ -183,7 +183,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.4.1 + 3.5.0 8 From f22a67a6953cd3b596bca20a904942827b3088b6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Feb 2023 07:14:45 +0100 Subject: [PATCH 34/87] chore(deps): bump versions-maven-plugin from 2.14.2 to 2.15.0 (#906) Bumps [versions-maven-plugin](https://github.com/mojohaus/versions) from 2.14.2 to 2.15.0. - [Release notes](https://github.com/mojohaus/versions/releases) - [Changelog](https://github.com/mojohaus/versions/blob/master/ReleaseNotes.md) - [Commits](https://github.com/mojohaus/versions/compare/2.14.2...2.15.0) --- updated-dependencies: - dependency-name: org.codehaus.mojo:versions-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index c3cc423e..533db237 100644 --- a/pom.xml +++ b/pom.xml @@ -75,7 +75,7 @@ org.codehaus.mojo versions-maven-plugin - 2.14.2 + 2.15.0 org.apache.maven.plugins From f7dd938762cd8bb9eef80edfdfbc32ce7a4c4c3b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 07:22:12 +0100 Subject: [PATCH 35/87] chore(deps): bump maven-compiler-plugin from 3.10.1 to 3.11.0 (#907) Bumps [maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.10.1 to 3.11.0. - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.10.1...maven-compiler-plugin-3.11.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-compiler-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 533db237..f054e954 100644 --- a/pom.xml +++ b/pom.xml @@ -80,7 +80,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.10.1 + 3.11.0 1.8 1.8 From 086b8e36a31da6577a4183b154e148fc7378dc80 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 07:00:23 +0100 Subject: [PATCH 36/87] chore(deps): bump maven-surefire-plugin from 3.0.0-M9 to 3.0.0 (#911) Bumps [maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.0.0-M9 to 3.0.0. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.0.0-M9...surefire-3.0.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f054e954..6c82221a 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M9 + 3.0.0 org.apache.maven.plugins From 73dfd18fd82e7aa37d41d428cbf201b6cf1fd149 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 07:10:53 +0200 Subject: [PATCH 37/87] chore(deps): bump maven-install-plugin from 3.1.0 to 3.1.1 (#916) Bumps [maven-install-plugin](https://github.com/apache/maven-install-plugin) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/apache/maven-install-plugin/releases) - [Commits](https://github.com/apache/maven-install-plugin/compare/maven-install-plugin-3.1.0...maven-install-plugin-3.1.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-install-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6c82221a..d1342777 100644 --- a/pom.xml +++ b/pom.xml @@ -109,7 +109,7 @@ org.apache.maven.plugins maven-install-plugin - 3.1.0 + 3.1.1 org.apache.maven.plugins From 5d69d0580e714eeca570b1ad294122ad557b9ae7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 07:11:21 +0200 Subject: [PATCH 38/87] chore(deps): bump maven-release-plugin from 3.0.0-M6 to 3.0.0 (#914) Bumps [maven-release-plugin](https://github.com/apache/maven-release) from 3.0.0-M6 to 3.0.0. - [Release notes](https://github.com/apache/maven-release/releases) - [Commits](https://github.com/apache/maven-release/compare/maven-release-3.0.0-M6...maven-release-3.0.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-release-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d1342777..5687d489 100644 --- a/pom.xml +++ b/pom.xml @@ -131,7 +131,7 @@ org.apache.maven.plugins maven-release-plugin - 3.0.0-M6 + 3.0.0 From b04459b7f40deecdef82ab375d59f4802da331f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 07:11:41 +0200 Subject: [PATCH 39/87] chore(deps): bump maven-deploy-plugin from 3.1.0 to 3.1.1 (#913) Bumps [maven-deploy-plugin](https://github.com/apache/maven-deploy-plugin) from 3.1.0 to 3.1.1. - [Release notes](https://github.com/apache/maven-deploy-plugin/releases) - [Commits](https://github.com/apache/maven-deploy-plugin/compare/maven-deploy-plugin-3.1.0...maven-deploy-plugin-3.1.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-deploy-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5687d489..7194637b 100644 --- a/pom.xml +++ b/pom.xml @@ -104,7 +104,7 @@ org.apache.maven.plugins maven-deploy-plugin - 3.1.0 + 3.1.1 org.apache.maven.plugins From 12bd1b1e43d6b77787e3e640c5dc5bcb3ed14880 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 07:12:01 +0200 Subject: [PATCH 40/87] chore(deps): bump maven-resources-plugin from 3.3.0 to 3.3.1 (#912) Bumps [maven-resources-plugin](https://github.com/apache/maven-resources-plugin) from 3.3.0 to 3.3.1. - [Release notes](https://github.com/apache/maven-resources-plugin/releases) - [Commits](https://github.com/apache/maven-resources-plugin/compare/maven-resources-plugin-3.3.0...maven-resources-plugin-3.3.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-resources-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 7194637b..19e60f00 100644 --- a/pom.xml +++ b/pom.xml @@ -126,7 +126,7 @@ org.apache.maven.plugins maven-resources-plugin - 3.3.0 + 3.3.1 org.apache.maven.plugins @@ -333,7 +333,7 @@ maven-resources-plugin - 3.3.0 + 3.3.1 copy-resources From f1d064f6d8dc444cc9227be246f378329cee22b1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 14:33:43 +0200 Subject: [PATCH 41/87] chore(deps): bump maven-enforcer-plugin from 3.2.1 to 3.3.0 (#920) Bumps [maven-enforcer-plugin](https://github.com/apache/maven-enforcer) from 3.2.1 to 3.3.0. - [Release notes](https://github.com/apache/maven-enforcer/releases) - [Commits](https://github.com/apache/maven-enforcer/compare/enforcer-3.2.1...enforcer-3.3.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-enforcer-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 19e60f00..fa0a0410 100644 --- a/pom.xml +++ b/pom.xml @@ -139,7 +139,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.2.1 + 3.3.0 enforce-maven From 27eec0c7da8c32df61125e6aa90a4e728d9ed85d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Apr 2023 09:12:48 +0200 Subject: [PATCH 42/87] chore(deps): bump okhttp from 4.10.0 to 4.11.0 (#923) Bumps [okhttp](https://github.com/square/okhttp) from 4.10.0 to 4.11.0. - [Release notes](https://github.com/square/okhttp/releases) - [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md) - [Commits](https://github.com/square/okhttp/compare/parent-4.10.0...parent-4.11.0) --- updated-dependencies: - dependency-name: com.squareup.okhttp3:okhttp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index fa0a0410..84e33658 100644 --- a/pom.xml +++ b/pom.xml @@ -315,7 +315,7 @@ com.squareup.okhttp3 okhttp - 4.10.0 + 4.11.0 com.squareup.okhttp3 From 7ba9cb9e1c85d0f220293884ee5c1d3e3c6c3b41 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Apr 2023 09:13:10 +0200 Subject: [PATCH 43/87] chore(deps): bump maven-checkstyle-plugin from 3.2.1 to 3.2.2 (#924) Bumps [maven-checkstyle-plugin](https://github.com/apache/maven-checkstyle-plugin) from 3.2.1 to 3.2.2. - [Release notes](https://github.com/apache/maven-checkstyle-plugin/releases) - [Commits](https://github.com/apache/maven-checkstyle-plugin/compare/maven-checkstyle-plugin-3.2.1...maven-checkstyle-plugin-3.2.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-checkstyle-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 84e33658..46239d47 100644 --- a/pom.xml +++ b/pom.xml @@ -218,7 +218,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.2.1 + 3.2.2 com.puppycrawl.tools From 59bafab64f19f777ec78163df9c01cfb7d4531be Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Apr 2023 09:13:48 +0200 Subject: [PATCH 44/87] chore(deps): bump logging-interceptor from 4.10.0 to 4.11.0 (#925) Bumps [logging-interceptor](https://github.com/square/okhttp) from 4.10.0 to 4.11.0. - [Release notes](https://github.com/square/okhttp/releases) - [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md) - [Commits](https://github.com/square/okhttp/compare/parent-4.10.0...parent-4.11.0) --- updated-dependencies: - dependency-name: com.squareup.okhttp3:logging-interceptor dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 46239d47..8daaf589 100644 --- a/pom.xml +++ b/pom.xml @@ -320,7 +320,7 @@ com.squareup.okhttp3 logging-interceptor - 4.10.0 + 4.11.0 From ca213db4928cfbc09d92806dfc566859c32ddfab Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 May 2023 08:56:58 +0200 Subject: [PATCH 45/87] chore(deps-dev): bump junit-jupiter-engine from 5.9.2 to 5.9.3 (#929) Bumps [junit-jupiter-engine](https://github.com/junit-team/junit5) from 5.9.2 to 5.9.3. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/compare/r5.9.2...r5.9.3) --- updated-dependencies: - dependency-name: org.junit.jupiter:junit-jupiter-engine dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8daaf589..08c830b5 100644 --- a/pom.xml +++ b/pom.xml @@ -256,7 +256,7 @@ org.junit.jupiter junit-jupiter-engine - 5.9.2 + 5.9.3 test From cd8beb19f7d4e4ad39aab25a66d31cdde45328cd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 May 2023 08:57:25 +0200 Subject: [PATCH 46/87] chore(deps): bump jacoco-maven-plugin from 0.8.8 to 0.8.10 (#928) Bumps [jacoco-maven-plugin](https://github.com/jacoco/jacoco) from 0.8.8 to 0.8.10. - [Release notes](https://github.com/jacoco/jacoco/releases) - [Commits](https://github.com/jacoco/jacoco/compare/v0.8.8...v0.8.10) --- updated-dependencies: - dependency-name: org.jacoco:jacoco-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 08c830b5..6b41ee92 100644 --- a/pom.xml +++ b/pom.xml @@ -199,7 +199,7 @@ org.jacoco jacoco-maven-plugin - 0.8.8 + 0.8.10 From 599886a6023942e00f197c7a8e3b1c9e0ea3651c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 May 2023 08:57:55 +0200 Subject: [PATCH 47/87] chore(deps-dev): bump junit-platform-runner from 1.9.2 to 1.9.3 (#926) Bumps [junit-platform-runner](https://github.com/junit-team/junit5) from 1.9.2 to 1.9.3. - [Release notes](https://github.com/junit-team/junit5/releases) - [Commits](https://github.com/junit-team/junit5/commits) --- updated-dependencies: - dependency-name: org.junit.platform:junit-platform-runner dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 6b41ee92..745cdadf 100644 --- a/pom.xml +++ b/pom.xml @@ -262,7 +262,7 @@ org.junit.platform junit-platform-runner - 1.9.2 + 1.9.3 test From 8b01672859311a8e327f044ce117e1afefefd5f0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Jun 2023 06:56:44 +0200 Subject: [PATCH 48/87] chore(deps): bump maven-surefire-plugin from 3.0.0 to 3.1.2 (#938) Bumps [maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.0.0 to 3.1.2. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.0.0...surefire-3.1.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 745cdadf..689690fb 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.0.0 + 3.1.2 org.apache.maven.plugins From a8d1399344064ad293624c1b655be2f27b8b0399 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 07:33:38 +0200 Subject: [PATCH 49/87] chore(deps): bump versions-maven-plugin from 2.15.0 to 2.16.0 (#940) Bumps [versions-maven-plugin](https://github.com/mojohaus/versions) from 2.15.0 to 2.16.0. - [Release notes](https://github.com/mojohaus/versions/releases) - [Changelog](https://github.com/mojohaus/versions/blob/master/ReleaseNotes.md) - [Commits](https://github.com/mojohaus/versions/compare/2.15.0...2.16.0) --- updated-dependencies: - dependency-name: org.codehaus.mojo:versions-maven-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 689690fb..4c2fcadd 100644 --- a/pom.xml +++ b/pom.xml @@ -75,7 +75,7 @@ org.codehaus.mojo versions-maven-plugin - 2.15.0 + 2.16.0 org.apache.maven.plugins From 56dd341733203589dd750d5c127402603177202b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 07:34:22 +0200 Subject: [PATCH 50/87] chore(deps): bump maven-checkstyle-plugin from 3.2.2 to 3.3.0 (#936) Bumps [maven-checkstyle-plugin](https://github.com/apache/maven-checkstyle-plugin) from 3.2.2 to 3.3.0. - [Commits](https://github.com/apache/maven-checkstyle-plugin/compare/maven-checkstyle-plugin-3.2.2...maven-checkstyle-plugin-3.3.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-checkstyle-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4c2fcadd..28faa89e 100644 --- a/pom.xml +++ b/pom.xml @@ -218,7 +218,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.2.2 + 3.3.0 com.puppycrawl.tools From c2dff05c34375f0ba4ae02e41687c32d233d252d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 07:34:49 +0200 Subject: [PATCH 51/87] chore(deps): bump maven-gpg-plugin from 3.0.1 to 3.1.0 (#931) Bumps [maven-gpg-plugin](https://github.com/apache/maven-gpg-plugin) from 3.0.1 to 3.1.0. - [Commits](https://github.com/apache/maven-gpg-plugin/compare/maven-gpg-plugin-3.0.1...maven-gpg-plugin-3.1.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-gpg-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 28faa89e..7a68ae5e 100644 --- a/pom.xml +++ b/pom.xml @@ -390,7 +390,7 @@ org.apache.maven.plugins maven-gpg-plugin - 3.0.1 + 3.1.0 sign-artifacts From 305bbeb84d6c5f3f17009a9d95d9e846c5c0472a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jul 2023 07:22:56 +0200 Subject: [PATCH 52/87] chore(deps): bump maven-release-plugin from 3.0.0 to 3.0.1 (#943) Bumps [maven-release-plugin](https://github.com/apache/maven-release) from 3.0.0 to 3.0.1. - [Release notes](https://github.com/apache/maven-release/releases) - [Commits](https://github.com/apache/maven-release/compare/maven-release-3.0.0...maven-release-3.0.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-release-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7a68ae5e..b8de7736 100644 --- a/pom.xml +++ b/pom.xml @@ -131,7 +131,7 @@ org.apache.maven.plugins maven-release-plugin - 3.0.0 + 3.0.1 From efcf9ab496609a385a9b6bee962dcb3d414f3996 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Jul 2023 07:23:23 +0200 Subject: [PATCH 53/87] chore(deps): bump maven-clean-plugin from 3.2.0 to 3.3.1 (#942) Bumps [maven-clean-plugin](https://github.com/apache/maven-clean-plugin) from 3.2.0 to 3.3.1. - [Release notes](https://github.com/apache/maven-clean-plugin/releases) - [Commits](https://github.com/apache/maven-clean-plugin/compare/maven-clean-plugin-3.2.0...maven-clean-plugin-3.3.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-clean-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b8de7736..34ae8aea 100644 --- a/pom.xml +++ b/pom.xml @@ -99,7 +99,7 @@ org.apache.maven.plugins maven-clean-plugin - 3.2.0 + 3.3.1 org.apache.maven.plugins From eb31d7be70b6ae80e12103a8db96979aedbd40e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jul 2023 07:36:29 +0200 Subject: [PATCH 54/87] chore(deps): bump msgpack-core from 0.9.3 to 0.9.4 (#944) Bumps [msgpack-core](https://github.com/msgpack/msgpack-java) from 0.9.3 to 0.9.4. - [Release notes](https://github.com/msgpack/msgpack-java/releases) - [Changelog](https://github.com/msgpack/msgpack-java/blob/develop/RELEASE_NOTES.md) - [Commits](https://github.com/msgpack/msgpack-java/compare/v0.9.3...v0.9.4) --- updated-dependencies: - dependency-name: org.msgpack:msgpack-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 34ae8aea..f750b59d 100644 --- a/pom.xml +++ b/pom.xml @@ -308,7 +308,7 @@ org.msgpack msgpack-core - 0.9.3 + 0.9.4 From 21baacfeb87b0f23bbbf34fe7d5c3b5d0a488876 Mon Sep 17 00:00:00 2001 From: Jamie Strandboge Date: Tue, 18 Jul 2023 16:36:05 -0500 Subject: [PATCH 55/87] chore: update README.md based on feedback from Product (#945) --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index ab8e1fdd..74f6a5ba 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ This is the official (and community-maintained) Java client library for [InfluxDB](https://www.influxdata.com/products/influxdb-overview/) (1.x), the open source time series database that is part of the TICK (Telegraf, InfluxDB, Chronograf, Kapacitor) stack. +For InfluxDB 3.0 users, this library is succeeded by the lightweight [v3 client library](https://github.com/InfluxCommunity/influxdb3-java). + _Note: This library is for use with InfluxDB 1.x and [2.x compatibility API](https://docs.influxdata.com/influxdb/v2.0/reference/api/influxdb-1x/). For full supports of InfluxDB 2.x features, please use the [influxdb-client-java](https://github.com/influxdata/influxdb-client-java) client._ ## Adding the library to your project From 52b53f48f8a11eb5b2e4d070669a719e565be141 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Aug 2023 06:51:19 +0200 Subject: [PATCH 56/87] chore(deps): bump org.apache.maven.plugins:maven-enforcer-plugin (#950) Bumps [org.apache.maven.plugins:maven-enforcer-plugin](https://github.com/apache/maven-enforcer) from 3.3.0 to 3.4.0. - [Release notes](https://github.com/apache/maven-enforcer/releases) - [Commits](https://github.com/apache/maven-enforcer/compare/enforcer-3.3.0...enforcer-3.4.0) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-enforcer-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f750b59d..a6770b0d 100644 --- a/pom.xml +++ b/pom.xml @@ -139,7 +139,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.3.0 + 3.4.0 enforce-maven From b1d1d8a2ed4430f6b6ac271362acab7b493be984 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Aug 2023 06:52:14 +0200 Subject: [PATCH 57/87] chore(deps): bump org.msgpack:msgpack-core from 0.9.4 to 0.9.5 (#949) Bumps [org.msgpack:msgpack-core](https://github.com/msgpack/msgpack-java) from 0.9.4 to 0.9.5. - [Release notes](https://github.com/msgpack/msgpack-java/releases) - [Changelog](https://github.com/msgpack/msgpack-java/blob/develop/RELEASE_NOTES.md) - [Commits](https://github.com/msgpack/msgpack-java/compare/v0.9.4...v0.9.5) --- updated-dependencies: - dependency-name: org.msgpack:msgpack-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a6770b0d..59ea3351 100644 --- a/pom.xml +++ b/pom.xml @@ -308,7 +308,7 @@ org.msgpack msgpack-core - 0.9.4 + 0.9.5 From abc3f41c02f4999c1d9973fa59b9f1b2dd456ccb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 07:16:10 +0100 Subject: [PATCH 58/87] chore(deps): bump org.codehaus.mojo:versions-maven-plugin (#963) Bumps [org.codehaus.mojo:versions-maven-plugin](https://github.com/mojohaus/versions) from 2.16.0 to 2.16.2. - [Release notes](https://github.com/mojohaus/versions/releases) - [Changelog](https://github.com/mojohaus/versions/blob/master/ReleaseNotes.md) - [Commits](https://github.com/mojohaus/versions/compare/2.16.0...2.16.2) --- updated-dependencies: - dependency-name: org.codehaus.mojo:versions-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 59ea3351..84ea8497 100644 --- a/pom.xml +++ b/pom.xml @@ -75,7 +75,7 @@ org.codehaus.mojo versions-maven-plugin - 2.16.0 + 2.16.2 org.apache.maven.plugins From 08e6d1000a497a84edf8c65d36fba8ab3019012a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 07:16:37 +0100 Subject: [PATCH 59/87] chore(deps): bump org.apache.maven.plugins:maven-javadoc-plugin (#961) Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.5.0 to 3.6.2. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.5.0...maven-javadoc-plugin-3.6.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 84ea8497..351fac5e 100644 --- a/pom.xml +++ b/pom.xml @@ -183,7 +183,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.5.0 + 3.6.2 8 From e9ae27bfef433292d4bdde8ab567ddc89d96f0e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 07:17:08 +0100 Subject: [PATCH 60/87] chore(deps): bump org.msgpack:msgpack-core from 0.9.5 to 0.9.6 (#956) Bumps [org.msgpack:msgpack-core](https://github.com/msgpack/msgpack-java) from 0.9.5 to 0.9.6. - [Release notes](https://github.com/msgpack/msgpack-java/releases) - [Changelog](https://github.com/msgpack/msgpack-java/blob/main/RELEASE_NOTES.md) - [Commits](https://github.com/msgpack/msgpack-java/compare/v0.9.5...v0.9.6) --- updated-dependencies: - dependency-name: org.msgpack:msgpack-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 351fac5e..d15fbb13 100644 --- a/pom.xml +++ b/pom.xml @@ -308,7 +308,7 @@ org.msgpack msgpack-core - 0.9.5 + 0.9.6 From 14c85772fc10c39966fd6811948d6d28c74c8978 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Nov 2023 07:17:33 +0100 Subject: [PATCH 61/87] chore(deps): bump org.apache.maven.plugins:maven-enforcer-plugin (#954) Bumps [org.apache.maven.plugins:maven-enforcer-plugin](https://github.com/apache/maven-enforcer) from 3.4.0 to 3.4.1. - [Release notes](https://github.com/apache/maven-enforcer/releases) - [Commits](https://github.com/apache/maven-enforcer/compare/enforcer-3.4.0...enforcer-3.4.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-enforcer-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d15fbb13..28bc8ea8 100644 --- a/pom.xml +++ b/pom.xml @@ -139,7 +139,7 @@ org.apache.maven.plugins maven-enforcer-plugin - 3.4.0 + 3.4.1 enforce-maven From 66589bd5bf8dc2832914132afc2b2f8cfb9d8d23 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 07:11:12 +0100 Subject: [PATCH 62/87] chore(deps): bump com.squareup.okhttp3:okhttp from 4.11.0 to 4.12.0 (#969) Bumps [com.squareup.okhttp3:okhttp](https://github.com/square/okhttp) from 4.11.0 to 4.12.0. - [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md) - [Commits](https://github.com/square/okhttp/compare/parent-4.11.0...parent-4.12.0) --- updated-dependencies: - dependency-name: com.squareup.okhttp3:okhttp dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 28bc8ea8..d16de744 100644 --- a/pom.xml +++ b/pom.xml @@ -315,7 +315,7 @@ com.squareup.okhttp3 okhttp - 4.11.0 + 4.12.0 com.squareup.okhttp3 From d96f2f65d5a4235e212edf39ab0c7b7bf3a75106 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 07:11:43 +0100 Subject: [PATCH 63/87] chore(deps): bump org.apache.maven.plugins:maven-clean-plugin (#968) Bumps [org.apache.maven.plugins:maven-clean-plugin](https://github.com/apache/maven-clean-plugin) from 3.3.1 to 3.3.2. - [Release notes](https://github.com/apache/maven-clean-plugin/releases) - [Commits](https://github.com/apache/maven-clean-plugin/compare/maven-clean-plugin-3.3.1...maven-clean-plugin-3.3.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-clean-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d16de744..57eee394 100644 --- a/pom.xml +++ b/pom.xml @@ -99,7 +99,7 @@ org.apache.maven.plugins maven-clean-plugin - 3.3.1 + 3.3.2 org.apache.maven.plugins From d7052c5a5017ca84f25b70a9b30113ca35395bac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 07:12:04 +0100 Subject: [PATCH 64/87] chore(deps): bump com.squareup.okhttp3:logging-interceptor (#967) Bumps [com.squareup.okhttp3:logging-interceptor](https://github.com/square/okhttp) from 4.11.0 to 4.12.0. - [Changelog](https://github.com/square/okhttp/blob/master/CHANGELOG.md) - [Commits](https://github.com/square/okhttp/compare/parent-4.11.0...parent-4.12.0) --- updated-dependencies: - dependency-name: com.squareup.okhttp3:logging-interceptor dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 57eee394..516d5081 100644 --- a/pom.xml +++ b/pom.xml @@ -320,7 +320,7 @@ com.squareup.okhttp3 logging-interceptor - 4.11.0 + 4.12.0 From d3a7bbcce9a5bfaf17ee0c93fb46d8d4fe027631 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Nov 2023 07:12:30 +0100 Subject: [PATCH 65/87] chore(deps): bump org.apache.maven.plugins:maven-surefire-plugin (#966) Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.1.2 to 3.2.2. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.1.2...surefire-3.2.2) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 516d5081..70c238cf 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.1.2 + 3.2.2 org.apache.maven.plugins From ba9bfebf2a24672b48827660ece79b45fbefe8bd Mon Sep 17 00:00:00 2001 From: Eran Leshem <1707552+eranl@users.noreply.github.com> Date: Sat, 2 Dec 2023 19:18:04 +0200 Subject: [PATCH 66/87] Default column name to pojo field name, and add `allFields` mode to `Measurement` annotation (#972) --- MANUAL.md | 29 +++- .../java/org/influxdb/annotation/Column.java | 5 +- .../java/org/influxdb/annotation/Exclude.java | 38 +++++ .../org/influxdb/annotation/Measurement.java | 7 + src/main/java/org/influxdb/dto/Point.java | 44 ++++-- .../influxdb/impl/InfluxDBResultMapper.java | 56 ++++--- src/test/java/org/influxdb/dto/PointTest.java | 141 ++++++++++++++++-- .../impl/InfluxDBResultMapperTest.java | 56 +++++-- 8 files changed, 309 insertions(+), 67 deletions(-) create mode 100644 src/main/java/org/influxdb/annotation/Exclude.java diff --git a/MANUAL.md b/MANUAL.md index 62d45d67..18040aea 100644 --- a/MANUAL.md +++ b/MANUAL.md @@ -323,21 +323,40 @@ public class Cpu { } ``` -2. Add @Measurement,@TimeColumn and @Column annotations: +2. Add @Measurement,@TimeColumn and @Column annotations (column names default to field names unless otherwise specified): ```Java @Measurement(name = "cpu") public class Cpu { @TimeColumn - @Column(name = "time") + @Column private Instant time; @Column(name = "host", tag = true) private String hostname; - @Column(name = "region", tag = true) + @Column(tag = true) + private String region; + @Column + private Double idle; + @Column + private Boolean happydevop; + @Column(name = "uptimesecs") + private Long uptimeSecs; + // getters (and setters if you need) +} +``` + +Alternatively, you can use: + +```Java +@Measurement(name = "cpu", allFields = true) +public class Cpu { + @TimeColumn + private Instant time; + @Column(name = "host", tag = true) + private String hostname; + @Column(tag = true) private String region; - @Column(name = "idle") private Double idle; - @Column(name = "happydevop") private Boolean happydevop; @Column(name = "uptimesecs") private Long uptimeSecs; diff --git a/src/main/java/org/influxdb/annotation/Column.java b/src/main/java/org/influxdb/annotation/Column.java index cde2fbe5..6edb256f 100644 --- a/src/main/java/org/influxdb/annotation/Column.java +++ b/src/main/java/org/influxdb/annotation/Column.java @@ -32,7 +32,10 @@ @Target(ElementType.FIELD) public @interface Column { - String name(); + /** + * If unset, the annotated field's name will be used as the column name. + */ + String name() default ""; boolean tag() default false; } diff --git a/src/main/java/org/influxdb/annotation/Exclude.java b/src/main/java/org/influxdb/annotation/Exclude.java new file mode 100644 index 00000000..01e6f52e --- /dev/null +++ b/src/main/java/org/influxdb/annotation/Exclude.java @@ -0,0 +1,38 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2017 azeti Networks AG () + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + * associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package org.influxdb.annotation; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * When a POJO annotated with {@code @Measurement(allFields = true)} is loaded or saved, + * this annotation can be used to exclude some of its fields. + * @see Measurement#allFields() + * + * @author Eran Leshem + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.FIELD) +public @interface Exclude { +} diff --git a/src/main/java/org/influxdb/annotation/Measurement.java b/src/main/java/org/influxdb/annotation/Measurement.java index a834bfba..fa9d19fd 100644 --- a/src/main/java/org/influxdb/annotation/Measurement.java +++ b/src/main/java/org/influxdb/annotation/Measurement.java @@ -40,4 +40,11 @@ String retentionPolicy() default "autogen"; TimeUnit timeUnit() default TimeUnit.MILLISECONDS; + + /** + * If {@code true}, then all non-static fields of this measurement will be loaded or saved, + * regardless of any {@code @Column} annotations. + * @see Exclude + */ + boolean allFields() default false; } diff --git a/src/main/java/org/influxdb/dto/Point.java b/src/main/java/org/influxdb/dto/Point.java index 96069026..b8cc9e2e 100755 --- a/src/main/java/org/influxdb/dto/Point.java +++ b/src/main/java/org/influxdb/dto/Point.java @@ -1,7 +1,15 @@ package org.influxdb.dto; +import org.influxdb.BuilderException; +import org.influxdb.annotation.Column; +import org.influxdb.annotation.Exclude; +import org.influxdb.annotation.Measurement; +import org.influxdb.annotation.TimeColumn; +import org.influxdb.impl.Preconditions; + import java.lang.annotation.Annotation; import java.lang.reflect.Field; +import java.lang.reflect.Modifier; import java.math.BigDecimal; import java.math.BigInteger; import java.math.RoundingMode; @@ -11,14 +19,9 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Objects; -import java.util.TreeMap; import java.util.Optional; +import java.util.TreeMap; import java.util.concurrent.TimeUnit; -import org.influxdb.BuilderException; -import org.influxdb.annotation.Column; -import org.influxdb.annotation.Measurement; -import org.influxdb.annotation.TimeColumn; -import org.influxdb.impl.Preconditions; /** * Representation of a InfluxDB database Point. @@ -276,23 +279,34 @@ public boolean hasFields() { */ public Builder addFieldsFromPOJO(final Object pojo) { - Class clazz = pojo.getClass(); + Class clazz = pojo.getClass(); + Measurement measurement = clazz.getAnnotation(Measurement.class); + boolean allFields = measurement != null && measurement.allFields(); + while (clazz != null) { for (Field field : clazz.getDeclaredFields()) { Column column = field.getAnnotation(Column.class); - if (column == null) { + if (column == null && !(allFields + && !field.isAnnotationPresent(Exclude.class) && !Modifier.isStatic(field.getModifiers()))) { continue; } field.setAccessible(true); - String fieldName = column.name(); - addFieldByAttribute(pojo, field, column, fieldName); + + String fieldName; + if (column != null && !column.name().isEmpty()) { + fieldName = column.name(); + } else { + fieldName = field.getName(); + } + + addFieldByAttribute(pojo, field, column != null && column.tag(), fieldName); } - clazz = clazz.getSuperclass(); - } + clazz = clazz.getSuperclass(); + } if (this.fields.isEmpty()) { throw new BuilderException("Class " + pojo.getClass().getName() @@ -302,8 +316,8 @@ public Builder addFieldsFromPOJO(final Object pojo) { return this; } - private void addFieldByAttribute(final Object pojo, final Field field, final Column column, - final String fieldName) { + private void addFieldByAttribute(final Object pojo, final Field field, final boolean tag, + final String fieldName) { try { Object fieldValue = field.get(pojo); @@ -325,7 +339,7 @@ private void addFieldByAttribute(final Object pojo, final Field field, final Col return; } - if (column.tag()) { + if (tag) { if (fieldValue != null) { this.tags.put(fieldName, (String) fieldValue); } diff --git a/src/main/java/org/influxdb/impl/InfluxDBResultMapper.java b/src/main/java/org/influxdb/impl/InfluxDBResultMapper.java index d6edef17..15d4c283 100644 --- a/src/main/java/org/influxdb/impl/InfluxDBResultMapper.java +++ b/src/main/java/org/influxdb/impl/InfluxDBResultMapper.java @@ -20,7 +20,14 @@ */ package org.influxdb.impl; +import org.influxdb.InfluxDBMapperException; +import org.influxdb.annotation.Column; +import org.influxdb.annotation.Exclude; +import org.influxdb.annotation.Measurement; +import org.influxdb.dto.QueryResult; + import java.lang.reflect.Field; +import java.lang.reflect.Modifier; import java.time.Instant; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatterBuilder; @@ -33,11 +40,6 @@ import java.util.concurrent.ConcurrentMap; import java.util.concurrent.TimeUnit; -import org.influxdb.InfluxDBMapperException; -import org.influxdb.annotation.Column; -import org.influxdb.annotation.Measurement; -import org.influxdb.dto.QueryResult; - /** * Main class responsible for mapping a QueryResult to a POJO. * @@ -213,13 +215,19 @@ void cacheMeasurementClass(final Class... classVarAgrs) { } ConcurrentMap influxColumnAndFieldMap = new ConcurrentHashMap<>(); + Measurement measurement = clazz.getAnnotation(Measurement.class); + boolean allFields = measurement != null && measurement.allFields(); + Class c = clazz; while (c != null) { for (Field field : c.getDeclaredFields()) { Column colAnnotation = field.getAnnotation(Column.class); - if (colAnnotation != null) { - influxColumnAndFieldMap.put(colAnnotation.name(), field); + if (colAnnotation == null && !(allFields + && !field.isAnnotationPresent(Exclude.class) && !Modifier.isStatic(field.getModifiers()))) { + continue; } + + influxColumnAndFieldMap.put(getFieldName(field, colAnnotation), field); } c = c.getSuperclass(); } @@ -227,6 +235,14 @@ void cacheMeasurementClass(final Class... classVarAgrs) { } } + private static String getFieldName(final Field field, final Column colAnnotation) { + if (colAnnotation != null && !colAnnotation.name().isEmpty()) { + return colAnnotation.name(); + } + + return field.getName(); + } + String getMeasurementName(final Class clazz) { return ((Measurement) clazz.getAnnotation(Measurement.class)).name(); } @@ -289,17 +305,11 @@ List parseSeriesAs(final QueryResult.Series series, final Class clazz, /** * InfluxDB client returns any number as Double. - * See https://github.com/influxdata/influxdb-java/issues/153#issuecomment-259681987 + * See ... * for more information. * - * @param object - * @param field - * @param value - * @param precision - * @throws IllegalArgumentException - * @throws IllegalAccessException */ - void setFieldValue(final T object, final Field field, final Object value, final TimeUnit precision) + private static void setFieldValue(final T object, final Field field, final Object value, final TimeUnit precision) throws IllegalArgumentException, IllegalAccessException { if (value == null) { return; @@ -325,8 +335,8 @@ void setFieldValue(final T object, final Field field, final Object value, fi } } - boolean fieldValueModified(final Class fieldType, final Field field, final T object, final Object value, - final TimeUnit precision) + static boolean fieldValueModified(final Class fieldType, final Field field, final T object, final Object value, + final TimeUnit precision) throws IllegalArgumentException, IllegalAccessException { if (String.class.isAssignableFrom(fieldType)) { field.set(object, String.valueOf(value)); @@ -351,8 +361,9 @@ boolean fieldValueModified(final Class fieldType, final Field field, fina return false; } - boolean fieldValueForPrimitivesModified(final Class fieldType, final Field field, final T object, - final Object value) throws IllegalArgumentException, IllegalAccessException { + static boolean fieldValueForPrimitivesModified(final Class fieldType, final Field field, final T object, + final Object value) + throws IllegalArgumentException, IllegalAccessException { if (double.class.isAssignableFrom(fieldType)) { field.setDouble(object, ((Double) value).doubleValue()); return true; @@ -372,8 +383,9 @@ boolean fieldValueForPrimitivesModified(final Class fieldType, final Fiel return false; } - boolean fieldValueForPrimitiveWrappersModified(final Class fieldType, final Field field, final T object, - final Object value) throws IllegalArgumentException, IllegalAccessException { + static boolean fieldValueForPrimitiveWrappersModified(final Class fieldType, final Field field, final T object, + final Object value) + throws IllegalArgumentException, IllegalAccessException { if (Double.class.isAssignableFrom(fieldType)) { field.set(object, value); return true; @@ -393,7 +405,7 @@ boolean fieldValueForPrimitiveWrappersModified(final Class fieldType, fin return false; } - private Long toMillis(final long value, final TimeUnit precision) { + private static Long toMillis(final long value, final TimeUnit precision) { return TimeUnit.MILLISECONDS.convert(value, precision); } diff --git a/src/test/java/org/influxdb/dto/PointTest.java b/src/test/java/org/influxdb/dto/PointTest.java index a4945417..c315aad2 100755 --- a/src/test/java/org/influxdb/dto/PointTest.java +++ b/src/test/java/org/influxdb/dto/PointTest.java @@ -1,7 +1,17 @@ package org.influxdb.dto; -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.Mockito.mock; +import org.influxdb.BuilderException; +import org.influxdb.InfluxDB; +import org.influxdb.annotation.Column; +import org.influxdb.annotation.Measurement; +import org.influxdb.annotation.TimeColumn; +import org.influxdb.impl.InfluxDBImpl; +import org.junit.Assert; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.platform.runner.JUnitPlatform; +import org.junit.runner.RunWith; +import org.mockito.Mockito; import java.lang.reflect.Field; import java.math.BigDecimal; @@ -16,18 +26,8 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicLong; -import org.influxdb.BuilderException; -import org.influxdb.InfluxDB; -import org.influxdb.annotation.Column; -import org.influxdb.annotation.Measurement; -import org.influxdb.annotation.TimeColumn; -import org.influxdb.impl.InfluxDBImpl; -import org.junit.Assert; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.junit.platform.runner.JUnitPlatform; -import org.junit.runner.RunWith; -import org.mockito.Mockito; +import static org.assertj.core.api.Assertions.assertThat; +import static org.mockito.Mockito.mock; /** * Test for the Point DTO. @@ -794,6 +794,63 @@ public void testAddFieldsFromPOJOWithPublicAttributes() { Assertions.assertEquals(pojo.uuid, p.getTags().get("uuid")); } + @Test + public void testAddFieldsFromPojoWithAllFieldsAnnotation() { + + PojoWithAllFieldsAnnotation pojo = new PojoWithAllFieldsAnnotation(); + pojo.booleanObject = true; + pojo.booleanPrimitive = false; + pojo.doubleObject = 2.0; + pojo.doublePrimitive = 3.1; + pojo.integerObject = 32; + pojo.integerPrimitive = 64; + pojo.longObject = 1L; + pojo.longPrimitive = 2L; + pojo.time = Instant.now(); + pojo.uuid = "TEST"; + + Point p = Point.measurementByPOJO(PojoWithAllFieldsAnnotation.class).addFieldsFromPOJO(pojo).build(); + + assertThat(p.lineProtocol()).startsWith("mymeasurement"); + assertThat(p.getFields()).doesNotContainKey("staticField"); + Assertions.assertEquals(pojo.booleanObject, p.getFields().get("booleanObject")); + Assertions.assertEquals(pojo.booleanPrimitive, p.getFields().get("booleanPrimitive")); + Assertions.assertEquals(pojo.doubleObject, p.getFields().get("doubleObject")); + Assertions.assertEquals(pojo.doublePrimitive, p.getFields().get("doublePrimitive")); + Assertions.assertEquals(pojo.integerObject, p.getFields().get("integerObject")); + Assertions.assertEquals(pojo.integerPrimitive, p.getFields().get("integerPrimitive")); + Assertions.assertEquals(pojo.longObject, p.getFields().get("longObject")); + Assertions.assertEquals(pojo.longPrimitive, p.getFields().get("longPrimitive")); + Assertions.assertEquals(pojo.uuid, p.getTags().get("uuid")); + } + + @Test + public void testAddFieldsFromPojoWithBlankColumnAnnotations() { + PojoWithBlankColumnAnnotations pojo = new PojoWithBlankColumnAnnotations(); + pojo.booleanObject = true; + pojo.booleanPrimitive = false; + pojo.doubleObject = 2.0; + pojo.doublePrimitive = 3.1; + pojo.integerObject = 32; + pojo.integerPrimitive = 64; + pojo.longObject = 1L; + pojo.longPrimitive = 2L; + pojo.time = Instant.now(); + pojo.uuid = "TEST"; + + Point p = Point.measurementByPOJO(PojoWithBlankColumnAnnotations.class).addFieldsFromPOJO(pojo).build(); + + Assertions.assertEquals(pojo.booleanObject, p.getFields().get("booleanObject")); + Assertions.assertEquals(pojo.booleanPrimitive, p.getFields().get("booleanPrimitive")); + Assertions.assertEquals(pojo.doubleObject, p.getFields().get("doubleObject")); + Assertions.assertEquals(pojo.doublePrimitive, p.getFields().get("doublePrimitive")); + Assertions.assertEquals(pojo.integerObject, p.getFields().get("integerObject")); + Assertions.assertEquals(pojo.integerPrimitive, p.getFields().get("integerPrimitive")); + Assertions.assertEquals(pojo.longObject, p.getFields().get("longObject")); + Assertions.assertEquals(pojo.longPrimitive, p.getFields().get("longPrimitive")); + Assertions.assertEquals(pojo.uuid, p.getTags().get("uuid")); + } + @Test public void testInheritMeasurement() { Point expected = Point.measurementByPOJO(SubClassMeasurement.class) @@ -1007,6 +1064,62 @@ static class PojoWithPublicAttributes { public Boolean booleanObject; } + @Measurement(name = "mymeasurement", allFields = true) + static class PojoWithAllFieldsAnnotation { + public static final String staticField = "static"; + + public boolean booleanPrimitive; + + @TimeColumn + public Instant time; + + @Column(tag = true) + public String uuid; + + public Double doubleObject; + public Long longObject; + public Integer integerObject; + public double doublePrimitive; + public long longPrimitive; + public int integerPrimitive; + public Boolean booleanObject; + } + + @Measurement(name = "mymeasurement") + static class PojoWithBlankColumnAnnotations { + + @Column + public boolean booleanPrimitive; + + @Column + @TimeColumn + public Instant time; + + @Column(tag = true) + public String uuid; + + @Column + public Double doubleObject; + + @Column + public Long longObject; + + @Column + public Integer integerObject; + + @Column + public double doublePrimitive; + + @Column + public long longPrimitive; + + @Column + public int integerPrimitive; + + @Column + public Boolean booleanObject; + } + @Measurement(name = "SuperMeasuremet") static class SuperMeasurement { @Column(name = "superClassField") diff --git a/src/test/java/org/influxdb/impl/InfluxDBResultMapperTest.java b/src/test/java/org/influxdb/impl/InfluxDBResultMapperTest.java index f4eee0ba..d93c4d30 100644 --- a/src/test/java/org/influxdb/impl/InfluxDBResultMapperTest.java +++ b/src/test/java/org/influxdb/impl/InfluxDBResultMapperTest.java @@ -20,6 +20,17 @@ */ package org.influxdb.impl; +import org.influxdb.InfluxDBMapperException; +import org.influxdb.annotation.Column; +import org.influxdb.annotation.Exclude; +import org.influxdb.annotation.Measurement; +import org.influxdb.annotation.TimeColumn; +import org.influxdb.dto.QueryResult; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.platform.runner.JUnitPlatform; +import org.junit.runner.RunWith; + import java.time.Instant; import java.util.Arrays; import java.util.Date; @@ -31,16 +42,6 @@ import java.util.UUID; import java.util.concurrent.TimeUnit; -import org.influxdb.InfluxDBMapperException; -import org.influxdb.annotation.Column; -import org.influxdb.annotation.Measurement; -import org.influxdb.annotation.TimeColumn; -import org.influxdb.dto.QueryResult; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.junit.platform.runner.JUnitPlatform; -import org.junit.runner.RunWith; - /** * @author fmachado */ @@ -71,6 +72,12 @@ public void testToPOJO_HappyPath() { // Then... Assertions.assertEquals(1, myList.size(), "there must be one entry in the result list"); + + //When... + List myList1 = mapper.toPOJO(queryResult, MyAllFieldsCustomMeasurement.class); + + // Then... + Assertions.assertEquals(1, myList1.size(), "there must be one entry in the result list"); } @Test @@ -578,6 +585,35 @@ public String toString() { } } + @Measurement(name = "CustomMeasurement", allFields = true) + static class MyAllFieldsCustomMeasurement { + private Instant time; + private String uuid; + private Double doubleObject; + private Long longObject; + private Integer integerObject; + private double doublePrimitive; + private long longPrimitive; + private int integerPrimitive; + private Boolean booleanObject; + private boolean booleanPrimitive; + + @SuppressWarnings("unused") + @Exclude + private String nonColumn1; + + @SuppressWarnings("unused") + @Exclude + private Random rnd; + + @Override + public String toString() { + return "MyCustomMeasurement [time=" + time + ", uuid=" + uuid + ", doubleObject=" + doubleObject + ", longObject=" + longObject + + ", integerObject=" + integerObject + ", doublePrimitive=" + doublePrimitive + ", longPrimitive=" + longPrimitive + + ", integerPrimitive=" + integerPrimitive + ", booleanObject=" + booleanObject + ", booleanPrimitive=" + booleanPrimitive + "]"; + } + } + @Measurement(name = "SuperMeasurement") static class MySuperMeasurement { From e5518beba598381095ceda3d8cc062c7dda59c45 Mon Sep 17 00:00:00 2001 From: Eran Leshem <1707552+eranl@users.noreply.github.com> Date: Sun, 3 Dec 2023 09:22:02 +0200 Subject: [PATCH 67/87] Fix time column with precision > ms (#973) --- src/main/java/org/influxdb/dto/Point.java | 3 +-- src/test/java/org/influxdb/dto/PointTest.java | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/influxdb/dto/Point.java b/src/main/java/org/influxdb/dto/Point.java index b8cc9e2e..d7eb0396 100755 --- a/src/main/java/org/influxdb/dto/Point.java +++ b/src/main/java/org/influxdb/dto/Point.java @@ -331,8 +331,7 @@ private void addFieldByAttribute(final Object pojo, final Field field, final boo .add(BigInteger.valueOf(instant.getNano())) .divide(BigInteger.valueOf(TimeUnit.NANOSECONDS.convert(1, timeUnit))); } else { - this.time = TimeUnit.MILLISECONDS.convert(instant.toEpochMilli(), timeUnit); - this.precision = timeUnit; + this.time = timeUnit.convert(instant.toEpochMilli(), TimeUnit.MILLISECONDS); } this.precision = timeUnit; }); diff --git a/src/test/java/org/influxdb/dto/PointTest.java b/src/test/java/org/influxdb/dto/PointTest.java index c315aad2..b59440c6 100755 --- a/src/test/java/org/influxdb/dto/PointTest.java +++ b/src/test/java/org/influxdb/dto/PointTest.java @@ -695,6 +695,23 @@ public void testAddFieldsFromPOJOWithTimeColumnNanoseconds() throws NoSuchFieldE pojo.time = null; } + @Test + public void testAddFieldsFromPOJOWithTimeColumnSeconds() throws NoSuchFieldException, IllegalAccessException { + TimeColumnPojoSec pojo = new TimeColumnPojoSec(); + pojo.time = Instant.now().plusSeconds(132L).plus(365L * 12000, ChronoUnit.DAYS); + pojo.booleanPrimitive = true; + + Point p = Point.measurementByPOJO(pojo.getClass()).addFieldsFromPOJO(pojo).build(); + Field timeField = p.getClass().getDeclaredField("time"); + Field precisionField = p.getClass().getDeclaredField("precision"); + timeField.setAccessible(true); + precisionField.setAccessible(true); + + Assertions.assertEquals(pojo.booleanPrimitive, p.getFields().get("booleanPrimitive")); + Assertions.assertEquals(TimeUnit.SECONDS, precisionField.get(p)); + Assertions.assertEquals(pojo.time.getEpochSecond(), timeField.get(p)); + } + @Test public void testAddFieldsFromPOJOWithTimeColumnNull() throws NoSuchFieldException, IllegalAccessException { TimeColumnPojo pojo = new TimeColumnPojo(); @@ -914,6 +931,14 @@ static class TimeColumnPojoNano { private Instant time; } + @Measurement(name = "tcmeasurement", allFields = true) + static class TimeColumnPojoSec { + boolean booleanPrimitive; + + @TimeColumn(timeUnit = TimeUnit.SECONDS) + Instant time; + } + @Measurement(name = "mymeasurement") static class Pojo { From 3c4064b95a77aed92352535640a516808b4ade0d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 06:51:45 +0100 Subject: [PATCH 68/87] chore(deps): bump org.jacoco:jacoco-maven-plugin from 0.8.10 to 0.8.11 (#978) Bumps [org.jacoco:jacoco-maven-plugin](https://github.com/jacoco/jacoco) from 0.8.10 to 0.8.11. - [Release notes](https://github.com/jacoco/jacoco/releases) - [Commits](https://github.com/jacoco/jacoco/compare/v0.8.10...v0.8.11) --- updated-dependencies: - dependency-name: org.jacoco:jacoco-maven-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 70c238cf..36785586 100644 --- a/pom.xml +++ b/pom.xml @@ -199,7 +199,7 @@ org.jacoco jacoco-maven-plugin - 0.8.10 + 0.8.11 From 5f066d1b5b835685d38db0865fbcb1be540f50f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Dec 2023 06:52:24 +0100 Subject: [PATCH 69/87] chore(deps): bump org.apache.maven.plugins:maven-javadoc-plugin (#975) Bumps [org.apache.maven.plugins:maven-javadoc-plugin](https://github.com/apache/maven-javadoc-plugin) from 3.6.2 to 3.6.3. - [Release notes](https://github.com/apache/maven-javadoc-plugin/releases) - [Commits](https://github.com/apache/maven-javadoc-plugin/compare/maven-javadoc-plugin-3.6.2...maven-javadoc-plugin-3.6.3) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-javadoc-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 36785586..1ee9a1a9 100644 --- a/pom.xml +++ b/pom.xml @@ -183,7 +183,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.6.2 + 3.6.3 8 From d6971437003ea9e9a883bfd328e5e317b2bbc702 Mon Sep 17 00:00:00 2001 From: Eran Leshem <1707552+eranl@users.noreply.github.com> Date: Mon, 4 Dec 2023 07:54:23 +0200 Subject: [PATCH 70/87] Throw if a non-Instant field is annotated with @TimeColumn (#974) --- src/main/java/org/influxdb/dto/Point.java | 34 +++++++++++-------- src/test/java/org/influxdb/dto/PointTest.java | 16 +++++++++ 2 files changed, 36 insertions(+), 14 deletions(-) diff --git a/src/main/java/org/influxdb/dto/Point.java b/src/main/java/org/influxdb/dto/Point.java index d7eb0396..c503a30e 100755 --- a/src/main/java/org/influxdb/dto/Point.java +++ b/src/main/java/org/influxdb/dto/Point.java @@ -1,6 +1,7 @@ package org.influxdb.dto; import org.influxdb.BuilderException; +import org.influxdb.InfluxDBMapperException; import org.influxdb.annotation.Column; import org.influxdb.annotation.Exclude; import org.influxdb.annotation.Measurement; @@ -322,20 +323,25 @@ private void addFieldByAttribute(final Object pojo, final Field field, final boo Object fieldValue = field.get(pojo); TimeColumn tc = field.getAnnotation(TimeColumn.class); - if (tc != null && Instant.class.isAssignableFrom(field.getType())) { - Optional.ofNullable((Instant) fieldValue).ifPresent(instant -> { - TimeUnit timeUnit = tc.timeUnit(); - if (timeUnit == TimeUnit.NANOSECONDS || timeUnit == TimeUnit.MICROSECONDS) { - this.time = BigInteger.valueOf(instant.getEpochSecond()) - .multiply(NANOSECONDS_PER_SECOND) - .add(BigInteger.valueOf(instant.getNano())) - .divide(BigInteger.valueOf(TimeUnit.NANOSECONDS.convert(1, timeUnit))); - } else { - this.time = timeUnit.convert(instant.toEpochMilli(), TimeUnit.MILLISECONDS); - } - this.precision = timeUnit; - }); - return; + if (tc != null) { + if (Instant.class.isAssignableFrom(field.getType())) { + Optional.ofNullable((Instant) fieldValue).ifPresent(instant -> { + TimeUnit timeUnit = tc.timeUnit(); + if (timeUnit == TimeUnit.NANOSECONDS || timeUnit == TimeUnit.MICROSECONDS) { + this.time = BigInteger.valueOf(instant.getEpochSecond()) + .multiply(NANOSECONDS_PER_SECOND) + .add(BigInteger.valueOf(instant.getNano())) + .divide(BigInteger.valueOf(TimeUnit.NANOSECONDS.convert(1, timeUnit))); + } else { + this.time = timeUnit.convert(instant.toEpochMilli(), TimeUnit.MILLISECONDS); + } + this.precision = timeUnit; + }); + return; + } + + throw new InfluxDBMapperException( + "Unsupported type " + field.getType() + " for time: should be of Instant type"); } if (tag) { diff --git a/src/test/java/org/influxdb/dto/PointTest.java b/src/test/java/org/influxdb/dto/PointTest.java index b59440c6..14d9614b 100755 --- a/src/test/java/org/influxdb/dto/PointTest.java +++ b/src/test/java/org/influxdb/dto/PointTest.java @@ -2,6 +2,7 @@ import org.influxdb.BuilderException; import org.influxdb.InfluxDB; +import org.influxdb.InfluxDBMapperException; import org.influxdb.annotation.Column; import org.influxdb.annotation.Measurement; import org.influxdb.annotation.TimeColumn; @@ -712,6 +713,13 @@ public void testAddFieldsFromPOJOWithTimeColumnSeconds() throws NoSuchFieldExcep Assertions.assertEquals(pojo.time.getEpochSecond(), timeField.get(p)); } + @Test + public void testAddFieldsFromPOJOWithBadTimeColumn() { + BadTimeColumnPojo pojo = new BadTimeColumnPojo(); + Assertions.assertThrows(InfluxDBMapperException.class, + () -> Point.measurementByPOJO(pojo.getClass()).addFieldsFromPOJO(pojo).build()); + } + @Test public void testAddFieldsFromPOJOWithTimeColumnNull() throws NoSuchFieldException, IllegalAccessException { TimeColumnPojo pojo = new TimeColumnPojo(); @@ -939,6 +947,14 @@ static class TimeColumnPojoSec { Instant time; } + @Measurement(name = "tcmeasurement", allFields = true) + static class BadTimeColumnPojo { + boolean booleanPrimitive; + + @TimeColumn + String time; + } + @Measurement(name = "mymeasurement") static class Pojo { From e93949f9a359b48a0af9cbd378ced79044bd5caf Mon Sep 17 00:00:00 2001 From: Eran Leshem <1707552+eranl@users.noreply.github.com> Date: Tue, 5 Dec 2023 20:44:34 +0200 Subject: [PATCH 71/87] Unify Point's and InfluxDBMapper's POJO saving logic (#979) --- src/main/java/org/influxdb/dto/Point.java | 28 ++++- .../org/influxdb/impl/InfluxDBMapper.java | 100 ++---------------- src/test/java/org/influxdb/dto/PointTest.java | 6 +- .../org/influxdb/impl/InfluxDBMapperTest.java | 3 + 4 files changed, 43 insertions(+), 94 deletions(-) diff --git a/src/main/java/org/influxdb/dto/Point.java b/src/main/java/org/influxdb/dto/Point.java index c503a30e..48fa7643 100755 --- a/src/main/java/org/influxdb/dto/Point.java +++ b/src/main/java/org/influxdb/dto/Point.java @@ -350,7 +350,7 @@ private void addFieldByAttribute(final Object pojo, final Field field, final boo } } else { if (fieldValue != null) { - this.fields.put(fieldName, fieldValue); + setField(field.getType(), fieldName, fieldValue); } } @@ -379,6 +379,32 @@ public Point build() { point.setTags(this.tags); return point; } + + private void setField( + final Class fieldType, + final String columnName, + final Object value) { + if (boolean.class.isAssignableFrom(fieldType) || Boolean.class.isAssignableFrom(fieldType)) { + addField(columnName, (boolean) value); + } else if (long.class.isAssignableFrom(fieldType) || Long.class.isAssignableFrom(fieldType)) { + addField(columnName, (long) value); + } else if (double.class.isAssignableFrom(fieldType) || Double.class.isAssignableFrom(fieldType)) { + addField(columnName, (double) value); + } else if (float.class.isAssignableFrom(fieldType) || Float.class.isAssignableFrom(fieldType)) { + addField(columnName, (float) value); + } else if (int.class.isAssignableFrom(fieldType) || Integer.class.isAssignableFrom(fieldType)) { + addField(columnName, (int) value); + } else if (short.class.isAssignableFrom(fieldType) || Short.class.isAssignableFrom(fieldType)) { + addField(columnName, (short) value); + } else if (String.class.isAssignableFrom(fieldType)) { + addField(columnName, (String) value); + } else if (Enum.class.isAssignableFrom(fieldType)) { + addField(columnName, ((Enum) value).name()); + } else { + throw new InfluxDBMapperException( + "Unsupported type " + fieldType + " for column " + columnName); + } + } } /** diff --git a/src/main/java/org/influxdb/impl/InfluxDBMapper.java b/src/main/java/org/influxdb/impl/InfluxDBMapper.java index 700a960c..2a6c0dc4 100644 --- a/src/main/java/org/influxdb/impl/InfluxDBMapper.java +++ b/src/main/java/org/influxdb/impl/InfluxDBMapper.java @@ -1,18 +1,13 @@ package org.influxdb.impl; -import java.lang.reflect.Field; -import java.time.Instant; -import java.util.List; -import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.TimeUnit; import org.influxdb.InfluxDB; -import org.influxdb.InfluxDBMapperException; -import org.influxdb.annotation.Column; import org.influxdb.annotation.Measurement; import org.influxdb.dto.Point; import org.influxdb.dto.Query; import org.influxdb.dto.QueryResult; +import java.util.List; + public class InfluxDBMapper extends InfluxDBResultMapper { private final InfluxDB influxDB; @@ -52,91 +47,16 @@ public List query(final Class clazz) { public void save(final T model) { throwExceptionIfMissingAnnotation(model.getClass()); - cacheMeasurementClass(model.getClass()); - - ConcurrentMap colNameAndFieldMap = getColNameAndFieldMap(model.getClass()); - - try { - Class modelType = model.getClass(); - String measurement = getMeasurementName(modelType); - String database = getDatabaseName(modelType); - String retentionPolicy = getRetentionPolicy(modelType); - TimeUnit timeUnit = getTimeUnit(modelType); - long time = timeUnit.convert(System.currentTimeMillis(), TimeUnit.MILLISECONDS); - Point.Builder pointBuilder = Point.measurement(measurement).time(time, timeUnit); - - for (String key : colNameAndFieldMap.keySet()) { - Field field = colNameAndFieldMap.get(key); - Column column = field.getAnnotation(Column.class); - String columnName = column.name(); - Class fieldType = field.getType(); - - if (!field.isAccessible()) { - field.setAccessible(true); - } - - Object value = field.get(model); - - if (column.tag()) { - /** Tags are strings either way. */ - pointBuilder.tag(columnName, value.toString()); - } else if ("time".equals(columnName)) { - if (value != null) { - setTime(pointBuilder, fieldType, timeUnit, value); - } - } else { - setField(pointBuilder, fieldType, columnName, value); - } - } - - Point point = pointBuilder.build(); + Class modelType = model.getClass(); + String database = getDatabaseName(modelType); + String retentionPolicy = getRetentionPolicy(modelType); + Point.Builder pointBuilder = Point.measurementByPOJO(modelType).addFieldsFromPOJO(model); + Point point = pointBuilder.build(); - if ("[unassigned]".equals(database)) { - influxDB.write(point); - } else { - influxDB.write(database, retentionPolicy, point); - } - - } catch (IllegalAccessException e) { - throw new InfluxDBMapperException(e); - } - } - - private void setTime( - final Point.Builder pointBuilder, - final Class fieldType, - final TimeUnit timeUnit, - final Object value) { - if (Instant.class.isAssignableFrom(fieldType)) { - Instant instant = (Instant) value; - long time = timeUnit.convert(instant.toEpochMilli(), TimeUnit.MILLISECONDS); - pointBuilder.time(time, timeUnit); - } else { - throw new InfluxDBMapperException( - "Unsupported type " + fieldType + " for time: should be of Instant type"); - } - } - - private void setField( - final Point.Builder pointBuilder, - final Class fieldType, - final String columnName, - final Object value) { - if (boolean.class.isAssignableFrom(fieldType) || Boolean.class.isAssignableFrom(fieldType)) { - pointBuilder.addField(columnName, (boolean) value); - } else if (long.class.isAssignableFrom(fieldType) || Long.class.isAssignableFrom(fieldType)) { - pointBuilder.addField(columnName, (long) value); - } else if (double.class.isAssignableFrom(fieldType) - || Double.class.isAssignableFrom(fieldType)) { - pointBuilder.addField(columnName, (double) value); - } else if (int.class.isAssignableFrom(fieldType) || Integer.class.isAssignableFrom(fieldType)) { - pointBuilder.addField(columnName, (int) value); - } else if (String.class.isAssignableFrom(fieldType)) { - pointBuilder.addField(columnName, (String) value); + if ("[unassigned]".equals(database)) { + influxDB.write(point); } else { - throw new InfluxDBMapperException( - "Unsupported type " + fieldType + " for column " + columnName); + influxDB.write(database, retentionPolicy, point); } } - } diff --git a/src/test/java/org/influxdb/dto/PointTest.java b/src/test/java/org/influxdb/dto/PointTest.java index 14d9614b..4121d402 100755 --- a/src/test/java/org/influxdb/dto/PointTest.java +++ b/src/test/java/org/influxdb/dto/PointTest.java @@ -737,7 +737,7 @@ public void testAddFieldsFromPOJOWithTimeColumnNull() throws NoSuchFieldExceptio } @Test - public void testAddFieldsFromPOJOWithData() throws NoSuchFieldException, IllegalAccessException { + public void testAddFieldsFromPOJOWithData() { Pojo pojo = new Pojo(); pojo.booleanObject = true; pojo.booleanPrimitive = false; @@ -760,7 +760,6 @@ public void testAddFieldsFromPOJOWithData() throws NoSuchFieldException, Illegal Assertions.assertEquals(pojo.integerPrimitive, p.getFields().get("integerPrimitive")); Assertions.assertEquals(pojo.longObject, p.getFields().get("longObject")); Assertions.assertEquals(pojo.longPrimitive, p.getFields().get("longPrimitive")); - Assertions.assertEquals(pojo.time, p.getFields().get("time")); Assertions.assertEquals(pojo.uuid, p.getTags().get("uuid")); } @@ -815,7 +814,6 @@ public void testAddFieldsFromPOJOWithPublicAttributes() { Assertions.assertEquals(pojo.integerPrimitive, p.getFields().get("integerPrimitive")); Assertions.assertEquals(pojo.longObject, p.getFields().get("longObject")); Assertions.assertEquals(pojo.longPrimitive, p.getFields().get("longPrimitive")); - Assertions.assertEquals(pojo.time, p.getFields().get("time")); Assertions.assertEquals(pojo.uuid, p.getTags().get("uuid")); } @@ -962,6 +960,7 @@ static class Pojo { private boolean booleanPrimitive; @Column(name = "time") + @TimeColumn private Instant time; @Column(name = "uuid", tag = true) @@ -1078,6 +1077,7 @@ static class PojoWithPublicAttributes { public boolean booleanPrimitive; @Column(name = "time") + @TimeColumn public Instant time; @Column(name = "uuid", tag = true) diff --git a/src/test/java/org/influxdb/impl/InfluxDBMapperTest.java b/src/test/java/org/influxdb/impl/InfluxDBMapperTest.java index cd2251ac..3d5bd86b 100644 --- a/src/test/java/org/influxdb/impl/InfluxDBMapperTest.java +++ b/src/test/java/org/influxdb/impl/InfluxDBMapperTest.java @@ -11,6 +11,7 @@ import org.influxdb.TestUtils; import org.influxdb.annotation.Column; import org.influxdb.annotation.Measurement; +import org.influxdb.annotation.TimeColumn; import org.influxdb.dto.Query; import org.junit.Assert; import org.junit.jupiter.api.AfterEach; @@ -129,6 +130,7 @@ static class ServerMeasure { /** Check the instant conversions */ @Column(name = "time") + @TimeColumn private Instant time; @Column(name = "name", tag = true) @@ -322,6 +324,7 @@ public void setField(Integer field) { static class NonInstantTime { @Column(name = "time") + @TimeColumn private long time; public long getTime() { From f324d221943d2eae901557c16656e2dd383a54fc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 07:06:57 +0100 Subject: [PATCH 72/87] chore(deps): bump org.apache.maven.plugins:maven-checkstyle-plugin (#981) Bumps [org.apache.maven.plugins:maven-checkstyle-plugin](https://github.com/apache/maven-checkstyle-plugin) from 3.3.0 to 3.3.1. - [Commits](https://github.com/apache/maven-checkstyle-plugin/compare/maven-checkstyle-plugin-3.3.0...maven-checkstyle-plugin-3.3.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-checkstyle-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1ee9a1a9..beb37742 100644 --- a/pom.xml +++ b/pom.xml @@ -218,7 +218,7 @@ org.apache.maven.plugins maven-checkstyle-plugin - 3.3.0 + 3.3.1 com.puppycrawl.tools From 4b4dc44eb97ec6d1a33cbd393e1e520614fe6755 Mon Sep 17 00:00:00 2001 From: Eran Leshem <1707552+eranl@users.noreply.github.com> Date: Wed, 13 Dec 2023 11:20:24 +0200 Subject: [PATCH 73/87] Support generic POJO super classes (#980) * Support generic POJO super classes * Add generic POJO super classes to MANUAL.md * Clean up TypeMapper --- MANUAL.md | 19 ++ src/main/java/org/influxdb/dto/Point.java | 28 ++- .../influxdb/impl/InfluxDBResultMapper.java | 185 ++++++++---------- .../java/org/influxdb/impl/TypeMapper.java | 70 +++++++ src/test/java/org/influxdb/dto/PointTest.java | 30 +++ .../impl/InfluxDBResultMapperTest.java | 56 ++++++ 6 files changed, 280 insertions(+), 108 deletions(-) create mode 100644 src/main/java/org/influxdb/impl/TypeMapper.java diff --git a/MANUAL.md b/MANUAL.md index 18040aea..92b245b2 100644 --- a/MANUAL.md +++ b/MANUAL.md @@ -402,6 +402,25 @@ influxDB.write(dbName, rpName, point); An alternative way to create InfluxDB queries is available. By using the [QueryBuilder](QUERY_BUILDER.md) you can create queries using java instead of providing the influxdb queries as strings. +#### Generic POJO super classes + +POJO classes can have generic super classes, for cases where multiple measurements have a similar structure, and differ by type(s), as in: + +```java +public class SuperMeasurement { + @Column + @TimeColumn + private Instant time; + @Column + T value; + // Other common columns and tags +} + +public class SubMeasurement extends SuperMeasurement { + // Any specific columns and tags +} +``` + ### InfluxDBMapper In case you want to save and load data using models you can use the [InfluxDBMapper](INFLUXDB_MAPPER.md). diff --git a/src/main/java/org/influxdb/dto/Point.java b/src/main/java/org/influxdb/dto/Point.java index 48fa7643..277ce4c9 100755 --- a/src/main/java/org/influxdb/dto/Point.java +++ b/src/main/java/org/influxdb/dto/Point.java @@ -7,10 +7,13 @@ import org.influxdb.annotation.Measurement; import org.influxdb.annotation.TimeColumn; import org.influxdb.impl.Preconditions; +import org.influxdb.impl.TypeMapper; import java.lang.annotation.Annotation; import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; import java.math.BigDecimal; import java.math.BigInteger; import java.math.RoundingMode; @@ -286,6 +289,8 @@ public Builder addFieldsFromPOJO(final Object pojo) { while (clazz != null) { + TypeMapper typeMapper = TypeMapper.empty(); + while (clazz != null) { for (Field field : clazz.getDeclaredFields()) { Column column = field.getAnnotation(Column.class); @@ -304,10 +309,20 @@ public Builder addFieldsFromPOJO(final Object pojo) { fieldName = field.getName(); } - addFieldByAttribute(pojo, field, column != null && column.tag(), fieldName); + addFieldByAttribute(pojo, field, column != null && column.tag(), fieldName, typeMapper); + } + + Class superclass = clazz.getSuperclass(); + Type genericSuperclass = clazz.getGenericSuperclass(); + if (genericSuperclass instanceof ParameterizedType) { + typeMapper = TypeMapper.of((ParameterizedType) genericSuperclass, superclass); + } else { + typeMapper = TypeMapper.empty(); } - clazz = clazz.getSuperclass(); + + clazz = superclass; } + } if (this.fields.isEmpty()) { throw new BuilderException("Class " + pojo.getClass().getName() @@ -318,13 +333,14 @@ public Builder addFieldsFromPOJO(final Object pojo) { } private void addFieldByAttribute(final Object pojo, final Field field, final boolean tag, - final String fieldName) { + final String fieldName, final TypeMapper typeMapper) { try { Object fieldValue = field.get(pojo); TimeColumn tc = field.getAnnotation(TimeColumn.class); + Class fieldType = (Class) typeMapper.resolve(field.getGenericType()); if (tc != null) { - if (Instant.class.isAssignableFrom(field.getType())) { + if (Instant.class.isAssignableFrom(fieldType)) { Optional.ofNullable((Instant) fieldValue).ifPresent(instant -> { TimeUnit timeUnit = tc.timeUnit(); if (timeUnit == TimeUnit.NANOSECONDS || timeUnit == TimeUnit.MICROSECONDS) { @@ -341,7 +357,7 @@ private void addFieldByAttribute(final Object pojo, final Field field, final boo } throw new InfluxDBMapperException( - "Unsupported type " + field.getType() + " for time: should be of Instant type"); + "Unsupported type " + fieldType + " for time: should be of Instant type"); } if (tag) { @@ -350,7 +366,7 @@ private void addFieldByAttribute(final Object pojo, final Field field, final boo } } else { if (fieldValue != null) { - setField(field.getType(), fieldName, fieldValue); + setField(fieldType, fieldName, fieldValue); } } diff --git a/src/main/java/org/influxdb/impl/InfluxDBResultMapper.java b/src/main/java/org/influxdb/impl/InfluxDBResultMapper.java index 15d4c283..5a4d3af8 100644 --- a/src/main/java/org/influxdb/impl/InfluxDBResultMapper.java +++ b/src/main/java/org/influxdb/impl/InfluxDBResultMapper.java @@ -28,6 +28,8 @@ import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; import java.time.Instant; import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatterBuilder; @@ -50,8 +52,12 @@ public class InfluxDBResultMapper { /** * Data structure used to cache classes used as measurements. */ + private static class ClassInfo { + ConcurrentMap fieldMap; + ConcurrentMap typeMappers; + } private static final - ConcurrentMap> CLASS_FIELD_CACHE = new ConcurrentHashMap<>(); + ConcurrentMap CLASS_INFO_CACHE = new ConcurrentHashMap<>(); private static final int FRACTION_MIN_WIDTH = 0; private static final int FRACTION_MAX_WIDTH = 9; @@ -204,21 +210,19 @@ void throwExceptionIfResultWithError(final QueryResult queryResult) { }); } - ConcurrentMap getColNameAndFieldMap(final Class clazz) { - return CLASS_FIELD_CACHE.get(clazz.getName()); - } - void cacheMeasurementClass(final Class... classVarAgrs) { for (Class clazz : classVarAgrs) { - if (CLASS_FIELD_CACHE.containsKey(clazz.getName())) { + if (CLASS_INFO_CACHE.containsKey(clazz.getName())) { continue; } - ConcurrentMap influxColumnAndFieldMap = new ConcurrentHashMap<>(); + ConcurrentMap fieldMap = new ConcurrentHashMap<>(); + ConcurrentMap typeMappers = new ConcurrentHashMap<>(); Measurement measurement = clazz.getAnnotation(Measurement.class); boolean allFields = measurement != null && measurement.allFields(); Class c = clazz; + TypeMapper typeMapper = TypeMapper.empty(); while (c != null) { for (Field field : c.getDeclaredFields()) { Column colAnnotation = field.getAnnotation(Column.class); @@ -227,11 +231,25 @@ void cacheMeasurementClass(final Class... classVarAgrs) { continue; } - influxColumnAndFieldMap.put(getFieldName(field, colAnnotation), field); + fieldMap.put(getFieldName(field, colAnnotation), field); + typeMappers.put(field, typeMapper); } - c = c.getSuperclass(); + + Class superclass = c.getSuperclass(); + Type genericSuperclass = c.getGenericSuperclass(); + if (genericSuperclass instanceof ParameterizedType) { + typeMapper = TypeMapper.of((ParameterizedType) genericSuperclass, superclass); + } else { + typeMapper = TypeMapper.empty(); + } + + c = superclass; } - CLASS_FIELD_CACHE.putIfAbsent(clazz.getName(), influxColumnAndFieldMap); + + ClassInfo classInfo = new ClassInfo(); + classInfo.fieldMap = fieldMap; + classInfo.typeMappers = typeMappers; + CLASS_INFO_CACHE.putIfAbsent(clazz.getName(), classInfo); } } @@ -255,10 +273,6 @@ String getRetentionPolicy(final Class clazz) { return ((Measurement) clazz.getAnnotation(Measurement.class)).retentionPolicy(); } - TimeUnit getTimeUnit(final Class clazz) { - return ((Measurement) clazz.getAnnotation(Measurement.class)).timeUnit(); - } - List parseSeriesAs(final QueryResult.Series series, final Class clazz, final List result) { return parseSeriesAs(series, clazz, result, TimeUnit.MILLISECONDS); } @@ -266,17 +280,19 @@ List parseSeriesAs(final QueryResult.Series series, final Class clazz, List parseSeriesAs(final QueryResult.Series series, final Class clazz, final List result, final TimeUnit precision) { int columnSize = series.getColumns().size(); - ConcurrentMap colNameAndFieldMap = CLASS_FIELD_CACHE.get(clazz.getName()); + + ClassInfo classInfo = CLASS_INFO_CACHE.get(clazz.getName()); try { T object = null; for (List row : series.getValues()) { for (int i = 0; i < columnSize; i++) { - Field correspondingField = colNameAndFieldMap.get(series.getColumns().get(i)/*InfluxDB columnName*/); + Field correspondingField = classInfo.fieldMap.get(series.getColumns().get(i)/*InfluxDB columnName*/); if (correspondingField != null) { if (object == null) { object = clazz.newInstance(); } - setFieldValue(object, correspondingField, row.get(i), precision); + setFieldValue(object, correspondingField, row.get(i), precision, + classInfo.typeMappers.get(correspondingField)); } } // When the "GROUP BY" clause is used, "tags" are returned as Map and @@ -285,10 +301,11 @@ List parseSeriesAs(final QueryResult.Series series, final Class clazz, // "tag" values are always String. if (series.getTags() != null && !series.getTags().isEmpty()) { for (Entry entry : series.getTags().entrySet()) { - Field correspondingField = colNameAndFieldMap.get(entry.getKey()/*InfluxDB columnName*/); + Field correspondingField = classInfo.fieldMap.get(entry.getKey()/*InfluxDB columnName*/); if (correspondingField != null) { // I don't think it is possible to reach here without a valid "object" - setFieldValue(object, correspondingField, entry.getValue(), precision); + setFieldValue(object, correspondingField, entry.getValue(), precision, + classInfo.typeMappers.get(correspondingField)); } } } @@ -309,104 +326,68 @@ List parseSeriesAs(final QueryResult.Series series, final Class clazz, * for more information. * */ - private static void setFieldValue(final T object, final Field field, final Object value, final TimeUnit precision) + private static void setFieldValue(final T object, final Field field, final Object value, final TimeUnit precision, + final TypeMapper typeMapper) throws IllegalArgumentException, IllegalAccessException { if (value == null) { return; } - Class fieldType = field.getType(); + Type fieldType = typeMapper.resolve(field.getGenericType()); + if (!field.isAccessible()) { + field.setAccessible(true); + } + field.set(object, adaptValue((Class) fieldType, value, precision, field.getName(), object.getClass().getName())); + } + + private static Object adaptValue(final Class fieldType, final Object value, final TimeUnit precision, + final String fieldName, final String className) { try { - if (!field.isAccessible()) { - field.setAccessible(true); + if (String.class.isAssignableFrom(fieldType)) { + return String.valueOf(value); + } + if (Instant.class.isAssignableFrom(fieldType)) { + if (value instanceof String) { + return Instant.from(RFC3339_FORMATTER.parse(String.valueOf(value))); + } + if (value instanceof Long) { + return Instant.ofEpochMilli(toMillis((long) value, precision)); + } + if (value instanceof Double) { + return Instant.ofEpochMilli(toMillis(((Double) value).longValue(), precision)); + } + if (value instanceof Integer) { + return Instant.ofEpochMilli(toMillis(((Integer) value).longValue(), precision)); + } + throw new InfluxDBMapperException("Unsupported type " + fieldType + " for field " + fieldName); } - if (fieldValueModified(fieldType, field, object, value, precision) - || fieldValueForPrimitivesModified(fieldType, field, object, value) - || fieldValueForPrimitiveWrappersModified(fieldType, field, object, value)) { - return; + if (Double.class.isAssignableFrom(fieldType) || double.class.isAssignableFrom(fieldType)) { + return value; + } + if (Long.class.isAssignableFrom(fieldType) || long.class.isAssignableFrom(fieldType)) { + return ((Double) value).longValue(); + } + if (Integer.class.isAssignableFrom(fieldType) || int.class.isAssignableFrom(fieldType)) { + return ((Double) value).intValue(); + } + if (Boolean.class.isAssignableFrom(fieldType) || boolean.class.isAssignableFrom(fieldType)) { + return Boolean.valueOf(String.valueOf(value)); + } + if (Enum.class.isAssignableFrom(fieldType)) { + //noinspection unchecked + return Enum.valueOf((Class) fieldType, String.valueOf(value)); } - String msg = "Class '%s' field '%s' is from an unsupported type '%s'."; - throw new InfluxDBMapperException( - String.format(msg, object.getClass().getName(), field.getName(), field.getType())); } catch (ClassCastException e) { String msg = "Class '%s' field '%s' was defined with a different field type and caused a ClassCastException. " + "The correct type is '%s' (current field value: '%s')."; throw new InfluxDBMapperException( - String.format(msg, object.getClass().getName(), field.getName(), value.getClass().getName(), value)); - } - } - - static boolean fieldValueModified(final Class fieldType, final Field field, final T object, final Object value, - final TimeUnit precision) - throws IllegalArgumentException, IllegalAccessException { - if (String.class.isAssignableFrom(fieldType)) { - field.set(object, String.valueOf(value)); - return true; - } - if (Instant.class.isAssignableFrom(fieldType)) { - Instant instant; - if (value instanceof String) { - instant = Instant.from(RFC3339_FORMATTER.parse(String.valueOf(value))); - } else if (value instanceof Long) { - instant = Instant.ofEpochMilli(toMillis((long) value, precision)); - } else if (value instanceof Double) { - instant = Instant.ofEpochMilli(toMillis(((Double) value).longValue(), precision)); - } else if (value instanceof Integer) { - instant = Instant.ofEpochMilli(toMillis(((Integer) value).longValue(), precision)); - } else { - throw new InfluxDBMapperException("Unsupported type " + field.getClass() + " for field " + field.getName()); - } - field.set(object, instant); - return true; - } - return false; - } - - static boolean fieldValueForPrimitivesModified(final Class fieldType, final Field field, final T object, - final Object value) - throws IllegalArgumentException, IllegalAccessException { - if (double.class.isAssignableFrom(fieldType)) { - field.setDouble(object, ((Double) value).doubleValue()); - return true; - } - if (long.class.isAssignableFrom(fieldType)) { - field.setLong(object, ((Double) value).longValue()); - return true; - } - if (int.class.isAssignableFrom(fieldType)) { - field.setInt(object, ((Double) value).intValue()); - return true; + String.format(msg, className, fieldName, value.getClass().getName(), value)); } - if (boolean.class.isAssignableFrom(fieldType)) { - field.setBoolean(object, Boolean.valueOf(String.valueOf(value)).booleanValue()); - return true; - } - return false; - } - static boolean fieldValueForPrimitiveWrappersModified(final Class fieldType, final Field field, final T object, - final Object value) - throws IllegalArgumentException, IllegalAccessException { - if (Double.class.isAssignableFrom(fieldType)) { - field.set(object, value); - return true; - } - if (Long.class.isAssignableFrom(fieldType)) { - field.set(object, Long.valueOf(((Double) value).longValue())); - return true; - } - if (Integer.class.isAssignableFrom(fieldType)) { - field.set(object, Integer.valueOf(((Double) value).intValue())); - return true; - } - if (Boolean.class.isAssignableFrom(fieldType)) { - field.set(object, Boolean.valueOf(String.valueOf(value))); - return true; - } - return false; + throw new InfluxDBMapperException( + String.format("Class '%s' field '%s' is from an unsupported type '%s'.", className, fieldName, fieldType)); } - private static Long toMillis(final long value, final TimeUnit precision) { - + private static long toMillis(final long value, final TimeUnit precision) { return TimeUnit.MILLISECONDS.convert(value, precision); } } diff --git a/src/main/java/org/influxdb/impl/TypeMapper.java b/src/main/java/org/influxdb/impl/TypeMapper.java new file mode 100644 index 00000000..98f4ada6 --- /dev/null +++ b/src/main/java/org/influxdb/impl/TypeMapper.java @@ -0,0 +1,70 @@ +/* + * The MIT License (MIT) + * + * Copyright (c) 2017 azeti Networks AG () + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and + * associated documentation files (the "Software"), to deal in the Software without restriction, + * including without limitation the rights to use, copy, modify, merge, publish, distribute, + * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or + * substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT + * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +package org.influxdb.impl; + +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.lang.reflect.TypeVariable; +import java.util.HashMap; +import java.util.Map; + +/** + * Resolves generic type variables to actual types, based on context. + * + * @author Eran Leshem + */ +@FunctionalInterface +public interface TypeMapper { + TypeMapper EMPTY = typeVariable -> null; + + static TypeMapper of(ParameterizedType type, Class clazz) { + TypeVariable>[] typeVariables = clazz.getTypeParameters(); + Type[] types = type.getActualTypeArguments(); + if (types.length != typeVariables.length) { + throw new IllegalStateException("Mismatched lengths for type variables and actual types"); + } + Map, Type> typeMapping = new HashMap<>(typeVariables.length); + for (int i = 0; i < typeVariables.length; i++) { + typeMapping.put(typeVariables[i], types[i]); + } + + return typeMapping::get; + } + + static TypeMapper empty() { + return EMPTY; + } + + default Type resolve(Type type) { + if (type instanceof TypeVariable) { + Type resolvedType = get((TypeVariable) type); + if (resolvedType == null) { + throw new IllegalStateException("Could not resolve type " + type); + } + + return resolvedType; + } + + return type; + } + + Type get(TypeVariable typeVariable); +} diff --git a/src/test/java/org/influxdb/dto/PointTest.java b/src/test/java/org/influxdb/dto/PointTest.java index 4121d402..9148c64b 100755 --- a/src/test/java/org/influxdb/dto/PointTest.java +++ b/src/test/java/org/influxdb/dto/PointTest.java @@ -890,6 +890,22 @@ public void testInheritMeasurement() { Assert.assertEquals(expected, actual); } + @Test + public void testGenericInheritMeasurement() { + Point expected = Point.measurementByPOJO(MyGenericSubMeasurement.class) + .addField("superValue", "super") + .addField("subValue", "sub") + .build(); + MyGenericSubMeasurement scm = new MyGenericSubMeasurement(); + scm.subValue = "sub"; + scm.superValue = "super"; + + Point actual = Point.measurementByPOJO(MyGenericSubMeasurement.class) + .addFieldsFromPOJO(scm) + .build(); + Assert.assertEquals(expected, actual); + } + static class PojoWithoutAnnotation { private String id; @@ -1173,6 +1189,20 @@ static class SubClassMeasurement extends SuperMeasurement { String subValue; } + @Measurement(name = "SuperMeasurement") + static class MyGenericSuperMeasurement { + + @Column(name = "superValue") + protected T superValue; + } + + @Measurement(name = "SubMeasurement") + static class MyGenericSubMeasurement extends MyGenericSuperMeasurement { + + @Column(name = "subValue") + protected String subValue; + } + @Measurement(name = "PojoNumberPrimitiveTypes") static class PojoNumberPrimitiveTypes { diff --git a/src/test/java/org/influxdb/impl/InfluxDBResultMapperTest.java b/src/test/java/org/influxdb/impl/InfluxDBResultMapperTest.java index d93c4d30..95967821 100644 --- a/src/test/java/org/influxdb/impl/InfluxDBResultMapperTest.java +++ b/src/test/java/org/influxdb/impl/InfluxDBResultMapperTest.java @@ -449,6 +449,38 @@ void testToPOJOInheritance() { Assertions.assertEquals(subValue, result.get(0).subValue); } + @Test + void testToPOJOGenericInheritance() { + // Given... + mapper.cacheMeasurementClass(MyGenericSubMeasurement.class); + + String superValue = UUID.randomUUID().toString(); + String subValue = "my sub value"; + List columnList = Arrays.asList("superValue", "subValue"); + + List firstSeriesResult = Arrays.asList(superValue, subValue); + + QueryResult.Series series = new QueryResult.Series(); + series.setName("MySeriesName"); + series.setColumns(columnList); + series.setValues(Arrays.asList(firstSeriesResult)); + + QueryResult.Result internalResult = new QueryResult.Result(); + internalResult.setSeries(Arrays.asList(series)); + + QueryResult queryResult = new QueryResult(); + queryResult.setResults(Arrays.asList(internalResult)); + + //When... + List result = + mapper.toPOJO(queryResult, MyGenericSubMeasurement.class, "MySeriesName"); + + //Then... + Assertions.assertTrue(result.size() == 1); + Assertions.assertEquals(superValue, result.get(0).superValue); + Assertions.assertEquals(subValue, result.get(0).subValue); + } + @Test public void testToPOJO_HasTimeColumn() { // Given... @@ -638,6 +670,30 @@ public String toString() { } } + @Measurement(name = "SuperMeasurement") + static class MyGenericSuperMeasurement { + + @Column(name = "superValue") + protected T superValue; + + @Override + public String toString() { + return "SuperMeasurement [superValue=" + superValue + "]"; + } + } + + @Measurement(name = "SubMeasurement") + static class MyGenericSubMeasurement extends MyGenericSuperMeasurement { + + @Column(name = "subValue") + protected String subValue; + + @Override + public String toString() { + return "MySubMeasurement [subValue=" + subValue + ", superValue=" + superValue + "]"; + } + } + @Measurement(name = "foo") static class MyPojoWithUnsupportedField { From d88f1d5ad8ff35ec17d5316bb1cd63579d76d973 Mon Sep 17 00:00:00 2001 From: Jakub Bednar Date: Thu, 14 Dec 2023 08:46:33 +0100 Subject: [PATCH 74/87] [maven-release-plugin] prepare release influxdb-java-2.24 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index beb37742..da1f4f9a 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.influxdb influxdb-java jar - 2.24-SNAPSHOT + 2.24 influxdb java bindings Java API to access the InfluxDB REST API http://www.influxdb.org @@ -24,7 +24,7 @@ scm:git:git@github.com:influxdata/influxdb-java.git scm:git:git@github.com:influxdata/influxdb-java.git git@github.com:influxdata/influxdb-java.git - HEAD + influxdb-java-2.24 From 05d836dce76a2c79b2428f3204b947e211a29fad Mon Sep 17 00:00:00 2001 From: Jakub Bednar Date: Thu, 14 Dec 2023 08:46:37 +0100 Subject: [PATCH 75/87] [maven-release-plugin] prepare for next development iteration --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index da1f4f9a..9db1f257 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.influxdb influxdb-java jar - 2.24 + 2.25-SNAPSHOT influxdb java bindings Java API to access the InfluxDB REST API http://www.influxdb.org @@ -24,7 +24,7 @@ scm:git:git@github.com:influxdata/influxdb-java.git scm:git:git@github.com:influxdata/influxdb-java.git git@github.com:influxdata/influxdb-java.git - influxdb-java-2.24 + HEAD From 9209837494514fe14b47ef37d4e754c65cfee7d5 Mon Sep 17 00:00:00 2001 From: Jakub Bednar Date: Thu, 14 Dec 2023 08:49:11 +0100 Subject: [PATCH 76/87] docs: update CHANGELOG.md to reflect actual version --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 026d4d09..ce4bebb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 2.24 [2023-12-14] + +### Improvements +- `allFields` mode to Measurement annotation [PR #972](https://github.com/influxdata/influxdb-java/pull/972) +- Support generic POJO super classes [PR #980](https://github.com/influxdata/influxdb-java/pull/980) + ## 2.23 [2022-07-07] ### Improvements From 788540c9ea3d7431b641341d2fc7d4cb0c71be96 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Jan 2024 07:28:31 +0100 Subject: [PATCH 77/87] chore(deps-dev): bump org.assertj:assertj-core from 3.24.2 to 3.25.1 (#988) Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.24.2 to 3.25.1. - [Release notes](https://github.com/assertj/assertj/releases) - [Commits](https://github.com/assertj/assertj/compare/assertj-build-3.24.2...assertj-build-3.25.1) --- updated-dependencies: - dependency-name: org.assertj:assertj-core dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 9db1f257..7a0a24cb 100644 --- a/pom.xml +++ b/pom.xml @@ -274,7 +274,7 @@ org.assertj assertj-core - 3.24.2 + 3.25.1 test From fbc34b0f8b9e2036330a0d8d8d4a071919bd1cec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 07:33:32 +0100 Subject: [PATCH 78/87] chore(deps): bump org.msgpack:msgpack-core from 0.9.6 to 0.9.7 (#991) Bumps [org.msgpack:msgpack-core](https://github.com/msgpack/msgpack-java) from 0.9.6 to 0.9.7. - [Release notes](https://github.com/msgpack/msgpack-java/releases) - [Changelog](https://github.com/msgpack/msgpack-java/blob/main/RELEASE_NOTES.md) - [Commits](https://github.com/msgpack/msgpack-java/compare/v0.9.6...v0.9.7) --- updated-dependencies: - dependency-name: org.msgpack:msgpack-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 7a0a24cb..d59632ca 100644 --- a/pom.xml +++ b/pom.xml @@ -308,7 +308,7 @@ org.msgpack msgpack-core - 0.9.6 + 0.9.7 From 7fc36f8b1e41515189baa0f6563f1815a0a5fd3d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 07:34:05 +0100 Subject: [PATCH 79/87] chore(deps): bump org.apache.maven.plugins:maven-surefire-plugin (#989) Bumps [org.apache.maven.plugins:maven-surefire-plugin](https://github.com/apache/maven-surefire) from 3.2.2 to 3.2.5. - [Release notes](https://github.com/apache/maven-surefire/releases) - [Commits](https://github.com/apache/maven-surefire/compare/surefire-3.2.2...surefire-3.2.5) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-surefire-plugin dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d59632ca..5d62b977 100644 --- a/pom.xml +++ b/pom.xml @@ -89,7 +89,7 @@ org.apache.maven.plugins maven-surefire-plugin - 3.2.2 + 3.2.5 org.apache.maven.plugins From 996f3578e502ffc69dfdbe03cc310f7e6c12cca3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 Jan 2024 07:35:03 +0100 Subject: [PATCH 80/87] chore(deps): bump org.apache.maven.plugins:maven-compiler-plugin (#985) Bumps [org.apache.maven.plugins:maven-compiler-plugin](https://github.com/apache/maven-compiler-plugin) from 3.11.0 to 3.12.1. - [Release notes](https://github.com/apache/maven-compiler-plugin/releases) - [Commits](https://github.com/apache/maven-compiler-plugin/compare/maven-compiler-plugin-3.11.0...maven-compiler-plugin-3.12.1) --- updated-dependencies: - dependency-name: org.apache.maven.plugins:maven-compiler-plugin dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5d62b977..da69cc89 100644 --- a/pom.xml +++ b/pom.xml @@ -80,7 +80,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.11.0 + 3.12.1 1.8 1.8 From ee7059e707014973510c709722ec065b28e3f963 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 07:22:01 +0100 Subject: [PATCH 81/87] chore(deps-dev): bump org.assertj:assertj-core from 3.25.1 to 3.25.2 (#995) Bumps [org.assertj:assertj-core](https://github.com/assertj/assertj) from 3.25.1 to 3.25.2. - [Release notes](https://github.com/assertj/assertj/releases) - [Commits](https://github.com/assertj/assertj/compare/assertj-build-3.25.1...assertj-build-3.25.2) --- updated-dependencies: - dependency-name: org.assertj:assertj-core dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index da69cc89..4aa5b3b7 100644 --- a/pom.xml +++ b/pom.xml @@ -274,7 +274,7 @@ org.assertj assertj-core - 3.25.1 + 3.25.2 test From 0c690c8d8a6627f525e05d68e0571e089c61845e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 Jan 2024 07:22:29 +0100 Subject: [PATCH 82/87] chore(deps): bump org.msgpack:msgpack-core from 0.9.7 to 0.9.8 (#992) Bumps [org.msgpack:msgpack-core](https://github.com/msgpack/msgpack-java) from 0.9.7 to 0.9.8. - [Release notes](https://github.com/msgpack/msgpack-java/releases) - [Changelog](https://github.com/msgpack/msgpack-java/blob/main/RELEASE_NOTES.md) - [Commits](https://github.com/msgpack/msgpack-java/compare/v0.9.7...v0.9.8) --- updated-dependencies: - dependency-name: org.msgpack:msgpack-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 4aa5b3b7..2bfa0359 100644 --- a/pom.xml +++ b/pom.xml @@ -308,7 +308,7 @@ org.msgpack msgpack-core - 0.9.7 + 0.9.8 From d204b8f9361f81a377170e37dcc8b5b97dadc523 Mon Sep 17 00:00:00 2001 From: Tim Yocum Date: Tue, 11 Feb 2025 23:55:02 -0600 Subject: [PATCH 83/87] chore/update-ubuntu (#1008) Bumping ubuntu runner to `-latest` as 20.04 is EOL. --- .github/workflows/pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5b70f5e1..2a7b043e 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -7,7 +7,7 @@ on: jobs: build: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: matrix: From 99fcaccb80f42a1ef3c2174b45e6c8fb53df908a Mon Sep 17 00:00:00 2001 From: Eran Leshem <1707552+eranl@users.noreply.github.com> Date: Tue, 25 Mar 2025 09:43:06 +0200 Subject: [PATCH 84/87] Add support for parameter binding to built queries (#1010) --- QUERY_BUILDER.md | 16 +++ .../org/influxdb/dto/BoundParameterQuery.java | 72 +------------- src/main/java/org/influxdb/dto/Query.java | 98 +++++++++++++------ .../java/org/influxdb/impl/InfluxDBImpl.java | 44 +++++---- .../org/influxdb/impl/InfluxDBService.java | 31 ++++-- .../org/influxdb/querybuilder/Appender.java | 2 + .../querybuilder/FunctionFactory.java | 4 + .../influxdb/querybuilder/Placeholder.java | 14 +++ .../querybuilder/api/BuiltQueryTest.java | 12 +++ 9 files changed, 168 insertions(+), 125 deletions(-) create mode 100644 src/main/java/org/influxdb/querybuilder/Placeholder.java diff --git a/QUERY_BUILDER.md b/QUERY_BUILDER.md index 5f500b8e..d84e6d25 100644 --- a/QUERY_BUILDER.md +++ b/QUERY_BUILDER.md @@ -588,3 +588,19 @@ Query select = select().raw("an expression on select").from(dbName, "cpu").where ```sqlite-psql SELECT an expression on select FROM h2o_feet WHERE an expression as condition; ``` + +Binding parameters + +If your Query is based on user input, it is good practice to use parameter binding to avoid [injection attacks](https://en.wikipedia.org/wiki/SQL_injection). +You can create queries with parameter binding: + +```java +Query query = select().from(DATABASE,"h2o_feet").where(gt("water_level", FunctionFactory.placeholder("level"))) + .bindParameter("level", 8); +``` + +```sqlite-psql +SELECT * FROM h2o_feet WHERE water_level > $level; +``` + +The values of bindParameter() calls are bound to the placeholders in the query (`level`). diff --git a/src/main/java/org/influxdb/dto/BoundParameterQuery.java b/src/main/java/org/influxdb/dto/BoundParameterQuery.java index 0c7b08b9..1f197289 100644 --- a/src/main/java/org/influxdb/dto/BoundParameterQuery.java +++ b/src/main/java/org/influxdb/dto/BoundParameterQuery.java @@ -1,77 +1,9 @@ package org.influxdb.dto; -import com.squareup.moshi.JsonWriter; -import java.io.IOException; -import java.nio.charset.Charset; -import java.util.HashMap; -import java.util.Map; -import java.util.Map.Entry; - -import org.influxdb.InfluxDBIOException; - -import okio.Buffer; - public final class BoundParameterQuery extends Query { - private final Map params = new HashMap<>(); - private BoundParameterQuery(final String command, final String database) { - super(command, database, true); - } - - public String getParameterJsonWithUrlEncoded() { - try { - String jsonParameterObject = createJsonObject(params); - String urlEncodedJsonParameterObject = encode(jsonParameterObject); - return urlEncodedJsonParameterObject; - } catch (IOException e) { - throw new InfluxDBIOException(e); - } - } - - private String createJsonObject(final Map parameterMap) throws IOException { - Buffer b = new Buffer(); - JsonWriter writer = JsonWriter.of(b); - writer.beginObject(); - for (Entry pair : parameterMap.entrySet()) { - String name = pair.getKey(); - Object value = pair.getValue(); - if (value instanceof Number) { - Number number = (Number) value; - writer.name(name).value(number); - } else if (value instanceof String) { - writer.name(name).value((String) value); - } else if (value instanceof Boolean) { - writer.name(name).value((Boolean) value); - } else { - writer.name(name).value(String.valueOf(value)); - } - } - writer.endObject(); - return b.readString(Charset.forName("utf-8")); - } - - @Override - public int hashCode() { - final int prime = 31; - int result = super.hashCode(); - result = prime * result + params.hashCode(); - return result; - } - - @Override - public boolean equals(final Object obj) { - if (this == obj) { - return true; - } - if (!super.equals(obj)) { - return false; - } - BoundParameterQuery other = (BoundParameterQuery) obj; - if (!params.equals(other.params)) { - return false; - } - return true; + super(command, database); } public static class QueryBuilder { @@ -93,7 +25,7 @@ public QueryBuilder bind(final String placeholder, final Object value) { if (query == null) { query = new BoundParameterQuery(influxQL, null); } - query.params.put(placeholder, value); + query.bindParameter(placeholder, value); return this; } diff --git a/src/main/java/org/influxdb/dto/Query.java b/src/main/java/org/influxdb/dto/Query.java index 5c4921b8..ebed08e7 100644 --- a/src/main/java/org/influxdb/dto/Query.java +++ b/src/main/java/org/influxdb/dto/Query.java @@ -1,8 +1,18 @@ package org.influxdb.dto; +import com.squareup.moshi.JsonWriter; +import okio.Buffer; +import org.influxdb.InfluxDBIOException; +import org.influxdb.querybuilder.Appendable; + +import java.io.IOException; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; +import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; /** * Represents a Query against Influxdb. @@ -15,6 +25,7 @@ public class Query { private final String command; private final String database; private final boolean requiresPost; + protected final Map params = new HashMap<>(); /** * @param command the query command @@ -68,38 +79,43 @@ public boolean requiresPost() { return requiresPost; } - @SuppressWarnings("checkstyle:avoidinlineconditionals") - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((command == null) ? 0 : command.hashCode()); - result = prime * result - + ((database == null) ? 0 : database.hashCode()); - return result; + public Query bindParameter(final String placeholder, final Object value) { + params.put(placeholder, value); + return this; + } + + public boolean hasBoundParameters() { + return !params.isEmpty(); + } + + public String getParameterJsonWithUrlEncoded() { + try { + String jsonParameterObject = createJsonObject(params); + String urlEncodedJsonParameterObject = encode(jsonParameterObject); + return urlEncodedJsonParameterObject; + } catch (IOException e) { + throw new InfluxDBIOException(e); + } } - @SuppressWarnings("checkstyle:needbraces") @Override - public boolean equals(final Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - Query other = (Query) obj; - if (command == null) { - if (other.command != null) - return false; - } else if (!command.equals(other.command)) + public boolean equals(final Object o) { + if (o == null || getClass() != o.getClass()) { return false; - if (database == null) { - if (other.database != null) - return false; - } else if (!database.equals(other.database)) - return false; - return true; + } + + Query query = (Query) o; + return Objects.equals(command, query.command) && Objects.equals(database, query.database) && params.equals( + query.params); + } + + @Override + public int hashCode() { + final int prime = 31; + int result = Objects.hashCode(command); + result = prime * result + Objects.hashCode(database); + result = prime * result + params.hashCode(); + return result; } /** @@ -115,4 +131,30 @@ public static String encode(final String command) { throw new IllegalStateException("Every JRE must support UTF-8", e); } } + + private String createJsonObject(final Map parameterMap) throws IOException { + Buffer b = new Buffer(); + JsonWriter writer = JsonWriter.of(b); + writer.beginObject(); + for (Map.Entry pair : parameterMap.entrySet()) { + String name = pair.getKey(); + Object value = pair.getValue(); + if (value instanceof Number) { + Number number = (Number) value; + writer.name(name).value(number); + } else if (value instanceof String) { + writer.name(name).value((String) value); + } else if (value instanceof Boolean) { + writer.name(name).value((Boolean) value); + } else if (value instanceof Appendable) { + StringBuilder stringBuilder = new StringBuilder(); + ((Appendable) value).appendTo(stringBuilder); + writer.name(name).value(stringBuilder.toString()); + } else { + writer.name(name).value(String.valueOf(value)); + } + } + writer.endObject(); + return b.readString(Charset.forName("utf-8")); + } } diff --git a/src/main/java/org/influxdb/impl/InfluxDBImpl.java b/src/main/java/org/influxdb/impl/InfluxDBImpl.java index 825e0708..23427a23 100644 --- a/src/main/java/org/influxdb/impl/InfluxDBImpl.java +++ b/src/main/java/org/influxdb/impl/InfluxDBImpl.java @@ -16,7 +16,6 @@ import org.influxdb.InfluxDBException; import org.influxdb.InfluxDBIOException; import org.influxdb.dto.BatchPoints; -import org.influxdb.dto.BoundParameterQuery; import org.influxdb.dto.Point; import org.influxdb.dto.Pong; import org.influxdb.dto.Query; @@ -637,13 +636,17 @@ public void query(final Query query, final int chunkSize, final BiConsumer onNext, final Runnable onComplete, final Consumer onFailure) { Call call; - if (query instanceof BoundParameterQuery) { - BoundParameterQuery boundParameterQuery = (BoundParameterQuery) query; - call = this.influxDBService.query(getDatabase(query), query.getCommandWithUrlEncoded(), chunkSize, - boundParameterQuery.getParameterJsonWithUrlEncoded()); + if (query.hasBoundParameters()) { + if (query.requiresPost()) { + call = this.influxDBService.postQuery(getDatabase(query), query.getCommandWithUrlEncoded(), chunkSize, + query.getParameterJsonWithUrlEncoded()); + } else { + call = this.influxDBService.query(getDatabase(query), query.getCommandWithUrlEncoded(), chunkSize, + query.getParameterJsonWithUrlEncoded()); + } } else { if (query.requiresPost()) { - call = this.influxDBService.query(getDatabase(query), query.getCommandWithUrlEncoded(), chunkSize, null); + call = this.influxDBService.postQuery(getDatabase(query), query.getCommandWithUrlEncoded(), chunkSize); } else { call = this.influxDBService.query(getDatabase(query), query.getCommandWithUrlEncoded(), chunkSize); } @@ -716,18 +719,21 @@ public void onFailure(final Call call, final Throwable t) { @Override public QueryResult query(final Query query, final TimeUnit timeUnit) { Call call; - if (query instanceof BoundParameterQuery) { - BoundParameterQuery boundParameterQuery = (BoundParameterQuery) query; - call = this.influxDBService.query(getDatabase(query), - TimeUtil.toTimePrecision(timeUnit), query.getCommandWithUrlEncoded(), - boundParameterQuery.getParameterJsonWithUrlEncoded()); + if (query.hasBoundParameters()) { + if (query.requiresPost()) { + call = this.influxDBService.postQuery(getDatabase(query), TimeUtil.toTimePrecision(timeUnit), + query.getCommandWithUrlEncoded(), query.getParameterJsonWithUrlEncoded()); + } else { + call = this.influxDBService.query(getDatabase(query), TimeUtil.toTimePrecision(timeUnit), + query.getCommandWithUrlEncoded(), query.getParameterJsonWithUrlEncoded()); + } } else { if (query.requiresPost()) { - call = this.influxDBService.query(getDatabase(query), - TimeUtil.toTimePrecision(timeUnit), query.getCommandWithUrlEncoded(), null); + call = this.influxDBService.postQuery(getDatabase(query), + TimeUtil.toTimePrecision(timeUnit), query.getCommandWithUrlEncoded()); } else { call = this.influxDBService.query(getDatabase(query), - TimeUtil.toTimePrecision(timeUnit), query.getCommandWithUrlEncoded()); + TimeUtil.toTimePrecision(timeUnit), query.getCommandWithUrlEncoded(), null); } } return executeQuery(call); @@ -788,10 +794,14 @@ public boolean databaseExists(final String name) { */ private Call callQuery(final Query query) { Call call; - if (query instanceof BoundParameterQuery) { - BoundParameterQuery boundParameterQuery = (BoundParameterQuery) query; + if (query.hasBoundParameters()) { + if (query.requiresPost()) { call = this.influxDBService.postQuery(getDatabase(query), query.getCommandWithUrlEncoded(), - boundParameterQuery.getParameterJsonWithUrlEncoded()); + query.getParameterJsonWithUrlEncoded()); + } else { + call = this.influxDBService.query(getDatabase(query), null, query.getCommandWithUrlEncoded(), + query.getParameterJsonWithUrlEncoded()); + } } else { if (query.requiresPost()) { call = this.influxDBService.postQuery(getDatabase(query), query.getCommandWithUrlEncoded()); diff --git a/src/main/java/org/influxdb/impl/InfluxDBService.java b/src/main/java/org/influxdb/impl/InfluxDBService.java index ce7a811b..061a7661 100644 --- a/src/main/java/org/influxdb/impl/InfluxDBService.java +++ b/src/main/java/org/influxdb/impl/InfluxDBService.java @@ -47,12 +47,7 @@ public Call writePoints(@Query(DB) String database, @GET("query") public Call query(@Query(DB) String db, - @Query(EPOCH) String epoch, @Query(value = Q, encoded = true) String query); - - @POST("query") - @FormUrlEncoded - public Call query(@Query(DB) String db, - @Query(EPOCH) String epoch, @Field(value = Q, encoded = true) String query, + @Query(EPOCH) String epoch, @Query(value = Q, encoded = true) String query, @Query(value = PARAMS, encoded = true) String params); @GET("query") @@ -66,9 +61,26 @@ public Call postQuery(@Query(DB) String db, @POST("query") @FormUrlEncoded - public Call postQuery(@Query(DB) String db, + public Call postQuery(@Query(DB) String db, @Query(EPOCH) String epoch, + @Field(value = Q, encoded = true) String query); + + @POST("query") + @FormUrlEncoded + public Call postQuery(@Query(DB) String db, @Query(EPOCH) String epoch, @Field(value = Q, encoded = true) String query, @Query(value = PARAMS, encoded = true) String params); + @Streaming + @POST("query?chunked=true") + @FormUrlEncoded + public Call postQuery(@Query(DB) String db, @Field(value = Q, encoded = true) String query, + @Query(CHUNK_SIZE) int chunkSize); + + @Streaming + @POST("query?chunked=true") + @FormUrlEncoded + public Call postQuery(@Query(DB) String db, @Field(value = Q, encoded = true) String query, + @Query(CHUNK_SIZE) int chunkSize, @Query(value = PARAMS, encoded = true) String params); + @POST("query") @FormUrlEncoded public Call postQuery(@Field(value = Q, encoded = true) String query); @@ -79,8 +91,7 @@ public Call query(@Query(DB) String db, @Query(value = Q, encoded @Query(CHUNK_SIZE) int chunkSize); @Streaming - @POST("query?chunked=true") - @FormUrlEncoded - public Call query(@Query(DB) String db, @Field(value = Q, encoded = true) String query, + @GET("query?chunked=true") + public Call query(@Query(DB) String db, @Query(value = Q, encoded = true) String query, @Query(CHUNK_SIZE) int chunkSize, @Query(value = PARAMS, encoded = true) String params); } diff --git a/src/main/java/org/influxdb/querybuilder/Appender.java b/src/main/java/org/influxdb/querybuilder/Appender.java index 3dab5c02..8c7e34bf 100644 --- a/src/main/java/org/influxdb/querybuilder/Appender.java +++ b/src/main/java/org/influxdb/querybuilder/Appender.java @@ -62,6 +62,8 @@ public static StringBuilder appendValue(final Object value, final StringBuilder stringBuilder.append(')'); } else if (value instanceof Column) { appendName(((Column) value).getName(), stringBuilder); + } else if (value instanceof Placeholder) { + stringBuilder.append('$').append(((Placeholder) value).getName()); } else if (value instanceof String) { stringBuilder.append("'").append(value).append("'"); } else if (value != null) { diff --git a/src/main/java/org/influxdb/querybuilder/FunctionFactory.java b/src/main/java/org/influxdb/querybuilder/FunctionFactory.java index 19541c46..ba5bfaba 100644 --- a/src/main/java/org/influxdb/querybuilder/FunctionFactory.java +++ b/src/main/java/org/influxdb/querybuilder/FunctionFactory.java @@ -61,6 +61,10 @@ public static Object column(final String name) { return new Column(name); } + public static Object placeholder(final String name) { + return new Placeholder(name); + } + private static void convertToColumns(final Object... arguments) { for (int i = 0; i < arguments.length; i++) { arguments[i] = convertToColumn(arguments[i]); diff --git a/src/main/java/org/influxdb/querybuilder/Placeholder.java b/src/main/java/org/influxdb/querybuilder/Placeholder.java new file mode 100644 index 00000000..8b21cd88 --- /dev/null +++ b/src/main/java/org/influxdb/querybuilder/Placeholder.java @@ -0,0 +1,14 @@ +package org.influxdb.querybuilder; + +public class Placeholder { + + private final String name; + + Placeholder(final String name) { + this.name = name; + } + + public String getName() { + return name; + } +} diff --git a/src/test/java/org/influxdb/querybuilder/api/BuiltQueryTest.java b/src/test/java/org/influxdb/querybuilder/api/BuiltQueryTest.java index 2f9565ad..1fcadfd7 100644 --- a/src/test/java/org/influxdb/querybuilder/api/BuiltQueryTest.java +++ b/src/test/java/org/influxdb/querybuilder/api/BuiltQueryTest.java @@ -10,10 +10,14 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import org.influxdb.dto.Query; +import org.influxdb.querybuilder.FunctionFactory; import org.influxdb.querybuilder.RawText; import org.influxdb.querybuilder.Where; import org.junit.jupiter.api.Test; +import org.junit.platform.runner.JUnitPlatform; +import org.junit.runner.RunWith; +@RunWith(JUnitPlatform.class) public class BuiltQueryTest { private static final String DATABASE = "testdb"; @@ -973,4 +977,12 @@ public void multipleDatabaseBackReferenceing() { assertEquals(query.getDatabase(), select.getDatabase()); } + @Test + public void testBoundParameters() { + Query query = select().column("a").from(DATABASE, "b") + .where(eq("c", FunctionFactory.placeholder("d"))).bindParameter("d", 3); + assertEquals("SELECT a FROM b WHERE c = $d;", query.getCommand()); + assertEquals(Query.encode("{\"d\":3}"), query.getParameterJsonWithUrlEncoded()); + assertEquals(DATABASE, query.getDatabase()); + } } From feb26abcd84953f7072b12dc17f83b89a37c6d65 Mon Sep 17 00:00:00 2001 From: Jakub Bednar Date: Wed, 26 Mar 2025 09:06:32 +0100 Subject: [PATCH 85/87] [maven-release-plugin] prepare release influxdb-java-2.25 --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 2bfa0359..b3878197 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.influxdb influxdb-java jar - 2.25-SNAPSHOT + 2.25 influxdb java bindings Java API to access the InfluxDB REST API http://www.influxdb.org @@ -24,7 +24,7 @@ scm:git:git@github.com:influxdata/influxdb-java.git scm:git:git@github.com:influxdata/influxdb-java.git git@github.com:influxdata/influxdb-java.git - HEAD + influxdb-java-2.25 From cf21d90d6132e500dd5845874c73adb0e32213d9 Mon Sep 17 00:00:00 2001 From: Jakub Bednar Date: Wed, 26 Mar 2025 09:06:37 +0100 Subject: [PATCH 86/87] [maven-release-plugin] prepare for next development iteration --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b3878197..3d2b083d 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.influxdb influxdb-java jar - 2.25 + 2.26-SNAPSHOT influxdb java bindings Java API to access the InfluxDB REST API http://www.influxdb.org From 3e40a7d43e3673724ebb6b2136cb53778c8d78ec Mon Sep 17 00:00:00 2001 From: Jakub Bednar Date: Wed, 26 Mar 2025 09:20:26 +0100 Subject: [PATCH 87/87] docs: update CHANGELOG.md for version 2.25 Also fixed deploying the client into OSS repository by increasing timeout. --- CHANGELOG.md | 5 +++++ pom.xml | 1 + 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce4bebb2..0cdc0396 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 2.25 [2025-03-26] + +### Improvements +- Add support for parameter binding to built queries [PR #1010](https://github.com/influxdata/influxdb-java/pull/1010) + ## 2.24 [2023-12-14] ### Improvements diff --git a/pom.xml b/pom.xml index 3d2b083d..4fa5111b 100644 --- a/pom.xml +++ b/pom.xml @@ -165,6 +165,7 @@ ossrh https://oss.sonatype.org/ true + 15 pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy