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 class
TeamCityUpdater.LogUpdateToAudit
-
Field Summary
Fields Modifier and Type Field Description static Logger
UPDATE_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 void
checkForUpdates()
Perform an unscheduled check for updatesDate
getLastCheckDate()
String
getLastCheckError()
String
getNotSupportedReason()
List<UpdateOption>
getUpdateOptions()
boolean
isSupported()
Future<Void>
prepareForUpdate(AvailableVersion version, String requestedBy)
void
setCurrentVersion(Supplier<ServerVersionInfo> currentVersion)
void
setFreeSpaceProvider(Supplier<Long> freeSpaceProvider)
void
setLogger(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:NewVersionAvailabilityProvider
Perform an unscheduled check for updates- Specified by:
checkForUpdates
in interfaceNewVersionAvailabilityProvider
-
getLastCheckError
@Nullable public String getLastCheckError()
- Specified by:
getLastCheckError
in interfaceNewVersionAvailabilityProvider
- Returns:
- error when last check failed, null otherwise
-
getLastCheckDate
@Nullable public Date getLastCheckDate()
- Specified by:
getLastCheckDate
in interfaceNewVersionAvailabilityProvider
- Returns:
- last check timestamp, null if have not checked yet
-
getUpdateOptions
@NotNull public List<UpdateOption> getUpdateOptions()
- Specified by:
getUpdateOptions
in 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)
-
-