2023-12-20 02:47:47 +03:00
|
|
|
package Visual_DVM_2021.Passes.SSH;
|
2024-10-09 22:21:57 +03:00
|
|
|
import _VisualDVM.GlobalData.Machine.Machine;
|
|
|
|
|
import _VisualDVM.GlobalData.User.User;
|
|
|
|
|
import _VisualDVM.TestingSystem.DVM.UserConnection;
|
2023-12-20 02:47:47 +03:00
|
|
|
import Visual_DVM_2021.Passes.Pass_2021;
|
2024-01-08 20:37:16 +03:00
|
|
|
public class ConnectionPass<T> extends Pass_2021<T> {
|
2023-12-20 02:47:47 +03:00
|
|
|
protected Machine machine = null;
|
2024-01-08 20:37:16 +03:00
|
|
|
public User user = null;
|
2023-12-20 02:47:47 +03:00
|
|
|
//--
|
|
|
|
|
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{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|