Package | Description |
---|---|
clientP2P | |
protocolP2P | |
serverP2P | |
tracker |
Modifier and Type | Method and Description |
---|---|
protected void |
ClientDownload.assignTasks()
Assign tasks randomly to threads.
|
protected void |
ClientDownload.checkTasksStatus()
Remove tasks from failed threads.
|
void |
ClientManagement.download(java.lang.String filename)
Try to download a file
|
protected byte[] |
ClientDownload.getHashSum512(HostItem hostItem)
Get hashsum from server.
|
protected void |
ClientDownload.init()
Initialize infos about file to download (size, hash512sum, partslist to dl).
|
void |
ClientManagement.initHostList()
Initialize hostList from tracker
|
java.lang.String[] |
ClientManagement.listDirectory()
list server’s directory content
|
protected void |
ClientDownload.purgeList()
Removes servers not owning the correct file to download from list.
|
protected void |
ClientDownload.setSize()
Set size of file to download.
|
Modifier and Type | Method and Description |
---|---|
private void |
Payload.checkRequestResponseCode()
Used to check RRCode used is compatible with this class use, or if a more specific subclass is required.
|
private void |
ProtocolP2PPacketUDP.constructPacket(byte[] packet)
Private constructor helper with packet as byte[] parameter (typically used when receiving Packet response/request).
|
private void |
ProtocolP2PPacketTCP.constructPacket(byte[] packet)
Private constructor helper with packet as byte[] parameter (typically used when receiving Packet response/request).
|
private void |
ProtocolP2PPacketUDP.constructPacket(byte[] packet,
java.net.DatagramSocket responseSocket)
Private constructor helper with packet as byte[] parameter and (typically used when receiving Packet request).
|
private void |
ProtocolP2PPacketTCP.constructPacket(byte[] packet,
java.net.Socket responseSocket)
Private constructor helper with packet as byte[] parameter and (typically used when receiving Packet request).
|
HostItem |
ProtocolP2PPacketUDP.getHostItem()
Get hostItem of the sender
|
HostItem |
ProtocolP2PPacketTCP.getHostItem()
Get hostItem of the sender
|
abstract HostItem |
ProtocolP2PPacket.getHostItem()
Get hostItem of the sender
|
ProtocolP2PPacket<?> |
ProtocolP2PPacketUDP.receiveResponse()
Receive response (typically used by client).
|
ProtocolP2PPacket<?> |
ProtocolP2PPacketTCP.receiveResponse()
Receive response (typically used by client).
|
abstract ProtocolP2PPacket<?> |
ProtocolP2PPacket.receiveResponse()
Receive a response
|
protected void |
ProtocolP2PPacketUDP.send(java.net.DatagramSocket socket)
Send a Packet.
|
protected void |
ProtocolP2PPacketUDP.send(java.net.DatagramSocket socket,
java.net.SocketAddress addr)
Send a Packet.
|
protected void |
ProtocolP2PPacketTCP.send(java.net.Socket socket)
Send a Packet.
|
void |
ProtocolP2PPacketUDP.sendRequest(java.lang.Object socket)
Send a Request throught socket.
|
void |
ProtocolP2PPacketTCP.sendRequest(java.lang.Object socket)
Send a Request throught socket.
|
abstract void |
ProtocolP2PPacket.sendRequest(java.lang.Object socket)
Send a request
|
<U extends ProtocolP2PPacket<?>> |
ProtocolP2PPacketUDP.sendResponse(U response)
Send a Response to a Request (typically used from server).
|
<U extends ProtocolP2PPacket<?>> |
ProtocolP2PPacketTCP.sendResponse(U response)
Send a Response to a Request (typically used from server).
|
abstract <U extends ProtocolP2PPacket<?>> |
ProtocolP2PPacket.sendResponse(U response)
Send a response
|
private void |
ProtocolP2PPacketUDP.setCheckSum(byte[] packet)
Used to set checksum into packet
|
private void |
FilePart.setFilename(byte[] packet)
Write from Packet into filename.
|
protected static void |
Payload.setPayloadSize(int size,
byte[] packet)
Set payload’s size in a Packet.
|
protected byte[] |
UpdateRatio.toPacket()
Returns a byte[] containing Packet with padding.
|
protected byte[] |
Unregister.toPacket()
Returns a byte[] containing Packet with padding.
|
protected byte[] |
SizeResponse.toPacket()
Returns a byte[] containing Packet with padding.
|
protected byte[] |
SizeRequest.toPacket()
Returns a byte[] containing Packet with padding.
|
protected byte[] |
Register.toPacket()
Returns a byte[] containing Packet with padding.
|
protected byte[] |
RatioResponse.toPacket()
Returns a byte[] containing Packet with padding.
|
protected byte[] |
RatioRequest.toPacket()
Returns a byte[] containing Packet with padding.
|
protected byte[] |
ProtocolP2PPacketUDP.toPacket()
Returns a byte[] containing full packet (typically used when sending packet).
|
protected byte[] |
ProtocolP2PPacketTCP.toPacket()
Returns a byte[] containing full packet (typically used when sending packet).
|
protected byte[] |
Payload.toPacket()
Returns a byte[] containing Packet with padding.
|
protected byte[] |
LoadRequest.toPacket()
Returns a byte[] containing Packet with padding.
|
protected byte[] |
HashResponse.toPacket()
Returns a byte[] containing Packet with padding.
|
protected byte[] |
HashRequest.toPacket()
Returns a byte[] containing Packet with padding.
|
protected byte[] |
FilePart.toPacket()
Returns a byte[] containing Packet with padding.
|
protected byte[] |
FileList.toPacket()
Returns a byte[] containing Packet with padding.
|
protected byte[] |
DiscoverResponse.toPacket()
Returns a byte[] containing Packet with padding.
|
protected byte[] |
DiscoverRequest.toPacket()
Returns a byte[] containing Packet with padding.
|
protected byte[] |
Denied.toPacket()
Returns a byte[] containing Packet with padding.
|
Constructor and Description |
---|
Denied(byte[] packet)
Constructor (typically used by client) with Packet received as parameter.
|
Denied(java.lang.String filename,
long offset)
Constructor (typically used by server) with informations about file part to send as parameters.
|
DiscoverRequest(byte[] packet)
Constructor (typically used by server) with a byte[] parameter containing the Packet received.
|
DiscoverRequest(java.lang.String filename)
Constructor with filename (typically used by client).
|
DiscoverResponse(byte[] packet)
Constructor (typically used by server) with a byte[] parameter containing the Packet received.
|
DiscoverResponse(java.lang.String filename,
java.util.List<HostItem> hostList)
Constructor with filename (typically used by tracker).
|
FileList(byte[] packet)
Constructor (typically used by client) with a byte[] parameter containing the Packet received.
|
FileList(java.lang.String[] fileList)
Constructor (typically used by the server) with an ArrayList parameter containing
filenames.
|
FilePart(byte[] packet)
Constructor (typically used by client) with Packet received as parameter.
|
FilePart(java.lang.String filename,
long offset,
byte[] partialContent)
Constructor (typically used by server) with informations about file part to send as parameters.
|
HashRequest(byte[] packet)
Constructor (typically used by client) with a byte[] parameter containing the Packet received.
|
HashRequest(java.lang.String filename,
HashAlgorithm[] algoList)
Constructor (typically used by the server) with a filename parameter.
|
HashResponse(byte[] packet)
Constructor (typically used by client) with a byte[] parameter containing the Packet received.
|
HashResponse(java.lang.String filename,
java.util.Map<HashAlgorithm,byte[]> hashes)
Constructor (typically used by the server) with a filename parameter.
|
LoadRequest(byte[] packet)
Constructor (typically used by server) with a byte[] parameter containing the Packet received.
|
LoadRequest(java.lang.String filename,
long offset,
long maxSizePartialContent,
HostItem hostItem)
Constructor (typically used by the client) with a filename parameter.
|
Payload(byte[] packet)
Constructor used to create a Payload (when no more specific subclasses exists) using packet as parameter.
|
Payload(RequestResponseCode requestResponseCode)
Consructor used to create Payload with a payload size of zero using a RRCode.
|
ProtocolP2PPacket(byte[] packet)
Construct a packet from byte[], subclasses must overwrite this constructor.
|
ProtocolP2PPacket(java.lang.Object socket)
Receive a request, subclasses must overwrite this constructor.
|
ProtocolP2PPacketTCP(byte[] packet)
Private constructor with packet as byte[] parameter (typically used when receiving Packet response).
|
ProtocolP2PPacketTCP(java.lang.Object socket)
Receive Request (typically used from server).
|
ProtocolP2PPacketUDP(byte[] packet)
Private constructor with packet as byte[] parameter (typically used when receiving Packet response).
|
ProtocolP2PPacketUDP(java.lang.Object socket)
Receive Request (typically used from server).
|
RatioRequest(byte[] packet)
Constructor (typically used by tracker) with a byte[] parameter containing the Packet received.
|
RatioRequest(HostItem hostItem)
Constructor with hostItem (typically used by client/server)
|
RatioResponse(byte[] packet)
Constructor (typically used by client/server) with a byte[] parameter containing the Packet received.
|
RatioResponse(HostItem hostItem,
long totalUp,
long totalDown)
Constructor with hostItem (typically used by tracker)
|
Register(byte[] packet)
Constructor (typically used by server) with a byte[] parameter containing the Packet received.
|
Register(HostItem hostItem)
Constructor with hostItem (typically used by client)
|
SizeRequest(byte[] packet)
Constructor (typically used by server) with a byte[] parameter containing the Packet received.
|
SizeRequest(java.lang.String filename)
Constructor (typically used by the client) with a filename parameter.
|
SizeResponse(byte[] packet)
Constructor (typically used by client) with Packet received as parameter.
|
SizeResponse(java.lang.String filename,
long totalSize)
Constructor (typically used by server) with informations about file part to send as parameters.
|
Unregister(byte[] packet)
Constructor (typically used by server) with a byte[] parameter containing the Packet received.
|
Unregister(HostItem hostItem)
Constructor with hostItem (typically used by client)
|
UpdateRatio(byte[] packet)
Constructor (typically used by tracker) with a byte[] parameter containing the Packet received.
|
UpdateRatio(HostItem client,
HostItem server,
long dataSize)
Constructor with hostItem (typically used by client)
|
Modifier and Type | Method and Description |
---|---|
protected double |
RatioWatcher.getPunishmentProbability(HostItem application)
Get Up-ratio for an applications
|
Modifier and Type | Method and Description |
---|---|
protected <T extends ProtocolP2PPacket<?>> |
TrackerManagement.handleDiscover(T pd)
Handle Discover request
|
protected <T extends ProtocolP2PPacket<?>> |
TrackerManagement.handleListRequest(T pd)
Handle List request
|
protected <T extends ProtocolP2PPacket<?>> |
TrackerManagement.handleListResponse(T pd,
HostItem host)
Handle List Responses
|
protected <T extends ProtocolP2PPacket<?>> |
TrackerManagement.handleRatio(T pd)
Handle Ratio request
|
protected <T extends ProtocolP2PPacket<?>> |
TrackerManagement.handleRegister(T pd)
Handle Registering
|
protected <T extends ProtocolP2PPacket<?>> |
TrackerManagement.handleSizeRequest(T pd)
Handle Size request
|
protected <T extends ProtocolP2PPacket<?>> |
TrackerManagement.handleUnregister(T pd)
Handle Unregistering
|
protected <T extends ProtocolP2PPacket<?>> |
TrackerManagement.handleUpdateRatio(T pd)
Handle Update Ratio
|