-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
1,302 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
src/main/java/uk/gov/justice/artemis/manager/connector/combined/CombinedManagement.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package uk.gov.justice.artemis.manager.connector.combined; | ||
|
||
import uk.gov.justice.artemis.manager.connector.combined.duplicate.AddedMessageFinder; | ||
import uk.gov.justice.artemis.manager.connector.combined.duplicate.DuplicateMessageFinder; | ||
import uk.gov.justice.artemis.manager.connector.combined.duplicate.DuplicateMessageRemover; | ||
import uk.gov.justice.artemis.manager.connector.combined.duplicate.DuplicateMessages; | ||
|
||
import java.util.List; | ||
|
||
public class CombinedManagement { | ||
|
||
private final DuplicateMessageFinder duplicateMessageFinder; | ||
private final DuplicateMessageRemover duplicateMessageRemover; | ||
private final AddedMessageFinder addedMessageFinder; | ||
|
||
public CombinedManagement(final DuplicateMessageFinder duplicateMessageFinder, | ||
final DuplicateMessageRemover duplicateMessageRemover, | ||
final AddedMessageFinder addedMessageFinder) { | ||
this.duplicateMessageFinder = duplicateMessageFinder; | ||
this.duplicateMessageRemover = duplicateMessageRemover; | ||
this.addedMessageFinder = addedMessageFinder; | ||
} | ||
|
||
public CombinedManagementFunction<List<String>> removeAllDuplicates() { | ||
|
||
return (queueBrowser, queueSender, jmsQueueControl) -> | ||
{ | ||
final DuplicateMessages duplicateMessages = duplicateMessageFinder.findDuplicateMessages(queueBrowser); | ||
|
||
duplicateMessageRemover.removeDuplicatesOnly( | ||
queueSender, | ||
jmsQueueControl, | ||
duplicateMessages); | ||
|
||
return addedMessageFinder.findAddedMessages(duplicateMessages, queueBrowser); | ||
}; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...in/java/uk/gov/justice/artemis/manager/connector/combined/CombinedManagementFunction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package uk.gov.justice.artemis.manager.connector.combined; | ||
|
||
import javax.jms.QueueBrowser; | ||
import javax.jms.QueueSender; | ||
|
||
import org.apache.activemq.artemis.api.jms.management.JMSQueueControl; | ||
|
||
public interface CombinedManagementFunction<T> { | ||
|
||
T apply(final QueueBrowser queueBrowser, final QueueSender queueSender, final JMSQueueControl jmsQueueControl); | ||
} |
8 changes: 8 additions & 0 deletions
8
...k/gov/justice/artemis/manager/connector/combined/CombinedManagementFunctionException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package uk.gov.justice.artemis.manager.connector.combined; | ||
|
||
public class CombinedManagementFunctionException extends RuntimeException { | ||
|
||
public CombinedManagementFunctionException(final String message, final Throwable cause) { | ||
super(message, cause); | ||
} | ||
} |
Oops, something went wrong.