Package jetbrains.buildServer.updates
Class TeamCityUpdater
- java.lang.Object
-
- jetbrains.buildServer.updates.TeamCityUpdater
-
- All Implemented Interfaces:
NewVersionAvailabilityProvider
public class TeamCityUpdater extends Object implements NewVersionAvailabilityProvider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTeamCityUpdater.LogUpdateToAudit
-
Field Summary
Fields Modifier and Type Field Description static LoggerUPDATE_LOGGER
-
Constructor Summary
Constructors Constructor Description TeamCityUpdater(ExecutorServices executors, VersionChecker versionChecker, HttpDownloader httpDownloader, ServerStopPerformer serverRestarter, EventDispatcher<BuildServerListener> events, StartupContext startupContext, SecurityContextEx securityContext, ServerResponsibility serverResponsibility, String currentDirPath, AuditLogFactory auditLogFactory, TeamCityServerStartupScript serverStartupScript, ServerPaths serverPaths)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckForUpdates()Perform an unscheduled check for updatesDategetLastCheckDate()StringgetLastCheckError()StringgetNotSupportedReason()List<UpdateOption>getUpdateOptions()booleanisSupported()Future<Void>prepareForUpdate(AvailableVersion version, String requestedBy)voidsetCurrentVersion(Supplier<ServerVersionInfo> currentVersion)voidsetFreeSpaceProvider(Supplier<Long> freeSpaceProvider)voidsetLogger(Logger logger)CompletableFuture<Void>startUpdate(AvailableVersion version, String superUserToken, String requestedBy)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jetbrains.buildServer.updates.NewVersionAvailabilityProvider
getUpdateOption, getUpdateOption, isUpdateAvailable
-
-
-
-
Field Detail
-
UPDATE_LOGGER
public static final Logger UPDATE_LOGGER
-
-
Constructor Detail
-
TeamCityUpdater
public TeamCityUpdater(@NotNull ExecutorServices executors, @NotNull VersionChecker versionChecker, @NotNull HttpDownloader httpDownloader, @NotNull ServerStopPerformer serverRestarter, @NotNull EventDispatcher<BuildServerListener> events, @NotNull StartupContext startupContext, @NotNull SecurityContextEx securityContext, @NotNull ServerResponsibility serverResponsibility, @NotNull String currentDirPath, @NotNull AuditLogFactory auditLogFactory, @NotNull TeamCityServerStartupScript serverStartupScript, @NotNull ServerPaths serverPaths)
-
-
Method Detail
-
prepareForUpdate
@NotNull public Future<Void> prepareForUpdate(@NotNull AvailableVersion version, @NotNull String requestedBy) throws ServerUpdateException
- Throws:
ServerUpdateException
-
startUpdate
@Nullable public CompletableFuture<Void> startUpdate(@NotNull AvailableVersion version, @NotNull String superUserToken, @NotNull String requestedBy) throws ServerUpdateException
- Parameters:
superUserToken- super user token that will be used to start updated version- Throws:
ServerUpdateException
-
checkForUpdates
public void checkForUpdates()
Description copied from interface:NewVersionAvailabilityProviderPerform an unscheduled check for updates- Specified by:
checkForUpdatesin interfaceNewVersionAvailabilityProvider
-
getLastCheckError
@Nullable public String getLastCheckError()
- Specified by:
getLastCheckErrorin interfaceNewVersionAvailabilityProvider- Returns:
- error when last check failed, null otherwise
-
getLastCheckDate
@Nullable public Date getLastCheckDate()
- Specified by:
getLastCheckDatein interfaceNewVersionAvailabilityProvider- Returns:
- last check timestamp, null if have not checked yet
-
getUpdateOptions
@NotNull public List<UpdateOption> getUpdateOptions()
- Specified by:
getUpdateOptionsin interfaceNewVersionAvailabilityProvider- Returns:
- all available update options
-
getNotSupportedReason
@Nullable public String getNotSupportedReason()
-
isSupported
public boolean isSupported()
-
setLogger
@TestOnly public void setLogger(@NotNull Logger logger)
-
setCurrentVersion
@TestOnly public void setCurrentVersion(@NotNull Supplier<ServerVersionInfo> currentVersion)
-
-