35 lines
1.0 KiB
Java
35 lines
1.0 KiB
Java
|
|
package Visual_DVM_2021.Passes.SSH;
|
||
|
|
import GlobalData.Machine.Machine;
|
||
|
|
import GlobalData.User.User;
|
||
|
|
import TestingSystem.DVM.UserConnection;
|
||
|
|
import Visual_DVM_2021.Passes.Pass_2021;
|
||
|
|
public class ConnectionPass_2023<T> extends Pass_2021<T> {
|
||
|
|
protected Machine machine = null;
|
||
|
|
protected User user = null;
|
||
|
|
//--
|
||
|
|
protected void Connect() throws Exception{
|
||
|
|
user.connection = null;
|
||
|
|
user.connection = new UserConnection(machine, user);
|
||
|
|
System.out.println("Соединение c " + machine.getURL() + " " + user.login + " успешно установлено.");
|
||
|
|
}
|
||
|
|
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{
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|