- java.lang.Object
-
- java.rmi.server.RemoteObject
-
- java.rmi.server.RemoteServer
-
- java.rmi.server.UnicastRemoteObject
-
- org.tentackle.update.AbstractUpdateServiceImpl
-
- All Implemented Interfaces:
java.io.Serializable,java.rmi.Remote,UpdateService
public abstract class AbstractUpdateServiceImpl extends java.rmi.server.UnicastRemoteObject implements UpdateService
Server side update service implementation.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractUpdateServiceImpl(int port, java.lang.String updateURL)Creates an update service object.AbstractUpdateServiceImpl(int port, java.lang.String updateURL, java.rmi.server.RMIClientSocketFactory csf, java.rmi.server.RMIServerSocketFactory ssf)Creates an update service object.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.lang.StringcreateBaseUrlName(ClientInfo clientInfo)Creates the base URL name without extension.protected java.net.URLcreateChecksumURL(ClientInfo clientInfo)Creates the URL for the checksum hash file.protected java.lang.StringcreateUpdateExecutor(ClientInfo clientInfo)Creates the name of the update executor.protected java.net.URLcreateZipURL(ClientInfo clientInfo)Creates the URL for the ZIP file.protected java.lang.StringdetermineChecksumHash(java.net.URL checksumURL)Determines the checksum hash.protected longdetermineDownloadSize(java.net.URL zipURL)Determines the download size of the ZIP file.abstract java.lang.StringgetArtifactName()Gets the artifact name excluding the version.UpdateInfogetInfo(ClientInfo clientInfo)Gets the info how to download and install the update.java.lang.StringgetUpdateURL()Gets the update base URL.abstract java.lang.StringgetVersion()Gets the server version.voidsetUpdateURL(java.lang.String updateURL)Sets the update base URL.-
Methods inherited from class java.rmi.server.UnicastRemoteObject
clone, exportObject, exportObject, exportObject, exportObject, exportObject, unexportObject
-
-
-
-
Constructor Detail
-
AbstractUpdateServiceImpl
public AbstractUpdateServiceImpl(int port, java.lang.String updateURL) throws java.rmi.RemoteExceptionCreates an update service object.- Parameters:
port- the tcp-port, 0 = system defaultupdateURL- the http url where to download the updates from- Throws:
java.rmi.RemoteException- if failed to export object
-
AbstractUpdateServiceImpl
public AbstractUpdateServiceImpl(int port, java.lang.String updateURL, java.rmi.server.RMIClientSocketFactory csf, java.rmi.server.RMIServerSocketFactory ssf) throws java.rmi.RemoteExceptionCreates an update service object.- Parameters:
port- the tcp-port, 0 = system defaultupdateURL- the http url where to download the updates fromcsf- the client socket factoryssf- the server socket factory- Throws:
java.rmi.RemoteException- if failed to export object
-
-
Method Detail
-
getArtifactName
public abstract java.lang.String getArtifactName()
Gets the artifact name excluding the version.Example:
admin-jlink-client
- Returns:
- the artifact name
-
getVersion
public abstract java.lang.String getVersion()
Gets the server version.- Returns:
- the version
-
getUpdateURL
public java.lang.String getUpdateURL()
Gets the update base URL.- Returns:
- the url (with trailing slash!)
-
setUpdateURL
public void setUpdateURL(java.lang.String updateURL)
Sets the update base URL.- Parameters:
updateURL- the url
-
getInfo
public UpdateInfo getInfo(ClientInfo clientInfo) throws java.rmi.RemoteException
Description copied from interface:UpdateServiceGets the info how to download and install the update.- Specified by:
getInfoin interfaceUpdateService- Parameters:
clientInfo- the client application info- Returns:
- the update info
- Throws:
java.rmi.RemoteException- if download info cannot be determined
-
createUpdateExecutor
protected java.lang.String createUpdateExecutor(ClientInfo clientInfo)
Creates the name of the update executor.- Parameters:
clientInfo- the client info- Returns:
- the executor name
-
createZipURL
protected java.net.URL createZipURL(ClientInfo clientInfo)
Creates the URL for the ZIP file.- Parameters:
clientInfo- the client info- Returns:
- the URL
-
createChecksumURL
protected java.net.URL createChecksumURL(ClientInfo clientInfo)
Creates the URL for the checksum hash file.- Parameters:
clientInfo- the client info- Returns:
- the URL
-
createBaseUrlName
protected java.lang.String createBaseUrlName(ClientInfo clientInfo)
Creates the base URL name without extension.- Parameters:
clientInfo- the client info- Returns:
- the URL string
-
determineChecksumHash
protected java.lang.String determineChecksumHash(java.net.URL checksumURL) throws java.io.IOExceptionDetermines the checksum hash.- Parameters:
checksumURL- the URL of the checksum hash file- Returns:
- the hash value
- Throws:
java.io.IOException- if failed
-
determineDownloadSize
protected long determineDownloadSize(java.net.URL zipURL) throws java.io.IOExceptionDetermines 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:
java.io.IOException- if failed
-
-