Interface BuildAgentEx

    • Method Detail

      • isLocal

        void isLocal​(Action<Boolean> callback)
        Calls callback with true if this agent is local for sure (i.e. installed on the same machine as server).
      • isLocalFast

        @Nullable
        Boolean isLocalFast()
        Returns the result of isLocal(Action) if the operation is fast, null otherwise
      • getAgentType

        @NotNull
        SAgentType getAgentType()
      • upgrade

        boolean upgrade​(Action<Boolean> callback)
        Sends upgrade command on agent
        Parameters:
        callback - will be called with true if upgrade was accepted by agent.
        Returns:
        true if upgrade is scheduled, false otherwise (for example if previous Upgrade call is still in progress).
      • setUpgrading

        void setUpgrading​(boolean isUpgrading)
        Changes agent upgrading status. Note that this method does not initiate upgrade. To initiate upgrade use upgrade(Action) method.
        Parameters:
        isUpgrading - agent upgrade status
      • getPingCode

        @NotNull
        String getPingCode()
      • register

        void register()
        Makes this agent registered.
      • unregister

        void unregister​(@NotNull
                        String unregistrationReason)
        Makes this agent unregistered.
        Parameters:
        unregistrationReason - reason of the agent unregistration
      • setCommunicationTimestamp

        void setCommunicationTimestamp​(Date timestamp)
        Updates agent - server binding timestamp and persists it in database if current node is allowed to do that
        Parameters:
        timestamp - timestamp
      • updateCommunicationTimestampInMemory

        void updateCommunicationTimestampInMemory​(@NotNull
                                                  Date timestamp)
        Updates agent - server binding timestamp in memory, does not persists it in database
        Parameters:
        timestamp -
      • setAgentDescription

        void setAgentDescription​(@NotNull
                                 AgentDescription description)
        Updates agent description of agent.
        Parameters:
        description -
      • stopBuild

        boolean stopBuild​(@NotNull
                          SRunningBuild build)
        Sends stop build command to agent.
        Returns:
        true if build was stopped on agent and false otherwise
      • getRemoteInterface

        <T> T getRemoteInterface​(@NotNull
                                 Class<T> type)
        Extension point allowing to call custom methods on agent remotely.
        Parameters:
        type - should contain only simple methods - with simple parameters and return types (number and strings)
      • updateAgent

        void updateAgent()
        Assuming that some other node can change agent information in database, this method reloads agent fields from database.
        Since:
        2018.1
      • setPingCode

        void setPingCode​(String pingCode)
      • isFakeAgent

        boolean isFakeAgent()
        Usually running builds have some agent, but sometimes this is not the case (composite build). To avoid returning null in such cases and make other code work properly a fake agent is created.
        Returns:
        true if this agent is a fake, not real agent.
        Since:
        2017.2
      • trySetSpecialState

        default boolean trySetSpecialState​(BuildAgentSpecialState specialState)
        Tries atomically to set a certain special state on agent. This operation is thread-safe
        Parameters:
        specialState -
        Returns:
        boolean if successful, false otherwise
        Since:
        2017.2.2
      • clearSpecialState

        void clearSpecialState​(BuildAgentSpecialState specialState)
        Clears special state if set to the given value
        Parameters:
        specialState -
        Since:
        2017.2.2
      • getSpecialState

        @Nullable
        BuildAgentSpecialState getSpecialState()
        Returns current special state
        Returns:
        see above
        Since:
        2017.2.1
      • getCurrentAgentVersion

        @NotNull
        String getCurrentAgentVersion()
        Returns:
        current agent version, i.e. version which corresponds to a fully updated agent
        Since:
        2018.1
      • getCurrentAgentPluginsSignature

        @NotNull
        String getCurrentAgentPluginsSignature()
        Returns:
        current plugins signature, i.e. a signature which corresponds to a fully updated agent
        Since:
        2018.1
      • isAccessible

        default boolean isAccessible()
        Returns true if the agent is connected to the current node, otherwise returns false. For example on the read-only node always return false. The remote operations can be executed on the agent only if the method returns true.
        Since:
        2018.1
      • buildStartedOnAgent

        void buildStartedOnAgent​(@NotNull
                                 SRunningBuild build)
        Called when a new build is started on this agent
        Parameters:
        build -
        Since:
        2018.2.2
      • getLastFinishedBuildDateOnAgent

        @Nullable
        Date getLastFinishedBuildDateOnAgent​(Date finishTimeAfter)
        Returns date of last finished build since given time
        Parameters:
        finishTimeAfter - finish time lower bound
        Returns:
      • isRemoved

        boolean isRemoved()
        Returns:
        true if this agent is removed
        Since:
        2022.08
      • markAsRemoved

        void markAsRemoved()
        Marks the agent as removed.
        Since:
        2022.08
      • getParameterValue

        String getParameterValue​(@NotNull
                                 String paramName)
        Returns value of a parameter with a given name. This method can access all agent parameters, including those which should not be exposed in the UI. The method can only be called by an authority with system admin like permission.
        Parameters:
        paramName - parameter name
        Returns:
        see above