public class ClientDownloadTCP extends ClientDownload
client, DIFF_PERCENT_PROGRESS, DIFF_TIME_PROGRESS_MILLIS, dirStorage, filename, hash512, hostList, lastPercentProgress, lastTimeProgress, logger, MAX_PARTIAL_SIZE, offsetsPending, offsetsToAsk, partsSubdir, ratioUpdater, size, sockList, stop, success, tracker| Constructor and Description |
|---|
ClientDownloadTCP(java.lang.String filename,
java.util.List<HostItem> hostList,
java.lang.String partsSubdir,
java.lang.String dirStorage,
Logger logger,
HostItem client,
HostItem tracker)
Constructor with parameters: filename, list of hosts, parts subdirectory and dirStorage
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
closeHostItemSocket(HostItem hostItem)
Close HostItem socket
|
protected ClientDownloadPart |
createDownloadPart(HostItem hostItem)
Create a clientDownloadPart
|
protected <T extends Payload> |
createProtocolP2PPacket(T payload)
Create packets
|
protected java.lang.Object |
getHostItemSocket(HostItem hostItem)
Getter for HostItem socket
|
protected void |
writeLog(java.lang.Exception e,
LogLevel logLevel)
Implementation of writeLog
|
protected void |
writeLog(java.lang.String text,
LogLevel logLevel)
Implementation of writeLog
|
assignTasks, checkTasksStatus, getHashSum512, getHashSum512, getSuccess, init, initThreads, printProgression, purgeList, reassembleFile, run, sendRatioUpdate, setSize, setStop, stopTaskssendEmptyDirectory, sendEmptyFile, sendInternalError, sendNotATracker, sendNotFound, sendUnknownHostpublic ClientDownloadTCP(java.lang.String filename,
java.util.List<HostItem> hostList,
java.lang.String partsSubdir,
java.lang.String dirStorage,
Logger logger,
HostItem client,
HostItem tracker)
filename - name of file to downloadhostList - list of serverspartsSubdir - directory to store .part filesdirStorage - directory to write assembled filelogger - Loggerclient - HostItem of the applicationtracker - HostItem of the trackerprotected ClientDownloadPart createDownloadPart(HostItem hostItem)
createDownloadPart in class ClientDownloadhostItem - Hostitem of the serverprotected void closeHostItemSocket(HostItem hostItem)
closeHostItemSocket in class ClientDownloadhostItem - HostItemprotected void writeLog(java.lang.String text,
LogLevel logLevel)
writeLog in class ServeErrorstext - Text to loglogLevel - level of loggingprotected void writeLog(java.lang.Exception e,
LogLevel logLevel)
writeLog in class ServeErrorse - exception to loglogLevel - level of loggingprotected <T extends Payload> ProtocolP2PPacket<T> createProtocolP2PPacket(T payload)
createProtocolP2PPacket in class ServeErrorspayload - Payloadprotected java.lang.Object getHostItemSocket(HostItem hostItem) throws java.net.SocketException, java.net.UnknownHostException, java.io.IOException
getHostItemSocket in class ClientDownloadhostItem - HostItemjava.net.SocketExceptionjava.net.UnknownHostExceptionjava.io.IOException