org.gudy.azureus2.core3.tracker.server.impl
Class TRTrackerServerImpl

java.lang.Object
  extended by org.gudy.azureus2.core3.tracker.server.impl.TRTrackerServerImpl
All Implemented Interfaces:
TRTrackerServer
Direct Known Subclasses:
TRTrackerServerDHT, TRTrackerServerTCP, TRTrackerServerUDP

public abstract class TRTrackerServerImpl
extends Object
implements TRTrackerServer


Field Summary
static boolean all_networks_permitted
           
static int announce_cache_period
           
static int announce_cache_threshold
           
static List<String> banned_clients
           
protected  AEMonitor class_mon
           
static int CLIENT_TIMEOUT_MULTIPLIER
           
static boolean full_scrape_enable
           
protected  IpFilter ip_filter
           
protected  CopyOnWriteList<TRTrackerServerListener> listeners
           
protected  CopyOnWriteList<TRTrackerServerListener2> listeners2
           
static int max_peers_to_send
           
static int max_seed_retention
           
static String[] permitted_networks
           
static String redirect_on_not_found
           
static boolean restrict_non_blocking_requests
           
static int RETRY_MINIMUM_MILLIS
           
static int RETRY_MINIMUM_SECS
           
static int scrape_cache_period
           
static int seed_limit
           
static boolean send_peer_ids
           
static boolean support_experimental_extensions
           
protected  AEMonitor this_mon
           
static int TIMEOUT_CHECK
           
 
Fields inherited from interface org.gudy.azureus2.core3.tracker.server.TRTrackerServer
DEFAULT_ANNOUNCE_CACHE_PEER_THRESHOLD, DEFAULT_ANNOUNCE_CACHE_PERIOD, DEFAULT_INC_BY, DEFAULT_INC_PER, DEFAULT_MAX_RETRY_DELAY, DEFAULT_MIN_RETRY_DELAY, DEFAULT_NAME, DEFAULT_NAT_CHECK_SECS, DEFAULT_SCRAPE_CACHE_PERIOD, DEFAULT_SCRAPE_RETRY_PERCENTAGE, DEFAULT_TRACKER_PORT, DEFAULT_TRACKER_PORT_SSL
 
Constructor Summary
TRTrackerServerImpl(String _name, boolean _start_up_ready)
           
 
Method Summary
 void addAuthenticationListener(TRTrackerServerAuthenticationListener l)
           
 TRTrackerServerTorrent addLink(String link, TRTrackerServerTorrent target)
           
 void addListener(TRTrackerServerListener l)
           
 void addListener2(TRTrackerServerListener2 l)
           
 void addRequestListener(TRTrackerServerRequestListener l)
           
 void close()
           
protected abstract  void closeSupport()
           
 void deny(byte[] _hash, boolean _explicit)
           
protected  void destroySupport()
           
protected static boolean getAllNetworksSupported()
           
protected static int getAnnounceCachePeerThreshold()
           
protected static int getAnnounceCachePeriod()
           
 long getAnnounceRetryInterval(TRTrackerServerTorrentImpl torrent)
           
protected  Set getBiasedPeers()
           
protected static int getMaxPeersToSend()
           
protected static int getMaxSeedRetention()
           
 long getMinAnnounceRetryInterval()
           
 long getMinScrapeRetryInterval()
           
 String getName()
           
 byte[] getPassword()
           
 TRTrackerServerPeer[] getPeers(byte[] hash)
           
protected static String[] getPermittedNetworks()
           
protected static int getScrapeCachePeriod()
           
 long getScrapeRetryInterval(TRTrackerServerTorrentImpl torrent)
           
 long getSeedAnnounceIntervalMultiplier()
           
protected static int getSeedLimit()
           
protected static boolean getSendPeerIds()
           
 TRTrackerServerStats getStats()
           
 TRTrackerServerTorrentStats getStats(byte[] hash)
           
 TRTrackerServerTorrentImpl getTorrent(byte[] hash)
           
 TRTrackerServerTorrentImpl getTorrent(String link)
           
 int getTorrentCount()
           
 TRTrackerServerTorrentImpl[] getTorrents()
           
 String getUsername()
           
 boolean hasExternalAuthorisation()
           
 boolean hasInternalAuthorisation()
           
 boolean isCompactEnabled()
           
 boolean isEnabled()
           
static boolean isFullScrapeEnabled()
           
 boolean isKeepAliveEnabled()
           
 boolean isKeyEnabled()
           
 boolean isReady()
           
 boolean isTrackerPasswordEnabled()
           
 boolean isWebPasswordEnabled()
           
 boolean isWebPasswordHTTPSOnly()
           
 boolean performExternalAuthorisation(InetSocketAddress remote_ip, String headers, URL resource, String user, String password)
           
 byte[] performExternalAuthorisation(URL resource, String user)
           
 TRTrackerServerTorrent permit(String _originator, byte[] _hash, boolean _explicit)
           
 TRTrackerServerTorrent permit(String _originator, byte[] _hash, boolean _explicit, boolean _enabled)
           
 void postProcess(TRTrackerServerPeer peer, TRTrackerServerTorrentImpl torrent, int type, String request, Map response)
           
 void preProcess(TRTrackerServerPeer peer, TRTrackerServerTorrent torrent, int type, String request, Map response)
           
