~motu-torrent/azureus/upstream-stable

« back to all changes in this revision

Viewing changes to com/aelitis/azureus/core/dht/nat/DHTNATPuncher.java

  • Committer: John Dong
  • Date: 2007-10-22 04:54:13 UTC
  • Revision ID: john.dong@gmail.com-20071022045413-3ovb11u82rrcokxx
Commit 3.0.3.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Created on 11-Aug-2005
3
 
 * Created by Paul Gardner
4
 
 * Copyright (C) 2005, 2006 Aelitis, All Rights Reserved.
5
 
 *
6
 
 * This program is free software; you can redistribute it and/or
7
 
 * modify it under the terms of the GNU General Public License
8
 
 * as published by the Free Software Foundation; either version 2
9
 
 * of the License, or (at your option) any later version.
10
 
 * This program is distributed in the hope that it will be useful,
11
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 * GNU General Public License for more details.
14
 
 * You should have received a copy of the GNU General Public License
15
 
 * along with this program; if not, write to the Free Software
16
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
17
 
 * 
18
 
 * AELITIS, SAS au capital de 46,603.30 euros
19
 
 * 8 Allee Lenotre, La Grille Royale, 78600 Le Mesnil le Roi, France.
20
 
 *
21
 
 */
22
 
 
23
 
package com.aelitis.azureus.core.dht.nat;
24
 
 
25
 
import java.net.InetSocketAddress;
26
 
import java.util.Map;
27
 
 
28
 
import com.aelitis.azureus.core.dht.transport.DHTTransportContact;
29
 
 
30
 
public interface 
31
 
DHTNATPuncher 
32
 
{
33
 
        public void
34
 
        start();
35
 
        
36
 
        public void
37
 
        destroy();
38
 
        
39
 
                /**
40
 
                 * We're trying to run a rendezvous
41
 
                 * @return
42
 
                 */
43
 
        
44
 
        public boolean
45
 
        active();
46
 
        
47
 
                /**
48
 
                 * Got a good running rendezvous
49
 
                 * @return
50
 
                 */
51
 
        
52
 
        public boolean
53
 
        operational();
54
 
        
55
 
        public Map
56
 
        punch(
57
 
                String                                  reason,
58
 
                DHTTransportContact             target,
59
 
                DHTTransportContact[]   rendezvous_used,
60
 
                Map                                             client_data );
61
 
        
62
 
                /**
63
 
                 * 
64
 
                 * @param target                input/output parameter for target of traversal
65
 
                 * @param client_data
66
 
                 * @return
67
 
                 */
68
 
        
69
 
        public Map
70
 
        punch(
71
 
                String                                  reason,
72
 
                InetSocketAddress[]             target,
73
 
                DHTTransportContact[]   rendezvous_used,
74
 
                Map                                             client_data );
75
 
        
76
 
                /**
77
 
                 * @param target
78
 
                 * @param rendezvous
79
 
                 */
80
 
        
81
 
        public void
82
 
        setRendezvous(
83
 
                DHTTransportContact             target,
84
 
                DHTTransportContact             rendezvous );
85
 
        
86
 
        public Map
87
 
        sendMessage(
88
 
                InetSocketAddress       rendezvous,
89
 
                InetSocketAddress       target,
90
 
                Map                                     message );
91
 
}
 
1
/*
 
2
 * Created on 11-Aug-2005
 
3
 * Created by Paul Gardner
 
4
 * Copyright (C) 2005, 2006 Aelitis, All Rights Reserved.
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the GNU General Public License
 
8
 * as published by the Free Software Foundation; either version 2
 
9
 * of the License, or (at your option) any later version.
 
10
 * This program is distributed in the hope that it will be useful,
 
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
 * GNU General Public License for more details.
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software
 
16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
17
 * 
 
18
 * AELITIS, SAS au capital de 46,603.30 euros
 
19
 * 8 Allee Lenotre, La Grille Royale, 78600 Le Mesnil le Roi, France.
 
20
 *
 
21
 */
 
22
 
 
23
package com.aelitis.azureus.core.dht.nat;
 
24
 
 
25
import java.net.InetSocketAddress;
 
26
import java.util.Map;
 
27
 
 
28
import com.aelitis.azureus.core.dht.transport.DHTTransportContact;
 
29
 
 
30
public interface 
 
31
DHTNATPuncher 
 
32
{
 
33
        public void
 
34
        start();
 
35
        
 
36
        public void
 
37
        destroy();
 
38
        
 
39
                /**
 
40
                 * We're trying to run a rendezvous
 
41
                 * @return
 
42
                 */
 
43
        
 
44
        public boolean
 
45
        active();
 
46
        
 
47
                /**
 
48
                 * Got a good running rendezvous
 
49
                 * @return
 
50
                 */
 
51
        
 
52
        public boolean
 
53
        operational();
 
54
        
 
55
        public Map
 
56
        punch(
 
57
                String                                  reason,
 
58
                DHTTransportContact             target,
 
59
                DHTTransportContact[]   rendezvous_used,
 
60
                Map                                             client_data );
 
61
        
 
62
                /**
 
63
                 * 
 
64
                 * @param target                input/output parameter for target of traversal
 
65
                 * @param client_data
 
66
                 * @return
 
67
                 */
 
68
        
 
69
        public Map
 
70
        punch(
 
71
                String                                  reason,
 
72
                InetSocketAddress[]             target,
 
73
                DHTTransportContact[]   rendezvous_used,
 
74
                Map                                             client_data );
 
75
        
 
76
                /**
 
77
                 * @param target
 
78
                 * @param rendezvous
 
79
                 */
 
80
        
 
81
        public void
 
82
        setRendezvous(
 
83
                DHTTransportContact             target,
 
84
                DHTTransportContact             rendezvous );
 
85
        
 
86
        public Map
 
87
        sendMessage(
 
88
                InetSocketAddress       rendezvous,
 
89
                InetSocketAddress       target,
 
90
                Map                                     message );
 
91
}