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 booleandismissToolError(String toolId)InstalledToolVersionExfindInstalledTool(String toolVersionId)Find tool by its un-typed id.Collection<InstalledToolVersionEx>getInstalledTools()Collection<InstalledToolVersionEx>getInstalledTools(ToolType toolType)Collection<ToolInstallationError>getNotDismissedInstallationErrors()ToolInstallationSourcegetToolInstallationSource(String toolId)ToolInstallationStatusgetToolInstallationStatus(String toolId)Collection<ToolState>getToolStates()voidinit()InstalledToolVersionExinstallTool(File toolContent, ToolInstallationSource toolInstallationSource)InstalledToolVersionExinstallTool(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".booleanisToolRegistered(File toolOriginalPackage)Checks if tool originated from given package is already registered on serverbooleanisToolRegistered(String toolId)Checks if toolName tool is already registered on servervoidmarkInstallationScheduled(ToolVersion tool, ToolInstallationSource installationSource)voidmarkInstallationSkipped(ToolVersion tool, ToolInstallationSource installationSource, ToolInstallationSkipReason skipReason)voidpersistInstallationError(ToolInstallationError error, ToolInstallationSource installationSource)booleanremoveTool(String toolName)Remove tool, clean all related data from disc (unpacked content, packed agent tool)InstalledToolVersionExupdateTool(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:
installToolin 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:
installToolin interfaceToolsRegistry- Throws:
ToolException
-
isToolRegistered
public boolean isToolRegistered(@NotNull String toolId)Description copied from interface:ReadonlyToolsRegistryChecks if toolName tool is already registered on server- Specified by:
isToolRegisteredin interfaceReadonlyToolsRegistry- Returns:
- true if toolName tool is already registered on server, false otherwise
-
isToolRegistered
public boolean isToolRegistered(@NotNull File toolOriginalPackage)Description copied from interface:ReadonlyToolsRegistryChecks if tool originated from given package is already registered on server- Specified by:
isToolRegisteredin 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:ToolsRegistryRemove tool, clean all related data from disc (unpacked content, packed agent tool)- Specified by:
removeToolin interfaceToolsRegistry- Returns:
- True if tool was actually removed, False otherwise.
-
dismissToolError
public boolean dismissToolError(@NotNull String toolId)- Specified by:
dismissToolErrorin interfaceToolsRegistry
-
getInstalledTools
@NotNull public Collection<InstalledToolVersionEx> getInstalledTools(@NotNull ToolType toolType)
- Specified by:
getInstalledToolsin interfaceReadonlyToolsRegistry
-
findInstalledTool
public InstalledToolVersionEx findInstalledTool(@NotNull String toolVersionId)
Description copied from interface:ReadonlyToolsRegistryFind tool by its un-typed id.- Specified by:
findInstalledToolin interfaceReadonlyToolsRegistry- Returns:
- Tool if found, Null otherwise
-
getNotDismissedInstallationErrors
@NotNull public Collection<ToolInstallationError> getNotDismissedInstallationErrors()
- Specified by:
getNotDismissedInstallationErrorsin interfaceToolsRegistry
-
persistInstallationError
public void persistInstallationError(@NotNull ToolInstallationError error, @NotNull ToolInstallationSource installationSource)- Specified by:
persistInstallationErrorin interfaceToolsRegistry
-
getToolInstallationStatus
@NotNull public ToolInstallationStatus getToolInstallationStatus(@NotNull String toolId)
- Specified by:
getToolInstallationStatusin interfaceToolsRegistry
-
getToolInstallationSource
@NotNull public ToolInstallationSource getToolInstallationSource(@NotNull String toolId)
- Specified by:
getToolInstallationSourcein interfaceToolsRegistry
-
markInstallationScheduled
public void markInstallationScheduled(@NotNull ToolVersion tool, @NotNull ToolInstallationSource installationSource)- Specified by:
markInstallationScheduledin interfaceToolsRegistry
-
markInstallationSkipped
public void markInstallationSkipped(@NotNull ToolVersion tool, @NotNull ToolInstallationSource installationSource, @NotNull ToolInstallationSkipReason skipReason)- Specified by:
markInstallationSkippedin interfaceToolsRegistry
-
updateTool
@Nullable public InstalledToolVersionEx updateTool(@NotNull InstalledToolVersionEx tool, @NotNull ToolInstallationSource toolInstallationSource) throws ToolException
- Specified by:
updateToolin interfaceToolsRegistry- Returns:
- updated installed tool entity or null if tool was actually deleted
- Throws:
ToolException
-
getInstalledTools
@NotNull public Collection<InstalledToolVersionEx> getInstalledTools()
- Specified by:
getInstalledToolsin interfaceReadonlyToolsRegistry
-
getToolStates
@NotNull public Collection<ToolState> getToolStates()
- Specified by:
getToolStatesin interfaceToolsRegistry
-
-