Class AbstractUpdateServiceImpl
java.lang.Object
org.tentackle.update.AbstractUpdateServiceImpl
- All Implemented Interfaces:
Remote, UpdateService
Server side update service implementation.
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractUpdateServiceImpl(String updateURL) Creates an update service object. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringcreateBaseUrlName(ClientInfo clientInfo) Creates the base URL name without extension.protected URLcreateChecksumURL(ClientInfo clientInfo) Creates the URL for the checksum hash file.protected StringcreateUpdateExecutor(ClientInfo clientInfo) Creates the name of the update executor.protected UpdateInfocreateUpdateInfo(String version, URL zipURL, String checksumHash, long size, String updateExecutor) Creates the update info to be returned to the client.protected URLcreateZipURL(ClientInfo clientInfo) Creates the URL for the ZIP file.protected StringdetermineChecksumHash(URL checksumURL) Determines the checksum hash.protected longdetermineDownloadSize(URL zipURL) Determines the download size of the ZIP file.abstract StringGets the artifact name excluding the version.getUpdateInfo(ClientInfo clientInfo) Gets the info, how to download and install the update.Gets the update base URL.abstract StringGets the server version.voidsetUpdateURL(String updateURL) Sets the update base URL.
-
Constructor Details
-
AbstractUpdateServiceImpl
Creates an update service object.- Parameters:
updateURL- the http url where to download the updates from
-
-
Method Details
-
getArtifactName
Gets the artifact name excluding the version.Example:
admin-jlink-client
- Returns:
- the artifact name
-
getVersion
-
getUpdateURL
-
setUpdateURL
Sets the update base URL.- Parameters:
updateURL- the url
-
getUpdateInfo
Description copied from interface:UpdateServiceGets the info, how to download and install the update.- Specified by:
getUpdateInfoin interfaceUpdateService- Parameters:
clientInfo- the client application info- Returns:
- the update info
-
createUpdateInfo
protected UpdateInfo createUpdateInfo(String version, URL zipURL, String checksumHash, long size, String updateExecutor) Creates the update info to be returned to the client.- Parameters:
version- the new application versionzipURL- the URL to download the zip filechecksumHash- the checksum hashsize- the download sizeupdateExecutor- the filename to execute to perform the update- Returns:
- the update info
-
createUpdateExecutor
Creates the name of the update executor.- Parameters:
clientInfo- the client info- Returns:
- the executor name
-
createZipURL
Creates the URL for the ZIP file.- Parameters:
clientInfo- the client info- Returns:
- the URL
-
createChecksumURL
Creates the URL for the checksum hash file.- Parameters:
clientInfo- the client info- Returns:
- the URL
-
createBaseUrlName
Creates the base URL name without extension.- Parameters:
clientInfo- the client info- Returns:
- the URL string
-
determineChecksumHash
Determines the checksum hash.- Parameters:
checksumURL- the URL of the checksum hash file- Returns:
- the hash value
- Throws:
IOException- if failed
-
determineDownloadSize
Determines the download size of the ZIP file.- Parameters:
zipURL- the download URL- Returns:
- the size in bytes, -1 if content-length in header response
- Throws:
IOException- if failed
-