1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package org.xnap.peer;
21
22 import javax.swing.Action;
23
24 /***
25 * Defines the requirements for a peer. Peers are participants of
26 * networks.
27 */
28 public interface Peer {
29
30
31
32
33
34 /***
35 * Returns the actions that can performed by the peer.
36 */
37 Action[] getActions();
38
39 /***
40 * Returns the client info. This is the name of the peer's software,
41 * e.g. "XNap 2.4"
42 *
43 * @return null, if the client info is unknown; the client info, otherwise
44 */
45 String getClientInfo();
46
47 /***
48 * Returns the number of shared files by this peer.
49 *
50 * @return -1, if the file count is unknown; the count, otherwise
51 */
52 int getFileCount();
53
54 /***
55 * Returns the ip address or hostname of this peer. The host can include
56 * the port separated by a colon like this: "localhost:6699".
57 */
58 String getHost();
59
60 /***
61 * Returns the link speed of the peer.
62 *
63 * @return -1, if the link speed is unknown; the speed in kb/s, otherwise
64 */
65 int getLinkSpeed();
66
67 /***
68 * Returns the number of currently running downloads from this peer.
69 */
70 int getLocalDownloadCount();
71
72 /***
73 * Returns the number of currently running uploads to this peer.
74 */
75 int getLocalUploadCount();
76
77 /***
78 * Returns the name of the peer.
79 */
80 String getName();
81
82 /***
83 * Returns the status of the peer. This could be something like "online"
84 * or "away".
85 */
86 String getStatus();
87
88 }