diff --git a/README.md b/README.md index bcfccf8..a1c2f6f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,7 @@ # Projet Répartition : Téléchargement FTP P2P +## Documentation +The report asked can be found in [doc/report.pdf](doc/report.pdf). + ## Protocol Documentation of the protocol used can be found in [doc/protocol.md](doc/protocol.md). diff --git a/doc/1.1/classdiagram-Page-1-1.1.svg b/doc/1.1/classdiagram-Page-1-1.1.svg deleted file mode 100644 index d7490c2..0000000 --- a/doc/1.1/classdiagram-Page-1-1.1.svg +++ /dev/null @@ -1,3 +0,0 @@ - - -
remoteException
remoteException
exception
exception
ClientManagementUDP
- String baseDirectory
- int UDPPort
- String host
- DatagramSocket socket
- String baseDirectory...
+ ClientManagementUDP(String baseDirectory, String host, int UDPPort)+ void run()+ void download(String filename) throws EmptyFile, NotFound, InternalError, UnknownHostException,IoException, TransmissionError, ProtocolError, VersionError, SizeError, InternalRemoteError,ProtocolRemoteError, VersionRemoteError+ String[] listDirectory() throws EmptyDirectory, InternalError, UnknownHostException, IOException,TransmissionError, ProtocolError, VersionError, SizeError, InternalRemoteError,ProtocolRemoteError, VersionRemoteErrorServerManagementUDP- String[] fileList- String baseDirectory- int UDPPort- DatagramSocket socket+ ServerManagementUDP(String baseDirectory, int UDPPort)+ void run()- void initFileList()- void sendInternalError(ProtocolP2PDatagram pd)ServerP2P- int port- String directory +void main()
Runnable
Run...
ClientP2P- String host- int port- String directory+ void main()

java.net.DatagramSocket


