JUpdater - 0.5
From LokDoc
| Important note This is the preliminary documentation for version 0.5 . It will replace the old documentation as soon as the new version is released. |
JUpdater is a project which aims to create an utility that allows developers to quickly implement version checks into Java programs. The utility ensure that the user can always be notified of new versions, and easily upgrade to the latest version from within the program, without having to do anything. The utility only downloads the files that are out of date, saving bandwidth.
JUpdater is split into two parts. A small Java client, which can easily be implemented into existing programs. And a PHP server part, which keeps track of the versions and provides the client with all the info it requires. The project is still in its youth, it's functional but expect a bug or two. Any program that is to be updated via JUpdater has to be contained in a jar file. A server that can handle PHP and MySQL is required.
Contents |
License
JUpdater is licensed under the GNU Lesser General Public License. See the file named COPYING, which is included in the download, for the full license. The following is the contents of the file named LICENSE.
JUpdater, a library for adding update checks to Java applications. Copyright (C) 2005-2006 Andreas Launila This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Client
A client has to be implemented into the software that should be updated, see JUpdater - 0.5 - Client for details.
Server
A server is required to provide clients with the latest versions, see JUpdater - 0.5 - Server for details.
Software implementing JUpdater
These are some examples of software that currently implements JUpdater for update checks.
What actually happens
Here's an in depth description of what actually happens behind the scenes when preforming a complete update check. This is not something that one has to know in order to use JUpdater, but it might be nice to know what's actually happening.
- The JUpdater instance's updateJar method is called with the name of the jar file to update and the relevant program name.
- The client opens a connection to the server and sends the program name (via HTTP Post).
- The server establishes a session and responds with the session id and the server's jar URL for that program. From this point on the client and server are in a session and the server therefor remembers what program the client wants to update during all further requests connected to that specific update.
- The client stores the server's response and sends a request for the file list of the server's jar file via XML-RPC. The server responds with a list (taken from the server's database).
- The client calculates MD5 checksums for all local files that it can find (looking in the file list from the server), the rest are given a checksum of 0. The client then sends the result to the server (via XML-RPC).
- The server checks all MD5 checksums against the entries in the database and returns a list of all the files for which the checksums did not match (i.e. a list of all files that are out of date). The following array is sent back for each file that is out of date: [filename, size, correct md5] (all of those things are read from the database).
- If nothing is out of date then the client stops here, otherwise it continues.
- The client requests a changelog from the server (via XML-RPC). The server responds with all changes (as entered by the administrator) made between the client's versions and the latest version.
- The client displays the changes and asks the listener with shouldStartDownloading() if it should download the files.
- If false is returned from the method then the client stops here, otherwise it continues.
- The client starts downloading the out of date files one by one into a temporary storage. For each file the client calculates the MD5 checksum and make sure that it matches, otherwise it tries again (until it's out of tries).
- The client begins to patch once all out of date files are downloaded. It copies the current jar's up to date files into a new jar file and then writes the downloaded files into that jar. Once all is done without errors it replaces the old jar with the up to date jar, hence completing the update.
To do
The following things are on the to do list for the next version. Feel free to add suggestions here.
- [x] Rework the tables to accommodate one changelog per synchronization instead of one per file version (and create a table upgrade script for old versions).
- [x] Add a table designed to quickly look up the latest version of a specified file in a specified program.
- [x] Logging whenever someone 1) checks for updates, 2) actually updates .
- [x] Add a method for automatically locating the jar that should be updated.
- [x] Add a method for restarting the program.
- [x] Add a decent server-side installer.
- [x] Add a quick way to perform the checks by using the manifest's implementation version property.
- [x} Remove the XML-RPC stand alone option, always run stand alone.
- [x] Fix the admin login redirect.
- [x] Add a way for the server to check the client's implemented jupdater client version and protest if it's incompatible.
- [x] Create a script for migrating tables from 0.3 and 0.4 to 0.5 .
- [x] Remember to update the readmes.
- [x] Build an easy way to view log statistics.
- [x] Add some code to preserve backward compatibility with 0.3 and 0.4 clients.
- [x] Make the client support redirected urls.
Legend
- [s] - Suggestion, it that has not yet been fully evaluated.
- [h] - On hold, the feature is on hold until further notice.
- [ ] - Not yet completed, but it will probably be included in the next release.
- [x] - Completed, will be included in the next release.
Changelog
Version 0.4.5
- Substantially improved the performance of both the client and server. The difference is best noticed with JAR files with many (thousands) of files.
Version 0.4.4
- Fixed a bug which created multiple versions when synchronizing a program if the process took too long.
Version 0.4.4a
- Fixed the previously broken install file.
External links
- JUpdater: The home of the JUpdater project.
| To do: JUpdater in wikipedia |
Categories: Todo | Projects | JUpdater

