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 12:54:48 UTC

[isis] branch master updated: ISIS-3003: move services that are bound to jdo command model entities closer to these

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 7cd580abb0 ISIS-3003: move services that are bound to jdo command model entities closer to these
7cd580abb0 is described below

commit 7cd580abb0b949ed8c518df1b275e0e60fd33023
Author: Andi Huber <ah...@apache.org>
AuthorDate: Wed Apr 13 14:54:41 2022 +0200

    ISIS-3003: move services that are bound to jdo command model entities
    closer to these
---
 .../isis/applib/domain/DomainObjectList.java       |  1 +
 .../isis/core/config/util/SpringProfileUtil.java   | 62 ++++++++++++++++++++++
 .../webapp/wicket/jdo/DemoAppWicketJdo.java        |  4 +-
 .../webapp/wicket/jpa/DemoAppWicketJpa.java        |  4 +-
 .../model/IsisModuleExtCommandLogApplib.java       |  3 ++
 .../commandlog/jdo/IsisModuleExtCommandLogJdo.java |  8 +--
 .../jdo/entities/CommandJdo_childCommands.java     |  4 +-
 .../jdo/entities/CommandJdo_openResultObject.java  |  4 +-
 .../jdo/entities/CommandJdo_openTargetObject.java  |  4 +-
 .../commandlog/jdo/entities/CommandJdo_retry.java  |  7 +--
 .../jdo/entities/CommandJdo_siblingCommands.java   |  4 +-
 .../jdo/mixins/HasInteractionId_command.java       |  4 +-
 .../mixins/HasUsername_recentCommandsByUser.java   |  4 +-
 .../jdo/mixins/Object_recentCommands.java          |  4 +-
 .../extensions/commandlog/jdo/mixins/T_recent.java |  4 +-
 .../jdo}/ui/CommandReplayOnPrimaryService.java     | 22 ++++----
 .../commandlog/jdo/ui/CommandServiceMenu.java      |  7 +--
 .../ui/rest/CommandRetrievalOnPrimaryService.java} | 28 ++++++----
 .../primary/IsisModuleExtCommandReplayPrimary.java |  8 ---
 .../primary/config/PrimaryConfig.java              |  4 +-
 .../primary/spiimpl/CaptureResultOfCommand.java    |  4 +-
 .../IsisModuleExtCommandReplaySecondary.java       |  4 --
 .../analyser/CommandReplayAnalyserException.java   |  4 +-
 .../analyser/CommandReplayAnalyserResult.java      |  4 +-
 .../analysis/CommandReplayAnalysisService.java     |  4 +-
 .../secondary/fetch/CommandFetcher.java            | 31 ++++++-----
 .../ui/CommandReplayOnSecondaryService.java        |  3 +-
 .../secondary/fetch/CommandFetcher_Test.java       |  8 +--
 28 files changed, 164 insertions(+), 88 deletions(-)

