Class ServerToolRegistryImpl
- java.lang.Object
-
- jetbrains.buildServer.tools.installed.ServerToolRegistryImpl
-
- All Implemented Interfaces:
ReadonlyToolsRegistry
,ToolsRegistry
public class ServerToolRegistryImpl extends Object implements ToolsRegistry
-
-
Constructor Summary
Constructors Constructor Description ServerToolRegistryImpl(ServerToolProviders toolProviders, ToolPaths paths, AgentPluginPacker agentPluginPacker, EventDispatcher<ToolEventsListener> dispatcher, ToolsState toolsState, ToolFreeDiskSpaceValidator toolFreeDiskSpaceValidator, ArchiveExtractorManager archiveExtractorManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
dismissToolError(String toolId)
InstalledToolVersionEx
findInstalledTool(String toolVersionId)
Find tool by its un-typed id.Collection<InstalledToolVersionEx>
getInstalledTools()
Collection<InstalledToolVersionEx>
getInstalledTools(ToolType toolType)
Collection<ToolInstallationError>
getNotDismissedInstallationErrors()
ToolInstallationSource
getToolInstallationSource(String toolId)
ToolInstallationStatus
getToolInstallationStatus(String toolId)
Collection<ToolState>
getToolStates()
void
init()
InstalledToolVersionEx
installTool(File toolContent, ToolInstallationSource toolInstallationSource)
InstalledToolVersionEx
installTool(ToolVersion toolVersion, File toolContent, ToolInstallationSource toolInstallationSource)
Installs tool, including: copying (overriding if already there) tool archive in "/plugins/.tools", unpacking it in "/system/cashes/tools.unpacked", repacking it as ZIP in "/system/cashes/agentTools", saving description in "/system/caches/tools/installedToolsState.xml".boolean
isToolRegistered(File toolOriginalPackage)
Checks if tool originated from given package is already registered on serverboolean
isToolRegistered(String toolId)
Checks if toolName tool is already registered on servervoid
markInstallationScheduled(ToolVersion tool, ToolInstallationSource installationSource)
void
markInstallationSkipped(ToolVersion tool, ToolInstallationSource installationSource, ToolInstallationSkipReason skipReason)
void
persistInstallationError(ToolInstallationError error, ToolInstallationSource installationSource)
boolean
removeTool(String toolName)
Remove tool, clean all related data from disc (unpacked content, packed agent tool)InstalledToolVersionEx
updateTool(InstalledToolVersionEx tool, ToolInstallationSource toolInstallationSource)
-
-
-
Constructor Detail
-
ServerToolRegistryImpl
public ServerToolRegistryImpl(@NotNull ServerToolProviders toolProviders, @NotNull ToolPaths paths, @NotNull AgentPluginPacker agentPluginPacker, @NotNull EventDispatcher<ToolEventsListener> dispatcher, @NotNull ToolsState toolsState, @NotNull ToolFreeDiskSpaceValidator toolFreeDiskSpaceValidator, @NotNull ArchiveExtractorManager archiveExtractorManager)
-
-
Method Detail
-
init
public void init()
-
installTool
@NotNull public InstalledToolVersionEx installTool(@NotNull File toolContent, @NotNull ToolInstallationSource toolInstallationSource) throws ToolException
- Specified by:
installTool
in interfaceToolsRegistry
- Throws:
ToolException
-
installTool
@NotNull public InstalledToolVersionEx installTool(@NotNull ToolVersion toolVersion, @NotNull File toolContent, @NotNull ToolInstallationSource toolInstallationSource) throws ToolException
Installs tool, including: copying (overriding if already there) tool archive in "/plugins/.tools", unpacking it in "/system/cashes/tools.unpacked", repacking it as ZIP in "/system/cashes/agentTools", saving description in "/system/caches/tools/installedToolsState.xml".- Specified by:
installTool
in interfaceToolsRegistry
- Throws:
ToolException
-
isToolRegistered
public boolean isToolRegistered(@NotNull String toolId)
Description copied from interface:ReadonlyToolsRegistry
Checks if toolName tool is already registered on server- Specified by:
isToolRegistered
in interfaceReadonlyToolsRegistry
- Returns:
- true if toolName tool is already registered on server, false otherwise
-
isToolRegistered
public boolean isToolRegistered(@NotNull File toolOriginalPackage)
Description copied from interface:ReadonlyToolsRegistry
Checks if tool originated from given package is already registered on server- Specified by:
isToolRegistered
in interfaceReadonlyToolsRegistry
- Parameters:
toolOriginalPackage
- origin tool package- Returns:
- true if tool based on toolPackage is already registered on server, false otherwise
-
removeTool
public boolean removeTool(@NotNull String toolName)
Description copied from interface:ToolsRegistry
Remove tool, clean all related data from disc (unpacked content, packed agent tool)- Specified by:
removeTool
in interfaceToolsRegistry
- Returns:
- True if tool was actually removed, False otherwise.
-
dismissToolError
public boolean dismissToolError(@NotNull String toolId)
- Specified by:
dismissToolError
in interfaceToolsRegistry
-
getInstalledTools
@NotNull public Collection<InstalledToolVersionEx> getInstalledTools(@NotNull ToolType toolType)
- Specified by:
getInstalledTools
in interfaceReadonlyToolsRegistry
-
findInstalledTool
public InstalledToolVersionEx findInstalledTool(@NotNull String toolVersionId)
Description copied from interface:ReadonlyToolsRegistry
Find tool by its un-typed id.- Specified by:
findInstalledTool
in interfaceReadonlyToolsRegistry
- Returns:
- Tool if found, Null otherwise
-
getNotDismissedInstallationErrors
@NotNull public Collection<ToolInstallationError> getNotDismissedInstallationErrors()
- Specified by:
getNotDismissedInstallationErrors
in interfaceToolsRegistry
-
persistInstallationError
public void persistInstallationError(@NotNull ToolInstallationError error, @NotNull ToolInstallationSource installationSource)
- Specified by:
persistInstallationError
in interfaceToolsRegistry
-
getToolInstallationStatus
@NotNull public ToolInstallationStatus getToolInstallationStatus(@NotNull String toolId)
- Specified by:
getToolInstallationStatus
in interfaceToolsRegistry
-
getToolInstallationSource
@NotNull public ToolInstallationSource getToolInstallationSource(@NotNull String toolId)
- Specified by:
getToolInstallationSource
in interfaceToolsRegistry
-
markInstallationScheduled
public void markInstallationScheduled(@NotNull ToolVersion tool, @NotNull ToolInstallationSource installationSource)
- Specified by:
markInstallationScheduled
in interfaceToolsRegistry
-
markInstallationSkipped
public void markInstallationSkipped(@NotNull ToolVersion tool, @NotNull ToolInstallationSource installationSource, @NotNull ToolInstallationSkipReason skipReason)
- Specified by:
markInstallationSkipped
in interfaceToolsRegistry
-
updateTool
@Nullable public InstalledToolVersionEx updateTool(@NotNull InstalledToolVersionEx tool, @NotNull ToolInstallationSource toolInstallationSource) throws ToolException
- Specified by:
updateTool
in interfaceToolsRegistry
- Returns:
- updated installed tool entity or null if tool was actually deleted
- Throws:
ToolException
-
getInstalledTools
@NotNull public Collection<InstalledToolVersionEx> getInstalledTools()
- Specified by:
getInstalledTools
in interfaceReadonlyToolsRegistry
-
getToolStates
@NotNull public Collection<ToolState> getToolStates()
- Specified by:
getToolStates
in interfaceToolsRegistry
-
-