java.net.DatagramSocket
java.net.SocketException
java.net.SocketException
java.nio.file.Paths
java.nio.file.Paths
java.nio.file.Files
java.nio.file.Files
java.util.Arrays
java.util.Arrays
InternalError
InternalError
ProtocolError
ProtocolError
SizeError
SizeError
TransmissionError
TransmissionError
VersionError
VersionError
EmptyDirectory
EmptyDirectory
EmptyFile
EmptyFile
InternalRemoteError
InternalRemoteError
NotFound
NotFound
ProtocolRemoteError
ProtocolRemoteError
VersionRemoteError
VersionRemoteError
java.net.InetAddress
java.net.InetAddress
java.io.IOException
java.io.IOException
java.util.Scanner
java.util.Scanner
java.io.File
java.io.File
java.net.UnknownHostException
java.net.UnknownHostException
Directories+ String projectName+ String dataHomeDirectory+ String os+ Directories(String projectName)- setDataHomeDirectory()+ void getDataHomeDirectory()- void openDataHomeDirectory()+ void askOpenDataHomeDirectory()+ Directories(String projectName)- setDataHomeDirectory()+ void getDataHomeDirectory()- void openDataHomeDirectory()+ void askOpenDataHomeDirectory()
\ No newline at end of file diff --git a/doc/1.1/classdiagram-Page-2-1.1.svg b/doc/1.1/classdiagram-Page-2-1.1.svg deleted file mode 100644 index 495c35e..0000000 --- a/doc/1.1/classdiagram-Page-2-1.1.svg +++ /dev/null @@ -1,3 +0,0 @@ - - -
remoteException
remoteException
exception
exception
InternalError
InternalError
ProtocolError
ProtocolError
SizeError
SizeError
TransmissionError
TransmissionError
VersionError
VersionError
EmptyDirectory
EmptyDirectory
EmptyFile
EmptyFile
InternalRemoteError
InternalRemoteError
NotFound
NotFound
ProtocolRemoteError
ProtocolRemoteError
VersionRemoteError
VersionRemoteError
CodeType
CodeType
RequestResponseCode+ final CodeType codeType~ final static int RRCODE_POSITION = 1;- RequestResponseCode (CodeType codeType, byte codeValue)~ static RequestResponseCode fromCode(byte code) throws ProtocolErrorProtocolP2PDatagram- final static byte PROTOCOL_VERSION = 0x11- final static int VERSION_POSITON = 0- byte version- Payload payload- InetAddress hostR- int portR+ ProtocolP2PDatagram(Payload payload)+ void send(DatagramSocket socket, String host, int port)throws InternalError, UnknownHostException,IOException+ void send(DatagramSocket socket,ProtocolP2PDatagram received) throws InternalError,IOException~ void sendResponse(DatagramSocket socket,InetAddress host, int port) throws InternalError,IOException+ static ProtocolP2PDatagram receive(DatagramSocket socket)throws EmptyFile, NotFound, EmptyDirectory, InternalRemoteError,VersionRemoteError, ProtocolRemoteError, TransmissionError,ProtocolError, VersionError, InternalError, SizeError, IOExceptionBytesArraysTools+ static void write(byte[] array, int start, int value)+ static void write(byte[] array, int start, long value)+ static int readInt(byte[], int start)+ static long readLong(byte[], int start)Payload~ RequestResponseCode requestResponseCode~ final static int PAYLOAD_SIZE_POSITION = 4~ final static int PAYLOAD_START_POSITION = 8;+Payload(RequestResponseCode requestResponseCode) throws InternalError~ Payload(byte[] datagram) throws SizeError, ProtocolError, InternalError,TransmissionError- void checkRequestResponseCode() throws InternalError~ protected byte[] toDatagram() throws InternalError~ static void setPayloadSize(int size, byte[] datagram) throws InternalError~ static int getPayloadSize(byte[] datagram) throws SizeError+ RequestResponseCode getRequestResponseCode()LoadRequest- String filename+ LoadRequest(String filename) throws InternalError~ LoadRequest(byte[] datagram) throws TransmissionError,SizeError, ProtocolError, InternalError~ byte[] toDatagram() throws InternalError+ String getFilename()FilePart- String filename- long totalSize- long offest- byte[] partialContent+ FilePart(String filename, long totalSize, long offset, byte[] partialContent) throws InternalError~ FilePart(byte[] datagram) throws TransmissionError, SizeError, ProtocolError, InternalError~ byte[] toDatagram() throws InternalError- void setOffset(byte[] datagram) throws SizeError- void setTotalSize(byte[] datagram) throws SizeError- int getFilenameSize(byte[] datagram) throws SizeError, ProtocolError- void setFilename(byte[] datagram) throws ProtocolError, SizeError, InternalError- void setPartialContent(byte[] datagram) throws ProtocolError, SizeError+ byte[] getPartialContent()+ String getFilename()+ long getOffset()+ long getTotalSize()FileList- String[] fileListFileList(String[] fileList) throws InternalError~ FileList(byte[] datagram) throws TransmissionError, SizeError, ProtocolError, InternalError~ byte[] toDatagram() throws InternalError+ String[] getFileList()
\ No newline at end of file diff --git a/doc/1.1/usecase-1.1.svg b/doc/1.1/usecase-1.1.svg deleted file mode 100644 index 9160b70..0000000 --- a/doc/1.1/usecase-1.1.svg +++ /dev/null @@ -1,3 +0,0 @@ - - -
Download
Download
List files
List files
test existence
test existence
Client
Client
Server
Server
\ No newline at end of file diff --git a/doc/Projet_JAVA_P2P_STRI2A_AUGE-HAAS-ROYER.docx b/doc/Projet_JAVA_P2P_STRI2A_AUGE-HAAS-ROYER.docx new file mode 100644 index 0000000..27b7fb4 Binary files /dev/null and b/doc/Projet_JAVA_P2P_STRI2A_AUGE-HAAS-ROYER.docx differ diff --git a/doc/classdiagrams/classe_clientP2P.svg b/doc/classdiagrams/classe_clientP2P.svg new file mode 100644 index 0000000..aa42b07 --- /dev/null +++ b/doc/classdiagrams/classe_clientP2P.svg @@ -0,0 +1,5725 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + clientP2P + + + + + + + + + + -logDir : String = "logs/" + + + -partsDir : String = ".parts/" + + + -loggerServer : Logger + + + -loggerClient : Logger + + + -directories : Directories + + + -tracker : HostItem + + + -server : HostItem + + + -scanner : Scanner + + + ~DEBUG : boolean = false + + + + + +initDirectoriesAndLoggers() : void + + + +ClientP2P(hostnameServer : String, portServer : int, hostnameTracker : String, portTracker : int) + + + -printUsage(serverPortRange : ServerPortRange, trackerPortRange : TrackerPortRange) : void + + + + +main(args : String[]) : void + + + + ClientP2P + + + + + + + + + + +ClientManagementUDP(baseDirectory : String, tracker : HostItem, partsSubdir : String, logger : Logger, client : HostItem) + + + #initDownloader(filename : String) : void + + + #writeLog(text : String, logLevel : LogLevel) : void + + + #writeLog(e : Exception, logLevel : LogLevel) : void + + + #createProtocolP2PPacket(payload : T) : ProtocolP2PPacket<T> + + + #getTrackerSocket() : Object + + + #closeTrackerSocket() : void + + + #getHostItemSocket(hostItem : HostItem) : Object + + + #closeHostItemSocket(hostItem : HostItem) : void + + + ClientManagementUDP + + + + + + + + + + +ClientManagementTCP(baseDirectory : String, tracker : HostItem, partsSubdir : String, logger : Logger, client : HostItem) + + + #initDownloader(filename : String) : void + + + #writeLog(text : String, logLevel : LogLevel) : void + + + #writeLog(e : Exception, logLevel : LogLevel) : void + + + #createProtocolP2PPacket(payload : T) : ProtocolP2PPacket<T> + + + #getTrackerSocket() : Object + + + #closeTrackerSocket() : void + + + #getHostItemSocket(hostItem : HostItem) : Object + + + #closeHostItemSocket(hostItem : HostItem) : void + + + ClientManagementTCP + + + + + + + + + + #baseDirectory : String + + + #partsSubdir : String + + + #hostList : HostItem = new ArrayList<>() + + + #tracker : HostItem + + + #client : HostItem + + + #logger : Logger + + + #downLoader : ClientDownload + + + + +ClientManagement(baseDirectory : String, tracker : HostItem, partsSubdir : String, logger : Logger, client : HostItem) + + + #getTrackerSocket() : Object + + + #closeTrackerSocket() : void + + + +initHostList() : void + + + -computeHashsum(filename : String, h : HashAlgorithm) : byte[] + + + #getHostItemSocket(hostItem : HostItem) : Object + + + #closeHostItemSocket(hostItem : HostItem) : void + + + +listDirectory() : String[] + + + #initDownloader(filename : String) : void + + + +download(filename : String) : void + + + #writeLog(text : String, logLevel : LogLevel) : void + + + #writeLog(e : Exception, logLevel : LogLevel) : void + + + ClientManagement + + + + + + + + + + -scanner : Scanner + + + -list : String[] + + + + +ClientInterfaceCLI(clientManagement : ClientManagement, logger : Logger, scanner : Scanner) + + + +run() : void + + + -initHostList() : boolean + + + -initFileList() : boolean + + + ClientInterfaceCLI + + + + + + + + + + #clientManagement : ClientManagement + + + -logger : Logger + + + + +ClientInterface(clientManagement : ClientManagement, logger : Logger) + + + #writeLog(text : String, logLevel : LogLevel) : void + + + #writeLog(e : Exception, logLevel : LogLevel) : void + + + ClientInterface + + + + + + + + + + +ClientDownloadUDP(filename : String, hostList : List<HostItem>, partsSubdir : String, dirStorage : String, logger : Logger, client : HostItem, tracker : HostItem) + + + #createDownloadPart(hostItem : HostItem) : ClientDownloadPart + + + #writeLog(text : String, logLevel : LogLevel) : void + + + #writeLog(e : Exception, logLevel : LogLevel) : void + + + #createProtocolP2PPacket(payload : T) : ProtocolP2PPacket<T> + + + #getHostItemSocket(hostItem : HostItem) : Object + + + #closeHostItemSocket(hostItem : HostItem) : void + + + ClientDownloadUDP + + + + + + + + + + +ClientDownloadTCP(filename : String, hostList : List<HostItem>, partsSubdir : String, dirStorage : String, logger : Logger, client : HostItem, tracker : HostItem) + + + #createDownloadPart(hostItem : HostItem) : ClientDownloadPart + + + #closeHostItemSocket(hostItem : HostItem) : void + + + #writeLog(text : String, logLevel : LogLevel) : void + + + #writeLog(e : Exception, logLevel : LogLevel) : void + + + #createProtocolP2PPacket(payload : T) : ProtocolP2PPacket<T> + + + #getHostItemSocket(hostItem : HostItem) : Object + + + ClientDownloadTCP + + + + + + + + + + -socket : DatagramSocket + + + + + + +ClientDownloadPartUDP(manager : ClientDownload, filename : String, socket : DatagramSocket, partsSubdir : String, logger : Logger, client : HostItem, server : HostItem) + + + #getSocket() : Object + + + #closeSocket() : void + + + #writeLog(text : String, logLevel : LogLevel) : void + + + #writeLog(e : Exception, logLevel : LogLevel) : void + + + #createProtocolP2PPacket(payload : T) : ProtocolP2PPacket<T> + + + ClientDownloadPartUDP + + + + + + + + + + -socket : Socket + + + + + + +ClientDownloadPartTCP(manager : ClientDownload, filename : String, socket : Socket, partsSubdir : String, logger : Logger, client : HostItem, server : HostItem) + + + #getSocket() : Object + + + #closeSocket() : void + + + #writeLog(text : String, logLevel : LogLevel) : void + + + #writeLog(e : Exception, logLevel : LogLevel) : void + + + #createProtocolP2PPacket(payload : T) : ProtocolP2PPacket<T> + + + ClientDownloadPartTCP + + + + + + + + + + #receivedBytesCount : long + + + #toDoTasks : List<Long> + + + #pendingTasks : List<Long> + + + #tasksDone : List<Long> + + + #tasksListsLock : boolean + + + #stop : boolean + + + #failed : boolean + + + #filename : String + + + #noTask : boolean + + + #partsSubdir : String + + + #MAX_PARTIAL_SIZE : long = 4096 + + + + #manager : ClientDownload + + + #logger : Logger + + + #client : HostItem + + + -server : HostItem + + + + +ClientDownloadPart(manager : ClientDownload, filename : String, partsSubdir : String, logger : Logger, client : HostItem, server : HostItem) + + + +getReceivedBytesCount() : Long + + + +hasFailed() : boolean + + + +setStop() : void + + + +run() : void + + + #closeSocket() : void + + + +getFailed() : List<Long> + + + +getDone() : List<Long> + + + +assignTask(task : Long) : void + + + +doTasks() : void + + + #reqPart(offset : Long) : ProtocolP2PPacket<?> + + + #getSocket() : Object + + + +downloadPart(d : T) : boolean + + + ClientDownloadPart + + + + + + + + + + #hostList : HostItem + + + #filename : String + + + #hash512 : byte[] + + + #sockList : ClientDownloadPart = new ArrayList<ClientDownloadPart>() + + + #ratioUpdater : Map<HostItem, Long> = new HashMap<>() + + + #offsetsToAsk : List<Long> = new ArrayList<Long>() + + + #offsetsPending : List<Long> = new ArrayList<Long>() + + + #stop : boolean + + + #size : long + + + #MAX_PARTIAL_SIZE : long = 4096 + + + + #partsSubdir : String + + + #dirStorage : String + + + #success : boolean = false + + + #logger : Logger + + + #client : HostItem + + + #tracker : HostItem + + + #lastPercentProgress : int + + + #lastTimeProgress : Instant + + + ~DIFF_TIME_PROGRESS_MILLIS : int = 2000 + + + + ~DIFF_PERCENT_PROGRESS : int = 5 + + + + + +ClientDownload(filename : String, hostList : List<HostItem>, partsSubdir : String, dirStorage : String, logger : Logger, client : HostItem, tracker : HostItem) + + + +getHashSum512() : byte[] + + + #stopTasks() : void + + + +setStop() : void + + + #assignTasks() : void + + + #createDownloadPart(hostItem : HostItem) : ClientDownloadPart + + + #initThreads() : void + + + #checkTasksStatus() : void + + + +sendRatioUpdate() : void + + + #getHashSum512(hostItem : HostItem) : byte[] + + + #purgeList() : void + + + #reassembleFile() : void + + + #setSize() : void + + + #closeHostItemSocket(hostItem : HostItem) : void + + + +run() : void + + + #printProgression() : void + + + #init() : void + + + #getHostItemSocket(hostItem : HostItem) : Object + + + ClientDownload + + + #manager + + + 1 + + + #clientManagement + + + 1 + + + #sockList + + + * + + + #downLoader + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/classdiagrams/classe_exceptions.svg b/doc/classdiagrams/classe_exceptions.svg new file mode 100644 index 0000000..cf17e1e --- /dev/null +++ b/doc/classdiagrams/classe_exceptions.svg @@ -0,0 +1,3356 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + remoteException + + + + + + + + + + localException + + + + + + + + + + exception + + + + + + + + + + -serialVersionUID : long = 12L + + + + + + VersionRemoteError + + + + + + + + + + -serialVersionUID : long = 12L + + + + + + UnknownHost + + + + + + + + + + -serialVersionUID : long = 12L + + + + + + ProtocolRemoteError + + + + + + + + + + -serialVersionUID : long = 12L + + + + + + NotFound + + + + + + + + + + -serialVersionUID : long = 12L + + + + + + NotATracker + + + + + + + + + + -serialVersionUID : long = 12L + + + + + + InternalRemoteError + + + + + + + + + + -serialVersionUID : long = 12L + + + + + + EmptyFile + + + + + + + + + + -serialVersionUID : long = 12L + + + + + + EmptyDirectory + + + + + + + + + + -serialVersionUID : long = 12L + + + + + + VersionError + + + + + + + + + + -serialVersionUID : long = 12L + + + + + + TransmissionError + + + + + + + + + + -serialVersionUID : long = 12L + + + + + + SocketClosed + + + + + + + + + + -serialVersionUID : long = 12L + + + + + + SizeError + + + + + + + + + + -serialVersionUID : long = 12L + + + + + + ProtocolError + + + + + + + + + + -serialVersionUID : long = 12L + + + + + + InternalError + + + + + + + + + + -serialVersionUID : long = 12L + + + + + + RemoteException + + + + + + + + + + -serialVersionUID : long = 13L + + + + + + LocalException + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/classdiagrams/classe_gui.svg b/doc/classdiagrams/classe_gui.svg new file mode 100644 index 0000000..71e4252 --- /dev/null +++ b/doc/classdiagrams/classe_gui.svg @@ -0,0 +1,2600 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + gui + + + + + + + + + + -serialVersionUID : long = 13L + + + + + + + +MainWindow() + + + MainWindow + + + + + + + + + + +main(args : String[]) : void + + + + + + Gui + + + + + + + + + + -jLabel1 : JLabel + + + -jToggleButton1 : JToggleButton + + + -message : String + + + -serialVersionUID : long = 13L + + + + + +ErrorFrame(message : String) + + + -initComponents() : void + + + -jToggleButton1ActionPerformed(evt : ActionEvent) : void + + + ErrorFrame + + + + + + + + + + -jButton1 : JButton + + + -jButton2 : JButton + + + -jLabel1 : JLabel + + + -jList1 : JList<String> + + + -jScrollPane1 : JScrollPane + + + -serialVersionUID : long = 13L + + + + -listFilesToDownload : String[] + + + -clientManagement : ClientManagement + + + -logger : Logger + + + -smtcp : ServerManagementTCP + + + -smudp : ServerManagementUDP + + + + +DownloadSelectionGen(listFilesToDownload : String[], clientManagement : ClientManagement, logger : Logger, smtcp : ServerManagementTCP, smudp : ServerManagementUDP) + + + -initComponents() : void + + + -jButton1ActionPerformed(evt : ActionEvent) : void + + + -jButton2ActionPerformed(evt : ActionEvent) : void + + + DownloadSelectionGen + + + + + + + + + + -serialVersionUID : long = 13L + + + + + + -fileToDownload : String + + + -clientManagement : ClientManagement + + + -logger : Logger + + + -smtcp : ServerManagementTCP + + + -smudp : ServerManagementUDP + + + + +DownloadFileGUI(fileToDownload : String, clientManagement : ClientManagement, logger : Logger, smtcp : ServerManagementTCP, smudp : ServerManagementUDP) + + + +download() : void + + + DownloadFileGUI + + + + + + + + + + -logDir : String = "logs/" + + + -partsDir : String = ".parts/" + + + -loggerServer : Logger + + + -loggerClient : Logger + + + -directories : Directories + + + -tracker : HostItem + + + -server : HostItem + + + ~DEBUG : boolean = false + + + + -hostnameServer : String + + + -hostnameTracker : String + + + -portServer : int + + + -portTracker : int + + + -protocolP2P : String + + + + +initDirectoriesAndLoggers() : void + + + +ClientP2PGUI(hostnameServer : String, portServer : int, hostnameTracker : String, portTracker : int, protocolP2P : String) + + + +connect() : void + + + ClientP2PGUI + + + + + + + + + + ~loggerC : Logger + + + -smtcp : ServerManagementTCP + + + -smudp : ServerManagementUDP + + + + +ClientInterfaceGUI(clientManagement : ClientManagement, logger : Logger, smtcp : ServerManagementTCP, smudp : ServerManagementUDP) + + + +run() : void + + + -initHostList() : boolean + + + ClientInterfaceGUI + + + + + + + + + + -jButton1 : JButton + + + -jComboBox1 : JComboBox<String> + + + -jLabel1 : JLabel + + + -jLabel2 : JLabel + + + -jLabel3 : JLabel + + + -jLabel4 : JLabel + + + -jLabel5 : JLabel + + + -jLabel6 : JLabel + + + -jTextField1 : JTextField + + + -jTextField2 : JTextField + + + -jTextField3 : JTextField + + + -jTextField4 : JTextField + + + -serialVersionUID : long = 13L + + + + + +ArgumentsGen() + + + -initComponents() : void + + + -jTextField1ActionPerformed(evt : ActionEvent) : void + + + -jTextField2ActionPerformed(evt : ActionEvent) : void + + + -jButton1ActionPerformed(evt : ActionEvent) : void + + + ArgumentsGen + + + diff --git a/doc/classdiagrams/classe_protocolP2P.svg b/doc/classdiagrams/classe_protocolP2P.svg new file mode 100644 index 0000000..87c2c65 --- /dev/null +++ b/doc/classdiagrams/classe_protocolP2P.svg @@ -0,0 +1,9195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + protocolP2P + + + + + + + + + + -client : HostItem + + + -server : HostItem + + + -dataSize : long + + + -DATA_SIZE_POSITION : int = PAYLOAD_START_POSITION + + + + -SERVER_PORT_START_POSITION : int = DATA_SIZE_POSITION + 8 + + + + -CLIENT_PORT_START_POSITION : int = SERVER_PORT_START_POSITION + 2 + + + + -HOSTNAMES_START_POSITION : int = CLIENT_PORT_START_POSITION + 2 + + + + + +UpdateRatio(client : HostItem, server : HostItem, dataSize : long) + + + #UpdateRatio(packet : byte[]) + + + #toPacket() : byte[] + + + UpdateRatio + + + + + + + + + + -hostItem : HostItem + + + -HOSTNAME_START_POSITION : int = PAYLOAD_START_POSITION + 2 + + + + + +Unregister(hostItem : HostItem) + + + #Unregister(packet : byte[]) + + + #toPacket() : byte[] + + + Unregister + + + + + + + + + + -filename : String + + + -totalSize : long + + + -TOTAL_SIZE_POSITION : int = PAYLOAD_START_POSITION + + + + -FILENAME_POSITION : int = TOTAL_SIZE_POSITION + 8 + + + + + +SizeResponse(filename : String, totalSize : long) + + + #SizeResponse(packet : byte[]) + + + #toPacket() : byte[] + + + SizeResponse + + + + + + + + + + -filename : String + + + + + + +SizeRequest(filename : String) + + + #SizeRequest(packet : byte[]) + + + #toPacket() : byte[] + + + SizeRequest + + + + + + + + + + +codeType : CodeType + + + +codeValue : byte + + + #RRCODE_POSITION : int = 1 + + + + -BY_CODE : Map<Byte, RequestResponseCode> = new HashMap<>() + + + + + -RequestResponseCode(codeType : CodeType, codeValue : byte) + + + #fromCode(code : byte) : RequestResponseCode + + + + + LIST_REQUEST + + + LOAD_REQUEST + + + HASH_REQUEST + + + DISCOVER_REQUEST + + + REGISTER + + + UNREGISTER + + + RATIO_REQUEST + + + UPDATE_RATIO + + + SIZE_REQUEST + + + LIST_RESPONSE + + + LOAD_RESPONSE + + + HASH_RESPONSE + + + DISCOVER_RESPONSE + + + RATIO_RESPONSE + + + DENIED + + + SIZE_RESPONSE + + + VERSION_ERROR + + + PROTOCOL_ERROR + + + INTERNAL_ERROR + + + EMPTY_DIRECTORY + + + NOT_FOUND + + + EMPTY_FILE + + + NOT_A_TRACKER + + + UNKNOWN_HOST + + + <<enumeration>> + RequestResponseCode + + + + + + + + + + -hostItem : HostItem + + + -HOSTNAME_START_POSITION : int = PAYLOAD_START_POSITION + 2 + + + + + +Register(hostItem : HostItem) + + + #Register(packet : byte[]) + + + #toPacket() : byte[] + + + Register + + + + + + + + + + -hostItem : HostItem + + + -totalUp : long + + + -totalDown : long + + + -TOTAL_UP_START_POSITION : int = PAYLOAD_START_POSITION + + + + -TOTAL_DOWN_START_POSITION : int = TOTAL_UP_START_POSITION + 8 + + + + -PORT_START_POSITION : int = TOTAL_DOWN_START_POSITION + 8 + + + + -HOSTNAME_START_POSITION : int = PORT_START_POSITION + 2 + + + + + +RatioResponse(hostItem : HostItem, totalUp : long, totalDown : long) + + + #RatioResponse(packet : byte[]) + + + #toPacket() : byte[] + + + RatioResponse + + + + + + + + + + -hostItem : HostItem + + + -HOSTNAME_START_POSITION : int = PAYLOAD_START_POSITION + 2 + + + + + +RatioRequest(hostItem : HostItem) + + + #RatioRequest(packet : byte[]) + + + #toPacket() : byte[] + + + RatioRequest + + + + + + + + + + -CHECKSUM_POSITION : int = 2 + + + + + + -remoteHost : HostItem + + + -responseSocketAddress : SocketAddress + + + -responseSocket : DatagramSocket + + + -requestSocket : DatagramSocket + + + + +ProtocolP2PPacketUDP(payload : T) + + + #send(socket : DatagramSocket) : void + + + #send(socket : DatagramSocket, addr : SocketAddress) : void + + + +sendRequest(socket : Object) : void + + + +ProtocolP2PPacketUDP(socket : Object) + + + +sendResponse(response : U) : void + + + +receiveResponse() : ProtocolP2PPacket<?> + + + -ProtocolP2PPacketUDP(packet : byte[]) + + + -constructPacket(packet : byte[]) : void + + + -constructPacket(packet : byte[], responseSocket : DatagramSocket) : void + + + #toPacket() : byte[] + + + -computeCheckSum(packet : byte[]) : int + + + -setCheckSum(packet : byte[]) : void + + + -checkCheckSum(packet : byte[]) : void + + + +getHostItem() : HostItem + + + ProtocolP2PPacketUDP + + + + + + + + + + -responseSocket : Socket + + + -requestSocket : Socket + + + + +ProtocolP2PPacketTCP(payload : T) + + + #send(socket : Socket) : void + + + +sendRequest(socket : Object) : void + + + +ProtocolP2PPacketTCP(socket : Object) + + + +sendResponse(response : U) : void + + + +receiveResponse() : ProtocolP2PPacket<?> + + + -ProtocolP2PPacketTCP(packet : byte[]) + + + -constructPacket(packet : byte[]) : void + + + -constructPacket(packet : byte[], responseSocket : Socket) : void + + + #toPacket() : byte[] + + + +getHostItem() : HostItem + + + ProtocolP2PPacketTCP + + + + + + + + + + -PROTOCOL_VERSION : byte = 0x12 + + + + + + #VERSION_POSITION : int = 0 + + + + #version : byte + + + #payload : Payload + + + + +ProtocolP2PPacket(payload : T) + + + +sendRequest(socket : Object) : void + + + +sendResponse(response : U) : void + + + +getHostItem() : HostItem + + + +receiveResponse() : ProtocolP2PPacket<?> + + + #ProtocolP2PPacket(socket : Object) + + + #ProtocolP2PPacket(packet : byte[]) + + + #checkProtocolVersion() : void + + + ProtocolP2PPacket + + + + + + + + + + #requestResponseCode : RequestResponseCode + + + #PAYLOAD_SIZE_POSITION : int = 4 + + + + #PAYLOAD_START_POSITION : int = 8 + + + + + +Payload(requestResponseCode : RequestResponseCode) + + + #Payload(packet : byte[]) + + + -checkRequestResponseCode() : void + + + #toPacket() : byte[] + + + #setPayloadSize(size : int, packet : byte[]) : void + + + + #getPayloadSize(packet : byte[]) : int + + + + Payload + + + + + + + + + + -filename : String + + + -maxSizePartialContent : long + + + -offset : long + + + -hostItem : HostItem + + + -OFFSET_POSITION : int = PAYLOAD_START_POSITION + + + + -MAX_SIZE_PARTIAL_CONTENT_POSITION : int = OFFSET_POSITION + 8 + + + + -FILENAME_SIZE_POSITION : int = MAX_SIZE_PARTIAL_CONTENT_POSITION + 8 + + + + -FILENAME_POSITION : int = FILENAME_SIZE_POSITION + 4 + + + + + +LoadRequest(filename : String, offset : long, maxSizePartialContent : long, hostItem : HostItem) + + + #LoadRequest(packet : byte[]) + + + #toPacket() : byte[] + + + LoadRequest + + + + + + + + + + -filename : String + + + -hashes : Map<HashAlgorithm, byte[]> = new HashMap<>() + + + -FILENAME_SIZE_POSITION : int = PAYLOAD_START_POSITION + + + + -FILENAME_POSITION : int = FILENAME_SIZE_POSITION + 4 + + + + + +HashResponse(filename : String, hashes : Map<HashAlgorithm, byte[]>) + + + #HashResponse(packet : byte[]) + + + #toPacket() : byte[] + + + +getHash(hashAlgo : HashAlgorithm) : byte[] + + + HashResponse + + + + + + + + + + -filename : String + + + -algoList : HashAlgorithm[] + + + -FILENAME_SIZE_POSITION : int = PAYLOAD_START_POSITION + + + + -FILENAME_POSITION : int = FILENAME_SIZE_POSITION + 4 + + + + + +HashRequest(filename : String, algoList : HashAlgorithm[]) + + + #HashRequest(packet : byte[]) + + + #toPacket() : byte[] + + + HashRequest + + + + + + + + + + -name : String + + + -BY_NAME : Map<String, HashAlgorithm> = new HashMap<>() + + + + + -HashAlgorithm(name : String) + + + +getName() : String + + + #fromName(name : String) : HashAlgorithm + + + + + SHA512 + + + MD5 + + + <<enumeration>> + HashAlgorithm + + + + + + + + + + -filename : String + + + -offset : long + + + -partialContent : byte[] + + + -OFFSET_POSITION : int = PAYLOAD_START_POSITION + + + + -FILENAME_SIZE_POSITION : int = OFFSET_POSITION + 8 + + + + -FILENAME_POSITION : int = FILENAME_SIZE_POSITION + 4 + + + + + +FilePart(filename : String, offset : long, partialContent : byte[]) + + + #FilePart(packet : byte[]) + + + #toPacket() : byte[] + + + -setOffset(packet : byte[]) : void + + + -getFilenameSize(packet : byte[]) : int + + + -setFilename(packet : byte[]) : void + + + -setPartialContent(packet : byte[]) : void + + + FilePart + + + + + + + + + + -fileList : String[] + + + + + + +FileList(fileList : String[]) + + + #FileList(packet : byte[]) + + + #toPacket() : byte[] + + + FileList + + + + + + + + + + -hostList : HostItem + + + -filename : String + + + -FILENAME_SIZE_POSITION : int = PAYLOAD_START_POSITION + + + + -FILENAME_POSITION : int = FILENAME_SIZE_POSITION + 4 + + + + + +DiscoverResponse(filename : String, hostList : List<HostItem>) + + + #DiscoverResponse(packet : byte[]) + + + #toPacket() : byte[] + + + +getHostList() : List<HostItem> + + + DiscoverResponse + + + + + + + + + + -filename : String + + + + + + +DiscoverRequest(filename : String) + + + #DiscoverRequest(packet : byte[]) + + + #toPacket() : byte[] + + + DiscoverRequest + + + + + + + + + + -filename : String + + + -offset : long + + + -OFFSET_POSITION : int = PAYLOAD_START_POSITION + + + + -FILENAME_POSITION : int = OFFSET_POSITION + 8 + + + + + +Denied(filename : String, offset : long) + + + #Denied(packet : byte[]) + + + #toPacket() : byte[] + + + Denied + + + + + + + + + + REQUEST + + + REQUEST_TRACKER + + + RESPONSE + + + ERROR + + + <<enumeration>> + CodeType + + + + + + + + + T : Payload + + + + + + + + + T : Payload + + + + + + + + + T : Payload + + + -algoList + + + * + + + +codeType + + + 1 + + + #requestResponseCode + + + 1 + + + #payload + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/classdiagrams/classe_serverP2P.svg b/doc/classdiagrams/classe_serverP2P.svg new file mode 100644 index 0000000..64a1fde --- /dev/null +++ b/doc/classdiagrams/classe_serverP2P.svg @@ -0,0 +1,4271 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + serverP2P + + + + + + + + + + -directories : Directories + + + -subdir : String = "seeded/" + + + + -logger : Logger + + + -tracker : HostItem + + + -server : HostItem + + + ~DEBUG : boolean = true + + + + + +ServerP2P(hostnameServer : String, portServer : int, hostnameTracker : String, portTracker : int, isInteractive : boolean) + + + +main(args : String[]) : void + + + + ServerP2P + + + + + + + + + + -socket : DatagramSocket + + + + + + +ServerManagementUDP(baseDirectory : String, server : HostItem, tracker : HostItem, logger : Logger) + + + +run() : void + + + #writeLog(text : String, logLevel : LogLevel) : void + + + #writeLog(e : Exception, logLevel : LogLevel) : void + + + #createProtocolP2PPacket(payload : T) : ProtocolP2PPacket<T> + + + #getTrackerSocket() : Object + + + #closeSocket() : void + + + ServerManagementUDP + + + + + + + + + + -addr : HostItem + + + + + + +ClientHandler(s : Socket) + + + +run() : void + + + -handleClientRequest() : boolean + + + ClientHandler + + + + + + + + + + -socket : ServerSocket + + + + + + +ServerManagementTCP(baseDirectory : String, server : HostItem, tracker : HostItem, logger : Logger) + + + +run() : void + + + #writeLog(text : String, logLevel : LogLevel) : void + + + #writeLog(e : Exception, logLevel : LogLevel) : void + + + #createProtocolP2PPacket(payload : T) : ProtocolP2PPacket<T> + + + #getTrackerSocket() : Object + + + #closeSocket() : void + + + ServerManagementTCP + + + + + + + + + + #stop : boolean + + + #fileListWatcher : FileWatcher + + + #logger : Logger + + + #baseDirectory : String + + + #server : HostItem + + + #tracker : HostItem + + + #punisher : Random = new Random() + + + #ratioWatcher : RatioWatcher + + + + +ServerManagement(baseDirectory : String, server : HostItem, tracker : HostItem, logger : Logger) + + + +setStop() : void + + + #closeSocket() : void + + + +updateFileList() : void + + + #sendListResponse(pd : T) : void + + + #sendHashResponse(pd : T) : void + + + #sendLoadResponse(pd : T) : void + + + #sendSizeResponse(pd : T) : void + + + #getTrackerSocket() : Object + + + #sendUnregisterRequest() : void + + + #handleRequest(pd : T) : void + + + ServerManagement + + + + + + + + + + +RatioWatcherUDP(logger : Logger, millis : long, tracker : HostItem) + + + #writeLog(text : String, logLevel : LogLevel) : void + + + #writeLog(e : Exception, logLevel : LogLevel) : void + + + #createProtocolP2PPacket(payload : T) : ProtocolP2PPacket<T> + + + #getTrackerSocket() : Object + + + #closeTrackerSocket() : void + + + RatioWatcherUDP + + + + + + + + + + +RatioWatcherTCP(logger : Logger, millis : long, tracker : HostItem) + + + #writeLog(text : String, logLevel : LogLevel) : void + + + #writeLog(e : Exception, logLevel : LogLevel) : void + + + #createProtocolP2PPacket(payload : T) : ProtocolP2PPacket<T> + + + #getTrackerSocket() : Object + + + #closeTrackerSocket() : void + + + RatioWatcherTCP + + + + + + + + + + ~punishmentFactor : double = 1.2 + + + + + + #logger : Logger + + + #stop : boolean + + + #time : long + + + #force : boolean + + + #tracker : HostItem + + + #thread : Thread + + + #cachePunishmentProbability : Map<HostItem, Double> = new HashMap<>() + + + #lock : boolean + + + + +RatioWatcher(logger : Logger, millis : long, tracker : HostItem) + + + +run() : void + + + #clean() : void + + + #getPunishmentProbability(application : HostItem) : double + + + +setStop() : void + + + #writeLog(text : String, logLevel : LogLevel) : void + + + #writeLog(e : Exception, logLevel : LogLevel) : void + + + #createProtocolP2PPacket(payload : T) : ProtocolP2PPacket<?> + + + #getTrackerSocket() : Object + + + #closeTrackerSocket() : void + + + RatioWatcher + + + + + + + + + + +FileWatcherUDP(logger : Logger, millis : long, server : HostItem, tracker : HostItem, baseDirectory : String) + + + #writeLog(text : String, logLevel : LogLevel) : void + + + #writeLog(e : Exception, logLevel : LogLevel) : void + + + #registerTracker() : void + + + FileWatcherUDP + + + + + + + + + + +FileWatcherTCP(logger : Logger, millis : long, server : HostItem, tracker : HostItem, baseDirectory : String) + + + #writeLog(text : String, logLevel : LogLevel) : void + + + #writeLog(e : Exception, logLevel : LogLevel) : void + + + #registerTracker() : void + + + FileWatcherTCP + + + + + + + + + + #fileList : String[] = new String[0] + + + #logger : Logger + + + #stop : boolean + + + #time : long + + + #force : boolean + + + #server : HostItem + + + #tracker : HostItem + + + #baseDirectory : String + + + #sha512 : Map<String, byte[]> = new HashMap<>() + + + #thread : Thread + + + + +FileWatcher(logger : Logger, millis : long, server : HostItem, tracker : HostItem, baseDirectory : String) + + + +getSha512Map() : Map<String, byte[]> + + + +trigger() : void + + + +run() : void + + + #registerTracker() : void + + + #updateFileList() : boolean + + + +setStop() : void + + + #initSha512() : void + + + #writeLog(text : String, logLevel : LogLevel) : void + + + #writeLog(e : Exception, logLevel : LogLevel) : void + + + FileWatcher + + + #ratioWatcher + + + 1 + + + -smudp + + + #fileListWatcher + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/classdiagrams/classe_tracker.svg b/doc/classdiagrams/classe_tracker.svg new file mode 100644 index 0000000..5edf986 --- /dev/null +++ b/doc/classdiagrams/classe_tracker.svg @@ -0,0 +1,1879 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + tracker + + + + + + + + + + -socket : DatagramSocket + + + + + + +TrackerManagementUDP(tracker : HostItem, logger : Logger) + + + +run() : void + + + #writeLog(text : String, logLevel : LogLevel) : void + + + #writeLog(e : Exception, logLevel : LogLevel) : void + + + #createProtocolP2PPacket(payload : T) : ProtocolP2PPacket<T> + + + #getHostItemSocket(hostItem : HostItem) : Object + + + #closeHostItemSocket(hostItem : HostItem) : void + + + TrackerManagementUDP + + + + + + + + + + -addr : HostItem + + + + + + +ClientHandler(s : Socket) + + + +run() : void + + + -handleClientRequest() : boolean + + + ClientHandler + + + + + + + + + + -socket : ServerSocket + + + + + + +TrackerManagementTCP(tracker : HostItem, logger : Logger) + + + +run() : void + + + #writeLog(text : String, logLevel : LogLevel) : void + + + #writeLog(e : Exception, logLevel : LogLevel) : void + + + #createProtocolP2PPacket(payload : T) : ProtocolP2PPacket<T> + + + #getHostItemSocket(hostItem : HostItem) : Object + + + #closeHostItemSocket(hostItem : HostItem) : void + + + TrackerManagementTCP + + + + + + + + + + #tracker : HostItem + + + #logger : Logger + + + #hostList : HostItem = new ArrayList<>() + + + #ratioUp : Map<HostItem, Long> = new HashMap<>() + + + #ratioDown : Map<HostItem, Long> = new HashMap<>() + + + #fileList : Map<String, List<HostItem>> = new HashMap<>() + + + #fileSize : Map<String, Long> = new HashMap<>() + + + #stop : boolean + + + #writeLock : AtomicBoolean + + + #readLock : AtomicInteger + + + + +TrackerManagement(tracker : HostItem, logger : Logger) + + + #handleDiscover(pd : T) : void + + + #handleRatio(pd : T) : void + + + #handleListResponse(pd : T, host : HostItem) : void + + + #handleUnregister(pd : T) : void + + + #getHostItemSocket(hostItem : HostItem) : Object + + + #closeHostItemSocket(hostItem : HostItem) : void + + + #handleUpdateRatio(pd : T) : void + + + #handleRegister(pd : T) : void + + + #handleListRequest(pd : T) : void + + + #handleSizeRequest(pd : T) : void + + + #handleRequest(pd : T) : void + + + +setStop() : void + + + TrackerManagement + + + + + + + + + + -tracker : HostItem + + + -directories : Directories + + + -logger : Logger + + + ~DEBUG : boolean = true + + + + + +Tracker(hostname : String, port : int, isInteractive : boolean) + + + +main(args : String[]) : void + + + + Tracker + + + + + + + + + + + + + + + + + + diff --git a/doc/classdiagrams/classe_utils.svg b/doc/classdiagrams/classe_utils.svg new file mode 100644 index 0000000..e35c50a --- /dev/null +++ b/doc/classdiagrams/classe_utils.svg @@ -0,0 +1,3823 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + +TrackerPortRange() + + + TrackerPortRange + + + + + + + + + + +ServerPortRange() + + + ServerPortRange + + + + + + + + + + #writeLog(text : String, logLevel : LogLevel) : void + + + #writeLog(e : Exception, logLevel : LogLevel) : void + + + #createProtocolP2PPacket(payload : T) : ProtocolP2PPacket<?> + + + #sendNotATracker(pd : T) : void + + + #sendInternalError(pd : T) : void + + + #sendNotFound(pd : T) : void + + + #sendEmptyDirectory(pd : T) : void + + + #sendEmptyFile(pd : T) : void + + + #sendUnknownHost(pd : T) : void + + + ServeErrors + + + + + + + + + + +searchByName(filesArray : String[], searchInput : String) : String[] + + + +searchByExtention(filesArray : String[], searchInput : String) : String[] + + + SearchFile + + + + + + + + + + #portMax : int + + + #portMin : int + + + #defaultPort : int + + + #type : String + + + + +PortRange(portMin : int, portMax : int, defaultPort : int, type : String) + + + +isPortInRange(port : int) : boolean + + + +toString() : String + + + PortRange + + + + + + + + + + Error + + + Info + + + Warning + + + Action + + + Debug + + + Progression + + + <<enumeration>> + LogLevel + + + + + + + + + + -logFile : Path + + + -debugMode : boolean + + + + +Logger(logFile : String, debugMode : boolean) + + + +write(text : String, logLevel : LogLevel) : void + + + +write(e : Exception, logLevel : LogLevel) : void + + + +writeTCP(text : String, logLevel : LogLevel) : void + + + +writeTCP(e : Exception, logLevel : LogLevel) : void + + + +writeUDP(text : String, logLevel : LogLevel) : void + + + +writeUDP(e : Exception, logLevel : LogLevel) : void + + + Logger + + + + + + + + + + -hostname : String + + + -port : int + + + -tcpSocket : Socket + + + -udpSocket : DatagramSocket + + + -inetAddress : InetAddress + + + + +HostItem(hostname : String, port : int) + + + +getTCPSocket() : Socket + + + +tryGetTCPSocket() : Socket + + + +closeTCPSocket() : void + + + +getUDPSocket() : DatagramSocket + + + +tryGetUDPSocket() : DatagramSocket + + + +closeUDPSocket() : void + + + +toString() : String + + + +equals(other : Object) : boolean + + + +hashCode() : int + + + +HostItem(s : Socket) + + + HostItem + + + + + + + + + + -projectName : String + + + -dataHomeDirectory : String + + + -os : String + + + + +Directories(projectName : String) + + + -setDataHomeDirectory() : void + + + +createSubdir(subdir : String) : void + + + -openDataHomeDirectory(subdir : String) : void + + + +askOpenDataHomeDirectory(subdir : String, scanner : Scanner) : void + + + Directories + + + + + + + + + + +write(array : byte[], start : int, value : int) : void + + + + + + +write16Bits(array : byte[], start : int, value : int) : void + + + + +write(array : byte[], start : int, value : long) : void + + + + +readInt(array : byte[], start : int) : int + + + + +readInt16Bits(array : byte[], start : int) : int + + + + +readLong(array : byte[], start : int) : long + + + + +cleanStrings(str : String) : String + + + + +write(byteArray : byte[], strArray : String[], start : int, separator : String) : void + + + + +readStringArray(byteArray : byte[], start : int, size : int, separator : String) : String[] + + + + +computeStringArraySize(strArray : String[], separator : String) : int + + + + +write(array : byte[], str : String, start : int) : void + + + + +readString(array : byte[], start : int, size : int) : String + + + + +readString(array : byte[], start : int, endStr : String) : String + + + + +write(dst : byte[], src : byte[], start : int) : void + + + + +readByteArray(src : byte[], start : int, end : int) : byte[] + + + + BytesArrayTools + + + + + + + + + + + + + diff --git a/doc/download_sequence_diagram.drawio b/doc/download_sequence_diagram.drawio new file mode 100644 index 0000000..2014841 --- /dev/null +++ b/doc/download_sequence_diagram.drawio @@ -0,0 +1 @@ +7VxZc6M4EP41rso8ZIrD56PjOJPUZifZ2HPsvMkg26oAYgQ48f761cUl+SCMsTO7nqpJoIGWUH9Sf90t0rJH/usnAsLln9iFXssy3NeWfd2yrJ5l059MsBaCttkVggVBrhCZuWCC/oFSaEhpglwYlW6MMfZiFJaFDg4C6MQlGSAEv5Rvm2Ov3GoIFlATTBzg6dJvyI2XUmoaRn7hFqLFUjbd78gLM+A8LwhOAtley7Ln/J+47INUl7w/WgIXvxRE9rhljwjGsTjyX0fQY0ObDpt47mbL1azfBAZxlQd6MzADptOeOVZv3p4Zl9JwK+AlciyGYeghB8QIB5bsdLxOB4r2P2SHie/dozn0UEDPrkJIkA9jSOgVT4ofc9nVyxLFcBIChz36QhFEZcvY9+iZSQ+pVWNAHyHZueeBMEIz3qpBJQQ6CYnQCj7BSICHSXESs5ZGGSj4rcwY0JWqsvE2uF4fOfLYAzPoXWXWG2EPs+YDzF8oigl+zqDAFM1pH2+AjzyG8K+QuCAAUizhbFJjXgEPLQJ64lB78FfXDSRttoIkhq8FkTTYJ4jpsJE1vUVetVIUrsuT5qWA1PSWZQGkg74UAjk7FpnqHCH0QIKkImD6uwBjngHzDgBj18RL+wB4mV61Z4u7r113+Nf3+7HTj+++DS/NXZixz5h5D5jp1wNNv9cUaCwNNFNCh5K+8Bkvp8dLp1Nzkek2hRedyVzfTUYPX8dPVPo0/uvLeDK9mCMPmh80BBXszoaArkzeUA7aDMcx9ukFGLhDRjWZzMPO865xjHBCHLjbg8aALGC8fwJAt8Rdt1rE+Gj0+vtsks5yAj26+K7K9HeTSWRzjxjRV8zaUhaLgWJT8frymSIbVdSY3d16xBBpeqgZwLpwW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aiRIebVjDl8YgKCDAzcSwOUMCqwwcosER+FDFakcZ4aSGxXca5UqjhDdQpLSPxDx8pAgm4LVFaab8uKEUjrscybnQge5GTWMoOB69P/1+PPfqThMAhQtW1p9x5iKlpj/D0WRSI4pZ5t0eHinwAJwbknnQZlThjhie0bW2biyuzAdTHJmi5XZYrbZZB9bbG4z0obdJRQ9xdjZOPG2ErvCGl81ps7SsVa/b5VMcWnrpmjIDXTV/Yh13YCm6EBuwFQKC903FRbUJMPRCgvW7sjHNKz2aYKfg+yaOl3KUMNv7fyxit+GtpZYCslOt7Q0SmOsY4RgByXP77+w/9shr2Mp7QyOgbz/fEx3XhB/EZaKQ++Zx4ClXuiX7nhThSb3zmyDOgVNdrHkt49QvKmzbr6jIo8Gzro5TQ2cFXOab94IqqyZvV1s82DgfGvSweRv9MxDZsxjXN6IyB74iAbDPJuQhtPsvgsauXJ7hgRGLOh0eVRH4IfqaQKlBw72wyTOMx55BYuiGoh9pSI+R6yKg1j7PoidJYyyZwh0IIWXSDnIHIRIHlTs05fH6+GUb0uTXmbjPtZzvN/K4/YU2ht2rx033k+jsQLuy+a80PfhU4sBn40ot2KQ+DNROGQIm61jDq1IVCxn7N3LGuSzi3ey8+J0ZFZZTvuH2qWlKWq4hJDuyKwEIfuXIWQfG0In+sapbbRLZr209LXiQEjUtn7W/VTEGHzs7FZ1KI6gJE4H1b50elWGUh3a5nNStp5f3eBRp9wxFz7Q4Kl5vOLutJS5lzl6F8bsI0yR7neWIFiIPRySgXgoyraUlLaMsLsCVhmp6OrFJhXp4IuFkrOb3/HNSPbB+d5NIG938/Q0/6saAqX5Xy6xx/8C \ No newline at end of file diff --git a/doc/download_sequence_diagram.svg b/doc/download_sequence_diagram.svg new file mode 100644 index 0000000..a67f522 --- /dev/null +++ b/doc/download_sequence_diagram.svg @@ -0,0 +1,3 @@ + + +
Application2
Application2
Application1
Application1
Application3
Application3
Tracker
Tracker
DISCOVER REQUEST(file1)
DISCOVER REQUES...
DISCOVER RESPONSE (file1, Application2, Application3)
DISCOVER RESPON...
Applications are all already registered successfully into tracker.
Lets start a download of file1 from Application1.
Applications are all already registered successfully into tracker....
SIZE REQUEST(file1)
SIZE REQUEST(fi...
SIZE RESPONSE(file1, sizeof(file1))
SIZE RESPONSE(f...
HASH REQUEST(file1, "SHA512")
HASH REQUEST(fi...
HASH RESPONSE(file1, sha512(file1))
HASH RESPONSE(f...
HASH REQUEST(file1, "SHA512")
HASH REQUEST(fi...
HASH RESPONSE(file1, sha512(file1))
HASH RESPONSE(f...
Application1 is requesting hashsum from each application to ensure applications have
the same file, but an improvement could be to register this sum in the tracker, and ask only the tracker once instead of asking each application.
Application1 is requesting hashsum from each application to ensure applications have...
LOAD PART(0, 512, file1)
LOAD PART(0, 51...
RATIO REQUEST(Application1)
RATIO REQUE...
RATIO RESPONSE(Application1, upratio, downratio)
RATIO RESPONSE(...
Application2 will cache the ratio a few seconds, to avoid asking the tracker
on each LOAD PART.
Here, based on this ratio, Application2 randomly decide to send a DENY to punish Application1. This filepart will be asked again later, and possibly to an other application.
Application2 will cache the ratio a few seconds, to avoid asking the tracker...
DENY(file1, 0)
DENY(file1, 0)
LOAD PART(1024, 512, file1)
LOAD PART(1024,...
RATIO REQUEST(Application1)
RATIO REQUEST(A...
RATIO RESPONSE(Application1, upratio, downratio)
RATIO RESPONSE(...
LOAD RESPONSE(file1, 1024, content(file1,1024, 512))
LOAD RESPONSE(f...
Application1 asks for all the missing fileparts (not represented here).
Application1 compute the hashsum locally and if it matches the received one, send
UPDATE RATIO to tracker.
Application1 asks for all the missing fileparts (not represented here)....
UPDATE RATIO(Application2, <number of bytes sent by Application2>)
UPDATE RATIO(Ap...
UPDATE RATIO(Application3, <number of bytes sent by Application3>)
UPDATE RATIO(Ap...
The download is over. Application1will detect a change in filelist an register the new
file to the tracker.
The download is over. Application1will detect a change in filelist an register the new...
Viewer does not support full SVG 1.1
\ No newline at end of file diff --git a/doc/gui_javap2p.pdf b/doc/gui_javap2p.pdf new file mode 100644 index 0000000..aa25831 Binary files /dev/null and b/doc/gui_javap2p.pdf differ diff --git a/doc/report.pdf b/doc/report.pdf new file mode 100644 index 0000000..db667a4 Binary files /dev/null and b/doc/report.pdf differ diff --git a/doc/tracker_sequence_diagram.drawio b/doc/tracker_sequence_diagram.drawio index 85919a8..8f43447 100644 --- a/doc/tracker_sequence_diagram.drawio +++ b/doc/tracker_sequence_diagram.drawio @@ -1 +1 @@ -7Vtfc+I2EP80zFwfkrEt28BjQkh60+tdEtJrp2/CFqBGWFSI/LlP3xWWDZbAEJ8hZpo8MNJqvZJ2f1rtSkoL9aYvNwLPJr/zmLCW58QvLXTV8rxO2IFfRXhNCX63mxLGgsYpyV0RBvQH0URHUxc0JvMCo+ScSTorEiOeJCSSBRoWgj8X2UacFXud4TGxCIMIM5v6J43lRFNdx1k1/EroeKK77gS6YYijx7Hgi0T31/LQaPmXNk9xJkvzzyc45s9rJNRvoZ7gXKal6UuPMKXaTG3pd9dbWvNxC5LIfT5oD/EQu5E/jLz2yB86Z14q4QmzhdbFg4A5EaHHK18zHcHQZ6q4mLIvdEQYTaB2OSOCTokEfnTFNPl2Rbt8nlBJBjMcqU+fATxAm8gpg5oLRTCoxPCJyOuM4dmcDpe9OkARJFqIOX0i92Se4kZR+UKqnno5Hpasyg4k1qJyVTtLuVMa6TLDQ8Iuc8P1OOOq+4QvJzSXgj/mKFCCRjDGazylTIH7OxExTrAmayS7YMdLzOg4gUoEplhO3baNNtcTEZK8rJG0rW4IB7WJV2DRrZ6vcaPXVUdXn9dAmmF0sobPIGPEemGMc9ErcEBB42NPrCALKz1GYXLuB1YagBXfaRJW2hZWWuji2/AfZYEPtLw/Wrphk9DSsdAyIAIm8+FZmoAVt1GexQ8tsHzlkmxFSqIad0JAW9X1oaw0QyE4vNC6lHy2pllGRlJ9AKJoMn5QbVdnYcHwztENX79DQHsaGQU12Lj9RzIVf9Hf/h7Iq3+vF/0wnm6ITO/7N58HD/37T79Yxl6zpGm9IZeST6GBJPGFyhUU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dPYoaconmF5O1e1SXmPXFCsU9i8fPUPz9Q3Hf9KIfHou7rgXMG4Pxk5gxm/dPgdtMBB/0PjSCd+3k7JRC+Cqf2IY4vi4VVvj1zlj0LCo6XpfBqF9G9AmKM1UsBUl3yn2kVaDFQq1WQlQZGKFWOx4rnvFqMuZ7exQ1FBghZARGjlP5XvkSy/b6Rwqk7PVvM7n0NsnlKYT7Va6xrWibS5d1k07U26OoIbR9ox0vqEYb+ZX1j4T2/3OVTg/5mXPuoK5WfARkjU08v7Y3dvcoasE6iWuvwKXZJrIw+sw23z/bDIyJswXZZtcCpuXZ5v4pNDipKTSbYd48hVqKGppCA/MUhPceU6K9g31KU2IVl23IeusyZ2W9BzLXGBb2RkDFDtPJJgGfHqzZJMAM6nt78ttBZf3jeLwsmjwsv23p5mnlqk3/AKoP3c7KN1gdB6GyS7Jjqoa4N1NWMyg72Ik6g/OgWlVThwCMBaRsSXznVnC/sn4ZfPvpch+Ol+XkgfeO7eA7+FrCOSXiFL+Slq9tGr4/Xy95q++3FDW16WusbQbvsaDjeRagvwEqYNU5gd9wfW4XCo+xOjufHVFwVbfiKL9GKgvET0S7fKDuAoqQBMeMY1UtxDH8TsiMxucW6Fl+H3NJ9ifuOhd3/S3fheTLQj7MyFRtGiSgisazB3Xv6qzbUH5ctlXXsX15kM3NxfzYPEPV3MFIe9H5gIMnpxB3nthZE3Ptre7xO3N911pZaWpLxUA5w7am24HLzX+ppNU3/wmERv8B \ No newline at end of file diff --git a/doc/tracker_sequence_diagram.svg b/doc/tracker_sequence_diagram.svg index 7018a9a..31c75da 100644 --- a/doc/tracker_sequence_diagram.svg +++ b/doc/tracker_sequence_diagram.svg @@ -1,3 +1,3 @@ -
Tracker
Tracker
Client1
Client1
:Object
:Object
Server1
Server1
Note
Note
REGISTER()
REGISTER()
LIST REQ
LIST REQ
LIST RESP(file1, file2)
LIST RESP(f...
DISCOVER RESP(server1, server2, server3)
DISCOVER RE...
Server2
Server2
REGISTER()
REGISTER()
LIST REQ
LIST REQ
DISCOVER REQ()
DISCOVER RE...
LIST RESP(file2, file3)
LIST RESP(f...
LIST REQ
LIST REQ
Server3
Server3
REGISTER()
REGISTER()
LIST REQ
LIST REQ
LIST RESP(file1, file3)
LIST RESP(f...
LIST RESP(file2, file2)
LIST RESP(f...
DISCOVER REQ(fichier2)
DISCOVER RE...
Now the client knows server1 and server3 have file1: download can begin.
Now the client knows server1 and server3 have file1: download can begin.
DISCOVER RESP(server1, server3)
DISCOVER RE...
Viewer does not support full SVG 1.1
\ No newline at end of file +
Tracker
Tracker
Client1
Client1
Server1
Server1
REGISTER()
REGISTER()
LIST REQ
LIST REQ
LIST RESP(file1, file2)
LIST RESP(f...
DISCOVER RESP(server1, server2, server3)
DISCOVER RE...
Server2
Server2
REGISTER()
REGISTER()
LIST REQ
LIST REQ
DISCOVER REQ()
DISCOVER RE...
LIST RESP(file2, file3)
LIST RESP(f...
LIST REQ
LIST REQ
Server3
Server3
REGISTER()
REGISTER()
LIST REQ
LIST REQ
LIST RESP(file1, file3)
LIST RESP(f...
LIST RESP(file2, file2)
LIST RESP(f...
DISCOVER REQ(fichier2)
DISCOVER RE...
Now the client knows server1 and server3 have file1: download can begin.
Now the client knows server1 and server3 have file1: download can begin.
DISCOVER RESP(server1, server3)
DISCOVER RE...
Viewer does not support full SVG 1.1
\ No newline at end of file diff --git a/doc/usecase.drawio b/doc/usecase.drawio new file mode 100644 index 0000000..997b932 --- /dev/null +++ b/doc/usecase.drawio @@ -0,0 +1 @@ +7V3dcps4FH4aT6/SAWR+fJk4abrddqfbtNv0khjFVoORB0Ri9+lXAmGQRGxiG0RidyYNkoUMn74jnT8pAzCeL69jfzH7ggMYDiwjWA7A5cCyLNcA9BerWeU1pmc5ec00RgGvKytu0B/IKw1em6IAJkJDgnFI0EKsnOAoghMi1PlxjJ/EZvc4FL914U+hUnEz8UO19icKyCyv9Sy3rP8I0XRWfLPpjPJP5n7RmL9JMvMD/FSpAlcDMI4xJvnVfDmGIUOvwCW/78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NTg2HG04OTHO5gVWpyVsD1a0K9EKltVFGnHVHbYl9Gf3zjNVEbYk4lfSmjXHzKoO7nvuKPKciLaenXQFVW21TNYj36MJLO+7tSSTsfIOSWibcvO0C5HjqrkHnkimjt0ezZE6nL+b0rvU7xlRoCSBU7W2TR92IMsr+4j3Yu7c1rct6VemoapmfHqocBHPilZ0hYbbzjSPEQv07+OYIiAlBzr6l43XFX9qjMDs+Mq+mAGyidvjbSfvOW+LL34CEguz0MjoEZ2uiW5ml1cCYoxmhMfZbqSVm5LW4SMmsT5jqn9ss12R0ht0zQ0c7v4sue5XUR9g+yM5ooxoDv+K8/lpqHdM17E80+Mf5bxhtUa42mx/KtNeUiz/ONX4Op/ \ No newline at end of file diff --git a/doc/usecase.svg b/doc/usecase.svg new file mode 100644 index 0000000..448acc3 --- /dev/null +++ b/doc/usecase.svg @@ -0,0 +1,3 @@ + + +
Utilisateur
Utili...
Système
Système
Application
Application
Télécharger
Télécharger
Afficher les fichiers
Afficher les fichiers
S'enregistrer au tracker
S'enregistrer au tracker
Envoyer
Envoyer
Rechercher
Rechercher
Rechercher par nom
Rechercher par nom
Rechercher par extention
Rechercher par extention
Reconstruire un fichier
Reconstruire un fichier
Télécharger block
Télécharger block
Vérifier l'intégrité d'un fichier
Vérifier l'intégrité d'...
<<include>>
<<include>>
<<include>>
<<include>>
<<include>>
<<include>>
<<extend>>
<<extend>>
<<include>>
<<include>>
<<include>>
<<include>>
mise en cache du ratio
mise en cache du ratio
consultation du ratio
consultation du ratio
Enregistrer une application
Enregistrer une applica...
fournir liste fichiers
fournir liste fichiers
fournir ratio
fournir ratio
Tracker
Tracker
Se désenregistrer du tracker
Se désenregistrer du tr...
mettre a jour le ratio
mettre a jour le ratio
<<include>>
<<include>>
<<include>>
<<include>>
<<include>>
<<include>>
<<extend>>
<<extend>>
Quelle application dispose du fichier
Quelle application disp...
<<include>>
<<include>>
<<extend>>
<<extend>>
<<extend>>
<<extend>>
mettre a jour un ratio
mettre a jour un ratio
<<extend>>
<<extend>>
fournir la taille
fournir la taille
<<extend>>
<<extend>>
fournir la liste des applications
fournir la liste des ap...
<<extend>>
<<extend>>
Viewer does not support full SVG 1.1
\ No newline at end of file diff --git a/doc/usecase.xml b/doc/usecase.xml deleted file mode 100644 index 5307609..0000000 --- a/doc/usecase.xml +++ /dev/null @@ -1 +0,0 @@ -7VjJkpswEP0aH5NiMV6OGbwkVZO5+DCTo8p0QClBu0Tb4Pn6SKYxEDKTpeIYV83FpX4tCek9qR9m5IdpudZil3zGCNTIc6Jy5C9Gnjf3PfNrgWMFTMazCoi1jCrIbYCNfAYGHUb3MoK805EQFcldF9xilsGWOpjQGotut6+ouk/diRh6wGYrVB99lBElFTrzpg3+EWSc1E92J/Mqk4q6M+8kT0SERQvylyM/1IhUtdIyBGW5q3mpxq1eyJ4XpiGj3xkQ5qXzsHoK1sWnx/x5eXgI0/gdq3MQas8bXmCRKRQRL5qONRNmNkO6Ce6KRBJsdmJrM4WR3WAJpcpErmn2F8ZrPYAmKFsQL3QNmALpo+nCWc/xqyF8anzmsGgkcMeMJS36p4wJVj0+z9wQYxrMzR/wNO7xdC9zsgdKKnM8h8SV612brKBHFsGJLCgNaZAZLoZE2LnWXI0w1+8TEpkyxCFqSjDGTKhlg95p3GcR2GkdEzV97hF3TNY3IDpyTRV7wi6VRg16arW/2KneBxwtSp75FBzrIDP7fWoHrVE2bIadomZc9MFWYxNmmEGFrKSl6ZR/UdYc93oLr3HHopDQMdCvS50l9tVTokEJkodu/f/3ko/fJL+45ONhSR68SX5xyYNhSe70rDBU0u7+x5PQ1fnyJlj72/mlIeh7oPcTD5xczAMn17wdzt/cDncwt6P+Z3RjHji9HcmvLt3AvGx2O9Ld7G0dmJfVHtN42Qa0cZyre5k//39mZsLmk80p1/ru5S+/Aw== \ No newline at end of file