From e6de7028d26df38db60cc21f36a811bfed1366a7 Mon Sep 17 00:00:00 2001 From: almeidast Date: Fri, 2 Aug 2024 09:56:28 +0100 Subject: [PATCH 01/17] Upgrade to the last Karma version and upgrade the Node version --- gateleen-hook-js/package.json | 2 +- gateleen-hook-js/pom.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gateleen-hook-js/package.json b/gateleen-hook-js/package.json index 05abbc7e..a8326b4e 100644 --- a/gateleen-hook-js/package.json +++ b/gateleen-hook-js/package.json @@ -35,7 +35,7 @@ "grunt-ngdocs": "0.2.10", "jasmine-core": "2.5.0", "jshint": "2.9.3", - "karma": "1.2.0", + "karma": "6.3.9", "karma-chrome-launcher": "2.2.0", "karma-coverage": "1.1.1", "karma-html-reporter": "0.2.7", diff --git a/gateleen-hook-js/pom.xml b/gateleen-hook-js/pom.xml index 1dff57c4..98fa11e2 100644 --- a/gateleen-hook-js/pom.xml +++ b/gateleen-hook-js/pom.xml @@ -81,7 +81,7 @@ initialize - v8.9.4 + v16.9.1 6.14.8 ${nodeDownloadRoot} ${npmDownloadRoot} From c2b844b8b255569338ff4d40e057d2deb79df438 Mon Sep 17 00:00:00 2001 From: runner Date: Thu, 8 Aug 2024 09:19:20 +0000 Subject: [PATCH 02/17] updating poms for 2.1.10 branch with snapshot versions From 8914d2ecf5b2b25a1259e04b3dff7a8a7981e6a0 Mon Sep 17 00:00:00 2001 From: runner Date: Thu, 8 Aug 2024 09:19:22 +0000 Subject: [PATCH 03/17] updating poms for 2.1.11-SNAPSHOT development --- gateleen-cache/pom.xml | 2 +- gateleen-core/pom.xml | 2 +- gateleen-delegate/pom.xml | 2 +- gateleen-delta/pom.xml | 2 +- gateleen-expansion/pom.xml | 2 +- gateleen-hook-js/pom.xml | 2 +- gateleen-hook/pom.xml | 2 +- gateleen-kafka/pom.xml | 2 +- gateleen-logging/pom.xml | 2 +- gateleen-merge/pom.xml | 2 +- gateleen-monitoring/pom.xml | 2 +- gateleen-packing/pom.xml | 2 +- gateleen-player/pom.xml | 2 +- gateleen-playground/pom.xml | 2 +- gateleen-qos/pom.xml | 2 +- gateleen-queue/pom.xml | 2 +- gateleen-routing/pom.xml | 2 +- gateleen-runconfig/pom.xml | 2 +- gateleen-scheduler/pom.xml | 2 +- gateleen-security/pom.xml | 2 +- gateleen-test/pom.xml | 2 +- gateleen-testhelper/pom.xml | 2 +- gateleen-user/pom.xml | 2 +- gateleen-validation/pom.xml | 2 +- pom.xml | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/gateleen-cache/pom.xml b/gateleen-cache/pom.xml index 07d0bbb9..08354d87 100644 --- a/gateleen-cache/pom.xml +++ b/gateleen-cache/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-cache diff --git a/gateleen-core/pom.xml b/gateleen-core/pom.xml index 21e1b5b4..0048af2d 100644 --- a/gateleen-core/pom.xml +++ b/gateleen-core/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-core diff --git a/gateleen-delegate/pom.xml b/gateleen-delegate/pom.xml index 82d61034..4f0989b3 100644 --- a/gateleen-delegate/pom.xml +++ b/gateleen-delegate/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-delegate diff --git a/gateleen-delta/pom.xml b/gateleen-delta/pom.xml index 161dcf21..2fb24072 100644 --- a/gateleen-delta/pom.xml +++ b/gateleen-delta/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-delta diff --git a/gateleen-expansion/pom.xml b/gateleen-expansion/pom.xml index 71b743dd..5671faa1 100644 --- a/gateleen-expansion/pom.xml +++ b/gateleen-expansion/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-expansion diff --git a/gateleen-hook-js/pom.xml b/gateleen-hook-js/pom.xml index 1dff57c4..655abef5 100644 --- a/gateleen-hook-js/pom.xml +++ b/gateleen-hook-js/pom.xml @@ -4,7 +4,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-hook-js jar diff --git a/gateleen-hook/pom.xml b/gateleen-hook/pom.xml index bd1649e1..8c9a7c0b 100644 --- a/gateleen-hook/pom.xml +++ b/gateleen-hook/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-hook diff --git a/gateleen-kafka/pom.xml b/gateleen-kafka/pom.xml index 37d000d7..b1c76515 100644 --- a/gateleen-kafka/pom.xml +++ b/gateleen-kafka/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-kafka diff --git a/gateleen-logging/pom.xml b/gateleen-logging/pom.xml index 968a0a48..f410999b 100644 --- a/gateleen-logging/pom.xml +++ b/gateleen-logging/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-logging diff --git a/gateleen-merge/pom.xml b/gateleen-merge/pom.xml index 4ebeb157..361e8d32 100644 --- a/gateleen-merge/pom.xml +++ b/gateleen-merge/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-merge diff --git a/gateleen-monitoring/pom.xml b/gateleen-monitoring/pom.xml index 174598dd..2c25ae3a 100644 --- a/gateleen-monitoring/pom.xml +++ b/gateleen-monitoring/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-monitoring diff --git a/gateleen-packing/pom.xml b/gateleen-packing/pom.xml index 049ca4e2..24ad9529 100644 --- a/gateleen-packing/pom.xml +++ b/gateleen-packing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-packing diff --git a/gateleen-player/pom.xml b/gateleen-player/pom.xml index 89538050..0761a332 100644 --- a/gateleen-player/pom.xml +++ b/gateleen-player/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-player diff --git a/gateleen-playground/pom.xml b/gateleen-playground/pom.xml index b7eec2b8..ab9c2d42 100644 --- a/gateleen-playground/pom.xml +++ b/gateleen-playground/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-playground diff --git a/gateleen-qos/pom.xml b/gateleen-qos/pom.xml index 18d9cf58..9ccc4f4b 100644 --- a/gateleen-qos/pom.xml +++ b/gateleen-qos/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-qos diff --git a/gateleen-queue/pom.xml b/gateleen-queue/pom.xml index 8de6d1ad..7a09ffc0 100644 --- a/gateleen-queue/pom.xml +++ b/gateleen-queue/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-queue diff --git a/gateleen-routing/pom.xml b/gateleen-routing/pom.xml index b0af7fb1..09608fa9 100644 --- a/gateleen-routing/pom.xml +++ b/gateleen-routing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-routing diff --git a/gateleen-runconfig/pom.xml b/gateleen-runconfig/pom.xml index e479ed88..85c494b6 100644 --- a/gateleen-runconfig/pom.xml +++ b/gateleen-runconfig/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-runconfig diff --git a/gateleen-scheduler/pom.xml b/gateleen-scheduler/pom.xml index a77b178d..ce41096d 100644 --- a/gateleen-scheduler/pom.xml +++ b/gateleen-scheduler/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-scheduler diff --git a/gateleen-security/pom.xml b/gateleen-security/pom.xml index b989cf34..bfcb166c 100644 --- a/gateleen-security/pom.xml +++ b/gateleen-security/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-security diff --git a/gateleen-test/pom.xml b/gateleen-test/pom.xml index 8f35e745..1cdc0a8a 100644 --- a/gateleen-test/pom.xml +++ b/gateleen-test/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-test jar diff --git a/gateleen-testhelper/pom.xml b/gateleen-testhelper/pom.xml index 4dcc96a3..e165af82 100644 --- a/gateleen-testhelper/pom.xml +++ b/gateleen-testhelper/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-testhelper diff --git a/gateleen-user/pom.xml b/gateleen-user/pom.xml index c05a4401..0e8cad60 100644 --- a/gateleen-user/pom.xml +++ b/gateleen-user/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-user diff --git a/gateleen-validation/pom.xml b/gateleen-validation/pom.xml index 1740837c..e1685bc1 100644 --- a/gateleen-validation/pom.xml +++ b/gateleen-validation/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT gateleen-validation diff --git a/pom.xml b/pom.xml index 9e602d43..9e89bd3d 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.11-SNAPSHOT pom gateleen Middleware library based on Vert.x to build advanced JSON/REST communication servers From ac4da871d901886e38cd121720042e399123137c Mon Sep 17 00:00:00 2001 From: runner Date: Thu, 8 Aug 2024 09:19:25 +0000 Subject: [PATCH 04/17] updating poms for branch'release-2.1.10' with non-snapshot versions --- gateleen-cache/pom.xml | 2 +- gateleen-core/pom.xml | 2 +- gateleen-delegate/pom.xml | 2 +- gateleen-delta/pom.xml | 2 +- gateleen-expansion/pom.xml | 2 +- gateleen-hook-js/pom.xml | 2 +- gateleen-hook/pom.xml | 2 +- gateleen-kafka/pom.xml | 2 +- gateleen-logging/pom.xml | 2 +- gateleen-merge/pom.xml | 2 +- gateleen-monitoring/pom.xml | 2 +- gateleen-packing/pom.xml | 2 +- gateleen-player/pom.xml | 2 +- gateleen-playground/pom.xml | 2 +- gateleen-qos/pom.xml | 2 +- gateleen-queue/pom.xml | 2 +- gateleen-routing/pom.xml | 2 +- gateleen-runconfig/pom.xml | 2 +- gateleen-scheduler/pom.xml | 2 +- gateleen-security/pom.xml | 2 +- gateleen-test/pom.xml | 2 +- gateleen-testhelper/pom.xml | 2 +- gateleen-user/pom.xml | 2 +- gateleen-validation/pom.xml | 2 +- pom.xml | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/gateleen-cache/pom.xml b/gateleen-cache/pom.xml index 07d0bbb9..9c6c6523 100644 --- a/gateleen-cache/pom.xml +++ b/gateleen-cache/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-cache diff --git a/gateleen-core/pom.xml b/gateleen-core/pom.xml index 21e1b5b4..ca8fe067 100644 --- a/gateleen-core/pom.xml +++ b/gateleen-core/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-core diff --git a/gateleen-delegate/pom.xml b/gateleen-delegate/pom.xml index 82d61034..96f51acc 100644 --- a/gateleen-delegate/pom.xml +++ b/gateleen-delegate/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-delegate diff --git a/gateleen-delta/pom.xml b/gateleen-delta/pom.xml index 161dcf21..bb61c261 100644 --- a/gateleen-delta/pom.xml +++ b/gateleen-delta/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-delta diff --git a/gateleen-expansion/pom.xml b/gateleen-expansion/pom.xml index 71b743dd..3575e917 100644 --- a/gateleen-expansion/pom.xml +++ b/gateleen-expansion/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-expansion diff --git a/gateleen-hook-js/pom.xml b/gateleen-hook-js/pom.xml index 1dff57c4..80fbdf67 100644 --- a/gateleen-hook-js/pom.xml +++ b/gateleen-hook-js/pom.xml @@ -4,7 +4,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-hook-js jar diff --git a/gateleen-hook/pom.xml b/gateleen-hook/pom.xml index bd1649e1..ea08a808 100644 --- a/gateleen-hook/pom.xml +++ b/gateleen-hook/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-hook diff --git a/gateleen-kafka/pom.xml b/gateleen-kafka/pom.xml index 37d000d7..ed2deabd 100644 --- a/gateleen-kafka/pom.xml +++ b/gateleen-kafka/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-kafka diff --git a/gateleen-logging/pom.xml b/gateleen-logging/pom.xml index 968a0a48..71a8da1c 100644 --- a/gateleen-logging/pom.xml +++ b/gateleen-logging/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-logging diff --git a/gateleen-merge/pom.xml b/gateleen-merge/pom.xml index 4ebeb157..8c74a969 100644 --- a/gateleen-merge/pom.xml +++ b/gateleen-merge/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-merge diff --git a/gateleen-monitoring/pom.xml b/gateleen-monitoring/pom.xml index 174598dd..e01e7ceb 100644 --- a/gateleen-monitoring/pom.xml +++ b/gateleen-monitoring/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-monitoring diff --git a/gateleen-packing/pom.xml b/gateleen-packing/pom.xml index 049ca4e2..2748d231 100644 --- a/gateleen-packing/pom.xml +++ b/gateleen-packing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-packing diff --git a/gateleen-player/pom.xml b/gateleen-player/pom.xml index 89538050..af6673f7 100644 --- a/gateleen-player/pom.xml +++ b/gateleen-player/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-player diff --git a/gateleen-playground/pom.xml b/gateleen-playground/pom.xml index b7eec2b8..7e79a6f1 100644 --- a/gateleen-playground/pom.xml +++ b/gateleen-playground/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-playground diff --git a/gateleen-qos/pom.xml b/gateleen-qos/pom.xml index 18d9cf58..945c5b8d 100644 --- a/gateleen-qos/pom.xml +++ b/gateleen-qos/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-qos diff --git a/gateleen-queue/pom.xml b/gateleen-queue/pom.xml index 8de6d1ad..f90dc96e 100644 --- a/gateleen-queue/pom.xml +++ b/gateleen-queue/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-queue diff --git a/gateleen-routing/pom.xml b/gateleen-routing/pom.xml index b0af7fb1..55d61f93 100644 --- a/gateleen-routing/pom.xml +++ b/gateleen-routing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-routing diff --git a/gateleen-runconfig/pom.xml b/gateleen-runconfig/pom.xml index e479ed88..21fe51b0 100644 --- a/gateleen-runconfig/pom.xml +++ b/gateleen-runconfig/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-runconfig diff --git a/gateleen-scheduler/pom.xml b/gateleen-scheduler/pom.xml index a77b178d..dbbec752 100644 --- a/gateleen-scheduler/pom.xml +++ b/gateleen-scheduler/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-scheduler diff --git a/gateleen-security/pom.xml b/gateleen-security/pom.xml index b989cf34..a8c4ccaa 100644 --- a/gateleen-security/pom.xml +++ b/gateleen-security/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-security diff --git a/gateleen-test/pom.xml b/gateleen-test/pom.xml index 8f35e745..d51c5a2c 100644 --- a/gateleen-test/pom.xml +++ b/gateleen-test/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-test jar diff --git a/gateleen-testhelper/pom.xml b/gateleen-testhelper/pom.xml index 4dcc96a3..a51b5a32 100644 --- a/gateleen-testhelper/pom.xml +++ b/gateleen-testhelper/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-testhelper diff --git a/gateleen-user/pom.xml b/gateleen-user/pom.xml index c05a4401..32566b13 100644 --- a/gateleen-user/pom.xml +++ b/gateleen-user/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-user diff --git a/gateleen-validation/pom.xml b/gateleen-validation/pom.xml index 1740837c..e1fc43fd 100644 --- a/gateleen-validation/pom.xml +++ b/gateleen-validation/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 gateleen-validation diff --git a/pom.xml b/pom.xml index 9e602d43..7217ab8a 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10-SNAPSHOT + 2.1.10 pom gateleen Middleware library based on Vert.x to build advanced JSON/REST communication servers From c879aad5bbddf2456ebe1bcb7a9072587e7e8e59 Mon Sep 17 00:00:00 2001 From: runner Date: Thu, 8 Aug 2024 09:24:11 +0000 Subject: [PATCH 05/17] updating develop poms to master versions to avoid merge conflicts --- gateleen-cache/pom.xml | 2 +- gateleen-core/pom.xml | 2 +- gateleen-delegate/pom.xml | 2 +- gateleen-delta/pom.xml | 2 +- gateleen-expansion/pom.xml | 2 +- gateleen-hook-js/pom.xml | 2 +- gateleen-hook/pom.xml | 2 +- gateleen-kafka/pom.xml | 2 +- gateleen-logging/pom.xml | 2 +- gateleen-merge/pom.xml | 2 +- gateleen-monitoring/pom.xml | 2 +- gateleen-packing/pom.xml | 2 +- gateleen-player/pom.xml | 2 +- gateleen-playground/pom.xml | 2 +- gateleen-qos/pom.xml | 2 +- gateleen-queue/pom.xml | 2 +- gateleen-routing/pom.xml | 2 +- gateleen-runconfig/pom.xml | 2 +- gateleen-scheduler/pom.xml | 2 +- gateleen-security/pom.xml | 2 +- gateleen-test/pom.xml | 2 +- gateleen-testhelper/pom.xml | 2 +- gateleen-user/pom.xml | 2 +- gateleen-validation/pom.xml | 2 +- pom.xml | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/gateleen-cache/pom.xml b/gateleen-cache/pom.xml index 08354d87..9c6c6523 100644 --- a/gateleen-cache/pom.xml +++ b/gateleen-cache/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-cache diff --git a/gateleen-core/pom.xml b/gateleen-core/pom.xml index 0048af2d..ca8fe067 100644 --- a/gateleen-core/pom.xml +++ b/gateleen-core/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-core diff --git a/gateleen-delegate/pom.xml b/gateleen-delegate/pom.xml index 4f0989b3..96f51acc 100644 --- a/gateleen-delegate/pom.xml +++ b/gateleen-delegate/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-delegate diff --git a/gateleen-delta/pom.xml b/gateleen-delta/pom.xml index 2fb24072..bb61c261 100644 --- a/gateleen-delta/pom.xml +++ b/gateleen-delta/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-delta diff --git a/gateleen-expansion/pom.xml b/gateleen-expansion/pom.xml index 5671faa1..3575e917 100644 --- a/gateleen-expansion/pom.xml +++ b/gateleen-expansion/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-expansion diff --git a/gateleen-hook-js/pom.xml b/gateleen-hook-js/pom.xml index 655abef5..80fbdf67 100644 --- a/gateleen-hook-js/pom.xml +++ b/gateleen-hook-js/pom.xml @@ -4,7 +4,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-hook-js jar diff --git a/gateleen-hook/pom.xml b/gateleen-hook/pom.xml index 8c9a7c0b..ea08a808 100644 --- a/gateleen-hook/pom.xml +++ b/gateleen-hook/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-hook diff --git a/gateleen-kafka/pom.xml b/gateleen-kafka/pom.xml index b1c76515..ed2deabd 100644 --- a/gateleen-kafka/pom.xml +++ b/gateleen-kafka/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-kafka diff --git a/gateleen-logging/pom.xml b/gateleen-logging/pom.xml index f410999b..71a8da1c 100644 --- a/gateleen-logging/pom.xml +++ b/gateleen-logging/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-logging diff --git a/gateleen-merge/pom.xml b/gateleen-merge/pom.xml index 361e8d32..8c74a969 100644 --- a/gateleen-merge/pom.xml +++ b/gateleen-merge/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-merge diff --git a/gateleen-monitoring/pom.xml b/gateleen-monitoring/pom.xml index 2c25ae3a..e01e7ceb 100644 --- a/gateleen-monitoring/pom.xml +++ b/gateleen-monitoring/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-monitoring diff --git a/gateleen-packing/pom.xml b/gateleen-packing/pom.xml index 24ad9529..2748d231 100644 --- a/gateleen-packing/pom.xml +++ b/gateleen-packing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-packing diff --git a/gateleen-player/pom.xml b/gateleen-player/pom.xml index 0761a332..af6673f7 100644 --- a/gateleen-player/pom.xml +++ b/gateleen-player/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-player diff --git a/gateleen-playground/pom.xml b/gateleen-playground/pom.xml index ab9c2d42..7e79a6f1 100644 --- a/gateleen-playground/pom.xml +++ b/gateleen-playground/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-playground diff --git a/gateleen-qos/pom.xml b/gateleen-qos/pom.xml index 9ccc4f4b..945c5b8d 100644 --- a/gateleen-qos/pom.xml +++ b/gateleen-qos/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-qos diff --git a/gateleen-queue/pom.xml b/gateleen-queue/pom.xml index 7a09ffc0..f90dc96e 100644 --- a/gateleen-queue/pom.xml +++ b/gateleen-queue/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-queue diff --git a/gateleen-routing/pom.xml b/gateleen-routing/pom.xml index 09608fa9..55d61f93 100644 --- a/gateleen-routing/pom.xml +++ b/gateleen-routing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-routing diff --git a/gateleen-runconfig/pom.xml b/gateleen-runconfig/pom.xml index 85c494b6..21fe51b0 100644 --- a/gateleen-runconfig/pom.xml +++ b/gateleen-runconfig/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-runconfig diff --git a/gateleen-scheduler/pom.xml b/gateleen-scheduler/pom.xml index ce41096d..dbbec752 100644 --- a/gateleen-scheduler/pom.xml +++ b/gateleen-scheduler/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-scheduler diff --git a/gateleen-security/pom.xml b/gateleen-security/pom.xml index bfcb166c..a8c4ccaa 100644 --- a/gateleen-security/pom.xml +++ b/gateleen-security/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-security diff --git a/gateleen-test/pom.xml b/gateleen-test/pom.xml index 1cdc0a8a..d51c5a2c 100644 --- a/gateleen-test/pom.xml +++ b/gateleen-test/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-test jar diff --git a/gateleen-testhelper/pom.xml b/gateleen-testhelper/pom.xml index e165af82..a51b5a32 100644 --- a/gateleen-testhelper/pom.xml +++ b/gateleen-testhelper/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-testhelper diff --git a/gateleen-user/pom.xml b/gateleen-user/pom.xml index 0e8cad60..32566b13 100644 --- a/gateleen-user/pom.xml +++ b/gateleen-user/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-user diff --git a/gateleen-validation/pom.xml b/gateleen-validation/pom.xml index e1685bc1..e1fc43fd 100644 --- a/gateleen-validation/pom.xml +++ b/gateleen-validation/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 gateleen-validation diff --git a/pom.xml b/pom.xml index 9e89bd3d..7217ab8a 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.11-SNAPSHOT + 2.1.10 pom gateleen Middleware library based on Vert.x to build advanced JSON/REST communication servers From 3952a9ea531b5dabf125048a0f8f2518ee375d1c Mon Sep 17 00:00:00 2001 From: runner Date: Thu, 8 Aug 2024 09:24:13 +0000 Subject: [PATCH 06/17] Updating develop poms back to pre merge state --- gateleen-cache/pom.xml | 2 +- gateleen-core/pom.xml | 2 +- gateleen-delegate/pom.xml | 2 +- gateleen-delta/pom.xml | 2 +- gateleen-expansion/pom.xml | 2 +- gateleen-hook-js/pom.xml | 2 +- gateleen-hook/pom.xml | 2 +- gateleen-kafka/pom.xml | 2 +- gateleen-logging/pom.xml | 2 +- gateleen-merge/pom.xml | 2 +- gateleen-monitoring/pom.xml | 2 +- gateleen-packing/pom.xml | 2 +- gateleen-player/pom.xml | 2 +- gateleen-playground/pom.xml | 2 +- gateleen-qos/pom.xml | 2 +- gateleen-queue/pom.xml | 2 +- gateleen-routing/pom.xml | 2 +- gateleen-runconfig/pom.xml | 2 +- gateleen-scheduler/pom.xml | 2 +- gateleen-security/pom.xml | 2 +- gateleen-test/pom.xml | 2 +- gateleen-testhelper/pom.xml | 2 +- gateleen-user/pom.xml | 2 +- gateleen-validation/pom.xml | 2 +- pom.xml | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/gateleen-cache/pom.xml b/gateleen-cache/pom.xml index 9c6c6523..08354d87 100644 --- a/gateleen-cache/pom.xml +++ b/gateleen-cache/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-cache diff --git a/gateleen-core/pom.xml b/gateleen-core/pom.xml index ca8fe067..0048af2d 100644 --- a/gateleen-core/pom.xml +++ b/gateleen-core/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-core diff --git a/gateleen-delegate/pom.xml b/gateleen-delegate/pom.xml index 96f51acc..4f0989b3 100644 --- a/gateleen-delegate/pom.xml +++ b/gateleen-delegate/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-delegate diff --git a/gateleen-delta/pom.xml b/gateleen-delta/pom.xml index bb61c261..2fb24072 100644 --- a/gateleen-delta/pom.xml +++ b/gateleen-delta/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-delta diff --git a/gateleen-expansion/pom.xml b/gateleen-expansion/pom.xml index 3575e917..5671faa1 100644 --- a/gateleen-expansion/pom.xml +++ b/gateleen-expansion/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-expansion diff --git a/gateleen-hook-js/pom.xml b/gateleen-hook-js/pom.xml index 80fbdf67..655abef5 100644 --- a/gateleen-hook-js/pom.xml +++ b/gateleen-hook-js/pom.xml @@ -4,7 +4,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-hook-js jar diff --git a/gateleen-hook/pom.xml b/gateleen-hook/pom.xml index ea08a808..8c9a7c0b 100644 --- a/gateleen-hook/pom.xml +++ b/gateleen-hook/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-hook diff --git a/gateleen-kafka/pom.xml b/gateleen-kafka/pom.xml index ed2deabd..b1c76515 100644 --- a/gateleen-kafka/pom.xml +++ b/gateleen-kafka/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-kafka diff --git a/gateleen-logging/pom.xml b/gateleen-logging/pom.xml index 71a8da1c..f410999b 100644 --- a/gateleen-logging/pom.xml +++ b/gateleen-logging/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-logging diff --git a/gateleen-merge/pom.xml b/gateleen-merge/pom.xml index 8c74a969..361e8d32 100644 --- a/gateleen-merge/pom.xml +++ b/gateleen-merge/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-merge diff --git a/gateleen-monitoring/pom.xml b/gateleen-monitoring/pom.xml index e01e7ceb..2c25ae3a 100644 --- a/gateleen-monitoring/pom.xml +++ b/gateleen-monitoring/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-monitoring diff --git a/gateleen-packing/pom.xml b/gateleen-packing/pom.xml index 2748d231..24ad9529 100644 --- a/gateleen-packing/pom.xml +++ b/gateleen-packing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-packing diff --git a/gateleen-player/pom.xml b/gateleen-player/pom.xml index af6673f7..0761a332 100644 --- a/gateleen-player/pom.xml +++ b/gateleen-player/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-player diff --git a/gateleen-playground/pom.xml b/gateleen-playground/pom.xml index 7e79a6f1..ab9c2d42 100644 --- a/gateleen-playground/pom.xml +++ b/gateleen-playground/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-playground diff --git a/gateleen-qos/pom.xml b/gateleen-qos/pom.xml index 945c5b8d..9ccc4f4b 100644 --- a/gateleen-qos/pom.xml +++ b/gateleen-qos/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-qos diff --git a/gateleen-queue/pom.xml b/gateleen-queue/pom.xml index f90dc96e..7a09ffc0 100644 --- a/gateleen-queue/pom.xml +++ b/gateleen-queue/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-queue diff --git a/gateleen-routing/pom.xml b/gateleen-routing/pom.xml index 55d61f93..09608fa9 100644 --- a/gateleen-routing/pom.xml +++ b/gateleen-routing/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-routing diff --git a/gateleen-runconfig/pom.xml b/gateleen-runconfig/pom.xml index 21fe51b0..85c494b6 100644 --- a/gateleen-runconfig/pom.xml +++ b/gateleen-runconfig/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-runconfig diff --git a/gateleen-scheduler/pom.xml b/gateleen-scheduler/pom.xml index dbbec752..ce41096d 100644 --- a/gateleen-scheduler/pom.xml +++ b/gateleen-scheduler/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-scheduler diff --git a/gateleen-security/pom.xml b/gateleen-security/pom.xml index a8c4ccaa..bfcb166c 100644 --- a/gateleen-security/pom.xml +++ b/gateleen-security/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-security diff --git a/gateleen-test/pom.xml b/gateleen-test/pom.xml index d51c5a2c..1cdc0a8a 100644 --- a/gateleen-test/pom.xml +++ b/gateleen-test/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-test jar diff --git a/gateleen-testhelper/pom.xml b/gateleen-testhelper/pom.xml index a51b5a32..e165af82 100644 --- a/gateleen-testhelper/pom.xml +++ b/gateleen-testhelper/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-testhelper diff --git a/gateleen-user/pom.xml b/gateleen-user/pom.xml index 32566b13..0e8cad60 100644 --- a/gateleen-user/pom.xml +++ b/gateleen-user/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-user diff --git a/gateleen-validation/pom.xml b/gateleen-validation/pom.xml index e1fc43fd..e1685bc1 100644 --- a/gateleen-validation/pom.xml +++ b/gateleen-validation/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT gateleen-validation diff --git a/pom.xml b/pom.xml index 7217ab8a..9e89bd3d 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.swisspush.gateleen gateleen - 2.1.10 + 2.1.11-SNAPSHOT pom gateleen Middleware library based on Vert.x to build advanced JSON/REST communication servers From ca8e682ae6c3212e863df617b79872596d38679c Mon Sep 17 00:00:00 2001 From: almeidast Date: Thu, 8 Aug 2024 15:09:19 +0100 Subject: [PATCH 07/17] #451 - start implement Copy --- .../swisspush/gateleen/delegate/Delegate.java | 7 +- .../gateleen/delegate/DelegateFactory.java | 28 ++---- .../gateleen/delegate/DelegateHandler.java | 30 +++---- .../gateleen/delegate/DelegateRequest.java | 8 +- .../gateleen_delegate_schema_delegates | 87 ++++++++++--------- 5 files changed, 81 insertions(+), 79 deletions(-) diff --git a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/Delegate.java b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/Delegate.java index f1aa6cc5..baf45d50 100644 --- a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/Delegate.java +++ b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/Delegate.java @@ -36,6 +36,7 @@ public class Delegate { private static final String PAYLOAD = "payload"; private static final String URI = "uri"; private static final String METHOD = "method"; + private static final String COPY = "copy"; private static final int FIRST = 0; private static final int STATUS_CODE_2XX = 2; @@ -239,7 +240,9 @@ private Future extractDelegateExecutionRequestJsonPayload(HttpServerRequ private Future generatePayload(String delegateExecutionRequestJsonPayload, MultiMap headers, DelegateRequest requestContainer, final Matcher matcher) { Promise promise = Promise.promise(); - if (requestContainer.getJoltSpec() != null) { + if (requestContainer.isCopy()) { + promise.complete(Buffer.buffer(delegateExecutionRequestJsonPayload)); + } else if (requestContainer.getJoltSpec() != null) { try { if (delegateExecutionRequestJsonPayload != null) { @@ -269,7 +272,7 @@ private Future generatePayload(String delegateExecutionRequestJsonPayloa } else { // matcher to replace wildcards with matching groups final JsonObject requestObject = requestContainer.getRequest(); - // get the string represantion of the payload object + // get the string representation of the payload object String payloadStr; payloadStr = requestObject.getJsonObject(PAYLOAD).encode(); diff --git a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateFactory.java b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateFactory.java index 966ac2d5..70bce068 100644 --- a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateFactory.java +++ b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateFactory.java @@ -24,8 +24,6 @@ /** * DelegateFactory is used to create delegate objects from their text representation. - * - * @author https://github.com/ljucam [Mario Ljuca] */ public class DelegateFactory { private static final Logger LOG = LoggerFactory.getLogger(DelegateFactory.class); @@ -36,6 +34,7 @@ public class DelegateFactory { private static final String DYNAMIC_HEADERS = "dynamicHeaders"; private static final String TRANSFORM = "transform"; private static final String TRANSFORM_WITH_METADATA = "transformWithMetadata"; + private static final String COPY = "copy"; private final ClientRequestCreator clientRequestCreator; @@ -46,11 +45,6 @@ public class DelegateFactory { /** * Creates a new instance of the DelegateFactory. - * - * @param clientRequestCreator - * @param properties - * @param delegatesSchema - * @param unmatchedDelegateStatusCode */ public DelegateFactory(final ClientRequestCreator clientRequestCreator, final Map properties, final String delegatesSchema, @Nullable StatusCode unmatchedDelegateStatusCode) { @@ -61,12 +55,7 @@ public DelegateFactory(final ClientRequestCreator clientRequestCreator, final Ma } /** - * Tries to create a Delegate object out of the - * buffer. - * - * @param delegateName name of the delegate - * @param buffer buffer of the delegate - * @return a Delegate object + * Tries to create a Delegate object out of the buffer. */ public Delegate parseDelegate(final String delegateName, final Buffer buffer) throws ValidationException { final String configString; @@ -90,11 +79,6 @@ public Delegate parseDelegate(final String delegateName, final Buffer buffer) th /** * Create the delegate out of the prepared string. - * - * @param delegateName name of the delegate - * @param configString the string rep. of the delegate - * @return the new delegate - * @throws ValidationException */ private Delegate createDelegate(final String delegateName, final String configString) throws ValidationException { JsonObject delegateObject = new JsonObject(configString); @@ -119,7 +103,11 @@ private Delegate createDelegate(final String delegateName, final String configSt LOG.trace("request of [{}] #: {}", delegateName, i); } JsonObject requestJsonObject = (JsonObject) delegateObject.getJsonArray(REQUESTS).getValue(i); - JoltSpec joltSpec = parsePayloadTransformSpec(requestJsonObject, delegateName); + boolean copy = requestJsonObject.getBoolean(COPY, false); + JoltSpec joltSpec = null; + if (!copy) { + joltSpec = parsePayloadTransformSpec(requestJsonObject, delegateName); + } HeaderFunction headerFunction; final JsonArray headerFunctionsArray = requestJsonObject.getJsonArray(DYNAMIC_HEADERS); @@ -129,7 +117,7 @@ private Delegate createDelegate(final String delegateName, final String configSt headerFunction = HeaderFunctions.DO_NOTHING; } - requests.add(new DelegateRequest(requestJsonObject, joltSpec, headerFunction)); + requests.add(new DelegateRequest(requestJsonObject, joltSpec, headerFunction, copy)); } return new Delegate(clientRequestCreator, delegateName, pattern, methods, requests, unmatchedDelegateStatusCode); diff --git a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateHandler.java b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateHandler.java index 9ed410f6..ca76fb69 100644 --- a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateHandler.java +++ b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateHandler.java @@ -33,21 +33,21 @@ * delegate.
* PUT /gateleen/server/delegate/v1/delegates/user-zip-copy/definition *
-    {
-        "methods": [ "PUT", "DELETE" ],
-        "pattern": "([^/]*)/(.*)",
-        "requests": [
-            {
-                 "headers" : [],
-                 "uri": "/gateleen/server/copy",
-                 "method": "POST",
-                 "payload": {
-                    "source": "/gateleen/$1?expand=100&zip=true",
-                    "destination": "/gateleen/zips/users/$1.zip"
-                }
-            }
-        ]
-    }
+ {
+ "methods": [ "PUT", "DELETE" ],
+ "pattern": "([^/]*)/(.*)",
+ "requests": [
+ {
+ "headers" : [],
+ "uri": "/gateleen/server/copy",
+ "method": "POST",
+ "payload": {
+ "source": "/gateleen/$1?expand=100&zip=true",
+ "destination": "/gateleen/zips/users/$1.zip"
+ }
+ }
+ ]
+ }
 
  * 
