Class RemoteUpdateService
java.lang.Object
lu.kbra.modelizer_next.bootstrap.remote.RemoteUpdateService
HTTP client for fetching update manifests and downloading application updates.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classRepresents an update manifest in the remote update part of the application.static final classRepresents an update release in the remote update part of the application. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddownload(URI downloadUri, Path destination, String displayVersion, ProgressListener listener) Downloads an update artifact.voiddownload(AvailableUpdate update, Path destination, ProgressListener listener) Downloads an update artifact.Fetches the manifest.com.fasterxml.jackson.databind.JsonNodeFetches the manifest JSON.com.fasterxml.jackson.databind.JsonNodeFetches the release manifest JSON.findLatest(UpdateChannel channel, VersionComparator.ParsedVersion currentVersion) Finds the latest that matches the supplied input.findLatestBootstrapInstaller(UpdateChannel channel, VersionComparator.ParsedVersion currentVersion) Finds the latest bootstrap installer that matches the supplied input.
-
Constructor Details
-
RemoteUpdateService
public RemoteUpdateService()
-
-
Method Details
-
download
public void download(AvailableUpdate update, Path destination, ProgressListener listener) throws IOException Downloads an update artifact.- Parameters:
update- update metadata to download or installdestination- destination path that receives generated datalistener- listener notified about progress or changes- Throws:
IOException- if the operation cannot be completed
-
download
public void download(URI downloadUri, Path destination, String displayVersion, ProgressListener listener) throws IOException Downloads an update artifact.- Parameters:
downloadUri- URI of the file to downloaddestination- destination path that receives generated datadisplayVersion- version text shown in progress messageslistener- listener notified about progress or changes- Throws:
IOException- if the operation cannot be completed
-
findLatestBootstrapInstaller
public BootstrapInstallerUpdate findLatestBootstrapInstaller(UpdateChannel channel, VersionComparator.ParsedVersion currentVersion) throws IOException, InterruptedException Finds the latest bootstrap installer that matches the supplied input.- Parameters:
channel- update channel to querycurrentVersion- currently installed version- Returns:
- the matching latest bootstrap installer, or
nullwhen no match exists - Throws:
IOException- if the operation cannot be completedInterruptedException- if the operation cannot be completed
-
fetchManifest
Fetches the manifest.- Returns:
- the fetch manifest result
- Throws:
IOException- if the operation cannot be completedInterruptedException- if the operation cannot be completed
-
fetchReleaseManifestJson
public com.fasterxml.jackson.databind.JsonNode fetchReleaseManifestJson() throws IOException, InterruptedExceptionFetches the release manifest JSON.- Returns:
- the fetch release manifest JSON result
- Throws:
IOException- if the operation cannot be completedInterruptedException- if the operation cannot be completed
-
fetchManifestJson
public com.fasterxml.jackson.databind.JsonNode fetchManifestJson() throws IOException, InterruptedExceptionFetches the manifest JSON.- Returns:
- the fetch manifest JSON result
- Throws:
IOException- if the operation cannot be completedInterruptedException- if the operation cannot be completed
-
findLatest
public AvailableUpdate findLatest(UpdateChannel channel, VersionComparator.ParsedVersion currentVersion) throws IOException, InterruptedException Finds the latest that matches the supplied input.- Parameters:
channel- update channel to querycurrentVersion- currently installed version- Returns:
- the matching latest, or
nullwhen no match exists - Throws:
IOException- if the operation cannot be completedInterruptedException- if the operation cannot be completed
-