1 /*
2  * File    : TRHost.java
3  * Created : 24-Oct-2003
4  * By      : parg
5  *
6  * Azureus - a Java Bittorrent client
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details ( see the LICENSE file ).
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22 
23 package org.gudy.azureus2.core3.tracker.host;
24 
25 /**
26  * @author parg
27  */
28 
29 import java.net.InetAddress;
30 
31 import org.gudy.azureus2.core3.torrent.*;
32 import org.gudy.azureus2.core3.tracker.server.*;
33 
34 public interface
35 TRHost
36 {
37 	public static final int DEFAULT_MIN_RETRY_DELAY 		= TRTrackerServer.DEFAULT_MIN_RETRY_DELAY;
38 	public static final int DEFAULT_MAX_RETRY_DELAY 		= TRTrackerServer.DEFAULT_MAX_RETRY_DELAY;
39 	public static final int DEFAULT_INC_BY					= TRTrackerServer.DEFAULT_INC_BY;
40 	public static final int DEFAULT_INC_PER			 		= TRTrackerServer.DEFAULT_INC_PER;
41 	public static final int DEFAULT_SCRAPE_RETRY_PERCENTAGE	= TRTrackerServer.DEFAULT_SCRAPE_RETRY_PERCENTAGE;
42 
43 	public static final int	DEFAULT_SCRAPE_CACHE_PERIOD				= TRTrackerServer.DEFAULT_SCRAPE_CACHE_PERIOD;
44 	public static final int	DEFAULT_ANNOUNCE_CACHE_PERIOD			= TRTrackerServer.DEFAULT_ANNOUNCE_CACHE_PERIOD;
45 	public static final int	DEFAULT_ANNOUNCE_CACHE_PEER_THRESHOLD	= TRTrackerServer.DEFAULT_ANNOUNCE_CACHE_PEER_THRESHOLD;
46 
47 	public static final int DEFAULT_PORT 					= TRTrackerServer.DEFAULT_TRACKER_PORT;
48 	public static final int DEFAULT_PORT_SSL				= TRTrackerServer.DEFAULT_TRACKER_PORT_SSL;
49 
50 	public void
initialise( TRHostTorrentFinder finder )51 	initialise(
52 		TRHostTorrentFinder	finder );
53 
54 	public String
getName()55 	getName();
56 
57 	public InetAddress
getBindIP()58 	getBindIP();
59 
60 	public TRHostTorrent
hostTorrent( TOTorrent torrent, boolean persistent, boolean passive )61 	hostTorrent(
62 		TOTorrent		torrent,
63 		boolean			persistent,
64 		boolean			passive )
65 
66 		throws TRHostException;
67 
68 	public TRHostTorrent
publishTorrent( TOTorrent torrent )69 	publishTorrent(
70 		TOTorrent		torrent )
71 
72 		throws TRHostException;
73 
74 	public TRHostTorrent[]
getTorrents()75 	getTorrents();
76 
77 		/**
78 		 * returns the host torrent for the torrent if it exists, null otherwise
79 		 * @param torrent
80 		 * @return
81 		 */
82 
83 	public TRHostTorrent
getHostTorrent( TOTorrent torrent )84 	getHostTorrent(
85 		TOTorrent		torrent );
86 
87 	public void
addListener( TRHostListener l )88 	addListener(
89 		TRHostListener	l );
90 
91 	public void
removeListener( TRHostListener l )92 	removeListener(
93 		TRHostListener	l );
94 
95 	public void
addListener2( TRHostListener2 l )96 	addListener2(
97 		TRHostListener2	l );
98 
99 	public void
removeListener2( TRHostListener2 l )100 	removeListener2(
101 		TRHostListener2	l );
102 
103 	public void
addAuthenticationListener( TRHostAuthenticationListener l )104 	addAuthenticationListener(
105 		TRHostAuthenticationListener	l );
106 
107 	public void
removeAuthenticationListener( TRHostAuthenticationListener l )108 	removeAuthenticationListener(
109 		TRHostAuthenticationListener	l );
110 
111 	public void
close()112 	close();
113 }
114