protected static void readConfig()
           
protected  void readConfigSettings()
           
 void removeAuthenticationListener(TRTrackerServerAuthenticationListener l)
           
 void removeLink(String link, TRTrackerServerTorrent target)
           
 void removeListener(TRTrackerServerListener l)
           
 void removeListener2(TRTrackerServerListener2 l)
           
 void removeRequestListener(TRTrackerServerRequestListener l)
           
 void setBiasedPeers(Set peers)
           
 void setEnabled(boolean e)
           
 void setEnableKeepAlive(boolean enable)
           
 void setReady()
           
static boolean supportsExtensions()
           
protected  void timerLoop()
           
 void updateStats(int request_type, TRTrackerServerTorrentImpl torrent, int bytes_in, int bytes_out)
           
protected  void updateTime(int request_type, long time)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.gudy.azureus2.core3.tracker.server.TRTrackerServer
getBindIP, getHost, getPort, isSSL
 

Field Detail

RETRY_MINIMUM_SECS

public static final int RETRY_MINIMUM_SECS
See Also:
Constant Field Values

RETRY_MINIMUM_MILLIS

public static final int RETRY_MINIMUM_MILLIS
See Also:
Constant Field Values

CLIENT_TIMEOUT_MULTIPLIER

public static final int CLIENT_TIMEOUT_MULTIPLIER
See Also:
Constant Field Values

TIMEOUT_CHECK

public static final int TIMEOUT_CHECK
See Also:
Constant Field Values

max_peers_to_send

public static int max_peers_to_send

send_peer_ids

public static boolean send_peer_ids

announce_cache_period

public static int announce_cache_period

scrape_cache_period

public static int scrape_cache_period

announce_cache_threshold

public static int announce_cache_threshold

max_seed_retention

public static int max_seed_retention

seed_limit

public static int seed_limit

full_scrape_enable

public static boolean full_scrape_enable

restrict_non_blocking_requests

public static boolean restrict_non_blocking_requests

all_networks_permitted

public static boolean all_networks_permitted

permitted_networks

public static String[] permitted_networks

support_experimental_extensions

public static boolean support_experimental_extensions

redirect_on_not_found

public static String redirect_on_not_found

banned_clients

public static List<String> banned_clients

class_mon

protected AEMonitor class_mon

ip_filter

protected IpFilter ip_filter

listeners

protected CopyOnWriteList<TRTrackerServerListener> listeners

listeners2

protected CopyOnWriteList<TRTrackerServerListener2> listeners2

this_mon

protected AEMonitor this_mon
Constructor Detail

TRTrackerServerImpl

public TRTrackerServerImpl(String _name,
                           boolean _start_up_ready)
Method Detail

readConfig

protected static void readConfig()

getSendPeerIds

protected static boolean getSendPeerIds()

getMaxPeersToSend

protected static int getMaxPeersToSend()

getScrapeCachePeriod

protected static int getScrapeCachePeriod()

getAnnounceCachePeriod

protected static int getAnnounceCachePeriod()

getAnnounceCachePeerThreshold

protected static int getAnnounceCachePeerThreshold()

getMaxSeedRetention

protected static int getMaxSeedRetention()

getSeedLimit

protected static int getSeedLimit()

isFullScrapeEnabled

public static boolean isFullScrapeEnabled()

getAllNetworksSupported

protected static boolean getAllNetworksSupported()

getPermittedNetworks

protected static String[] getPermittedNetworks()

supportsExtensions

public static boolean supportsExtensions()

readConfigSettings

protected void readConfigSettings()

setReady

public void setReady()
Specified by:
setReady in interface TRTrackerServer

isReady

public final boolean isReady()

setEnabled

public void setEnabled(boolean e)
Specified by:
setEnabled in interface TRTrackerServer

isEnabled

public boolean isEnabled()

setEnableKeepAlive

public void setEnableKeepAlive(boolean enable)
Specified by:
setEnableKeepAlive in interface TRTrackerServer

isKeepAliveEnabled

public boolean isKeepAliveEnabled()

addLink

public TRTrackerServerTorrent addLink(String link,
                                      TRTrackerServerTorrent target)

removeLink

public void removeLink(String link,
                       TRTrackerServerTorrent target)

setBiasedPeers

public void setBiasedPeers(Set peers)
Specified by:
setBiasedPeers in interface TRTrackerServer

getBiasedPeers