* To trigger an execution, it suffice to perform a PUT request on the virtual collection execution within diff --git a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateRequest.java b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateRequest.java index 66ff0b21..08a20f44 100644 --- a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateRequest.java +++ b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateRequest.java @@ -14,11 +14,13 @@ public class DelegateRequest { private final JsonObject request; private final JoltSpec joltSpec; private final HeaderFunction headerFunction; + private final boolean copy; - public DelegateRequest(JsonObject request, JoltSpec joltSpec, HeaderFunction headerFunction) { + public DelegateRequest(JsonObject request, JoltSpec joltSpec, HeaderFunction headerFunction, boolean copy) { this.request = request; this.joltSpec = joltSpec; this.headerFunction = headerFunction; + this.copy = copy; } public JsonObject getRequest() { @@ -32,4 +34,8 @@ public JoltSpec getJoltSpec() { public HeaderFunction getHeaderFunction() { return headerFunction; } + + public boolean isCopy() { + return copy; + } } diff --git a/gateleen-delegate/src/main/resources/gateleen_delegate_schema_delegates b/gateleen-delegate/src/main/resources/gateleen_delegate_schema_delegates index 14f06104..4f348f39 100644 --- a/gateleen-delegate/src/main/resources/gateleen_delegate_schema_delegates +++ b/gateleen-delegate/src/main/resources/gateleen_delegate_schema_delegates @@ -4,7 +4,7 @@ "type": "object", "properties": { "methods": { - "description": "Restricts the HTTP methods concerned by this rule (`GET`, `PUT`, `POST`, `DELETE`).\nWhen absent, all methods are concerned.", + "description": "Restricts the HTTP methods concerned by this rule (`GET`, `PUT`, `POST`, `DELETE`). When absent, all methods are concerned.", "type": "array", "items": { "type": "string" @@ -19,55 +19,56 @@ "type": "string" }, "pattern": { - "description": "Pattern for grouping the incoming uri", + "description": "Pattern for grouping the incoming URI", "type": "string" }, "requests": { "type": "array", - "items": {"$ref": "#/definitions/Request"} + "items": { "$ref": "#/definitions/Request" } } }, "additionalProperties": false, "definitions": { "HeaderFunction": { - "properties": { - "header": { - "description": "the request-header name to manipulate (set, remove or conditional set)", - "type": "string", - "minLength": 1 - }, - "value": { - "description": "the value to be set. null and empty string means 'remove the header'. value can contain other header names between single angular brackets which resolves to their values accordingly", - "type": [ - "null", - "string" - ] - }, - "mode": { - "description": "define a condition-mode. 'complete' sets the header value only if this header is not yet present. 'overwrite' sets the header value only if the header is already present. Ignored if value is null or empty string", - "type": "string", - "enum": [ - "complete", - "override" - ] - } + "properties": { + "header": { + "description": "The request-header name to manipulate (set, remove or conditional set)", + "type": "string", + "minLength": 1 + }, + "value": { + "description": "The value to be set. Null and empty string means 'remove the header'. Value can contain other header names between single angular brackets which resolves to their values accordingly", + "type": [ + "null", + "string" + ] }, - "required": [ - "header", - "value" - ] + "mode": { + "description": "Define a condition-mode. 'complete' sets the header value only if this header is not yet present. 'overwrite' sets the header value only if the header is already present. Ignored if value is null or empty string", + "type": "string", + "enum": [ + "complete", + "override" + ] + } + }, + "required": [ + "header", + "value" + ] }, "Request": { "oneOf": [ { "required": ["payload"] }, { "required": ["transform"] }, - { "required": ["transformWithMetadata"] } + { "required": ["transformWithMetadata"] }, + { "required": ["copy"] } ], "anyOf": [ { "oneOf": [ - {"required": ["dynamicHeaders"]}, - {"required": ["headers"]} + { "required": ["dynamicHeaders"] }, + { "required": ["headers"] } ] }, { @@ -91,24 +92,28 @@ ] }, "payload": { - "description": "The payload to send in requests body", + "description": "The payload to send in the request's body", "type": "object" }, "transform": { - "description": "The jolt spec definition to transform the payload", + "description": "The JOLT spec definition to transform the payload", "type": "array" }, "transformWithMetadata": { - "description": "The jolt spec definition to transform the payload and additional metadata", + "description": "The JOLT spec definition to transform the payload and additional metadata", "type": "array" }, - "dynamicHeaders": { - "description": "Manipulate (set / remove / replace) request headers using HeaderFunctions - option to reference other header vales", - "type": "array", - "items": { - "$ref": "#/definitions/HeaderFunction" - } - }, + "copy": { + "description": "Indicates that the original payload should be copied to the new destination", + "type": "boolean" + }, + "dynamicHeaders": { + "description": "Manipulate (set / remove / replace) request headers using HeaderFunctions - option to reference other header values", + "type": "array", + "items": { + "$ref": "#/definitions/HeaderFunction" + } + }, "headers": { "description": "Headers to send with the request", "type": "array", From 77a3544263f2bb8091ca4ea1b1b31247ec77f6f9 Mon Sep 17 00:00:00 2001 From: almeidast Date: Thu, 8 Aug 2024 17:26:10 +0100 Subject: [PATCH 08/17] #451 - remove delegate copy --- .../swisspush/gateleen/delegate/Delegate.java | 7 ++--- .../gateleen/delegate/DelegateFactory.java | 28 ++++++++++++----- .../gateleen/delegate/DelegateHandler.java | 30 +++++++++---------- .../gateleen/delegate/DelegateRequest.java | 8 +---- 4 files changed, 38 insertions(+), 35 deletions(-) diff --git a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/Delegate.java b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/Delegate.java index baf45d50..f1aa6cc5 100644 --- a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/Delegate.java +++ b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/Delegate.java @@ -36,7 +36,6 @@ public class Delegate { private static final String PAYLOAD = "payload"; private static final String URI = "uri"; private static final String METHOD = "method"; - private static final String COPY = "copy"; private static final int FIRST = 0; private static final int STATUS_CODE_2XX = 2; @@ -240,9 +239,7 @@ private Future extractDelegateExecutionRequestJsonPayload(HttpServerRequ private Future generatePayload(String delegateExecutionRequestJsonPayload, MultiMap headers, DelegateRequest requestContainer, final Matcher matcher) { Promise promise = Promise.promise(); - if (requestContainer.isCopy()) { - promise.complete(Buffer.buffer(delegateExecutionRequestJsonPayload)); - } else if (requestContainer.getJoltSpec() != null) { + if (requestContainer.getJoltSpec() != null) { try { if (delegateExecutionRequestJsonPayload != null) { @@ -272,7 +269,7 @@ private Future generatePayload(String delegateExecutionRequestJsonPayloa } else { // matcher to replace wildcards with matching groups final JsonObject requestObject = requestContainer.getRequest(); - // get the string representation of the payload object + // get the string represantion of the payload object String payloadStr; payloadStr = requestObject.getJsonObject(PAYLOAD).encode(); diff --git a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateFactory.java b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateFactory.java index 70bce068..966ac2d5 100644 --- a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateFactory.java +++ b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateFactory.java @@ -24,6 +24,8 @@ /** * DelegateFactory is used to create delegate objects from their text representation. + * + * @author https://github.com/ljucam [Mario Ljuca] */ public class DelegateFactory { private static final Logger LOG = LoggerFactory.getLogger(DelegateFactory.class); @@ -34,7 +36,6 @@ public class DelegateFactory { private static final String DYNAMIC_HEADERS = "dynamicHeaders"; private static final String TRANSFORM = "transform"; private static final String TRANSFORM_WITH_METADATA = "transformWithMetadata"; - private static final String COPY = "copy"; private final ClientRequestCreator clientRequestCreator; @@ -45,6 +46,11 @@ public class DelegateFactory { /** * Creates a new instance of the DelegateFactory. + * + * @param clientRequestCreator + * @param properties + * @param delegatesSchema + * @param unmatchedDelegateStatusCode */ public DelegateFactory(final ClientRequestCreator clientRequestCreator, final Map properties, final String delegatesSchema, @Nullable StatusCode unmatchedDelegateStatusCode) { @@ -55,7 +61,12 @@ public DelegateFactory(final ClientRequestCreator clientRequestCreator, final Ma } /** - * Tries to create a Delegate object out of the buffer. + * Tries to create a Delegate object out of the + * buffer. + * + * @param delegateName name of the delegate + * @param buffer buffer of the delegate + * @return a Delegate object */ public Delegate parseDelegate(final String delegateName, final Buffer buffer) throws ValidationException { final String configString; @@ -79,6 +90,11 @@ public Delegate parseDelegate(final String delegateName, final Buffer buffer) th /** * Create the delegate out of the prepared string. + * + * @param delegateName name of the delegate + * @param configString the string rep. of the delegate + * @return the new delegate + * @throws ValidationException */ private Delegate createDelegate(final String delegateName, final String configString) throws ValidationException { JsonObject delegateObject = new JsonObject(configString); @@ -103,11 +119,7 @@ private Delegate createDelegate(final String delegateName, final String configSt LOG.trace("request of [{}] #: {}", delegateName, i); } JsonObject requestJsonObject = (JsonObject) delegateObject.getJsonArray(REQUESTS).getValue(i); - boolean copy = requestJsonObject.getBoolean(COPY, false); - JoltSpec joltSpec = null; - if (!copy) { - joltSpec = parsePayloadTransformSpec(requestJsonObject, delegateName); - } + JoltSpec joltSpec = parsePayloadTransformSpec(requestJsonObject, delegateName); HeaderFunction headerFunction; final JsonArray headerFunctionsArray = requestJsonObject.getJsonArray(DYNAMIC_HEADERS); @@ -117,7 +129,7 @@ private Delegate createDelegate(final String delegateName, final String configSt headerFunction = HeaderFunctions.DO_NOTHING; } - requests.add(new DelegateRequest(requestJsonObject, joltSpec, headerFunction, copy)); + requests.add(new DelegateRequest(requestJsonObject, joltSpec, headerFunction)); } return new Delegate(clientRequestCreator, delegateName, pattern, methods, requests, unmatchedDelegateStatusCode); diff --git a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateHandler.java b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateHandler.java index ca76fb69..9ed410f6 100644 --- a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateHandler.java +++ b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateHandler.java @@ -33,21 +33,21 @@ * delegate.
* PUT /gateleen/server/delegate/v1/delegates/user-zip-copy/definition *
- {
- "methods": [ "PUT", "DELETE" ],
- "pattern": "([^/]*)/(.*)",
- "requests": [
- {
- "headers" : [],
- "uri": "/gateleen/server/copy",
- "method": "POST",
- "payload": {
- "source": "/gateleen/$1?expand=100&zip=true",
- "destination": "/gateleen/zips/users/$1.zip"
- }
- }
- ]
- }
+    {
+        "methods": [ "PUT", "DELETE" ],
+        "pattern": "([^/]*)/(.*)",
+        "requests": [
+            {
+                 "headers" : [],
+                 "uri": "/gateleen/server/copy",
+                 "method": "POST",
+                 "payload": {
+                    "source": "/gateleen/$1?expand=100&zip=true",
+                    "destination": "/gateleen/zips/users/$1.zip"
+                }
+            }
+        ]
+    }
 
  * 
* To trigger an execution, it suffice to perform a PUT request on the virtual collection execution within diff --git a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateRequest.java b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateRequest.java index 08a20f44..66ff0b21 100644 --- a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateRequest.java +++ b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateRequest.java @@ -14,13 +14,11 @@ public class DelegateRequest { private final JsonObject request; private final JoltSpec joltSpec; private final HeaderFunction headerFunction; - private final boolean copy; - public DelegateRequest(JsonObject request, JoltSpec joltSpec, HeaderFunction headerFunction, boolean copy) { + public DelegateRequest(JsonObject request, JoltSpec joltSpec, HeaderFunction headerFunction) { this.request = request; this.joltSpec = joltSpec; this.headerFunction = headerFunction; - this.copy = copy; } public JsonObject getRequest() { @@ -34,8 +32,4 @@ public JoltSpec getJoltSpec() { public HeaderFunction getHeaderFunction() { return headerFunction; } - - public boolean isCopy() { - return copy; - } } From 5256fe4399dae68daeca3a60a959ff3dd62ae5a0 Mon Sep 17 00:00:00 2001 From: almeidast Date: Thu, 8 Aug 2024 17:30:19 +0100 Subject: [PATCH 09/17] #451 - remove delegate copy --- .../gateleen_delegate_schema_delegates | 87 +++++++++---------- 1 file changed, 41 insertions(+), 46 deletions(-) diff --git a/gateleen-delegate/src/main/resources/gateleen_delegate_schema_delegates b/gateleen-delegate/src/main/resources/gateleen_delegate_schema_delegates index 4f348f39..14f06104 100644 --- a/gateleen-delegate/src/main/resources/gateleen_delegate_schema_delegates +++ b/gateleen-delegate/src/main/resources/gateleen_delegate_schema_delegates @@ -4,7 +4,7 @@ "type": "object", "properties": { "methods": { - "description": "Restricts the HTTP methods concerned by this rule (`GET`, `PUT`, `POST`, `DELETE`). When absent, all methods are concerned.", + "description": "Restricts the HTTP methods concerned by this rule (`GET`, `PUT`, `POST`, `DELETE`).\nWhen absent, all methods are concerned.", "type": "array", "items": { "type": "string" @@ -19,56 +19,55 @@ "type": "string" }, "pattern": { - "description": "Pattern for grouping the incoming URI", + "description": "Pattern for grouping the incoming uri", "type": "string" }, "requests": { "type": "array", - "items": { "$ref": "#/definitions/Request" } + "items": {"$ref": "#/definitions/Request"} } }, "additionalProperties": false, "definitions": { "HeaderFunction": { - "properties": { - "header": { - "description": "The request-header name to manipulate (set, remove or conditional set)", - "type": "string", - "minLength": 1 - }, - "value": { - "description": "The value to be set. Null and empty string means 'remove the header'. Value can contain other header names between single angular brackets which resolves to their values accordingly", - "type": [ - "null", - "string" - ] + "properties": { + "header": { + "description": "the request-header name to manipulate (set, remove or conditional set)", + "type": "string", + "minLength": 1 + }, + "value": { + "description": "the value to be set. null and empty string means 'remove the header'. value can contain other header names between single angular brackets which resolves to their values accordingly", + "type": [ + "null", + "string" + ] + }, + "mode": { + "description": "define a condition-mode. 'complete' sets the header value only if this header is not yet present. 'overwrite' sets the header value only if the header is already present. Ignored if value is null or empty string", + "type": "string", + "enum": [ + "complete", + "override" + ] + } }, - "mode": { - "description": "Define a condition-mode. 'complete' sets the header value only if this header is not yet present. 'overwrite' sets the header value only if the header is already present. Ignored if value is null or empty string", - "type": "string", - "enum": [ - "complete", - "override" - ] - } - }, - "required": [ - "header", - "value" - ] + "required": [ + "header", + "value" + ] }, "Request": { "oneOf": [ { "required": ["payload"] }, { "required": ["transform"] }, - { "required": ["transformWithMetadata"] }, - { "required": ["copy"] } + { "required": ["transformWithMetadata"] } ], "anyOf": [ { "oneOf": [ - { "required": ["dynamicHeaders"] }, - { "required": ["headers"] } + {"required": ["dynamicHeaders"]}, + {"required": ["headers"]} ] }, { @@ -92,28 +91,24 @@ ] }, "payload": { - "description": "The payload to send in the request's body", + "description": "The payload to send in requests body", "type": "object" }, "transform": { - "description": "The JOLT spec definition to transform the payload", + "description": "The jolt spec definition to transform the payload", "type": "array" }, "transformWithMetadata": { - "description": "The JOLT spec definition to transform the payload and additional metadata", + "description": "The jolt spec definition to transform the payload and additional metadata", "type": "array" }, - "copy": { - "description": "Indicates that the original payload should be copied to the new destination", - "type": "boolean" - }, - "dynamicHeaders": { - "description": "Manipulate (set / remove / replace) request headers using HeaderFunctions - option to reference other header values", - "type": "array", - "items": { - "$ref": "#/definitions/HeaderFunction" - } - }, + "dynamicHeaders": { + "description": "Manipulate (set / remove / replace) request headers using HeaderFunctions - option to reference other header vales", + "type": "array", + "items": { + "$ref": "#/definitions/HeaderFunction" + } + }, "headers": { "description": "Headers to send with the request", "type": "array", From 9336b6e7d843a3597628c9861f9aa438ad0804d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Weber?= Date: Wed, 4 Sep 2024 08:34:40 +0200 Subject: [PATCH 10/17] No Issue: Added queuing rule for playground server --- .../main/resources/playground/server/admin/v1/routing/rules | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gateleen-playground/src/main/resources/playground/server/admin/v1/routing/rules b/gateleen-playground/src/main/resources/playground/server/admin/v1/routing/rules index 268aaf73..351a62d7 100755 --- a/gateleen-playground/src/main/resources/playground/server/admin/v1/routing/rules +++ b/gateleen-playground/src/main/resources/playground/server/admin/v1/routing/rules @@ -62,6 +62,11 @@ "description": "CircuitBreaker API", "url": "http://localhost:7013/playground/server/queuecircuitbreaker/circuit/$1" }, + "/playground/server/queuing/(.*)": { + "description": "Redisques API", + "metricName": "server-queuing-api", + "url": "http://localhost:7015/queuing/$1" + }, "/playground/server/redisques/(.*)": { "description": "Redisques API", "url": "http://localhost:7015/queuing/$1" From cc3d53da2233a287ae72e21a60d1be8587aad9be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Weber?= Date: Wed, 4 Sep 2024 08:47:21 +0200 Subject: [PATCH 11/17] No Issue: Added queuing rule for playground server --- .../main/java/org/swisspush/gateleen/runconfig/RunConfig.java | 1 + 1 file changed, 1 insertion(+) diff --git a/gateleen-runconfig/src/main/java/org/swisspush/gateleen/runconfig/RunConfig.java b/gateleen-runconfig/src/main/java/org/swisspush/gateleen/runconfig/RunConfig.java index a6f9f273..8688b46f 100755 --- a/gateleen-runconfig/src/main/java/org/swisspush/gateleen/runconfig/RunConfig.java +++ b/gateleen-runconfig/src/main/java/org/swisspush/gateleen/runconfig/RunConfig.java @@ -437,6 +437,7 @@ public static JsonObject buildRedisquesConfig() { .address(Address.redisquesAddress()) .processorAddress(Address.queueProcessorAddress()) .httpRequestHandlerEnabled(true) + .enableQueueNameDecoding(false) .httpRequestHandlerPort(7015) .redisReconnectAttempts(-1) .redisPoolRecycleTimeoutMs(-1) From d58bc34d7e2489aaab93f974d7c25e5208b8688b Mon Sep 17 00:00:00 2001 From: Xin Zheng Date: Wed, 18 Sep 2024 09:37:34 +0700 Subject: [PATCH 12/17] use set for metric --- .../org/swisspush/gateleen/monitoring/MonitoringHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gateleen-monitoring/src/main/java/org/swisspush/gateleen/monitoring/MonitoringHandler.java b/gateleen-monitoring/src/main/java/org/swisspush/gateleen/monitoring/MonitoringHandler.java index a4fe0ec9..efd5bca5 100644 --- a/gateleen-monitoring/src/main/java/org/swisspush/gateleen/monitoring/MonitoringHandler.java +++ b/gateleen-monitoring/src/main/java/org/swisspush/gateleen/monitoring/MonitoringHandler.java @@ -353,7 +353,7 @@ public void stopRequestMetricTracking(final String metricName, long startTime, S if (metricName != null) { double duration = (System.nanoTime() - startTime) / 1000000d; vertx.eventBus().publish(getMonitoringAddress(), - new JsonObject().put(METRIC_NAME, prefix + "routing." + metricName + ".duration").put(METRIC_ACTION, "update").put("n", duration)); + new JsonObject().put(METRIC_NAME, prefix + "routing." + metricName + ".duration").put(METRIC_ACTION, "set").put("n", duration)); } updatePendingRequestCount(false); } @@ -389,7 +389,7 @@ public void updateLastUsedQueueSizeInformation(final String queue) { vertx.eventBus().request(getRedisquesAddress(), buildGetQueueItemsCountOperation(queue), (Handler>>) reply -> { if (reply.succeeded() && OK.equals(reply.result().body().getString(STATUS))) { final long count = reply.result().body().getLong(VALUE); - vertx.eventBus().publish(getMonitoringAddress(), new JsonObject().put(METRIC_NAME, prefix + LAST_USED_QUEUE_SIZE_METRIC).put(METRIC_ACTION, "update").put("n", count)); + vertx.eventBus().publish(getMonitoringAddress(), new JsonObject().put(METRIC_NAME, prefix + LAST_USED_QUEUE_SIZE_METRIC).put(METRIC_ACTION, "set").put("n", count)); } else { log.error("Error gathering queue size for queue '{}'", queue); } From d9fe1aea9401adcc6c5edc3ba1c0349d223deb1a Mon Sep 17 00:00:00 2001 From: Xin Zheng Date: Fri, 20 Sep 2024 16:25:03 +0700 Subject: [PATCH 13/17] try to fix tests --- .../hook/HookQueueingStrategiesTest.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/gateleen-test/src/test/java/org/swisspush/gateleen/hook/HookQueueingStrategiesTest.java b/gateleen-test/src/test/java/org/swisspush/gateleen/hook/HookQueueingStrategiesTest.java index c09efccc..910484a0 100644 --- a/gateleen-test/src/test/java/org/swisspush/gateleen/hook/HookQueueingStrategiesTest.java +++ b/gateleen-test/src/test/java/org/swisspush/gateleen/hook/HookQueueingStrategiesTest.java @@ -78,18 +78,18 @@ public void testDiscardPayloadQueueingStrategy(TestContext context) { when().get("pushnotification/queuing/queues/") .then().assertThat() .body("queues", hasItem(queueName)); - given().urlEncodingEnabled(true).when().get("pushnotification/queuing/queues/" + queueName) + given().urlEncodingEnabled(false).when().get("pushnotification/queuing/queues/" + queueName) .then().assertThat() .body(queueName, hasSize(3)); // check that no queue items do have a payload - String responseIndex0 = given().urlEncodingEnabled(true) + String responseIndex0 = given().urlEncodingEnabled(false) .when().get("pushnotification/queuing/queues/" + queueName + "/0") .then().extract().response().asString(); - String responseIndex1 = given().urlEncodingEnabled(true) + String responseIndex1 = given().urlEncodingEnabled(false) .when().get("pushnotification/queuing/queues/" + queueName + "/1") .then().extract().response().asString(); - String responseIndex2 = given().urlEncodingEnabled(true) + String responseIndex2 = given().urlEncodingEnabled(false) .when().get("pushnotification/queuing/queues/" + queueName + "/2") .then().extract().response().asString(); @@ -147,7 +147,7 @@ public void testReducedPropagationQueueingStrategy(TestContext context) { .then().assertThat() .body("queues", hasItem(queueName)) .body("queues", not(hasItem(managerQueue))); - given().urlEncodingEnabled(true).when().get("pushnotification/queuing/queues/" + queueName) + given().urlEncodingEnabled(false).when().get("pushnotification/queuing/queues/" + queueName) .then().assertThat() .body(queueName, hasSize(3)); when().get("pushnotification/queuing/locks/") @@ -158,10 +158,10 @@ public void testReducedPropagationQueueingStrategy(TestContext context) { // after 5s an unlocked manager queue with a single queue item should exist and the original queue should be empty // and its lock should have been deleted Awaitility.await().untilAsserted(() -> when().get("pushnotification/queuing/queues/").then().assertThat().body("queues", hasItem(managerQueue))); - given().urlEncodingEnabled(true).when().get("pushnotification/queuing/queues/" + managerQueue) + given().urlEncodingEnabled(false).when().get("pushnotification/queuing/queues/" + managerQueue) .then().assertThat() .body(managerQueue, hasSize(1)); - given().urlEncodingEnabled(true).when().get("pushnotification/queuing/queues/" + queueName) + given().urlEncodingEnabled(false).when().get("pushnotification/queuing/queues/" + queueName) .then().assertThat() .body(queueName, empty()); @@ -181,7 +181,7 @@ public void testReducedPropagationQueueingStrategy(TestContext context) { .then().assertThat() .body("queues", hasItem(queueName)) .body("queues", hasItem(managerQueue)); - given().urlEncodingEnabled(true).when().get("pushnotification/queuing/queues/" + queueName) + given().urlEncodingEnabled(false).when().get("pushnotification/queuing/queues/" + queueName) .then().assertThat() .body(queueName, hasSize(2)); when().get("pushnotification/queuing/locks/") @@ -193,10 +193,10 @@ public void testReducedPropagationQueueingStrategy(TestContext context) { // and its lock should have been deleted TestUtils.waitSomeTime(5); Awaitility.await().untilAsserted(() -> when().get("pushnotification/queuing/queues/").then().assertThat().body("queues", hasItem(managerQueue))); - given().urlEncodingEnabled(true).when().get("pushnotification/queuing/queues/" + managerQueue) + given().urlEncodingEnabled(false).when().get("pushnotification/queuing/queues/" + managerQueue) .then().assertThat() .body(managerQueue, hasSize(1)); - given().urlEncodingEnabled(true).when().get("pushnotification/queuing/queues/" + queueName) + given().urlEncodingEnabled(false).when().get("pushnotification/queuing/queues/" + queueName) .then().assertThat() .body(queueName, empty()); From 45f39c1e18c5c878e237e7e42cebed45f94b3f9e Mon Sep 17 00:00:00 2001 From: Xin Zheng Date: Fri, 20 Sep 2024 16:57:00 +0700 Subject: [PATCH 14/17] try to fix tests --- .../gateleen/core/monitoring/MonitoringTest.java | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/gateleen-test/src/test/java/org/swisspush/gateleen/core/monitoring/MonitoringTest.java b/gateleen-test/src/test/java/org/swisspush/gateleen/core/monitoring/MonitoringTest.java index b1bfa6ad..91ae8fb5 100644 --- a/gateleen-test/src/test/java/org/swisspush/gateleen/core/monitoring/MonitoringTest.java +++ b/gateleen-test/src/test/java/org/swisspush/gateleen/core/monitoring/MonitoringTest.java @@ -29,10 +29,6 @@ @RunWith(VertxUnitRunner.class) public class MonitoringTest extends AbstractTest { Logger log = LoggerFactory.getLogger(MonitoringTest.class); - - private static final long MAX_DURATION_THRESHOLD = 100; - private static final double MEAN_DURATION_THRESHOLD = 25.0; - /** * Overwrite RestAssured configuration */ @@ -95,17 +91,7 @@ public void testStorageMetrics(TestContext context) throws Exception { // read the jmx infos if (mbs.isRegistered(beanNameObject)) { - log.info(" > Min: {}", mbs.getAttribute(beanNameObject, "Min")); - log.info(" > Mean: {}", mbs.getAttribute(beanNameObject, "Mean")); - log.info(" > Max: {}", mbs.getAttribute(beanNameObject, "Max")); - log.info(" > Count: {}", mbs.getAttribute(beanNameObject, "Count")); - log.info(" > StdDev: {}", mbs.getAttribute(beanNameObject, "StdDev")); - - // check max threshold - context.assertTrue((Long) mbs.getAttribute(beanNameObject, "Max") <= MAX_DURATION_THRESHOLD, "'Max' should be below the threshold"); - - // checm mean threshold - context.assertTrue((Double) mbs.getAttribute(beanNameObject, "Mean") <= MEAN_DURATION_THRESHOLD, "'Mean' should be below the threshold"); + log.info(" > Value: {}", mbs.getAttribute(beanNameObject, "Value")); } else { context.fail("could not found mbean " + beanName); } From ab6712a28e9fbf40cf1e0b39cc1412f6452fa044 Mon Sep 17 00:00:00 2001 From: Almeida Stenio Date: Wed, 25 Sep 2024 16:41:27 +0100 Subject: [PATCH 15/17] Revert "#451 - remove delegate copy" This reverts commit 5256fe4399dae68daeca3a60a959ff3dd62ae5a0. --- .../gateleen_delegate_schema_delegates | 87 ++++++++++--------- 1 file changed, 46 insertions(+), 41 deletions(-) diff --git a/gateleen-delegate/src/main/resources/gateleen_delegate_schema_delegates b/gateleen-delegate/src/main/resources/gateleen_delegate_schema_delegates index 14f06104..4f348f39 100644 --- a/gateleen-delegate/src/main/resources/gateleen_delegate_schema_delegates +++ b/gateleen-delegate/src/main/resources/gateleen_delegate_schema_delegates @@ -4,7 +4,7 @@ "type": "object", "properties": { "methods": { - "description": "Restricts the HTTP methods concerned by this rule (`GET`, `PUT`, `POST`, `DELETE`).\nWhen absent, all methods are concerned.", + "description": "Restricts the HTTP methods concerned by this rule (`GET`, `PUT`, `POST`, `DELETE`). When absent, all methods are concerned.", "type": "array", "items": { "type": "string" @@ -19,55 +19,56 @@ "type": "string" }, "pattern": { - "description": "Pattern for grouping the incoming uri", + "description": "Pattern for grouping the incoming URI", "type": "string" }, "requests": { "type": "array", - "items": {"$ref": "#/definitions/Request"} + "items": { "$ref": "#/definitions/Request" } } }, "additionalProperties": false, "definitions": { "HeaderFunction": { - "properties": { - "header": { - "description": "the request-header name to manipulate (set, remove or conditional set)", - "type": "string", - "minLength": 1 - }, - "value": { - "description": "the value to be set. null and empty string means 'remove the header'. value can contain other header names between single angular brackets which resolves to their values accordingly", - "type": [ - "null", - "string" - ] - }, - "mode": { - "description": "define a condition-mode. 'complete' sets the header value only if this header is not yet present. 'overwrite' sets the header value only if the header is already present. Ignored if value is null or empty string", - "type": "string", - "enum": [ - "complete", - "override" - ] - } + "properties": { + "header": { + "description": "The request-header name to manipulate (set, remove or conditional set)", + "type": "string", + "minLength": 1 + }, + "value": { + "description": "The value to be set. Null and empty string means 'remove the header'. Value can contain other header names between single angular brackets which resolves to their values accordingly", + "type": [ + "null", + "string" + ] }, - "required": [ - "header", - "value" - ] + "mode": { + "description": "Define a condition-mode. 'complete' sets the header value only if this header is not yet present. 'overwrite' sets the header value only if the header is already present. Ignored if value is null or empty string", + "type": "string", + "enum": [ + "complete", + "override" + ] + } + }, + "required": [ + "header", + "value" + ] }, "Request": { "oneOf": [ { "required": ["payload"] }, { "required": ["transform"] }, - { "required": ["transformWithMetadata"] } + { "required": ["transformWithMetadata"] }, + { "required": ["copy"] } ], "anyOf": [ { "oneOf": [ - {"required": ["dynamicHeaders"]}, - {"required": ["headers"]} + { "required": ["dynamicHeaders"] }, + { "required": ["headers"] } ] }, { @@ -91,24 +92,28 @@ ] }, "payload": { - "description": "The payload to send in requests body", + "description": "The payload to send in the request's body", "type": "object" }, "transform": { - "description": "The jolt spec definition to transform the payload", + "description": "The JOLT spec definition to transform the payload", "type": "array" }, "transformWithMetadata": { - "description": "The jolt spec definition to transform the payload and additional metadata", + "description": "The JOLT spec definition to transform the payload and additional metadata", "type": "array" }, - "dynamicHeaders": { - "description": "Manipulate (set / remove / replace) request headers using HeaderFunctions - option to reference other header vales", - "type": "array", - "items": { - "$ref": "#/definitions/HeaderFunction" - } - }, + "copy": { + "description": "Indicates that the original payload should be copied to the new destination", + "type": "boolean" + }, + "dynamicHeaders": { + "description": "Manipulate (set / remove / replace) request headers using HeaderFunctions - option to reference other header values", + "type": "array", + "items": { + "$ref": "#/definitions/HeaderFunction" + } + }, "headers": { "description": "Headers to send with the request", "type": "array", From c44599e1bf761927483cfb29f62c9ed14020a1aa Mon Sep 17 00:00:00 2001 From: Almeida Stenio Date: Wed, 25 Sep 2024 16:41:43 +0100 Subject: [PATCH 16/17] Revert "#451 - remove delegate copy" This reverts commit 77a3544263f2bb8091ca4ea1b1b31247ec77f6f9. --- .../swisspush/gateleen/delegate/Delegate.java | 7 +++-- .../gateleen/delegate/DelegateFactory.java | 28 +++++------------ .../gateleen/delegate/DelegateHandler.java | 30 +++++++++---------- .../gateleen/delegate/DelegateRequest.java | 8 ++++- 4 files changed, 35 insertions(+), 38 deletions(-) diff --git a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/Delegate.java b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/Delegate.java index f1aa6cc5..baf45d50 100644 --- a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/Delegate.java +++ b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/Delegate.java @@ -36,6 +36,7 @@ public class Delegate { private static final String PAYLOAD = "payload"; private static final String URI = "uri"; private static final String METHOD = "method"; + private static final String COPY = "copy"; private static final int FIRST = 0; private static final int STATUS_CODE_2XX = 2; @@ -239,7 +240,9 @@ private Future extractDelegateExecutionRequestJsonPayload(HttpServerRequ private Future generatePayload(String delegateExecutionRequestJsonPayload, MultiMap headers, DelegateRequest requestContainer, final Matcher matcher) { Promise promise = Promise.promise(); - if (requestContainer.getJoltSpec() != null) { + if (requestContainer.isCopy()) { + promise.complete(Buffer.buffer(delegateExecutionRequestJsonPayload)); + } else if (requestContainer.getJoltSpec() != null) { try { if (delegateExecutionRequestJsonPayload != null) { @@ -269,7 +272,7 @@ private Future generatePayload(String delegateExecutionRequestJsonPayloa } else { // matcher to replace wildcards with matching groups final JsonObject requestObject = requestContainer.getRequest(); - // get the string represantion of the payload object + // get the string representation of the payload object String payloadStr; payloadStr = requestObject.getJsonObject(PAYLOAD).encode(); diff --git a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateFactory.java b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateFactory.java index 966ac2d5..70bce068 100644 --- a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateFactory.java +++ b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateFactory.java @@ -24,8 +24,6 @@ /** * DelegateFactory is used to create delegate objects from their text representation. - * - * @author https://github.com/ljucam [Mario Ljuca] */ public class DelegateFactory { private static final Logger LOG = LoggerFactory.getLogger(DelegateFactory.class); @@ -36,6 +34,7 @@ public class DelegateFactory { private static final String DYNAMIC_HEADERS = "dynamicHeaders"; private static final String TRANSFORM = "transform"; private static final String TRANSFORM_WITH_METADATA = "transformWithMetadata"; + private static final String COPY = "copy"; private final ClientRequestCreator clientRequestCreator; @@ -46,11 +45,6 @@ public class DelegateFactory { /** * Creates a new instance of the DelegateFactory. - * - * @param clientRequestCreator - * @param properties - * @param delegatesSchema - * @param unmatchedDelegateStatusCode */ public DelegateFactory(final ClientRequestCreator clientRequestCreator, final Map properties, final String delegatesSchema, @Nullable StatusCode unmatchedDelegateStatusCode) { @@ -61,12 +55,7 @@ public DelegateFactory(final ClientRequestCreator clientRequestCreator, final Ma } /** - * Tries to create a Delegate object out of the - * buffer. - * - * @param delegateName name of the delegate - * @param buffer buffer of the delegate - * @return a Delegate object + * Tries to create a Delegate object out of the buffer. */ public Delegate parseDelegate(final String delegateName, final Buffer buffer) throws ValidationException { final String configString; @@ -90,11 +79,6 @@ public Delegate parseDelegate(final String delegateName, final Buffer buffer) th /** * Create the delegate out of the prepared string. - * - * @param delegateName name of the delegate - * @param configString the string rep. of the delegate - * @return the new delegate - * @throws ValidationException */ private Delegate createDelegate(final String delegateName, final String configString) throws ValidationException { JsonObject delegateObject = new JsonObject(configString); @@ -119,7 +103,11 @@ private Delegate createDelegate(final String delegateName, final String configSt LOG.trace("request of [{}] #: {}", delegateName, i); } JsonObject requestJsonObject = (JsonObject) delegateObject.getJsonArray(REQUESTS).getValue(i); - JoltSpec joltSpec = parsePayloadTransformSpec(requestJsonObject, delegateName); + boolean copy = requestJsonObject.getBoolean(COPY, false); + JoltSpec joltSpec = null; + if (!copy) { + joltSpec = parsePayloadTransformSpec(requestJsonObject, delegateName); + } HeaderFunction headerFunction; final JsonArray headerFunctionsArray = requestJsonObject.getJsonArray(DYNAMIC_HEADERS); @@ -129,7 +117,7 @@ private Delegate createDelegate(final String delegateName, final String configSt headerFunction = HeaderFunctions.DO_NOTHING; } - requests.add(new DelegateRequest(requestJsonObject, joltSpec, headerFunction)); + requests.add(new DelegateRequest(requestJsonObject, joltSpec, headerFunction, copy)); } return new Delegate(clientRequestCreator, delegateName, pattern, methods, requests, unmatchedDelegateStatusCode); diff --git a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateHandler.java b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateHandler.java index 9ed410f6..ca76fb69 100644 --- a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateHandler.java +++ b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateHandler.java @@ -33,21 +33,21 @@ * delegate.
* PUT /gateleen/server/delegate/v1/delegates/user-zip-copy/definition *
-    {
-        "methods": [ "PUT", "DELETE" ],
-        "pattern": "([^/]*)/(.*)",
-        "requests": [
-            {
-                 "headers" : [],
-                 "uri": "/gateleen/server/copy",
-                 "method": "POST",
-                 "payload": {
-                    "source": "/gateleen/$1?expand=100&zip=true",
-                    "destination": "/gateleen/zips/users/$1.zip"
-                }
-            }
-        ]
-    }
+ {
+ "methods": [ "PUT", "DELETE" ],
+ "pattern": "([^/]*)/(.*)",
+ "requests": [
+ {
+ "headers" : [],
+ "uri": "/gateleen/server/copy",
+ "method": "POST",
+ "payload": {
+ "source": "/gateleen/$1?expand=100&zip=true",
+ "destination": "/gateleen/zips/users/$1.zip"
+ }
+ }
+ ]
+ }
 
  * 
* To trigger an execution, it suffice to perform a PUT request on the virtual collection execution within diff --git a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateRequest.java b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateRequest.java index 66ff0b21..08a20f44 100644 --- a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateRequest.java +++ b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateRequest.java @@ -14,11 +14,13 @@ public class DelegateRequest { private final JsonObject request; private final JoltSpec joltSpec; private final HeaderFunction headerFunction; + private final boolean copy; - public DelegateRequest(JsonObject request, JoltSpec joltSpec, HeaderFunction headerFunction) { + public DelegateRequest(JsonObject request, JoltSpec joltSpec, HeaderFunction headerFunction, boolean copy) { this.request = request; this.joltSpec = joltSpec; this.headerFunction = headerFunction; + this.copy = copy; } public JsonObject getRequest() { @@ -32,4 +34,8 @@ public JoltSpec getJoltSpec() { public HeaderFunction getHeaderFunction() { return headerFunction; } + + public boolean isCopy() { + return copy; + } } From 110c4afc61c43adc2a960d6e87a00d8e5bf9cf38 Mon Sep 17 00:00:00 2001 From: Almeida Stenio Date: Wed, 25 Sep 2024 16:41:56 +0100 Subject: [PATCH 17/17] Revert "#451 - start implement Copy" This reverts commit ca8e682ae6c3212e863df617b79872596d38679c. --- .../swisspush/gateleen/delegate/Delegate.java | 7 +- .../gateleen/delegate/DelegateFactory.java | 28 ++++-- .../gateleen/delegate/DelegateHandler.java | 30 +++---- .../gateleen/delegate/DelegateRequest.java | 8 +- .../gateleen_delegate_schema_delegates | 87 +++++++++---------- 5 files changed, 79 insertions(+), 81 deletions(-) diff --git a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/Delegate.java b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/Delegate.java index baf45d50..f1aa6cc5 100644 --- a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/Delegate.java +++ b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/Delegate.java @@ -36,7 +36,6 @@ public class Delegate { private static final String PAYLOAD = "payload"; private static final String URI = "uri"; private static final String METHOD = "method"; - private static final String COPY = "copy"; private static final int FIRST = 0; private static final int STATUS_CODE_2XX = 2; @@ -240,9 +239,7 @@ private Future extractDelegateExecutionRequestJsonPayload(HttpServerRequ private Future generatePayload(String delegateExecutionRequestJsonPayload, MultiMap headers, DelegateRequest requestContainer, final Matcher matcher) { Promise promise = Promise.promise(); - if (requestContainer.isCopy()) { - promise.complete(Buffer.buffer(delegateExecutionRequestJsonPayload)); - } else if (requestContainer.getJoltSpec() != null) { + if (requestContainer.getJoltSpec() != null) { try { if (delegateExecutionRequestJsonPayload != null) { @@ -272,7 +269,7 @@ private Future generatePayload(String delegateExecutionRequestJsonPayloa } else { // matcher to replace wildcards with matching groups final JsonObject requestObject = requestContainer.getRequest(); - // get the string representation of the payload object + // get the string represantion of the payload object String payloadStr; payloadStr = requestObject.getJsonObject(PAYLOAD).encode(); diff --git a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateFactory.java b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateFactory.java index 70bce068..966ac2d5 100644 --- a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateFactory.java +++ b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateFactory.java @@ -24,6 +24,8 @@ /** * DelegateFactory is used to create delegate objects from their text representation. + * + * @author https://github.com/ljucam [Mario Ljuca] */ public class DelegateFactory { private static final Logger LOG = LoggerFactory.getLogger(DelegateFactory.class); @@ -34,7 +36,6 @@ public class DelegateFactory { private static final String DYNAMIC_HEADERS = "dynamicHeaders"; private static final String TRANSFORM = "transform"; private static final String TRANSFORM_WITH_METADATA = "transformWithMetadata"; - private static final String COPY = "copy"; private final ClientRequestCreator clientRequestCreator; @@ -45,6 +46,11 @@ public class DelegateFactory { /** * Creates a new instance of the DelegateFactory. + * + * @param clientRequestCreator + * @param properties + * @param delegatesSchema + * @param unmatchedDelegateStatusCode */ public DelegateFactory(final ClientRequestCreator clientRequestCreator, final Map properties, final String delegatesSchema, @Nullable StatusCode unmatchedDelegateStatusCode) { @@ -55,7 +61,12 @@ public DelegateFactory(final ClientRequestCreator clientRequestCreator, final Ma } /** - * Tries to create a Delegate object out of the buffer. + * Tries to create a Delegate object out of the + * buffer. + * + * @param delegateName name of the delegate + * @param buffer buffer of the delegate + * @return a Delegate object */ public Delegate parseDelegate(final String delegateName, final Buffer buffer) throws ValidationException { final String configString; @@ -79,6 +90,11 @@ public Delegate parseDelegate(final String delegateName, final Buffer buffer) th /** * Create the delegate out of the prepared string. + * + * @param delegateName name of the delegate + * @param configString the string rep. of the delegate + * @return the new delegate + * @throws ValidationException */ private Delegate createDelegate(final String delegateName, final String configString) throws ValidationException { JsonObject delegateObject = new JsonObject(configString); @@ -103,11 +119,7 @@ private Delegate createDelegate(final String delegateName, final String configSt LOG.trace("request of [{}] #: {}", delegateName, i); } JsonObject requestJsonObject = (JsonObject) delegateObject.getJsonArray(REQUESTS).getValue(i); - boolean copy = requestJsonObject.getBoolean(COPY, false); - JoltSpec joltSpec = null; - if (!copy) { - joltSpec = parsePayloadTransformSpec(requestJsonObject, delegateName); - } + JoltSpec joltSpec = parsePayloadTransformSpec(requestJsonObject, delegateName); HeaderFunction headerFunction; final JsonArray headerFunctionsArray = requestJsonObject.getJsonArray(DYNAMIC_HEADERS); @@ -117,7 +129,7 @@ private Delegate createDelegate(final String delegateName, final String configSt headerFunction = HeaderFunctions.DO_NOTHING; } - requests.add(new DelegateRequest(requestJsonObject, joltSpec, headerFunction, copy)); + requests.add(new DelegateRequest(requestJsonObject, joltSpec, headerFunction)); } return new Delegate(clientRequestCreator, delegateName, pattern, methods, requests, unmatchedDelegateStatusCode); diff --git a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateHandler.java b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateHandler.java index ca76fb69..9ed410f6 100644 --- a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateHandler.java +++ b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateHandler.java @@ -33,21 +33,21 @@ * delegate.
* PUT /gateleen/server/delegate/v1/delegates/user-zip-copy/definition *
- {
- "methods": [ "PUT", "DELETE" ],
- "pattern": "([^/]*)/(.*)",
- "requests": [
- {
- "headers" : [],
- "uri": "/gateleen/server/copy",
- "method": "POST",
- "payload": {
- "source": "/gateleen/$1?expand=100&zip=true",
- "destination": "/gateleen/zips/users/$1.zip"
- }
- }
- ]
- }
+    {
+        "methods": [ "PUT", "DELETE" ],
+        "pattern": "([^/]*)/(.*)",
+        "requests": [
+            {
+                 "headers" : [],
+                 "uri": "/gateleen/server/copy",
+                 "method": "POST",
+                 "payload": {
+                    "source": "/gateleen/$1?expand=100&zip=true",
+                    "destination": "/gateleen/zips/users/$1.zip"
+                }
+            }
+        ]
+    }
 
  * 
* To trigger an execution, it suffice to perform a PUT request on the virtual collection execution within diff --git a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateRequest.java b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateRequest.java index 08a20f44..66ff0b21 100644 --- a/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateRequest.java +++ b/gateleen-delegate/src/main/java/org/swisspush/gateleen/delegate/DelegateRequest.java @@ -14,13 +14,11 @@ public class DelegateRequest { private final JsonObject request; private final JoltSpec joltSpec; private final HeaderFunction headerFunction; - private final boolean copy; - public DelegateRequest(JsonObject request, JoltSpec joltSpec, HeaderFunction headerFunction, boolean copy) { + public DelegateRequest(JsonObject request, JoltSpec joltSpec, HeaderFunction headerFunction) { this.request = request; this.joltSpec = joltSpec; this.headerFunction = headerFunction; - this.copy = copy; } public JsonObject getRequest() { @@ -34,8 +32,4 @@ public JoltSpec getJoltSpec() { public HeaderFunction getHeaderFunction() { return headerFunction; } - - public boolean isCopy() { - return copy; - } } diff --git a/gateleen-delegate/src/main/resources/gateleen_delegate_schema_delegates b/gateleen-delegate/src/main/resources/gateleen_delegate_schema_delegates index 4f348f39..14f06104 100644 --- a/gateleen-delegate/src/main/resources/gateleen_delegate_schema_delegates +++ b/gateleen-delegate/src/main/resources/gateleen_delegate_schema_delegates @@ -4,7 +4,7 @@ "type": "object", "properties": { "methods": { - "description": "Restricts the HTTP methods concerned by this rule (`GET`, `PUT`, `POST`, `DELETE`). When absent, all methods are concerned.", + "description": "Restricts the HTTP methods concerned by this rule (`GET`, `PUT`, `POST`, `DELETE`).\nWhen absent, all methods are concerned.", "type": "array", "items": { "type": "string" @@ -19,56 +19,55 @@ "type": "string" }, "pattern": { - "description": "Pattern for grouping the incoming URI", + "description": "Pattern for grouping the incoming uri", "type": "string" }, "requests": { "type": "array", - "items": { "$ref": "#/definitions/Request" } + "items": {"$ref": "#/definitions/Request"} } }, "additionalProperties": false, "definitions": { "HeaderFunction": { - "properties": { - "header": { - "description": "The request-header name to manipulate (set, remove or conditional set)", - "type": "string", - "minLength": 1 - }, - "value": { - "description": "The value to be set. Null and empty string means 'remove the header'. Value can contain other header names between single angular brackets which resolves to their values accordingly", - "type": [ - "null", - "string" - ] + "properties": { + "header": { + "description": "the request-header name to manipulate (set, remove or conditional set)", + "type": "string", + "minLength": 1 + }, + "value": { + "description": "the value to be set. null and empty string means 'remove the header'. value can contain other header names between single angular brackets which resolves to their values accordingly", + "type": [ + "null", + "string" + ] + }, + "mode": { + "description": "define a condition-mode. 'complete' sets the header value only if this header is not yet present. 'overwrite' sets the header value only if the header is already present. Ignored if value is null or empty string", + "type": "string", + "enum": [ + "complete", + "override" + ] + } }, - "mode": { - "description": "Define a condition-mode. 'complete' sets the header value only if this header is not yet present. 'overwrite' sets the header value only if the header is already present. Ignored if value is null or empty string", - "type": "string", - "enum": [ - "complete", - "override" - ] - } - }, - "required": [ - "header", - "value" - ] + "required": [ + "header", + "value" + ] }, "Request": { "oneOf": [ { "required": ["payload"] }, { "required": ["transform"] }, - { "required": ["transformWithMetadata"] }, - { "required": ["copy"] } + { "required": ["transformWithMetadata"] } ], "anyOf": [ { "oneOf": [ - { "required": ["dynamicHeaders"] }, - { "required": ["headers"] } + {"required": ["dynamicHeaders"]}, + {"required": ["headers"]} ] }, { @@ -92,28 +91,24 @@ ] }, "payload": { - "description": "The payload to send in the request's body", + "description": "The payload to send in requests body", "type": "object" }, "transform": { - "description": "The JOLT spec definition to transform the payload", + "description": "The jolt spec definition to transform the payload", "type": "array" }, "transformWithMetadata": { - "description": "The JOLT spec definition to transform the payload and additional metadata", + "description": "The jolt spec definition to transform the payload and additional metadata", "type": "array" }, - "copy": { - "description": "Indicates that the original payload should be copied to the new destination", - "type": "boolean" - }, - "dynamicHeaders": { - "description": "Manipulate (set / remove / replace) request headers using HeaderFunctions - option to reference other header values", - "type": "array", - "items": { - "$ref": "#/definitions/HeaderFunction" - } - }, + "dynamicHeaders": { + "description": "Manipulate (set / remove / replace) request headers using HeaderFunctions - option to reference other header vales", + "type": "array", + "items": { + "$ref": "#/definitions/HeaderFunction" + } + }, "headers": { "description": "Headers to send with the request", "type": "array",