package _VisualDVM.Passes.SSH;
import Common.Passes.Pass;
import _VisualDVM.GlobalData.Machine.Machine;
import _VisualDVM.GlobalData.User.User;
import _VisualDVM.TestingSystem.DVM.UserConnection;
public class ConnectionPass<T> extends Pass<T> {
    public User user = null;
    protected Machine machine = 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 {
    }
}
