1 /* 2 * File : TRTrackerServer.java 3 * Created : 5 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.server; 24 25 import java.net.InetAddress; 26 import java.util.Set; 27 28 import org.gudy.azureus2.core3.util.Constants; 29 30 public interface 31 TRTrackerServer 32 { 33 public static final String DEFAULT_NAME = Constants.APP_NAME; 34 35 public static final int DEFAULT_MIN_RETRY_DELAY = 120; 36 public static final int DEFAULT_MAX_RETRY_DELAY = 3600; 37 public static final int DEFAULT_INC_BY = 60; 38 public static final int DEFAULT_INC_PER = 10; 39 public static final int DEFAULT_SCRAPE_RETRY_PERCENTAGE = 200; 40 41 public static final int DEFAULT_SCRAPE_CACHE_PERIOD = 5000; 42 public static final int DEFAULT_ANNOUNCE_CACHE_PERIOD = 500; 43 public static final int DEFAULT_ANNOUNCE_CACHE_PEER_THRESHOLD = 500; 44 45 public static final int DEFAULT_TRACKER_PORT = 6969; 46 public static final int DEFAULT_TRACKER_PORT_SSL = 7000; 47 48 public static final int DEFAULT_NAT_CHECK_SECS = 15; 49 50 public String getName()51 getName(); 52 53 public int getPort()54 getPort(); 55 56 public String getHost()57 getHost(); 58 59 public InetAddress getBindIP()60 getBindIP(); 61 62 public void setReady()63 setReady(); 64 65 public void setEnabled( boolean enabled )66 setEnabled( 67 boolean enabled ); 68 69 public boolean isSSL()70 isSSL(); 71 72 public void setEnableKeepAlive( boolean enable )73 setEnableKeepAlive( 74 boolean enable ); 75 76 public TRTrackerServerTorrent permit( String originator, byte[] hash, boolean explicit )77 permit( 78 String originator, 79 byte[] hash, 80 boolean explicit ) 81 82 throws TRTrackerServerException; 83 84 public TRTrackerServerTorrent permit( String originator, byte[] hash, boolean explicit, boolean enabled )85 permit( 86 String originator, 87 byte[] hash, 88 boolean explicit, 89 boolean enabled ) 90 91 throws TRTrackerServerException; 92 93 public void deny( byte[] hash, boolean explicit )94 deny( 95 byte[] hash, 96 boolean explicit ) 97 98 throws TRTrackerServerException; 99 100 public TRTrackerServerTorrentStats getStats( byte[] hash )101 getStats( 102 byte[] hash ); 103 104 public TRTrackerServerPeer[] getPeers( byte[] hash )105 getPeers( 106 byte[] hash ); 107 108 public TRTrackerServerStats getStats()109 getStats(); 110 111 public void setBiasedPeers( Set ips )112 setBiasedPeers( 113 Set ips ); 114 115 public void addListener( TRTrackerServerListener l )116 addListener( 117 TRTrackerServerListener l ); 118 119 public void removeListener( TRTrackerServerListener l )120 removeListener( 121 TRTrackerServerListener l ); 122 123 public void addListener2( TRTrackerServerListener2 l )124 addListener2( 125 TRTrackerServerListener2 l ); 126 127 public void removeListener2( TRTrackerServerListener2 l )128 removeListener2( 129 TRTrackerServerListener2 l ); 130 131 132 public void addRequestListener( TRTrackerServerRequestListener l )133 addRequestListener( 134 TRTrackerServerRequestListener l ); 135 136 public void removeRequestListener( TRTrackerServerRequestListener l )137 removeRequestListener( 138 TRTrackerServerRequestListener l ); 139 140 public void addAuthenticationListener( TRTrackerServerAuthenticationListener l )141 addAuthenticationListener( 142 TRTrackerServerAuthenticationListener l ); 143 144 public void removeAuthenticationListener( TRTrackerServerAuthenticationListener l )145 removeAuthenticationListener( 146 TRTrackerServerAuthenticationListener l ); 147 148 public void close()149 close(); 150 } 151