diff --git a/api/applib/src/main/java/org/apache/isis/applib/domain/DomainObjectList.java b/api/applib/src/main/java/org/apache/isis/applib/domain/DomainObjectList.java
index 6375d421a0..eb9f6af9d2 100644
--- a/api/applib/src/main/java/org/apache/isis/applib/domain/DomainObjectList.java
+++ b/api/applib/src/main/java/org/apache/isis/applib/domain/DomainObjectList.java
@@ -113,6 +113,7 @@ public class DomainObjectList {
 
 
     // -- title
+    @Getter
     private String title;
     @ObjectSupport public String title() {
         return title;
diff --git a/core/config/src/main/java/org/apache/isis/core/config/util/SpringProfileUtil.java b/core/config/src/main/java/org/apache/isis/core/config/util/SpringProfileUtil.java
new file mode 100644
index 0000000000..2a99cdc14e
--- /dev/null
+++ b/core/config/src/main/java/org/apache/isis/core/config/util/SpringProfileUtil.java
@@ -0,0 +1,62 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License.
+ */
+package org.apache.isis.core.config.util;
+
+import java.util.stream.Collectors;
+
+import org.springframework.lang.Nullable;
+
+import org.apache.isis.commons.collections.Can;
+import org.apache.isis.commons.internal.base._Strings;
+
+import lombok.val;
+import lombok.experimental.UtilityClass;
+
+@UtilityClass
+public class SpringProfileUtil {
+
+    private final String SPRING_PROFILES = "spring.profiles.active";
+
+    public void addActiveProfile(final @Nullable String profile) {
+        val profileIfAny = _Strings.blankToNullOrTrim(profile);
+        System.setProperty(SPRING_PROFILES,
+                stringify(currentActiveProfiles().add(profileIfAny)));
+    }
+
+    public void removeActiveProfile(final @Nullable String profile) {
+        val profileIfAny = _Strings.blankToNullOrTrim(profile);
+        System.setProperty(SPRING_PROFILES,
+                stringify(currentActiveProfiles().remove(profileIfAny)));
+    }
+
+    // -- HELPER
+
+    private Can<String> currentActiveProfiles() {
+        return _Strings.splitThenStream(System.getProperty(SPRING_PROFILES), ",")
+        .map(String::trim)
+        .map(_Strings::emptyToNull)
+        .collect(Can.toCan());
+    }
+
+    private String stringify(final Can<String> profiles) {
+        return profiles.stream()
+                .collect(Collectors.joining(","));
+    }
+
+}
diff --git a/examples/demo/wicket/jdo/src/main/java/demoapp/webapp/wicket/jdo/DemoAppWicketJdo.java b/examples/demo/wicket/jdo/src/main/java/demoapp/webapp/wicket/jdo/DemoAppWicketJdo.java
index 70c5639e14..5200292899 100644
--- a/examples/demo/wicket/jdo/src/main/java/demoapp/webapp/wicket/jdo/DemoAppWicketJdo.java
+++ b/examples/demo/wicket/jdo/src/main/java/demoapp/webapp/wicket/jdo/DemoAppWicketJdo.java
@@ -25,6 +25,7 @@ import org.springframework.context.annotation.Import;
 
 import org.apache.isis.commons.internal.os._OsUtil;
 import org.apache.isis.core.config.presets.IsisPresets;
+import org.apache.isis.core.config.util.SpringProfileUtil;
 import org.apache.isis.extensions.viewer.wicket.pdfjs.ui.IsisModuleExtPdfjsUi;
 import org.apache.isis.valuetypes.asciidoc.metamodel.IsisModuleValAsciidocMetaModel;
 import org.apache.isis.valuetypes.asciidoc.persistence.jdo.dn5.IsisModuleValAsciidocPersistenceJdoDn5;
@@ -83,7 +84,8 @@ public class DemoAppWicketJdo extends SpringBootServletInitializer {
     	IsisPresets.prototyping();
         //IsisPresets.logging(WebRequestCycleForIsis.class, "debug");
 
-        System.setProperty("spring.profiles.active", "demo-jdo");
+        SpringProfileUtil.removeActiveProfile("demo-jpa"); // just in case
+        SpringProfileUtil.addActiveProfile("demo-jdo");
 
         SpringApplication.run(new Class[] { DemoAppWicketJdo.class }, args);
 
diff --git a/examples/demo/wicket/jpa/src/main/java/demoapp/webapp/wicket/jpa/DemoAppWicketJpa.java b/examples/demo/wicket/jpa/src/main/java/demoapp/webapp/wicket/jpa/DemoAppWicketJpa.java
index 5d9149b5b4..392b4193a7 100644
--- a/examples/demo/wicket/jpa/src/main/java/demoapp/webapp/wicket/jpa/DemoAppWicketJpa.java
+++ b/examples/demo/wicket/jpa/src/main/java/demoapp/webapp/wicket/jpa/DemoAppWicketJpa.java
@@ -25,6 +25,7 @@ import org.springframework.context.annotation.Import;
 
 import org.apache.isis.commons.internal.os._OsUtil;
 import org.apache.isis.core.config.presets.IsisPresets;
+import org.apache.isis.core.config.util.SpringProfileUtil;
 import org.apache.isis.extensions.viewer.wicket.pdfjs.ui.IsisModuleExtPdfjsUi;
 import org.apache.isis.valuetypes.asciidoc.metamodel.IsisModuleValAsciidocMetaModel;
 import org.apache.isis.valuetypes.asciidoc.persistence.jpa.IsisModuleValAsciidocPersistenceJpa;
@@ -87,7 +88,8 @@ public class DemoAppWicketJpa extends SpringBootServletInitializer {
         //IsisPresets.logging(EntityModel.class, "debug");
         //IsisPresets.logging(FormExecutorDefault.class, "debug");
 
-        System.setProperty("spring.profiles.active", "demo-jpa");
+        SpringProfileUtil.removeActiveProfile("demo-jdo"); // just in case
+    	SpringProfileUtil.addActiveProfile("demo-jpa");
 
         SpringApplication.run(new Class[] { DemoAppWicketJpa.class }, args);
 
diff --git a/extensions/core/command-log/applib/src/main/java/org/apache/isis/extensions/commandlog/model/IsisModuleExtCommandLogApplib.java b/extensions/core/command-log/applib/src/main/java/org/apache/isis/extensions/commandlog/model/IsisModuleExtCommandLogApplib.java
index 1ef3cdad46..a391895c4f 100644
--- a/extensions/core/command-log/applib/src/main/java/org/apache/isis/extensions/commandlog/model/IsisModuleExtCommandLogApplib.java
+++ b/extensions/core/command-log/applib/src/main/java/org/apache/isis/extensions/commandlog/model/IsisModuleExtCommandLogApplib.java
@@ -47,4 +47,7 @@ extends ModuleWithFixtures {
     public static final String NAMESPACE_PRIMARY = "isis.ext.commandReplayPrimary";
     public static final String NAMESPACE_SECONDARY = "isis.ext.commandReplaySecondary";
 
+    public static final String COMMAND_REPLAY_ON_PRIMARY_SERVICE =
+            NAMESPACE_PRIMARY + ".CommandReplayOnPrimaryService";
+
 }
diff --git a/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/IsisModuleExtCommandLogJdo.java b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/IsisModuleExtCommandLogJdo.java
index d4044cbd28..fd58a50e86 100644
--- a/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/IsisModuleExtCommandLogJdo.java
+++ b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/IsisModuleExtCommandLogJdo.java
@@ -24,8 +24,9 @@ import org.springframework.context.annotation.Import;
 
 import org.apache.isis.extensions.commandlog.jdo.entities.CommandJdo;
 import org.apache.isis.extensions.commandlog.jdo.entities.CommandJdoRepository;
+import org.apache.isis.extensions.commandlog.jdo.ui.CommandReplayOnPrimaryService;
 import org.apache.isis.extensions.commandlog.jdo.ui.CommandServiceMenu;
-import org.apache.isis.extensions.commandlog.model.IsisModuleExtCommandLogApplib;
+import org.apache.isis.extensions.commandlog.jdo.ui.rest.CommandRetrievalOnPrimaryService;
 import org.apache.isis.extensions.commandlog.model.command.CommandModel;
 import org.apache.isis.testing.fixtures.applib.fixturescripts.FixtureScript;
 import org.apache.isis.testing.fixtures.applib.teardown.jdo.TeardownFixtureJdoAbstract;
@@ -40,6 +41,8 @@ import org.apache.isis.testing.fixtures.applib.teardown.jdo.TeardownFixtureJdoAb
         , CommandServiceMenu.class
 
         // @Service's
+        , CommandReplayOnPrimaryService.class
+        , CommandRetrievalOnPrimaryService.class
         , CommandJdo.TableColumnOrderDefault.class
 
         // entities
@@ -49,8 +52,7 @@ import org.apache.isis.testing.fixtures.applib.teardown.jdo.TeardownFixtureJdoAb
         basePackageClasses= {
                 IsisModuleExtCommandLogJdo.class
         })
-public class IsisModuleExtCommandLogJdo
-implements IsisModuleExtCommandLogApplib {
+public class IsisModuleExtCommandLogJdo {
 
     public static final String NAMESPACE = "isis.ext.commandLog";
 
diff --git a/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/entities/CommandJdo_childCommands.java b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/entities/CommandJdo_childCommands.java
index 8636b34a00..b3cd665c16 100644
--- a/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/entities/CommandJdo_childCommands.java
+++ b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/entities/CommandJdo_childCommands.java
@@ -22,7 +22,7 @@ import java.util.List;
 
 import org.apache.isis.applib.annotation.Collection;
 import org.apache.isis.applib.annotation.CollectionLayout;
-import org.apache.isis.extensions.commandlog.jdo.IsisModuleExtCommandLogJdo;
+import org.apache.isis.extensions.commandlog.model.IsisModuleExtCommandLogApplib;
 import org.apache.isis.extensions.commandlog.model.command.CommandModel;
 
 import lombok.RequiredArgsConstructor;
@@ -39,7 +39,7 @@ import lombok.RequiredArgsConstructor;
 public class CommandJdo_childCommands {
 
     public static class CollectionDomainEvent
-            extends IsisModuleExtCommandLogJdo.CollectionDomainEvent<CommandJdo_childCommands, CommandModel> { }
+            extends IsisModuleExtCommandLogApplib.CollectionDomainEvent<CommandJdo_childCommands, CommandModel> { }
 
     private final CommandJdo commandJdo;
 
diff --git a/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/entities/CommandJdo_openResultObject.java b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/entities/CommandJdo_openResultObject.java
index 59a1687df1..e0cb6876b5 100644
--- a/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/entities/CommandJdo_openResultObject.java
+++ b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/entities/CommandJdo_openResultObject.java
@@ -25,7 +25,7 @@ import org.apache.isis.applib.annotation.ActionLayout;
 import org.apache.isis.applib.annotation.SemanticsOf;
 import org.apache.isis.applib.services.bookmark.BookmarkService;
 import org.apache.isis.applib.services.message.MessageService;
-import org.apache.isis.extensions.commandlog.jdo.IsisModuleExtCommandLogJdo;
+import org.apache.isis.extensions.commandlog.model.IsisModuleExtCommandLogApplib;
 
 import lombok.RequiredArgsConstructor;
 import lombok.val;
@@ -39,7 +39,7 @@ import lombok.val;
 public class CommandJdo_openResultObject {
 
     public static class ActionDomainEvent
-            extends IsisModuleExtCommandLogJdo.ActionDomainEvent<CommandJdo_openResultObject> { }
+            extends IsisModuleExtCommandLogApplib.ActionDomainEvent<CommandJdo_openResultObject> { }
 
     private final CommandJdo commandJdo;
 
diff --git a/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/entities/CommandJdo_openTargetObject.java b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/entities/CommandJdo_openTargetObject.java
index 3fb718d45a..979a6c3024 100644
--- a/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/entities/CommandJdo_openTargetObject.java
+++ b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/entities/CommandJdo_openTargetObject.java
@@ -25,7 +25,7 @@ import org.apache.isis.applib.annotation.ActionLayout;
 import org.apache.isis.applib.annotation.SemanticsOf;
 import org.apache.isis.applib.services.bookmark.BookmarkService;
 import org.apache.isis.applib.services.message.MessageService;
-import org.apache.isis.extensions.commandlog.jdo.IsisModuleExtCommandLogJdo;
+import org.apache.isis.extensions.commandlog.model.IsisModuleExtCommandLogApplib;
 
 import lombok.RequiredArgsConstructor;
 import lombok.val;
@@ -39,7 +39,7 @@ import lombok.val;
 public class CommandJdo_openTargetObject {
 
     public static class ActionDomainEvent
-            extends IsisModuleExtCommandLogJdo.ActionDomainEvent<CommandJdo_openTargetObject> { }
+            extends IsisModuleExtCommandLogApplib.ActionDomainEvent<CommandJdo_openTargetObject> { }
 
     private final CommandJdo commandJdo;
 
diff --git a/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/entities/CommandJdo_retry.java b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/entities/CommandJdo_retry.java
index 4d1b9d1282..f1a9cb5d14 100644
--- a/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/entities/CommandJdo_retry.java
+++ b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/entities/CommandJdo_retry.java
@@ -26,11 +26,11 @@ import org.apache.isis.applib.annotation.Publishing;
 import org.apache.isis.applib.annotation.SemanticsOf;
 import org.apache.isis.applib.services.bookmark.BookmarkService;
 import org.apache.isis.applib.services.command.CommandExecutorService;
+import org.apache.isis.applib.services.iactnlayer.InteractionService;
 import org.apache.isis.applib.services.metamodel.MetaModelService;
 import org.apache.isis.applib.services.repository.RepositoryService;
 import org.apache.isis.applib.services.xactn.TransactionService;
-import org.apache.isis.applib.services.iactnlayer.InteractionService;
-import org.apache.isis.extensions.commandlog.jdo.IsisModuleExtCommandLogJdo;
+import org.apache.isis.extensions.commandlog.model.IsisModuleExtCommandLogApplib;
 import org.apache.isis.extensions.commandlog.model.command.ReplayState;
 
 import lombok.RequiredArgsConstructor;
@@ -46,7 +46,8 @@ public class CommandJdo_retry {
 
     private final CommandJdo commandJdo;
 
-    public static class ActionDomainEvent extends IsisModuleExtCommandLogJdo.ActionDomainEvent<CommandJdo_retry> { }
+    public static class ActionDomainEvent
+        extends IsisModuleExtCommandLogApplib.ActionDomainEvent<CommandJdo_retry> { }
 
     public CommandJdo act() {
 
diff --git a/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/entities/CommandJdo_siblingCommands.java b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/entities/CommandJdo_siblingCommands.java
index 22c6200d9c..825e210fab 100644
--- a/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/entities/CommandJdo_siblingCommands.java
+++ b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/entities/CommandJdo_siblingCommands.java
@@ -25,7 +25,7 @@ import javax.inject.Inject;
 
 import org.apache.isis.applib.annotation.Collection;
 import org.apache.isis.applib.annotation.CollectionLayout;
-import org.apache.isis.extensions.commandlog.jdo.IsisModuleExtCommandLogJdo;
+import org.apache.isis.extensions.commandlog.model.IsisModuleExtCommandLogApplib;
 
 import lombok.RequiredArgsConstructor;
 
@@ -40,7 +40,7 @@ import lombok.RequiredArgsConstructor;
 public class CommandJdo_siblingCommands {
 
     public static class CollectionDomainEvent
-            extends IsisModuleExtCommandLogJdo.CollectionDomainEvent<CommandJdo_siblingCommands, CommandJdo> { }
+            extends IsisModuleExtCommandLogApplib.CollectionDomainEvent<CommandJdo_siblingCommands, CommandJdo> { }
 
     private final CommandJdo commandJdo;
 
diff --git a/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/mixins/HasInteractionId_command.java b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/mixins/HasInteractionId_command.java
index b4a236cc35..01001e23c4 100644
--- a/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/mixins/HasInteractionId_command.java
+++ b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/mixins/HasInteractionId_command.java
@@ -27,9 +27,9 @@ import org.apache.isis.applib.annotation.ActionLayout;
 import org.apache.isis.applib.annotation.SemanticsOf;
 import org.apache.isis.applib.mixins.system.HasInteractionId;
 import org.apache.isis.applib.services.command.Command;
-import org.apache.isis.extensions.commandlog.jdo.IsisModuleExtCommandLogJdo;
 import org.apache.isis.extensions.commandlog.jdo.entities.CommandJdo;
 import org.apache.isis.extensions.commandlog.jdo.entities.CommandJdoRepository;
+import org.apache.isis.extensions.commandlog.model.IsisModuleExtCommandLogApplib;
 
 import lombok.RequiredArgsConstructor;
 
@@ -50,7 +50,7 @@ import lombok.RequiredArgsConstructor;
 public class HasInteractionId_command {
 
     public static class ActionDomainEvent
-            extends IsisModuleExtCommandLogJdo.ActionDomainEvent<HasInteractionId_command> { }
+            extends IsisModuleExtCommandLogApplib.ActionDomainEvent<HasInteractionId_command> { }
 
     private final HasInteractionId hasInteractionId;
 
diff --git a/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/mixins/HasUsername_recentCommandsByUser.java b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/mixins/HasUsername_recentCommandsByUser.java
index 2067ab5701..bbd15b445e 100644
--- a/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/mixins/HasUsername_recentCommandsByUser.java
+++ b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/mixins/HasUsername_recentCommandsByUser.java
@@ -26,9 +26,9 @@ import javax.inject.Inject;
 import org.apache.isis.applib.annotation.Collection;
 import org.apache.isis.applib.annotation.CollectionLayout;
 import org.apache.isis.applib.mixins.security.HasUsername;
-import org.apache.isis.extensions.commandlog.jdo.IsisModuleExtCommandLogJdo;
 import org.apache.isis.extensions.commandlog.jdo.entities.CommandJdo;
 import org.apache.isis.extensions.commandlog.jdo.entities.CommandJdoRepository;
+import org.apache.isis.extensions.commandlog.model.IsisModuleExtCommandLogApplib;
 
 
 /**
@@ -44,7 +44,7 @@ import org.apache.isis.extensions.commandlog.jdo.entities.CommandJdoRepository;
 public class HasUsername_recentCommandsByUser {
 
     public static class CollectionDomainEvent
-            extends IsisModuleExtCommandLogJdo.CollectionDomainEvent<HasUsername_recentCommandsByUser, CommandJdo> { }
+            extends IsisModuleExtCommandLogApplib.CollectionDomainEvent<HasUsername_recentCommandsByUser, CommandJdo> { }
 
     private final HasUsername hasUsername;
     public HasUsername_recentCommandsByUser(final HasUsername hasUsername) {
diff --git a/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/mixins/Object_recentCommands.java b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/mixins/Object_recentCommands.java
index fa92dca846..4239a160cf 100644
--- a/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/mixins/Object_recentCommands.java
+++ b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/mixins/Object_recentCommands.java
@@ -32,9 +32,9 @@ import org.apache.isis.applib.annotation.SemanticsOf;
 import org.apache.isis.applib.mixins.layout.LayoutMixinConstants;
 import org.apache.isis.applib.mixins.system.HasInteractionId;
 import org.apache.isis.applib.services.bookmark.BookmarkService;
-import org.apache.isis.extensions.commandlog.jdo.IsisModuleExtCommandLogJdo;
 import org.apache.isis.extensions.commandlog.jdo.entities.CommandJdo;
 import org.apache.isis.extensions.commandlog.jdo.entities.CommandJdoRepository;
+import org.apache.isis.extensions.commandlog.model.IsisModuleExtCommandLogApplib;
 
 import lombok.RequiredArgsConstructor;
 
@@ -61,7 +61,7 @@ import lombok.RequiredArgsConstructor;
 public class Object_recentCommands {
 
     public static class ActionDomainEvent
-            extends IsisModuleExtCommandLogJdo.ActionDomainEvent<Object_recentCommands> { }
+            extends IsisModuleExtCommandLogApplib.ActionDomainEvent<Object_recentCommands> { }
 
     private final Object domainObject; // mixee
 
diff --git a/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/mixins/T_recent.java b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/mixins/T_recent.java
index 4fe2d814de..14f8d54158 100644
--- a/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/mixins/T_recent.java
+++ b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/mixins/T_recent.java
@@ -27,9 +27,9 @@ import org.apache.isis.applib.annotation.Collection;
 import org.apache.isis.applib.annotation.CollectionLayout;
 import org.apache.isis.applib.services.bookmark.BookmarkService;
 import org.apache.isis.applib.services.queryresultscache.QueryResultsCache;
-import org.apache.isis.extensions.commandlog.jdo.IsisModuleExtCommandLogJdo;
 import org.apache.isis.extensions.commandlog.jdo.entities.CommandJdo;
 import org.apache.isis.extensions.commandlog.jdo.entities.CommandJdoRepository;
+import org.apache.isis.extensions.commandlog.model.IsisModuleExtCommandLogApplib;
 
 @Collection(
     domainEvent = T_recent.CollectionDomainEvent.class
@@ -40,7 +40,7 @@ import org.apache.isis.extensions.commandlog.jdo.entities.CommandJdoRepository;
 public abstract class T_recent<T> {
 
     public static class CollectionDomainEvent
-            extends IsisModuleExtCommandLogJdo.CollectionDomainEvent<T_recent, CommandJdo> { }
+            extends IsisModuleExtCommandLogApplib.CollectionDomainEvent<T_recent, CommandJdo> { }
 
     private final T domainObject;
     public T_recent(final T domainObject) {
diff --git a/extensions/core/command-replay/primary/src/main/java/org/apache/isis/extensions/commandreplay/primary/ui/CommandReplayOnPrimaryService.java b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/ui/CommandReplayOnPrimaryService.java
similarity index 91%
rename from extensions/core/command-replay/primary/src/main/java/org/apache/isis/extensions/commandreplay/primary/ui/CommandReplayOnPrimaryService.java
rename to extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/ui/CommandReplayOnPrimaryService.java
index 5c3931b138..11f12d3c69 100644
--- a/extensions/core/command-replay/primary/src/main/java/org/apache/isis/extensions/commandreplay/primary/ui/CommandReplayOnPrimaryService.java
+++ b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/ui/CommandReplayOnPrimaryService.java
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.extensions.commandreplay.primary.ui;
+package org.apache.isis.extensions.commandlog.jdo.ui;
 
 import java.util.List;
 import java.util.UUID;
@@ -24,6 +24,7 @@ import java.util.UUID;
 import javax.inject.Inject;
 import javax.inject.Named;
 
+import org.springframework.context.annotation.Profile;
 import org.springframework.lang.Nullable;
 
 import org.apache.isis.applib.annotation.Action;
@@ -40,10 +41,10 @@ import org.apache.isis.applib.services.commanddto.conmap.ContentMappingServiceFo
 import org.apache.isis.applib.services.jaxb.JaxbService;
 import org.apache.isis.applib.services.message.MessageService;
 import org.apache.isis.applib.value.Clob;
+import org.apache.isis.extensions.commandlog.jdo.ui.rest.CommandRetrievalOnPrimaryService;
+import org.apache.isis.extensions.commandlog.model.IsisModuleExtCommandLogApplib;
 import org.apache.isis.extensions.commandlog.model.command.CommandModel;
 import org.apache.isis.extensions.commandlog.model.command.CommandModelRepository;
-import org.apache.isis.extensions.commandreplay.primary.IsisModuleExtCommandReplayPrimary;
-import org.apache.isis.extensions.commandreplay.primary.restapi.CommandRetrievalService;
 import org.apache.isis.schema.cmd.v2.CommandDto;
 import org.apache.isis.schema.cmd.v2.CommandsDto;
 
@@ -60,8 +61,9 @@ import lombok.RequiredArgsConstructor;
     named = "Activity",
     menuBar = DomainServiceLayout.MenuBar.SECONDARY
 )
-@Named(IsisModuleExtCommandReplayPrimary.NAMESPACE + ".CommandReplayOnPrimaryService")
+@Named(IsisModuleExtCommandLogApplib.COMMAND_REPLAY_ON_PRIMARY_SERVICE)
 @javax.annotation.Priority(PriorityPrecedence.EARLY)
+@Profile("primary")
 @RequiredArgsConstructor
 //@Log4j2
 public class CommandReplayOnPrimaryService {
@@ -70,9 +72,10 @@ public class CommandReplayOnPrimaryService {
     @Inject final JaxbService jaxbService;
     @Inject final MessageService messageService;
     @Inject final ContentMappingServiceForCommandsDto contentMappingServiceForCommandsDto;
-    @Inject final CommandRetrievalService commandRetrievalService;
+    @Inject final CommandRetrievalOnPrimaryService commandRetrievalOnPrimaryService;
 
-    public static abstract class ActionDomainEvent<T> extends IsisModuleExtCommandReplayPrimary.ActionDomainEvent<T> { }
+    public static abstract class ActionDomainEvent<T>
+    extends IsisModuleExtCommandLogApplib.ActionDomainEvent<T> { }
 
 
     public static class NotFoundException extends RecoverableException {
@@ -107,17 +110,14 @@ public class CommandReplayOnPrimaryService {
                 @ParameterLayout(named="Batch size")
                 final Integer batchSize)
                 throws NotFoundException {
-            return commandRetrievalService.findCommandsOnPrimaryFrom(interactionId, batchSize);
+            return commandRetrievalOnPrimaryService.findCommandsOnPrimaryFrom(interactionId, batchSize);
         }
         @MemberSupport public Integer default1Act() {
-            return commandRetrievalService.default1FindCommandsOnPrimaryFrom();
+            return commandRetrievalOnPrimaryService.default1FindCommandsOnPrimaryFrom();
         }
 
     }
 
-
-
-
     @Action(domainEvent = downloadCommands.ActionEvent.class, semantics = SemanticsOf.SAFE)
     @ActionLayout(cssClassFa = "fa-download", sequence="50")
     public class downloadCommands {
diff --git a/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/ui/CommandServiceMenu.java b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/ui/CommandServiceMenu.java
index 4f2f82d7e9..fcc408979f 100644
--- a/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/ui/CommandServiceMenu.java
+++ b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/ui/CommandServiceMenu.java
@@ -45,6 +45,7 @@ import org.apache.isis.applib.services.clock.ClockService;
 import org.apache.isis.extensions.commandlog.jdo.IsisModuleExtCommandLogJdo;
 import org.apache.isis.extensions.commandlog.jdo.entities.CommandJdo;
 import org.apache.isis.extensions.commandlog.jdo.entities.CommandJdoRepository;
+import org.apache.isis.extensions.commandlog.model.IsisModuleExtCommandLogApplib;
 
 import lombok.RequiredArgsConstructor;
 
@@ -65,11 +66,11 @@ import lombok.RequiredArgsConstructor;
 public class CommandServiceMenu {
 
     public static abstract class PropertyDomainEvent<T>
-            extends IsisModuleExtCommandLogJdo.PropertyDomainEvent<CommandServiceMenu, T> { }
+            extends IsisModuleExtCommandLogApplib.PropertyDomainEvent<CommandServiceMenu, T> { }
     public static abstract class CollectionDomainEvent<T>
-            extends IsisModuleExtCommandLogJdo.CollectionDomainEvent<CommandServiceMenu, T> { }
+            extends IsisModuleExtCommandLogApplib.CollectionDomainEvent<CommandServiceMenu, T> { }
     public static abstract class ActionDomainEvent
-            extends IsisModuleExtCommandLogJdo.ActionDomainEvent<CommandServiceMenu> {
+            extends IsisModuleExtCommandLogApplib.ActionDomainEvent<CommandServiceMenu> {
     }
 
     final CommandJdoRepository commandServiceRepository;
diff --git a/extensions/core/command-replay/primary/src/main/java/org/apache/isis/extensions/commandreplay/primary/restapi/CommandRetrievalService.java b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/ui/rest/CommandRetrievalOnPrimaryService.java
similarity index 74%
rename from extensions/core/command-replay/primary/src/main/java/org/apache/isis/extensions/commandreplay/primary/restapi/CommandRetrievalService.java
rename to extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/ui/rest/CommandRetrievalOnPrimaryService.java
index f57a20629b..186c4896b2 100644
--- a/extensions/core/command-replay/primary/src/main/java/org/apache/isis/extensions/commandreplay/primary/restapi/CommandRetrievalService.java
+++ b/extensions/core/command-log/jdo/src/main/java/org/apache/isis/extensions/commandlog/jdo/ui/rest/CommandRetrievalOnPrimaryService.java
@@ -16,7 +16,7 @@
  *  specific language governing permissions and limitations
  *  under the License.
  */
-package org.apache.isis.extensions.commandreplay.primary.restapi;
+package org.apache.isis.extensions.commandlog.jdo.ui.rest;
 
 import java.util.List;
 import java.util.UUID;
@@ -24,18 +24,20 @@ import java.util.UUID;
 import javax.inject.Inject;
 import javax.inject.Named;
 
+import org.springframework.context.annotation.Profile;
 import org.springframework.lang.Nullable;
 
 import org.apache.isis.applib.annotation.Action;
 import org.apache.isis.applib.annotation.DomainService;
+import org.apache.isis.applib.annotation.MemberSupport;
 import org.apache.isis.applib.annotation.NatureOfService;
 import org.apache.isis.applib.annotation.ParameterLayout;
 import org.apache.isis.applib.annotation.PriorityPrecedence;
 import org.apache.isis.applib.annotation.SemanticsOf;
 import org.apache.isis.applib.exceptions.RecoverableException;
-import org.apache.isis.extensions.commandlog.model.command.CommandModel;
+import org.apache.isis.extensions.commandlog.jdo.entities.CommandJdo;
+import org.apache.isis.extensions.commandlog.model.IsisModuleExtCommandLogApplib;
 import org.apache.isis.extensions.commandlog.model.command.CommandModelRepository;
-import org.apache.isis.extensions.commandreplay.primary.IsisModuleExtCommandReplayPrimary;
 
 import lombok.Getter;
 
@@ -45,12 +47,13 @@ import lombok.Getter;
 @DomainService(
     nature = NatureOfService.REST
 )
-@Named(IsisModuleExtCommandReplayPrimary.NAMESPACE + ".CommandRetrievalService")
+@Named(IsisModuleExtCommandLogApplib.NAMESPACE_PRIMARY + ".CommandRetrievalOnPrimaryService")
 @javax.annotation.Priority(PriorityPrecedence.EARLY)
-public class CommandRetrievalService {
+@Profile("primary")
+public class CommandRetrievalOnPrimaryService {
 
     public static abstract class ActionDomainEvent
-            extends IsisModuleExtCommandReplayPrimary.ActionDomainEvent<CommandRetrievalService> { }
+            extends IsisModuleExtCommandLogApplib.ActionDomainEvent<CommandRetrievalOnPrimaryService> { }
 
     public static class FindCommandsOnPrimaryFromDomainEvent extends ActionDomainEvent { }
     public static class NotFoundException extends RecoverableException {
@@ -71,8 +74,11 @@ public class CommandRetrievalService {
      * @param batchSize - the maximum number of commands to return.  If not specified, all found will be returned.
      * @throws NotFoundException - if the command with specified transaction cannot be found.
      */
-    @Action(domainEvent = FindCommandsOnPrimaryFromDomainEvent.class, semantics = SemanticsOf.SAFE)
-    public List<? extends CommandModel> findCommandsOnPrimaryFrom(
+    @Action(
+            domainEvent = FindCommandsOnPrimaryFromDomainEvent.class,
+            semantics = SemanticsOf.SAFE,
+            typeOf = CommandJdo.class)
+    public List<CommandJdo> findCommandsOnPrimaryFrom(
             @Nullable
             @ParameterLayout(named="Interaction Id")
             final UUID interactionId,
@@ -80,16 +86,16 @@ public class CommandRetrievalService {
             @ParameterLayout(named="Batch size")
             final Integer batchSize)
             throws NotFoundException {
-        final List<? extends CommandModel> commands = commandModelRepository.findSince(interactionId, batchSize);
+        final List<CommandJdo> commands = commandModelRepository.findSince(interactionId, batchSize);
         if(commands == null) {
             throw new NotFoundException(interactionId);
         }
         return commands;
     }
-    public Integer default1FindCommandsOnPrimaryFrom() {
+    @MemberSupport public Integer default1FindCommandsOnPrimaryFrom() {
         return 25;
     }
 
-    @Inject CommandModelRepository<? extends CommandModel> commandModelRepository;
+    @Inject CommandModelRepository<CommandJdo> commandModelRepository;
 }
 
diff --git a/extensions/core/command-replay/primary/src/main/java/org/apache/isis/extensions/commandreplay/primary/IsisModuleExtCommandReplayPrimary.java b/extensions/core/command-replay/primary/src/main/java/org/apache/isis/extensions/commandreplay/primary/IsisModuleExtCommandReplayPrimary.java
index e27ac96411..a18b647059 100644
--- a/extensions/core/command-replay/primary/src/main/java/org/apache/isis/extensions/commandreplay/primary/IsisModuleExtCommandReplayPrimary.java
+++ b/extensions/core/command-replay/primary/src/main/java/org/apache/isis/extensions/commandreplay/primary/IsisModuleExtCommandReplayPrimary.java
@@ -22,12 +22,9 @@ import org.springframework.context.annotation.Configuration;
 import org.springframework.context.annotation.Import;
 import org.springframework.context.annotation.Profile;
 
-import org.apache.isis.extensions.commandlog.model.IsisModuleExtCommandLogApplib;
 import org.apache.isis.extensions.commandreplay.primary.config.PrimaryConfig;
 import org.apache.isis.extensions.commandreplay.primary.mixins.Object_openOnSecondary;
-import org.apache.isis.extensions.commandreplay.primary.restapi.CommandRetrievalService;
 import org.apache.isis.extensions.commandreplay.primary.spiimpl.CaptureResultOfCommand;
-import org.apache.isis.extensions.commandreplay.primary.ui.CommandReplayOnPrimaryService;
 
 /**
  * @since 2.0 {@index}
@@ -35,11 +32,8 @@ import org.apache.isis.extensions.commandreplay.primary.ui.CommandReplayOnPrimar
 @Configuration
 @Import({
         // @Configuration's
-        IsisModuleExtCommandLogApplib.class,
 
         // @Service's
-        CommandRetrievalService.class,
-        CommandReplayOnPrimaryService.class,
         CaptureResultOfCommand.class,
         PrimaryConfig.class,
 
@@ -50,8 +44,6 @@ import org.apache.isis.extensions.commandreplay.primary.ui.CommandReplayOnPrimar
 @Profile("primary")
 public class IsisModuleExtCommandReplayPrimary {
 
-    public static final String NAMESPACE = IsisModuleExtCommandLogApplib.NAMESPACE_PRIMARY;
-
     public abstract static class ActionDomainEvent<S>
             extends org.apache.isis.applib.events.domain.ActionDomainEvent<S> { }
 
diff --git a/extensions/core/command-replay/primary/src/main/java/org/apache/isis/extensions/commandreplay/primary/config/PrimaryConfig.java b/extensions/core/command-replay/primary/src/main/java/org/apache/isis/extensions/commandreplay/primary/config/PrimaryConfig.java
index 11d10693db..5866e70520 100644
--- a/extensions/core/command-replay/primary/src/main/java/org/apache/isis/extensions/commandreplay/primary/config/PrimaryConfig.java
+++ b/extensions/core/command-replay/primary/src/main/java/org/apache/isis/extensions/commandreplay/primary/config/PrimaryConfig.java
@@ -25,7 +25,7 @@ import org.springframework.stereotype.Service;
 
 import org.apache.isis.applib.annotation.PriorityPrecedence;
 import org.apache.isis.core.config.IsisConfiguration;
-import org.apache.isis.extensions.commandreplay.primary.IsisModuleExtCommandReplayPrimary;
+import org.apache.isis.extensions.commandlog.model.IsisModuleExtCommandLogApplib;
 
 import lombok.Getter;
 import lombok.val;
@@ -34,7 +34,7 @@ import lombok.val;
  * @since 2.0 {@index}
  */
 @Service
-@Named(IsisModuleExtCommandReplayPrimary.NAMESPACE + ".PrimaryConfig")
+@Named(IsisModuleExtCommandLogApplib.NAMESPACE_PRIMARY + ".PrimaryConfig")
 @javax.annotation.Priority(PriorityPrecedence.MIDPOINT)
 //@Log4j2
 public class PrimaryConfig {
diff --git a/extensions/core/command-replay/primary/src/main/java/org/apache/isis/extensions/commandreplay/primary/spiimpl/CaptureResultOfCommand.java b/extensions/core/command-replay/primary/src/main/java/org/apache/isis/extensions/commandreplay/primary/spiimpl/CaptureResultOfCommand.java
index 1465a32445..2fd862c409 100644
--- a/extensions/core/command-replay/primary/src/main/java/org/apache/isis/extensions/commandreplay/primary/spiimpl/CaptureResultOfCommand.java
+++ b/extensions/core/command-replay/primary/src/main/java/org/apache/isis/extensions/commandreplay/primary/spiimpl/CaptureResultOfCommand.java
@@ -29,8 +29,8 @@ import org.apache.isis.applib.services.command.Command;
 import org.apache.isis.applib.services.commanddto.conmap.UserDataKeys;
 import org.apache.isis.applib.services.commanddto.processor.spi.CommandDtoProcessorService;
 import org.apache.isis.applib.util.schema.CommandDtoUtils;
+import org.apache.isis.extensions.commandlog.model.IsisModuleExtCommandLogApplib;
 import org.apache.isis.extensions.commandlog.model.command.CommandModel;
-import org.apache.isis.extensions.commandreplay.primary.IsisModuleExtCommandReplayPrimary;
 import org.apache.isis.schema.cmd.v2.CommandDto;
 
 import lombok.val;
@@ -43,7 +43,7 @@ import lombok.val;
  * Uses the SPI infrastructure to copy over standard properties from {@link Command} to {@link CommandDto}.
  */
 @Service
-@Named(IsisModuleExtCommandReplayPrimary.NAMESPACE + ".CaptureResultOfCommand")
+@Named(IsisModuleExtCommandLogApplib.NAMESPACE_PRIMARY + ".CaptureResultOfCommand")
 // specify quite a high priority since custom processors will probably want to run after this one
 // (but can choose to run before if they wish)
 @javax.annotation.Priority(PriorityPrecedence.EARLY)
diff --git a/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/IsisModuleExtCommandReplaySecondary.java b/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/IsisModuleExtCommandReplaySecondary.java
index c48fa2810c..902e17f378 100644
--- a/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/IsisModuleExtCommandReplaySecondary.java
+++ b/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/IsisModuleExtCommandReplaySecondary.java
@@ -38,7 +38,6 @@ import org.springframework.scheduling.quartz.SimpleTriggerFactoryBean;
 import org.springframework.scheduling.quartz.SpringBeanJobFactory;
 
 import org.apache.isis.core.config.IsisConfiguration;
-import org.apache.isis.extensions.commandlog.model.IsisModuleExtCommandLogApplib;
 import org.apache.isis.extensions.commandreplay.secondary.analyser.CommandReplayAnalyserException;
 import org.apache.isis.extensions.commandreplay.secondary.analyser.CommandReplayAnalyserResult;
 import org.apache.isis.extensions.commandreplay.secondary.analysis.CommandReplayAnalysisService;
@@ -58,7 +57,6 @@ import lombok.val;
 @Configuration
 @Import({
         // @Configuration's
-        IsisModuleExtCommandLogApplib.class,
         IsisModuleExtQuartzImpl.class,
 
         // @Service's
@@ -78,8 +76,6 @@ import lombok.val;
 @Profile("secondary")
 public class IsisModuleExtCommandReplaySecondary {
 
-    public static final String NAMESPACE = IsisModuleExtCommandLogApplib.NAMESPACE_SECONDARY;
-
     public abstract static class ActionDomainEvent<S>
             extends org.apache.isis.applib.events.domain.ActionDomainEvent<S> { }
 
diff --git a/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/analyser/CommandReplayAnalyserException.java b/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/analyser/CommandReplayAnalyserException.java
index c7dac55636..f832f797f4 100644
--- a/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/analyser/CommandReplayAnalyserException.java
+++ b/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/analyser/CommandReplayAnalyserException.java
@@ -30,8 +30,8 @@ import org.apache.isis.applib.services.commanddto.conmap.UserDataKeys;
 import org.apache.isis.applib.util.schema.CommandDtoUtils;
 import org.apache.isis.commons.internal.base._Strings;
 import org.apache.isis.core.config.IsisConfiguration;
+import org.apache.isis.extensions.commandlog.model.IsisModuleExtCommandLogApplib;
 import org.apache.isis.extensions.commandlog.model.command.CommandModel;
-import org.apache.isis.extensions.commandreplay.secondary.IsisModuleExtCommandReplaySecondary;
 import org.apache.isis.schema.common.v2.InteractionType;
 
 import lombok.RequiredArgsConstructor;
@@ -41,7 +41,7 @@ import lombok.val;
  * @since 2.0 {@index}
  */
 @Service
-@Named(IsisModuleExtCommandReplaySecondary.NAMESPACE + ".CommandReplayAnalyserException")
+@Named(IsisModuleExtCommandLogApplib.NAMESPACE_SECONDARY + ".CommandReplayAnalyserException")
 @javax.annotation.Priority(PriorityPrecedence.MIDPOINT)
 @RequiredArgsConstructor
 public class CommandReplayAnalyserException implements CommandReplayAnalyser {
diff --git a/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/analyser/CommandReplayAnalyserResult.java b/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/analyser/CommandReplayAnalyserResult.java
index 88a73fd7b0..64d4720fd8 100644
--- a/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/analyser/CommandReplayAnalyserResult.java
+++ b/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/analyser/CommandReplayAnalyserResult.java
@@ -29,8 +29,8 @@ import org.apache.isis.applib.annotation.PriorityPrecedence;
 import org.apache.isis.applib.services.commanddto.conmap.UserDataKeys;
 import org.apache.isis.applib.util.schema.CommandDtoUtils;
 import org.apache.isis.core.config.IsisConfiguration;
+import org.apache.isis.extensions.commandlog.model.IsisModuleExtCommandLogApplib;
 import org.apache.isis.extensions.commandlog.model.command.CommandModel;
-import org.apache.isis.extensions.commandreplay.secondary.IsisModuleExtCommandReplaySecondary;
 import org.apache.isis.schema.common.v2.InteractionType;
 
 import lombok.RequiredArgsConstructor;
@@ -40,7 +40,7 @@ import lombok.val;
  * @since 2.0 {@index}
  */
 @Service
-@Named(IsisModuleExtCommandReplaySecondary.NAMESPACE + ".CommandReplayAnalyserResult")
+@Named(IsisModuleExtCommandLogApplib.NAMESPACE_SECONDARY + ".CommandReplayAnalyserResult")
 @javax.annotation.Priority(PriorityPrecedence.MIDPOINT)
 @RequiredArgsConstructor
 public class CommandReplayAnalyserResult implements CommandReplayAnalyser {
diff --git a/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/analysis/CommandReplayAnalysisService.java b/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/analysis/CommandReplayAnalysisService.java
index 335129802e..6751922ee2 100644
--- a/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/analysis/CommandReplayAnalysisService.java
+++ b/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/analysis/CommandReplayAnalysisService.java
@@ -26,8 +26,8 @@ import javax.inject.Named;
 import org.springframework.stereotype.Service;
 
 import org.apache.isis.applib.annotation.PriorityPrecedence;
+import org.apache.isis.extensions.commandlog.model.IsisModuleExtCommandLogApplib;
 import org.apache.isis.extensions.commandlog.model.command.CommandModel;
-import org.apache.isis.extensions.commandreplay.secondary.IsisModuleExtCommandReplaySecondary;
 import org.apache.isis.extensions.commandreplay.secondary.analyser.CommandReplayAnalyser;
 
 import lombok.extern.log4j.Log4j2;
@@ -36,7 +36,7 @@ import lombok.extern.log4j.Log4j2;
  * @since 2.0 {@index}
  */
 @Service
-@Named(IsisModuleExtCommandReplaySecondary.NAMESPACE + ".CommandReplayAnalysisService")
+@Named(IsisModuleExtCommandLogApplib.NAMESPACE_SECONDARY + ".CommandReplayAnalysisService")
 @javax.annotation.Priority(PriorityPrecedence.MIDPOINT)
 @Log4j2
 public class CommandReplayAnalysisService {
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 87f469d496..4b2c671644 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
@@ -24,6 +24,7 @@ import java.util.UUID;
 
 import javax.inject.Inject;
 import javax.inject.Named;
+import javax.ws.rs.core.GenericType;
 import javax.ws.rs.core.Response;
 
 import org.springframework.lang.Nullable;
@@ -35,7 +36,6 @@ import org.apache.isis.applib.services.jaxb.JaxbService;
 import org.apache.isis.applib.services.jaxb.JaxbService.Simple;
 import org.apache.isis.extensions.commandlog.model.IsisModuleExtCommandLogApplib;
 import org.apache.isis.extensions.commandlog.model.command.CommandModel;
-import org.apache.isis.extensions.commandreplay.secondary.IsisModuleExtCommandReplaySecondary;
 import org.apache.isis.extensions.commandreplay.secondary.SecondaryStatus;
 import org.apache.isis.extensions.commandreplay.secondary.StatusException;
 import org.apache.isis.extensions.commandreplay.secondary.config.SecondaryConfig;
@@ -44,6 +44,8 @@ import org.apache.isis.schema.cmd.v2.CommandsDto;
 import org.apache.isis.viewer.restfulobjects.client.RestfulClient;
 import org.apache.isis.viewer.restfulobjects.client.RestfulClientConfig;
 
+import lombok.AccessLevel;
+import lombok.RequiredArgsConstructor;
 import lombok.val;
 import lombok.extern.log4j.Log4j2;
 
@@ -52,15 +54,24 @@ import lombok.extern.log4j.Log4j2;
  * @since 2.0 {@index}
  */
 @Service()
-@Named(IsisModuleExtCommandReplaySecondary.NAMESPACE + ".CommandFetcher")
+@Named(IsisModuleExtCommandLogApplib.NAMESPACE_SECONDARY + ".CommandFetcher")
 @javax.annotation.Priority(PriorityPrecedence.MIDPOINT)
+@RequiredArgsConstructor(access = AccessLevel.PACKAGE) // JUnit Support
 @Log4j2
 public class CommandFetcher {
 
     static final String URL_SUFFIX =
             "services/"
-            + IsisModuleExtCommandLogApplib.NAMESPACE_PRIMARY
-            + ".CommandRetrievalService/actions/findCommandsOnPrimaryFrom/invoke";
+            + IsisModuleExtCommandLogApplib.COMMAND_REPLAY_ON_PRIMARY_SERVICE
+            + "/actions/findCommandsOnPrimaryFrom/invoke";
+
+    private final SecondaryConfig secondaryConfig;
+    private final boolean useRequestDebugLogging;
+
+    @Inject
+    public CommandFetcher(final SecondaryConfig secondaryConfig) {
+        this(secondaryConfig, false);
+    }
 
     /**
      * Replicates a single command.
@@ -129,14 +140,16 @@ public class CommandFetcher {
                 SuppressionType.RO);
 
         final Response response = request.get();
-        val digest = client.digest(response, String.class)
+        val digest = client.digestList(response, CommandModel.class, new GenericType<List<CommandModel>>(){})
                 .mapFailure(failure->{
                     log.warn("rest call failed", failure);
                     return new StatusException(SecondaryStatus.REST_CALL_FAILING);
                 })
                 .ifFailureFail();
 
-        return unmarshal(digest.getValue().orElse("<unable to read from response entity>"), endpointUri);
+        System.err.printf("%s%n", digest.getValue());
+
+        return null;//unmarshal(digest.getValue().orElse("<unable to read from response entity>"), endpointUri);
     }
 
     private CommandsDto unmarshal(final String rawValue, final String endpointUri) throws StatusException {
@@ -152,9 +165,6 @@ public class CommandFetcher {
         return commandsDto;
     }
 
-    // package private in support of JUnit
-    boolean useRequestDebugLogging = false;
-
     private static RestfulClient newClient(
             final SecondaryConfig secondaryConfig,
             final boolean useRequestDebugLogging) {
@@ -172,7 +182,4 @@ public class CommandFetcher {
         return client;
     }
 
-    // package private in support of JUnit
-    @Inject SecondaryConfig secondaryConfig;
-
 }
diff --git a/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/ui/CommandReplayOnSecondaryService.java b/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/ui/CommandReplayOnSecondaryService.java
index cc80224022..315039bfc4 100644
--- a/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/ui/CommandReplayOnSecondaryService.java
+++ b/extensions/core/command-replay/secondary/src/main/java/org/apache/isis/extensions/commandreplay/secondary/ui/CommandReplayOnSecondaryService.java
@@ -34,6 +34,7 @@ import org.apache.isis.applib.annotation.PriorityPrecedence;
 import org.apache.isis.applib.annotation.SemanticsOf;
 import org.apache.isis.applib.services.jaxb.JaxbService;
 import org.apache.isis.applib.value.Clob;
+import org.apache.isis.extensions.commandlog.model.IsisModuleExtCommandLogApplib;
 import org.apache.isis.extensions.commandlog.model.command.CommandModel;
 import org.apache.isis.extensions.commandlog.model.command.CommandModelRepository;
 import org.apache.isis.extensions.commandreplay.secondary.IsisModuleExtCommandReplaySecondary;
@@ -49,7 +50,7 @@ import lombok.val;
 @DomainService(
     nature = NatureOfService.VIEW
 )
-@Named(IsisModuleExtCommandReplaySecondary.NAMESPACE + ".CommandReplayOnSecondaryService")
+@Named(IsisModuleExtCommandLogApplib.NAMESPACE_SECONDARY + ".CommandReplayOnSecondaryService")
 @DomainServiceLayout(
     named = "Activity",
     menuBar = DomainServiceLayout.MenuBar.SECONDARY
diff --git a/extensions/core/command-replay/secondary/src/test/java/org/apache/isis/extensions/commandreplay/secondary/fetch/CommandFetcher_Test.java b/extensions/core/command-replay/secondary/src/test/java/org/apache/isis/extensions/commandreplay/secondary/fetch/CommandFetcher_Test.java
index d9652695f5..df2819d303 100644
--- a/extensions/core/command-replay/secondary/src/test/java/org/apache/isis/extensions/commandreplay/secondary/fetch/CommandFetcher_Test.java
+++ b/extensions/core/command-replay/secondary/src/test/java/org/apache/isis/extensions/commandreplay/secondary/fetch/CommandFetcher_Test.java
@@ -48,12 +48,12 @@ class CommandFetcher_Test {
         config.getPrimaryAccess().setBaseUrlWicket(Optional.of("http://localhost:8080/wicket/"));
         config.setBatchSize(10);
 
-        val fetcher = new CommandFetcher();
-        fetcher.secondaryConfig = new SecondaryConfig(mmc.getConfiguration());
-        fetcher.useRequestDebugLogging = true;
+        val secondaryConfig = new SecondaryConfig(mmc.getConfiguration());
+        val useRequestDebugLogging = true;
+        val fetcher = new CommandFetcher(secondaryConfig, useRequestDebugLogging);
 
         // when
-        CommandsDto entity = fetcher.callPrimary(null);
+        final CommandsDto entity = fetcher.callPrimary(null);
 
         System.out.println(JaxbUtil.toXml(entity));
     }