79 lines
1.5 KiB
Java
79 lines
1.5 KiB
Java
|
|
package com.tuoheng.steam.dos;
|
||
|
|
|
||
|
|
import com.tuoheng.steam.util.TimeUtils;
|
||
|
|
|
||
|
|
import java.io.Serializable;
|
||
|
|
import java.util.Date;
|
||
|
|
import java.util.concurrent.CompletableFuture;
|
||
|
|
|
||
|
|
|
||
|
|
public class StreamProcess implements Serializable {
|
||
|
|
|
||
|
|
Process process;
|
||
|
|
Date createTime;
|
||
|
|
String stopTime;
|
||
|
|
ProcessType processType;
|
||
|
|
String fileName;
|
||
|
|
|
||
|
|
|
||
|
|
|
||
|
|
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;
|
||
|
|
}
|
||
|
|
}
|