This repository has been archived by the owner on Jul 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 27
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
1 parent
88c756e
commit 88a115b
Showing
51 changed files
with
1,124 additions
and
122 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
parodos-model-api/src/main/java/com/redhat/parodos/workflow/enums/WorkFlowLogLevel.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,17 @@ | ||
package com.redhat.parodos.workflow.enums; | ||
|
||
import lombok.Getter; | ||
|
||
public enum WorkFlowLogLevel { | ||
|
||
INFO("\u001B[32m"), WARNING("\u001B[33m"), ERROR("\u001B[34m"); | ||
|
||
// Ansi code | ||
@Getter | ||
private final String code; | ||
|
||
WorkFlowLogLevel(String code) { | ||
this.code = code; | ||
} | ||
|
||
} |
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
47 changes: 47 additions & 0 deletions
47
...dos-model-api/src/main/java/com/redhat/parodos/workflow/task/log/dto/WorkFlowTaskLog.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,47 @@ | ||
/* | ||
* Copyright (c) 2022 Red Hat Developer | ||
* | ||
* Licensed 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 | ||
* | ||
* https://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 com.redhat.parodos.workflow.task.log.dto; | ||
|
||
import java.time.Instant; | ||
|
||
import com.redhat.parodos.workflow.enums.WorkFlowLogLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
/** | ||
* dto to represent workFlow tasks' log objects | ||
* | ||
* @author Richard Wang (Github: richardW98) | ||
*/ | ||
@Builder | ||
@Data | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
public class WorkFlowTaskLog { | ||
|
||
private String logText; | ||
|
||
private WorkFlowLogLevel workFlowLoglevel = WorkFlowLogLevel.INFO; | ||
|
||
@Override | ||
public String toString() { | ||
return Instant.now().toString() + " " + workFlowLoglevel.getCode() + workFlowLoglevel.name() + "\u001B[39m " | ||
+ logText; | ||
} | ||
|
||
} |
45 changes: 45 additions & 0 deletions
45
...el-api/src/main/java/com/redhat/parodos/workflow/task/log/service/WorkFlowLogService.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,45 @@ | ||
/* | ||
* Copyright (c) 2022 Red Hat Developer | ||
* | ||
* Licensed 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 | ||
* | ||
* https://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 com.redhat.parodos.workflow.task.log.service; | ||
|
||
import java.util.UUID; | ||
|
||
import com.redhat.parodos.workflow.task.log.dto.WorkFlowTaskLog; | ||
|
||
/** | ||
* Service interface for recording workFlow tasks' log | ||
* | ||
* @author Richard Wang (Github: richardW98) | ||
*/ | ||
public interface WorkFlowLogService { | ||
|
||
/** | ||
* contract to get log for a task execution | ||
* @param workFlowExecutionId main WorkFlow Execution's ID | ||
* @param taskName task name for the log | ||
* @return log of the task execution | ||
*/ | ||
String getLog(UUID workFlowExecutionId, String taskName); | ||
|
||
/** | ||
* contract to add log to a task execution | ||
* @param workFlowExecutionId main WorkFlow Execution's ID | ||
* @param taskName task name for the log | ||
* @param log log dto object of the task execution | ||
*/ | ||
void writeLog(UUID workFlowExecutionId, String taskName, WorkFlowTaskLog log); | ||
|
||
} |
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
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.