-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#29498 Add job watcher filtering and predicates in RealTimeJobMonitor
Introduced a new abstract class `AbstractJobWatcher` and modified `RealTimeJobMonitor` to support job watcher filtering using predicates. Updated related test configurations to include the new classes for initialization. These changes enhance the monitoring functionality by allowing more precise control over job update notifications.
- Loading branch information
1 parent
ff5a516
commit dc929f5
Showing
4 changed files
with
223 additions
and
14 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
dotCMS/src/main/java/com/dotcms/jobs/business/api/events/AbstractJobWatcher.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,32 @@ | ||
package com.dotcms.jobs.business.api.events; | ||
|
||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import java.util.function.Consumer; | ||
import java.util.function.Predicate; | ||
import org.immutables.value.Value; | ||
|
||
/** | ||
* Class to hold a watcher and its filter predicate. | ||
*/ | ||
@Value.Style(typeImmutable = "*", typeAbstract = "Abstract*") | ||
@Value.Immutable | ||
@JsonSerialize(as = JobWatcher.class) | ||
@JsonDeserialize(as = JobWatcher.class) | ||
public interface AbstractJobWatcher { | ||
|
||
/** | ||
* Returns a Consumer that performs an operation on a Job instance. | ||
* | ||
* @return a Consumer of Job that defines what to do with a Job instance. | ||
*/ | ||
Consumer<com.dotcms.jobs.business.job.Job> watcher(); | ||
|
||
/** | ||
* Returns a predicate that can be used to filter jobs based on custom criteria. | ||
* | ||
* @return a Predicate object to filter Job instances | ||
*/ | ||
Predicate<com.dotcms.jobs.business.job.Job> filter(); | ||
|
||
} |
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