Class TptApiCallable<S>
- java.lang.Object
-
- com.piketec.jenkins.plugins.tpt.api.callables.TptApiCallable<S>
-
- Type Parameters:
S
- is the return type of the call method, i.e. the type of whatever you want to get from the TPT API. NOTE: This type must be Serializable
- All Implemented Interfaces:
hudson.remoting.Callable<S,InterruptedException>
,Serializable
,org.jenkinsci.remoting.RoleSensitive
- Direct Known Subclasses:
CleanUpCallable
,ExecuteTestsWorkerJobCallable
,GetTestCasesCallable
,RunOverviewReportCallable
public abstract class TptApiCallable<S> extends Object implements hudson.remoting.Callable<S,InterruptedException>
This class can open a TPT API connection. It is a Callable, which means it will be executed on a Jenkins Agent. This is necessary, because we want to use the TPT API only via localhost and not via another remote connection. Every request that is made to the TPT API extends this class.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TptApiCallable(TaskListener listener, int tptPort, String tptBindingName, FilePath[] exePaths, List<String> arguments, long startUpWaitTime)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected com.piketec.tpt.api.TptApi
getApi()
Starts TPT if necessary and returns a TPT API connection for the settings given in the constructorprotected com.piketec.tpt.api.TptApi
getApiIfTptIsOpen()
Only returns the TPT API if TPT is already running.TptLogger
getLogger()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
TptApiCallable
public TptApiCallable(TaskListener listener, int tptPort, String tptBindingName, FilePath[] exePaths, List<String> arguments, long startUpWaitTime)
-
-
Method Detail
-
getLogger
public TptLogger getLogger()
- Returns:
- a logger that prints its log messages live on the Jenkins Agent
-
getApi
@Nullable protected com.piketec.tpt.api.TptApi getApi() throws InterruptedException
Starts TPT if necessary and returns a TPT API connection for the settings given in the constructor- Returns:
- the handle to the api
- Throws:
InterruptedException
- If thread was interrupted
-
getApiIfTptIsOpen
@Nullable protected com.piketec.tpt.api.TptApi getApiIfTptIsOpen()
Only returns the TPT API if TPT is already running. Otherwise it returns null.- Returns:
- the handle to the api
-
-