Class TSClient
- java.lang.Object
-
- de.tracetronic.jenkins.plugins.ecutest.tool.client.AbstractToolClient
-
- de.tracetronic.jenkins.plugins.ecutest.tool.client.TSClient
-
- All Implemented Interfaces:
ToolClient
public class TSClient extends AbstractToolClient
Client to start and stop the Tool-Server via command line execution.
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_TCP_PORT
Defines the default port used for TCP communication with the Tool-Server.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static List<String>
checkProcesses(Launcher launcher, boolean kill)
Checks already opened Tool-Server instances.protected ArgumentListBuilder
createCmdLine()
Creates the command line string for a process invocation.int
getTcpPort()
String
getToolLibsIniPath()
boolean
restart(boolean checkProcesses, FilePath workspace, Launcher launcher, TaskListener listener)
Restarts a tool.boolean
start(boolean checkProcesses, FilePath workspace, Launcher launcher, TaskListener listener)
Starts a tool.boolean
stop(boolean checkProcesses, FilePath workspace, Launcher launcher, TaskListener listener)
Stops a tool.-
Methods inherited from class de.tracetronic.jenkins.plugins.ecutest.tool.client.AbstractToolClient
getInstallPath, getTimeout, getToolName, launchProcess
-
-
-
-
Field Detail
-
DEFAULT_TCP_PORT
public static final int DEFAULT_TCP_PORT
Defines the default port used for TCP communication with the Tool-Server.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TSClient
public TSClient(String toolName, String installPath, int timeout, String toolLibsIniPath, int tcpPort)
Instantiates a newTSClient
.- Parameters:
toolName
- the tool name identifying the chosenETInstallation
.installPath
- the Tool-Server install pathtimeout
- the timeouttoolLibsIniPath
- the alternative ToolLibs.ini pathtcpPort
- the alternative TCP port
-
TSClient
public TSClient(String toolName, int timeout)
Instantiates a newTSClient
.- Parameters:
toolName
- the tool name identifying the chosenETInstallation
.timeout
- the timeout
-
-
Method Detail
-
checkProcesses
public static List<String> checkProcesses(Launcher launcher, boolean kill) throws IOException, InterruptedException
Checks already opened Tool-Server instances.- Parameters:
launcher
- the launcherkill
- specifies whether to task-kill the running processes- Returns:
- list of found processes, can be empty but never
null
- Throws:
IOException
- signals that an I/O exception has occurredInterruptedException
- if the current thread is interrupted while waiting for the completion
-
getToolLibsIniPath
public String getToolLibsIniPath()
-
getTcpPort
public int getTcpPort()
-
start
public boolean start(boolean checkProcesses, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException
Description copied from interface:ToolClient
Starts a tool.- Parameters:
checkProcesses
- specifies whether to check open processes after tear downworkspace
- the workspacelauncher
- the launcherlistener
- the listener- Returns:
true
if successful,false
otherwise- Throws:
IOException
- signals that an I/O exception has occurredInterruptedException
- if the build gets interrupted
-
stop
public boolean stop(boolean checkProcesses, FilePath workspace, Launcher launcher, TaskListener listener) throws InterruptedException, IOException
Description copied from interface:ToolClient
Stops a tool.- Parameters:
checkProcesses
- specifies whether to check open processes after tear downworkspace
- the workspacelauncher
- the launcherlistener
- the listener- Returns:
true
if successful,false
otherwise- Throws:
InterruptedException
- if the build gets interruptedIOException
- signals that an I/O exception has occurred
-
restart
public boolean restart(boolean checkProcesses, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException
Description copied from interface:ToolClient
Restarts a tool.- Parameters:
checkProcesses
- specifies whether to check open processes after tear downworkspace
- the workspacelauncher
- the launcherlistener
- the listener- Returns:
true
if successful,false
otherwise- Throws:
IOException
- signals that an I/O exception has occurredInterruptedException
- if the build gets interrupted
-
createCmdLine
protected ArgumentListBuilder createCmdLine()
Description copied from class:AbstractToolClient
Creates the command line string for a process invocation.- Specified by:
createCmdLine
in classAbstractToolClient
- Returns:
- the
ArgumentListBuilder
-
-