-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Publish progress report Initial publish failure handling * TaskManagerImpl tests * Publisher unit tests * TaskManager: split tasks into site and global tasks. Publish status API to get the current task progress. Publish status API spec update
- Loading branch information
Showing
45 changed files
with
2,024 additions
and
726 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
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
62 changes: 62 additions & 0 deletions
62
src/main/java/org/craftercms/studio/api/v2/event/task/TaskEvent.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,62 @@ | ||
/* | ||
* Copyright (C) 2007-2024 Crafter Software Corporation. All Rights Reserved. | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 3 as published by | ||
* the Free Software Foundation. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
package org.craftercms.studio.api.v2.event.task; | ||
|
||
import org.craftercms.studio.api.v2.event.BroadcastEvent; | ||
import org.craftercms.studio.api.v2.event.StudioEvent; | ||
import org.craftercms.studio.api.v2.task.TaskProgress; | ||
|
||
/** | ||
* Event triggered when a task is state changes | ||
*/ | ||
public class TaskEvent extends StudioEvent implements BroadcastEvent { | ||
public static final String EVENT_TYPE_TASK_COMPLETED = "TASK_COMPLETED"; | ||
public static final String EVENT_TYPE_TASK_STARTED = "TASK_STARTED"; | ||
public static final String EVENT_TYPE_TASK_PROGRESS = "TASK_PROGRESS"; | ||
|
||
private final TaskProgress<?, ?> progress; | ||
private final String eventType; | ||
|
||
public TaskEvent(final TaskProgress<?, ?> progress, final String eventType) { | ||
this.progress = progress; | ||
this.eventType = eventType; | ||
} | ||
|
||
/** | ||
* Get the {@link TaskProgress} associated with this event | ||
* | ||
* @return the task progress | ||
*/ | ||
public TaskProgress<?, ?> getProgress() { | ||
return progress; | ||
} | ||
|
||
@Override | ||
public String getEventType() { | ||
return eventType; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return """ | ||
TaskEvent {taskId=%s, timestamp=%s, eventType=%s, progress=%s} | ||
""".formatted(progress.getTask().getTaskId(), | ||
timestamp, | ||
getEventType(), | ||
progress); | ||
} | ||
} |
Oops, something went wrong.