- 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 abstract java.lang.StringcreateServerVersion()Gets the server version.protected abstract java.net.URLcreateShaURL(ClientInfo clientInfo)Creates the URL for the SHA256 file.protected abstract java.lang.StringcreateUpdateExecutor(ClientInfo clientInfo)Creates the name of the update executor.protected abstract java.net.URLcreateZipURL(ClientInfo clientInfo)Creates the URL for the ZIP file.protected longdetermineDownloadSize(java.net.URL zipURL)Determines the download size of the ZIP file.protected java.lang.StringdetermineShaHash(java.net.URL shaURL)Determines the SHA hash.UpdateInfogetInfo(ClientInfo clientInfo)Gets the info how to download and install the update.java.lang.StringgetUpdateURL()Gets the update base URL.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
-
getUpdateURL
public java.lang.String getUpdateURL()
Gets the update base URL.- Returns:
- the url
-
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
-
createServerVersion
protected abstract java.lang.String createServerVersion()
Gets the server version.- Returns:
- the version
-
createUpdateExecutor
protected abstract java.lang.String createUpdateExecutor(ClientInfo clientInfo)
Creates the name of the update executor.- Parameters:
clientInfo- the client info- Returns:
- the executor name
-
createZipURL
protected abstract java.net.URL createZipURL(ClientInfo clientInfo)
Creates the URL for the ZIP file.- Parameters:
clientInfo- the client info- Returns:
- the URL
-
createShaURL
protected abstract java.net.URL createShaURL(ClientInfo clientInfo)
Creates the URL for the SHA256 file.- Parameters:
clientInfo- the client info- Returns:
- the URL
-
determineShaHash
protected java.lang.String determineShaHash(java.net.URL shaURL) throws java.io.IOExceptionDetermines the SHA hash.- Parameters:
shaURL- the SHA file URL- 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
-
-