рефакторинг серверной части сапфора.

This commit is contained in:
2023-12-16 03:57:01 +03:00
parent b7b41ae59c
commit 34c08e7d44
32 changed files with 942 additions and 355 deletions

View File

@@ -0,0 +1,44 @@
package Visual_DVM_2021.Passes;
import Common.Current;
import Repository.Server.ServerCode;
import Repository.Server.ServerExchangeUnit_2021;
import TestingSystem.Common.TestingPackage.TestingPackage;
import TestingSystem.Common.TestingPackageToKill.TestingPackageToKill;
import Visual_DVM_2021.Passes.Server.TestingSystemPass;
public abstract class AbortTestingPackage extends TestingSystemPass<TestingPackage> {
TestingPackageToKill packageToKill = null;
@Override
public String getIconPath() {
return "/icons/Ban.PNG";
}
@Override
public String getButtonText() {
return "";
}
public abstract Current currentName();
public abstract int getAbortType();
@Override
protected boolean canStart(Object... args) throws Exception {
packageToKill = null;
if (Current.Check(Log, currentName())) {
target = (TestingPackage) Current.get(currentName());
switch (target.state) {
case Done:
case Aborted:
Log.Writeln_("Пакет уже завершен.");
break;
default:
packageToKill = new TestingPackageToKill();
packageToKill.packageId = target.id;
packageToKill.type = getAbortType();
return true;
}
}
;
return false;
}
@Override
protected void ServerAction() throws Exception {
Command(new ServerExchangeUnit_2021(ServerCode.PublishObject, null, packageToKill));
}
}