You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2022/04/13 18:16:22 UTC

[isis] branch master updated: ISIS-3003: fetcher: use param arg API

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new 0c46dac614 ISIS-3003: fetcher: use param arg API
0c46dac614 is described below

commit 0c46dac614ce9bc514957d88ce784faf6033a1b8
Author: Andi Huber <ah...@apache.org>
AuthorDate: Wed Apr 13 20:16:16 2022 +0200

    ISIS-3003: fetcher: use param arg API
---
 extensions/core/command-replay/secondary/pom.xml   |  6 +++++
 .../secondary/fetch/CommandFetcher.java            | 30 ++++++----------------
 .../restfulobjects/client/RestfulClient.java       | 17 +-----------
 3 files changed, 15 insertions(+), 38 deletions(-)

diff --git a/extensions/core/command-replay/secondary/pom.xml b/extensions/core/command-replay/secondary/pom.xml
index 57ceb79bdf..1ca33ab512 100644
--- a/extensions/core/command-replay/secondary/pom.xml
+++ b/extensions/core/command-replay/secondary/pom.xml
@@ -79,6 +79,12 @@
 			<artifactId>isis-core-internaltestsupport</artifactId>
 			<scope>test</scope>
 		</dependency>
+		
+		<dependency>
+			<groupId>org.apache.isis.viewer</groupId>
+			<artifactId>isis-viewer-restfulobjects-jaxrsresteasy4</artifactId>
+			<scope>test</scope>
+		</dependency>
 
 		<dependency>
 			<groupId>org.glassfish.jersey.ext</groupId>
diff --git a/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/fetch/CommandFetcher.java b/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/fetch/CommandFetcher.java
index 8a0b2762da..0cfa56d7f3 100644
--- a/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/fetch/CommandFetcher.java
+++ b/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/fetch/CommandFetcher.java
@@ -112,34 +112,20 @@ public class CommandFetcher {
         return commandsDto;
     }
 
-    //TODO simplify
-    private String buildUri(final UUID interactionId) {
-
-//        val args = client.arguments()
-//                .build();
-
-        val uri =
-                interactionId != null
-                        ? String.format(
-                            "%s?interactionId=%s&batchSize=%d",
-                            URL_SUFFIX, interactionId, secondaryConfig.getBatchSize())
-                        : String.format(
-                            "%s?batchSize=%d",
-                            URL_SUFFIX, secondaryConfig.getBatchSize());
-        log.info("uri = {}", uri);
-        return uri;
-    }
-
     // package private in support of JUnit
-    CommandsDto callPrimary(final UUID transactionId) throws StatusException {
+    CommandsDto callPrimary(final @Nullable UUID interactionId) throws StatusException {
 
-        val endpointUri = buildUri(transactionId);
         val client = newClient(secondaryConfig, useRequestDebugLogging );
         val request = client.request(
-                endpointUri,
+                URL_SUFFIX,
                 SuppressionType.RO);
 
-        final Response response = request.get();
+        val args = client.arguments()
+                .addActionParameter("interactionId", interactionId!=null ? interactionId.toString() : null)
+                .addActionParameter("batchSize", secondaryConfig.getBatchSize())
+                .build();
+
+        final Response response = request.post(args);
         val digest = client.digestList(response, CommandModel.class, new GenericType<List<CommandModel>>(){})
                 .mapFailure(failure->{
                     log.warn("rest call failed", failure);
diff --git a/viewers/restfulobjects/client/src/main/java/org/apache/isis/viewer/restfulobjects/client/RestfulClient.java b/viewers/restfulobjects/client/src/main/java/org/apache/isis/viewer/restfulobjects/client/RestfulClient.java
index 72c398850b..e338e0de78 100644
--- a/viewers/restfulobjects/client/src/main/java/org/apache/isis/viewer/restfulobjects/client/RestfulClient.java
+++ b/viewers/restfulobjects/client/src/main/java/org/apache/isis/viewer/restfulobjects/client/RestfulClient.java
@@ -88,25 +88,10 @@ if(digest.isSuccess()) {
  *
  * Maven Setup:
  * <blockquote><pre>{@code
-<dependency>
-    <groupId>org.apache.isis.core</groupId>
-    <artifactId>isis-core-applib</artifactId>
-    <version>2.0.0-M7-SNAPSHOT</version>
-</dependency>
 <dependency>
     <groupId>org.glassfish.jersey.ext</groupId>
     <artifactId>jersey-spring5</artifactId>
-    <version>2.29.1</version>
-</dependency>
-<dependency>
-    <groupId>org.glassfish</groupId>
-    <artifactId>javax.json</artifactId>
-    <version>1.1.4</version>
-</dependency>
-<dependency>
-    <groupId>org.eclipse.persistence</groupId>
-    <artifactId>org.eclipse.persistence.moxy</artifactId>
-    <version>2.7.5</version>
+    <version>2.35</version>
 </dependency>
  * }</pre></blockquote>
  *