-
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.
#29479 Remove JobResult enum and refactor job handling logic
Remove the `JobResult` enum and update job processing methods to use an `AbstractJobResult` interface. This refactor centralizes job result handling, differentiates success, failure, and cancellation cases, and incorporates metadata and error details within the job result.
- Loading branch information
1 parent
acbceef
commit a15d7c8
Showing
6 changed files
with
182 additions
and
91 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
24 changes: 24 additions & 0 deletions
24
dotCMS/src/main/java/com/dotcms/jobs/business/job/AbstractJobResult.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,24 @@ | ||
package com.dotcms.jobs.business.job; | ||
|
||
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; | ||
import com.fasterxml.jackson.databind.annotation.JsonSerialize; | ||
import java.util.Map; | ||
import java.util.Optional; | ||
import org.immutables.value.Value; | ||
|
||
/** | ||
* Abstract interface for an immutable JobResult class. This interface defines the structure for job | ||
* result information in the job processing system. The concrete implementation will be generated as | ||
* an immutable class named JobResult. | ||
*/ | ||
@Value.Style(typeImmutable = "*", typeAbstract = "Abstract*") | ||
@Value.Immutable | ||
@JsonSerialize(as = JobResult.class) | ||
@JsonDeserialize(as = JobResult.class) | ||
public interface AbstractJobResult { | ||
|
||
Optional<com.dotcms.jobs.business.error.ErrorDetail> errorDetail(); | ||
|
||
Optional<Map<String, Object>> metadata(); | ||
|
||
} |
17 changes: 0 additions & 17 deletions
17
dotCMS/src/main/java/com/dotcms/jobs/business/job/JobResult.java
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.