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 booleanbuildDetachedFromAgent(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 itbooleanbuildFinished(String buildId, Date finishDate, boolean buildFailed)booleanbuildInterrupted(String buildId, String comment, boolean needRequeue)voiddispose()Stop agent log proxy, after invocation no other messages will be sent to the servervoidflush()Synchronously send queued messages to the server, if possibleintgetBuildMessageSequence()Returns the current build message sequence number.booleanhasConnection2Server()booleanhasPendingBuildFinishedCommand()Returns true if buildFinished command is waiting to be sent to the serverbooleanhasPendingCommands()booleanisBuildFailing(String buildId)Checks for build status on the build server.voidkillAllPendingAndIgnore(String buildId)Cleanup queue of messages which should be sent to the server.booleanlogMessages(String buildId, List<BuildMessage1> messages)voidonBuildStart(String buildId)Notifies proxy that another build was startedvoidrunRemote(String buildId, RemoteAction action)Run remote action, which can be queued for later execution if server is not accessiblevoidrunRemoteAndWait(String buildId, RemoteAction action)Runs remote action and waits till it is executed.voidsetBuildMessageSequence(int buildMessageSequence)Setter for the build message sequence number.voidwakeUpFlush()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 InterruptedExceptionRuns 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
-
-