2024-12-18 17:09:09 +08:00
|
|
|
package com.tuoheng.steam.dos;
|
|
|
|
|
|
2025-08-04 15:23:23 +08:00
|
|
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
2024-12-18 17:09:09 +08:00
|
|
|
import com.tuoheng.steam.util.TimeUtils;
|
|
|
|
|
|
|
|
|
|
import java.io.Serializable;
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
import java.util.concurrent.CompletableFuture;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class StreamProcess implements Serializable {
|
|
|
|
|
|
2025-08-04 15:23:23 +08:00
|
|
|
@JsonIgnore
|
2024-12-18 17:09:09 +08:00
|
|
|
Process process;
|
|
|
|
|
Date createTime;
|
|
|
|
|
String stopTime;
|
|
|
|
|
ProcessType processType;
|
|
|
|
|
String fileName;
|
|
|
|
|
|
2025-08-04 14:14:26 +08:00
|
|
|
public Process getProcess() {
|
|
|
|
|
return process;
|
|
|
|
|
}
|
2024-12-18 17:09:09 +08:00
|
|
|
|
|
|
|
|
public String startTime(){
|
|
|
|
|
return TimeUtils.formatDateToString(createTime);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public String getStopTime() {
|
|
|
|
|
return stopTime;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setStopTime(String stopTime) {
|
|
|
|
|
this.stopTime = stopTime;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public CompletableFuture<Process> onExit(){
|
|
|
|
|
return process.onExit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void destroy(){
|
|
|
|
|
process.destroy();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ProcessType getProcessType() {
|
|
|
|
|
return processType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setProcessType(ProcessType processType) {
|
|
|
|
|
this.processType = processType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public Long getInnerProcessId() {
|
|
|
|
|
return process.pid();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Date getCreateTime() {
|
|
|
|
|
return createTime;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setCreateTime(Date createTime) {
|
|
|
|
|
this.createTime = createTime;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public StreamProcess(Process process, String fileName, ProcessType processType) {
|
|
|
|
|
this.process = process;
|
|
|
|
|
this.fileName = fileName;
|
|
|
|
|
this.createTime = new Date();
|
|
|
|
|
this.processType = processType;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String getFileName() {
|
|
|
|
|
return fileName;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void setFileName(String fileName) {
|
|
|
|
|
this.fileName = fileName;
|
|
|
|
|
}
|
|
|
|
|
}
|