Files
VisualSapfor/src/_VisualDVM/Passes/All/SendBugReport.java

28 lines
1.1 KiB
Java

package _VisualDVM.Passes.All;
import Common.Utils.Utils_;
import _VisualDVM.Global;
import _VisualDVM.Passes.Server.ComponentsRepositoryPass;
import _VisualDVM.Repository.BugReport.BugReport;
import _VisualDVM.Repository.BugReport.BugReportState;
import _VisualDVM.Repository.Server.ServerCode;
import _VisualDVM.Repository.Server.ServerExchangeUnit_2021;
public class SendBugReport extends ComponentsRepositoryPass<BugReport> {
@Override
protected void ServerAction() throws Exception {
target = Global.componentsServer.db.bugReports.getUI().getCurrent();
if (!target.project_version.isEmpty()) {
//отправить архив.
Command(new ServerExchangeUnit_2021(ServerCode.SendBugReport,
target.id,
Utils_.fileToBytes(target.getArchiveFile())
));
}
// синхрон бд
Command(new ServerExchangeUnit_2021(ServerCode.PublishObject, "", target));
}
@Override
protected void performFail() throws Exception {
target.state = BugReportState.draft;
}
}