Class TptApiCallable<S>
java.lang.Object
jenkins.security.MasterToSlaveCallable<S,InterruptedException>
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
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:
-
Constructor Summary
ConstructorsConstructorDescriptionTptApiCallable
(TaskListener listener, int tptPort, String tptBindingName, FilePath[] exePaths, List<String> arguments, long startUpWaitTime) -
Method Summary
Modifier and TypeMethodDescriptionprotected 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
Only returns the TPT API if TPT is already running.Methods inherited from class jenkins.security.MasterToSlaveCallable
checkRoles
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface hudson.remoting.Callable
call, getChannelOrFail, getOpenChannelOrFail
-
Constructor Details
-
TptApiCallable
public TptApiCallable(TaskListener listener, int tptPort, String tptBindingName, FilePath[] exePaths, List<String> arguments, long startUpWaitTime)
-
-
Method Details
-
getLogger
- Returns:
- a logger that prints its log messages live on the Jenkins Agent
-
getApi
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
-