package Visual_DVM_2021.Passes.SSH;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.GlobalData.User.User;
import _VisualDVM.TestingSystem.DVM.UserConnection;
import Common.Passes.Pass;
public class ConnectionPass<T> extends Pass<T> {
    protected Machine machine = null;
    public User user = null;
    //--
    protected void Connect() throws Exception{
        user.connection = null;
        user.connection = new UserConnection(machine, user);
    }
    void Disconnect(){
        if (user.connection!=null){
            user.connection.Disconnect();
            user.connection = null;
        }
    }
    @Override
    protected void body() throws Exception {
        Connect();
        ServerAction();
    }
    @Override
    protected void performFinish() throws Exception {
        Disconnect();
    }
    //--
    protected void ServerAction() throws Exception{

    }
}
