Interface RemoteAgentConnection
-
- All Known Implementing Classes:
PollingRemoteAgentConnection
public interface RemoteAgentConnection
The connection to remote agent that is injected intoRegisteredAgent
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
RemoteAgentConnection.Listener
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
dispose()
Close this connection.<T> T
getCustomHandler(Class<T> tClass)
Extension point allowing to send custom commands to agent.String
getProtocolDescription()
String
getType()
It's different fromgetProtocolDescription()
in a way that the returned value will not change in the future and can be used to determine type of the connection.void
isLocal(Action<Boolean> callback)
Check whether this connection is local (Agent works on the same machine)default boolean
isMultiNodeAware()
AgentBuildResult
runBuild(AgentBuild agentBuild)
Run build on the Agent.void
setListener(RemoteAgentConnection.Listener listener)
boolean
stopBuild(long buildId)
Send stop build command to agent.void
updateAgentInfo(int agentId, String agentName)
Updates information about the agent in the connectionboolean
upgrade(Action<Boolean> callback)
Sends upgrade command on agent
-
-
-
Method Detail
-
isLocal
void isLocal(Action<Boolean> callback)
Check whether this connection is local (Agent works on the same machine)
-
runBuild
@NotNull AgentBuildResult runBuild(@NotNull AgentBuild agentBuild)
Run build on the Agent.- Throws:
AlreadyRunningBuildException
- if the agent says that it runs some other build.ShutdownInProgressException
- if the agent says that it is in the shutdown process.AgentTimeoutException
- if the agent didn't get this command because of timeoutTeamCityRuntimeException
- if the agent report some other error.
-
stopBuild
boolean stopBuild(long buildId)
Send stop build command to agent.- Returns:
- true if agent confirms build stopping.
- Throws:
AgentTimeoutException
- if the agent didn't get this command because of timeout.TeamCityRuntimeException
- in case of any other errors.
-
upgrade
boolean upgrade(Action<Boolean> callback)
Sends upgrade command on agent- Parameters:
callback
- will be called with true if upgrade was accepted by agent.
-
getCustomHandler
<T> T getCustomHandler(Class<T> tClass)
Extension point allowing to send custom commands to agent.
-
getProtocolDescription
@NotNull String getProtocolDescription()
-
getType
@NotNull String getType()
It's different fromgetProtocolDescription()
in a way that the returned value will not change in the future and can be used to determine type of the connection.
-
dispose
void dispose()
Close this connection.
-
setListener
void setListener(RemoteAgentConnection.Listener listener)
-
updateAgentInfo
void updateAgentInfo(int agentId, @NotNull String agentName)
Updates information about the agent in the connection- Parameters:
agentId
-agentName
-
-
isMultiNodeAware
default boolean isMultiNodeAware()
- Returns:
- true if this connection can be used on any node and false if it can be used only on the node which manages agents
-
-