protected Set getBiasedPeers()

isWebPasswordEnabled

public boolean isWebPasswordEnabled()

isTrackerPasswordEnabled

public boolean isTrackerPasswordEnabled()

isWebPasswordHTTPSOnly

public boolean isWebPasswordHTTPSOnly()

hasExternalAuthorisation

public boolean hasExternalAuthorisation()

hasInternalAuthorisation

public boolean hasInternalAuthorisation()

performExternalAuthorisation

public boolean performExternalAuthorisation(InetSocketAddress remote_ip,
                                            String headers,
                                            URL resource,
                                            String user,
                                            String password)

performExternalAuthorisation

public byte[] performExternalAuthorisation(URL resource,
                                           String user)

getName

public String getName()
Specified by:
getName in interface TRTrackerServer

isCompactEnabled

public boolean isCompactEnabled()

isKeyEnabled

public boolean isKeyEnabled()

getUsername

public String getUsername()

getPassword

public byte[] getPassword()

getMinAnnounceRetryInterval

public long getMinAnnounceRetryInterval()

getAnnounceRetryInterval

public long getAnnounceRetryInterval(TRTrackerServerTorrentImpl torrent)

getSeedAnnounceIntervalMultiplier

public long getSeedAnnounceIntervalMultiplier()

getScrapeRetryInterval

public long getScrapeRetryInterval(TRTrackerServerTorrentImpl torrent)

getMinScrapeRetryInterval

public long getMinScrapeRetryInterval()

getStats

public TRTrackerServerStats getStats()
Specified by:
getStats in interface TRTrackerServer

updateStats

public void updateStats(int request_type,
                        TRTrackerServerTorrentImpl torrent,
                        int bytes_in,
                        int bytes_out)

updateTime

protected void updateTime(int request_type,
                          long time)

timerLoop

protected void timerLoop()

permit

public TRTrackerServerTorrent permit(String _originator,
                                     byte[] _hash,
                                     boolean _explicit)
                              throws TRTrackerServerException
Specified by:
permit in interface TRTrackerServer
Throws:
TRTrackerServerException

permit

public TRTrackerServerTorrent permit(String _originator,
                                     byte[] _hash,
                                     boolean _explicit,
                                     boolean _enabled)
                              throws TRTrackerServerException
Specified by:
permit in interface TRTrackerServer
Throws:
TRTrackerServerException

deny

public void deny(byte[] _hash,
                 boolean _explicit)
          throws TRTrackerServerException
Specified by:
deny in interface TRTrackerServer
Throws:
TRTrackerServerException

getTorrent

public TRTrackerServerTorrentImpl getTorrent(byte[] hash)

getTorrent

public TRTrackerServerTorrentImpl getTorrent(String link)

getTorrents

public TRTrackerServerTorrentImpl[] getTorrents()

getTorrentCount

public int getTorrentCount()

getStats

public TRTrackerServerTorrentStats getStats(byte[] hash)
Specified by:
getStats in interface TRTrackerServer

getPeers

public TRTrackerServerPeer[] getPeers(byte[] hash)
Specified by:
getPeers in interface TRTrackerServer

addListener

public void addListener(TRTrackerServerListener l)
Specified by:
addListener in interface TRTrackerServer

removeListener

public void removeListener(TRTrackerServerListener l)
Specified by:
removeListener in interface TRTrackerServer

addListener2

public void addListener2(TRTrackerServerListener2 l)
Specified by:
addListener2 in interface TRTrackerServer

removeListener2

public void removeListener2(TRTrackerServerListener2 l)
Specified by:
removeListener2 in interface TRTrackerServer

addAuthenticationListener

public void addAuthenticationListener(TRTrackerServerAuthenticationListener l)
Specified by:
addAuthenticationListener in interface TRTrackerServer

removeAuthenticationListener

public void removeAuthenticationListener(TRTrackerServerAuthenticationListener l)
Specified by:
removeAuthenticationListener in interface TRTrackerServer

preProcess

public void preProcess(TRTrackerServerPeer peer,
                       TRTrackerServerTorrent torrent,
                       int type,
                       String request,
                       Map response)
                throws TRTrackerServerException
Throws:
TRTrackerServerException

postProcess

public void postProcess(TRTrackerServerPeer peer,
                        TRTrackerServerTorrentImpl torrent,
                        int type,
                        String request,
                        Map response)
                 throws TRTrackerServerException
Throws:
TRTrackerServerException

addRequestListener

public void addRequestListener(TRTrackerServerRequestListener l)
Specified by:
addRequestListener in interface TRTrackerServer

removeRequestListener

public void removeRequestListener(TRTrackerServerRequestListener l)
Specified by:
removeRequestListener in interface TRTrackerServer

close

public void close()
Specified by:
close in interface TRTrackerServer

closeSupport

protected abstract void closeSupport()

destroySupport

protected void destroySupport()