DownloadDb

class DownloadDb

A listing of files within multifiles for management of client-side synchronization with a server-provided set of files.

This class manages one copy of the database for the client, representing the files on the client system, and another copy for the server, representing the files the server has available.

Inheritance diagram

digraph inheritance0d2f4bf5d5 { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "DownloadDb" [URL="acron.core.DownloadDb.html#acron.core.DownloadDb",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "DownloadDb" [arrowsize=0.75,style=""]; }
enum Status

Status of a multifile is stored in this enum Note these values are in increasing order of “doneness” So if you are decompressed, you are complete If you are extracted, you are decompressed and complete

enumerator Status_incomplete = 0
enumerator Status_complete = 1
enumerator Status_decompressed = 2
enumerator Status_extracted = 3
DownloadDb.__init__()

Create a download db with these client and server dbs

Create a download db with these client and server dbs

Primarily used for testing.

DownloadDb.add_client_multifile()
DownloadDb.add_version()

Appends a new version of the file onto the end of the list, or changes the hash associated with a version previously added.

Note: version numbers start at 1

DownloadDb.client_multifile_complete()

A multifile is complete when it is completely downloaded. Note: it may already be decompressed or extracted and it is still complete

DownloadDb.client_multifile_decompressed()
DownloadDb.client_multifile_exists()

Queries from the Launcher

DownloadDb.client_multifile_extracted()
DownloadDb.create_new_server_db()

Server side operations to create multifile records

Used on the server side makefiles to create a new clean server db

DownloadDb.delete_client_multifile()

Operations on multifiles

DownloadDb.expand_client_multifile()
DownloadDb.get_client_multifile_hash()

Ask what version (told with the hash) this multifile is

Return the hash value of the file we are working on

DownloadDb.get_client_multifile_name()
DownloadDb.get_client_multifile_phase()
DownloadDb.get_client_multifile_size()
DownloadDb.get_client_num_multifiles()
DownloadDb.get_hash()

Returns the MD5 hash associated with the indicated version of the indicated file.

DownloadDb.get_num_versions()

Returns the number of versions stored for the indicated file.

DownloadDb.get_server_file_name()
DownloadDb.get_server_multifile_hash()

Return the hash value of the server file

DownloadDb.get_server_multifile_name()
DownloadDb.get_server_multifile_phase()
DownloadDb.get_server_multifile_size()
DownloadDb.get_server_num_files()
DownloadDb.get_server_num_multifiles()
DownloadDb.get_version()

Returns the version number of this particular file, determined by looking up the hash generated from the file. Returns -1 if the version number cannot be determined.

DownloadDb.has_version()

Returns true if the indicated file has version information, false otherwise. Some files recorded in the database may not bother to track versions.

DownloadDb.insert_new_version()

Inserts a new version 1 copy of the file, sliding all the other versions up by one.

DownloadDb.output()
DownloadDb.read_db()
DownloadDb.server_add_file()
DownloadDb.server_add_multifile()
DownloadDb.set_client_multifile_complete()
DownloadDb.set_client_multifile_decompressed()
DownloadDb.set_client_multifile_delta_size()
DownloadDb.set_client_multifile_extracted()
DownloadDb.set_client_multifile_hash()

Set the hash value of file we are working on

DownloadDb.set_client_multifile_incomplete()
DownloadDb.set_client_multifile_size()
DownloadDb.set_num_versions()

Reduces the number of versions of a particular file stored in the ddb by throwing away all versions higher than the indicated index.

DownloadDb.set_server_multifile_hash()

Set the hash value of file we are working on

DownloadDb.set_server_multifile_size()
DownloadDb.write()
DownloadDb.write_client_db()

Write a database file

DownloadDb.write_db()
DownloadDb.write_server_db()
DownloadDb.write_version_map()