Class AbstractUpdateServiceImpl

All Implemented Interfaces:
Serializable, Remote, UpdateService

public abstract class AbstractUpdateServiceImpl extends UnicastRemoteObject implements UpdateService
Server side update service implementation.
See Also:
  • Constructor Details

    • AbstractUpdateServiceImpl

      public AbstractUpdateServiceImpl(int port, String updateURL) throws RemoteException
      Creates an update service object.
      Parameters:
      port - the tcp-port, 0 = system default
      updateURL - the http url where to download the updates from
      Throws:
      RemoteException - if failed to export object
    • AbstractUpdateServiceImpl

      public AbstractUpdateServiceImpl(int port, String updateURL, RMIClientSocketFactory csf, RMIServerSocketFactory ssf) throws RemoteException
      Creates an update service object.
      Parameters:
      port - the tcp-port, 0 = system default
      updateURL - the http url where to download the updates from
      csf - the client socket factory
      ssf - the server socket factory
      Throws:
      RemoteException - if failed to export object
  • Method Details

    • getArtifactName

      public abstract String getArtifactName()
      Gets the artifact name excluding the version.

      Example:

      admin-jlink-client
      Returns:
      the artifact name
    • getVersion

      public abstract String getVersion()
      Gets the server version.
      Returns:
      the version
    • getUpdateURL

      public String getUpdateURL()
      Gets the update base URL.
      Returns:
      the url (with trailing slash!)
    • setUpdateURL

      public void setUpdateURL(String updateURL)
      Sets the update base URL.
      Parameters:
      updateURL - the url
    • getUpdateInfo

      public UpdateInfo getUpdateInfo(ClientInfo clientInfo) throws RemoteException
      Description copied from interface: UpdateService
      Gets the info how to download and install the update.
      Specified by:
      getUpdateInfo in interface UpdateService
      Parameters:
      clientInfo - the client application info
      Returns:
      the update info
      Throws:
      RemoteException - if download info cannot be determined
    • 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 version
      zipURL - the URL to download the zip file
      checksumHash - the checksum hash
      size - the download size
      updateExecutor - the filename to execute to perform the update
      Returns:
      the update info
    • createUpdateExecutor

      protected String createUpdateExecutor(ClientInfo clientInfo)
      Creates the name of the update executor.
      Parameters:
      clientInfo - the client info
      Returns:
      the executor name
    • createZipURL

      protected URL createZipURL(ClientInfo clientInfo)
      Creates the URL for the ZIP file.
      Parameters:
      clientInfo - the client info
      Returns:
      the URL
    • createChecksumURL

      protected URL createChecksumURL(ClientInfo clientInfo)
      Creates the URL for the checksum hash file.
      Parameters:
      clientInfo - the client info
      Returns:
      the URL
    • createBaseUrlName

      protected String createBaseUrlName(ClientInfo clientInfo)
      Creates the base URL name without extension.
      Parameters:
      clientInfo - the client info
      Returns:
      the URL string
    • determineChecksumHash

      protected String determineChecksumHash(URL checksumURL) throws IOException
      Determines the checksum hash.
      Parameters:
      checksumURL - the URL of the checksum hash file
      Returns:
      the hash value
      Throws:
      IOException - if failed
    • determineDownloadSize

      protected long determineDownloadSize(URL zipURL) throws IOException
      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