package Visual_DVM_2021.Passes.All;
import Common.Database.Database;
import Common.Global;
import Repository.Server.ServerCode;
import Repository.Server.ServerExchangeUnit_2021;
import SapforTestingSystem.ServerSapfor.ServerSapfor;
import Visual_DVM_2021.Passes.DeleteObjectPass;
import Visual_DVM_2021.Passes.Pass_2021;
import Visual_DVM_2021.Passes.TestingSystemPass;
public class DeleteServerSapfor extends DeleteObjectPass<ServerSapfor> {
    public DeleteServerSapfor() {
        super(ServerSapfor.class);
    }
    @Override
    protected Database getDb() {
        return Global.testingServer.db;
    }
    @Override
    protected void performDone() throws Exception {
        super.performDone();
        Pass_2021 serverPass = new TestingSystemPass<ServerSapfor>() {
            @Override
            public String getDescription() {
                return "Удаление тестовой версии SAPFOR с сервера";
            }
            @Override
            protected boolean canStart(Object... args) throws Exception {
                target = (ServerSapfor) args[0];
                return true;
            }
            @Override
            protected void ServerAction() throws Exception {
                Command(new ServerExchangeUnit_2021(ServerCode.DeleteObject, "", target));
            }
        };
        serverPass.Do(target);
    }
}
