01: package vicazh.hyperpool.stream.net.http;
02:
03: import java.io.*;
04: import java.util.*;
05:
06: class ReconnectItem implements Serializable {
07:
08: int id;
09:
10: String name;
11:
12: boolean accept;
13:
14: long length;
15:
16: long index;
17:
18: int retryindex;
19:
20: String client;
21:
22: String location;
23:
24: ReconnectItem(ReconnectConnection connection) {
25: id = connection.hashCode();
26: client = connection.client;
27: List<Session> sessions = connection.getSessions();
28: if (sessions.size() == 0)
29: return;
30: PathStream stream = (PathStream) sessions.get(0).getClient();
31: if (stream == null)
32: return;
33: location = stream.getFile();
34: if (stream.path != null)
35: name = stream.path[stream.path.length - 1];
36: accept = connection.accept;
37: length = connection.length;
38: index = connection.index;
39: retryindex = connection.retryindex;
40: }
41:
42: public String toString() {
43: return name;
44: }
45:
46: public boolean equals(Object obj) {
47: return id == ((ReconnectItem) obj).id;
48: }
49: }
|