You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@causeway.apache.org by da...@apache.org on 2026/06/19 10:34:40 UTC
(causeway) 02/03: CAUSEWAY-4039: removed unused finders
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch CAUSEWAY-4039
in repository https://gitbox.apache.org/repos/asf/causeway.git
commit b8bc8654489a1d29351b2ddb1d1a995cb4cbd862
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Jun 19 09:31:53 2026 +0100
CAUSEWAY-4039: removed unused finders
---
.../applib/dom/CommandLogEntryRepository.java | 45 ++--------------
.../dom/CommandLogEntryRepositoryAbstract.java | 61 ----------------------
2 files changed, 3 insertions(+), 103 deletions(-)
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntryRepository.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntryRepository.java
index 5c702064b83..b440a1a655d 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntryRepository.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntryRepository.java
@@ -91,34 +91,14 @@ List<CommandLogEntry> findByTargetAndFromAndTo(
/**
- * Intended to support the replay of commands on a secondary instance of
- * the application.
+ * Intended to support the replay of commands for regression testing on a reference or candidate version of the application.
*
+ * <p>
* This finder returns all (completed) {@link CommandLogEntry}s started after
* the command with the specified interactionId. The number of commands
* returned can be limited so that they can be applied in batches.
+ * </p>
*
- * If the provided interactionId is null, then only a single
- * {@link CommandLogEntry command} is returned. This is intended to support
- * the case when the secondary does not yet have any
- * {@link CommandLogEntry command}s replicated. In practice this is unlikely;
- * typically we expect that the secondary will be set up to run against a
- * copy of the primary instance's DB (restored from a backup), in which
- * case there will already be a {@link CommandLogEntry command} representing the
- * current high water mark on the secondary system.
- *
- * If the interactionId is not null but the corresponding
- * {@link CommandLogEntry command} is not found, then <tt>null</tt> is returned.
- * In the replay scenario the caller will probably interpret this as an
- * error because it means that the high water mark on the secondary is
- * inaccurate, referring to a non-existent {@link CommandLogEntry command} on
- * the primary.
- *
- * @param interactionId - the identifier of the {@link CommandLogEntry command} being
- * the replay HWM (using {@link #findMostRecentReplayed()} on the
- * secondary), or null if no HWM was found there.
- * @param batchSize - to restrict the number returned (so that replay
- * commands can be batched).
*/
List<CommandLogEntry> findSince(final UUID interactionId, final Integer batchSize);
@@ -130,21 +110,8 @@ default List<CommandLogEntry> findForegroundSinceTimestamp(final Timestamp since
List<CommandLogEntry> findForegroundBeforeTimestamp(final Timestamp before, final Integer limitIfAny);
- default List<CommandLogEntry> findForegroundSinceTimestampAndCanBeExported(final Timestamp since) {
- return findForegroundSinceTimestampAndCanBeExported(since, null);
- }
-
List<CommandLogEntry> findForegroundSinceTimestampAndCanBeExported(final Timestamp since, final Integer limitIfAny);
- List<CommandLogEntry> findForegroundBeforeTimestampAndCanBeExported(final Timestamp before, final Integer limitIfAny);
-
- default List<CommandLogEntry> findForegroundSinceTimestampAndHasBeenExported(final Timestamp since) {
- return findForegroundSinceTimestampAndHasBeenExported(since, null);
- }
-
- List<CommandLogEntry> findForegroundSinceTimestampAndHasBeenExported(final Timestamp since, final Integer limitIfAny);
-
- List<CommandLogEntry> findForegroundBeforeTimestampAndHasBeenExported(final Timestamp before, final Integer limitIfAny);
/**
* Command Replay feature: Can replay or retry.
@@ -157,7 +124,6 @@ default List<CommandLogEntry> findForegroundSinceTimestampAndHasBeenExported(fin
List<CommandLogEntry> findSinceAndWithReplayOkOrExcluded(Timestamp since);
-
/**
* Returns any persisted commands that have not yet started.
*
@@ -221,11 +187,6 @@ default List<CommandLogEntry> saveForReplay(@Nullable final CommandsDto commands
// --
- List<CommandLogEntry> findCommandsOnPrimaryElseFail(
- final @Nullable UUID interactionId,
- final @Nullable Integer batchSize) throws NotFoundException;
-
-
/**
* intended for testing purposes only
*/
diff --git a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntryRepositoryAbstract.java b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntryRepositoryAbstract.java
index cf8519e5dad..ecd738064c2 100644
--- a/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntryRepositoryAbstract.java
+++ b/extensions/core/commandlog/applib/src/main/java/org/apache/causeway/extensions/commandlog/applib/dom/CommandLogEntryRepositoryAbstract.java
@@ -220,36 +220,6 @@ public List<CommandLogEntry> findRecentByTargetOrResult(final Bookmark targetOrR
);
}
- /**
- * Intended to support the replay of commands on a secondary instance of
- * the application.
- *
- * This finder returns all (completed) {@link CommandLogEntry}s started after
- * the command with the specified interactionId. The number of commands
- * returned can be limited so that they can be applied in batches.
- *
- * If the provided interactionId is null, then only a single
- * {@link CommandLogEntry command} is returned. This is intended to support
- * the case when the secondary does not yet have any
- * {@link CommandLogEntry command}s replicated. In practice this is unlikely;
- * typically we expect that the secondary will be set up to run against a
- * copy of the primary instance's DB (restored from a backup), in which
- * case there will already be a {@link CommandLogEntry command} representing the
- * current high water mark on the secondary system.
- *
- * If the interactionId is not null but the corresponding
- * {@link CommandLogEntry command} is not found, then <tt>null</tt> is returned.
- * In the replay scenario the caller will probably interpret this as an
- * error because it means that the high water mark on the secondary is
- * inaccurate, referring to a non-existent {@link CommandLogEntry command} on
- * the primary.
- *
- * @param interactionId - the identifier of the {@link CommandLogEntry command} being
- * the replay HWM (using {@link #findMostRecentReplayed()} on the
- * secondary), or null if no HWM was found there.
- * @param batchSize - to restrict the number returned (so that replay
- * commands can be batched).
- */
@Override
public List<CommandLogEntry> findSince(final UUID interactionId, final Integer batchSize) {
if(interactionId == null) {
@@ -368,17 +338,6 @@ public void truncateLog() {
// --
- @Override
- public List<CommandLogEntry> findCommandsOnPrimaryElseFail(
- final @Nullable UUID interactionId,
- final @Nullable Integer batchSize) throws NotFoundException {
-
- final List<CommandLogEntry> commands = findSince(interactionId, batchSize);
- if(commands == null) {
- throw new NotFoundException(interactionId);
- }
- return commands;
- }
private C findByInteractionIdElseNull(final UUID interactionId) {
var q = Query.named(commandLogEntryClass, CommandLogEntry.Nq.FIND_BY_INTERACTION_ID)
@@ -412,31 +371,11 @@ public List<CommandLogEntry> findForegroundBeforeTimestamp(final Timestamp befor
return allMatches(query, batchSizeIfAny);
}
- @Override
- public List<CommandLogEntry> findForegroundSinceTimestampAndCanBeExported(final Timestamp since) {
- return findForegroundSinceTimestampAndCanBeExported(since, null);
- }
-
@Override
public List<CommandLogEntry> findForegroundSinceTimestampAndCanBeExported(final Timestamp since, Integer batchSizeIfAny) {
return findForegroundSinceTimestampWithState(since, ReplayState.UNDEFINED, batchSizeIfAny);
}
- @Override
- public List<CommandLogEntry> findForegroundBeforeTimestampAndCanBeExported(final Timestamp before, Integer batchSizeIfAny) {
- return findForegroundBeforeTimestampWithState(before, ReplayState.UNDEFINED, batchSizeIfAny);
- }
-
- @Override
- public List<CommandLogEntry> findForegroundSinceTimestampAndHasBeenExported(final Timestamp since, Integer batchSizeIfAny) {
- return findForegroundSinceTimestampWithState(since, ReplayState.EXPORTED, batchSizeIfAny);
- }
-
- @Override
- public List<CommandLogEntry> findForegroundBeforeTimestampAndHasBeenExported(final Timestamp before, Integer batchSizeIfAny) {
- return findForegroundBeforeTimestampWithState(before, ReplayState.EXPORTED, batchSizeIfAny);
- }
-
@Override
public List<CommandLogEntry> findForegroundSinceTimestampAndWithReplayPendingOrFailed(final Timestamp since) {
return findForegroundSinceTimestampWithStates(since, ReplayState.PENDING, ReplayState.FAILED);