Package jetbrains.buildServer.agent
Interface AgentLogProxy
-
- All Known Implementing Classes:
AgentLogProxyImpl
public interface AgentLogProxy
- Author:
- Kir This component is used as XML-RPC handler which processes messages from builds running on the build agent. It collects messages into bundles and send them to the server. If server is not accessible, it keeps collecting messages until server is available, reregisters on the server if needed, and sends collected messages.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
buildDetachedFromAgent(String buildId, String stepId)
Indicates that the build tasks are finished on the agent but the build itself should continue until some external process finishes itboolean
buildFinished(String buildId, Date finishDate, boolean buildFailed)
boolean
buildInterrupted(String buildId, String comment, boolean needRequeue)
void
dispose()
Stop agent log proxy, after invocation no other messages will be sent to the servervoid
flush()
Synchronously send queued messages to the server, if possibleint
getBuildMessageSequence()
Returns the current build message sequence number.boolean
hasConnection2Server()
boolean
hasPendingBuildFinishedCommand()
Returns true if buildFinished command is waiting to be sent to the serverboolean
hasPendingCommands()
boolean
isBuildFailing(String buildId)
Checks for build status on the build server.void
killAllPendingAndIgnore(String buildId)
Cleanup queue of messages which should be sent to the server.boolean
logMessages(String buildId, List<BuildMessage1> messages)
void
onBuildStart(String buildId)
Notifies proxy that another build was startedvoid
runRemote(String buildId, RemoteAction action)
Run remote action, which can be queued for later execution if server is not accessiblevoid
runRemoteAndWait(String buildId, RemoteAction action)
Runs remote action and waits till it is executed.void
setBuildMessageSequence(int buildMessageSequence)
Setter for the build message sequence number.void
wakeUpFlush()
Wakes up flush thread if it is waiting to send messages to server
-
-
-
Method Detail
-
dispose
void dispose()
Stop agent log proxy, after invocation no other messages will be sent to the server
-
logMessages
boolean logMessages(String buildId, List<BuildMessage1> messages)
-
hasPendingCommands
boolean hasPendingCommands()
- Returns:
- true if there are unsent messages to the server
-
hasPendingBuildFinishedCommand
boolean hasPendingBuildFinishedCommand()
Returns true if buildFinished command is waiting to be sent to the server- Returns:
- true if buildFinished command is pending
-
killAllPendingAndIgnore
void killAllPendingAndIgnore(@Nullable String buildId)
Cleanup queue of messages which should be sent to the server.- Parameters:
buildId
- this buildId will be placed to stop list and other messages won't be accepted for this build
-
runRemote
void runRemote(@NotNull String buildId, @NotNull RemoteAction action)
Run remote action, which can be queued for later execution if server is not accessible
-
runRemoteAndWait
void runRemoteAndWait(@NotNull String buildId, @NotNull RemoteAction action) throws InterruptedException
Runs remote action and waits till it is executed.- Parameters:
buildId
- build idaction
- action to execute- Throws:
InterruptedException
- if action was removed from the queue for some reason
-
hasConnection2Server
boolean hasConnection2Server()
- Returns:
- true if build agent thinks that there is a valid connection to TeamCity server
-
wakeUpFlush
void wakeUpFlush()
Wakes up flush thread if it is waiting to send messages to server
-
flush
void flush()
Synchronously send queued messages to the server, if possible
-
onBuildStart
void onBuildStart(String buildId)
Notifies proxy that another build was started
-
buildFinished
boolean buildFinished(String buildId, Date finishDate, boolean buildFailed)
- Returns:
- fake value, to conform XML-RPC requirements
- Since:
- 2019.1.1
-
buildDetachedFromAgent
boolean buildDetachedFromAgent(String buildId, String stepId)
Indicates that the build tasks are finished on the agent but the build itself should continue until some external process finishes it- Since:
- 2019.2
-
buildInterrupted
boolean buildInterrupted(String buildId, String comment, boolean needRequeue)
- Parameters:
comment
- a comment to interrupt the build withneedRequeue
- if true, build should be re-added to the build queue- Returns:
- fake value, to conform XML-RPC requirements
- Since:
- 2019.1.1
-
isBuildFailing
boolean isBuildFailing(String buildId) throws InterruptedException
Checks for build status on the build server. The call is synchronous, it makes sure that previous logged messages are sent to the server.- Returns:
- true if build status on the server is failing
- Throws:
InterruptedException
- if action was removed from the queue for some reason, and could not be completed (for instance, build is obsolete)- Since:
- 2019.1.1
-
getBuildMessageSequence
int getBuildMessageSequence()
Returns the current build message sequence number. The build message sequence number is an incrementing number attached to all log messages.- Returns:
- see above
-
setBuildMessageSequence
void setBuildMessageSequence(int buildMessageSequence)
Setter for the build message sequence number. The build message sequence number is an incrementing number attached to all log messages.- Parameters:
buildMessageSequence
- the new build message sequence number
-
-