Class 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 Detail

    • 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