Class TRTrackerServerImpl
- java.lang.Object
-
- com.biglybt.core.tracker.server.impl.TRTrackerServerImpl
-
- All Implemented Interfaces:
TRTrackerServer
- Direct Known Subclasses:
TRTrackerServerDHT
,TRTrackerServerTCP
,TRTrackerServerUDP
public abstract class TRTrackerServerImpl extends java.lang.Object implements TRTrackerServer
-
-
Field Summary
-
Fields inherited from interface com.biglybt.core.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
Constructors Constructor Description TRTrackerServerImpl(java.lang.String _name, boolean _start_up_ready)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.biglybt.core.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 java.lang.String[] permitted_networks
-
support_experimental_extensions
public static boolean support_experimental_extensions
-
redirect_on_not_found
public static java.lang.String redirect_on_not_found
-
banned_clients
public static final java.util.List<java.lang.String> banned_clients
-
torrent_map
private static final java.util.Map torrent_map
-
link_map
private static final java.util.Map link_map
-
class_mon
protected final AEMonitor class_mon
-
ip_filter
protected final IpFilter ip_filter
-
current_announce_retry_interval
private long current_announce_retry_interval
-
current_scrape_retry_interval
private long current_scrape_retry_interval
-
current_total_clients
private long current_total_clients
-
current_min_poll_interval
private int current_min_poll_interval
-
current_min_seed_announce_mult
private final int current_min_seed_announce_mult
-
stats
private final TRTrackerServerStatsImpl stats
-
name
private final java.lang.String name
-
web_password_enabled
private boolean web_password_enabled
-
web_password_https_only
private boolean web_password_https_only
-
tracker_password_enabled
private boolean tracker_password_enabled
-
password_user
private java.lang.String password_user
-
password_pw
private byte[] password_pw
-
compact_enabled
private boolean compact_enabled
-
key_enabled
private boolean key_enabled
-
enabled
private boolean enabled
-
keep_alive_enabled
private boolean keep_alive_enabled
-
listeners
protected final CopyOnWriteList<TRTrackerServerListener> listeners
-
listeners2
protected final CopyOnWriteList<TRTrackerServerListener2> listeners2
-
auth_listeners
private final java.util.List<TRTrackerServerAuthenticationListener> auth_listeners
-
request_listeners
private final java.util.Vector<TRTrackerServerRequestListener> request_listeners
-
this_mon
protected AEMonitor this_mon
-
config_listener
private final COConfigurationListener config_listener
-
destroyed
private boolean destroyed
-
biased_peers
private java.util.Set biased_peers
-
is_ready
private boolean is_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 java.lang.String[] getPermittedNetworks()
-
supportsExtensions
public static boolean supportsExtensions()
-
readConfigSettings
protected void readConfigSettings()
-
setReady
public void setReady()
- Specified by:
setReady
in interfaceTRTrackerServer
-
isReady
public final boolean isReady()
-
setEnabled
public void setEnabled(boolean e)
- Specified by:
setEnabled
in interfaceTRTrackerServer
-
isEnabled
public boolean isEnabled()
-
setEnableKeepAlive
public void setEnableKeepAlive(boolean enable)
- Specified by:
setEnableKeepAlive
in interfaceTRTrackerServer
-
isKeepAliveEnabled
public boolean isKeepAliveEnabled()
-
addLink
public TRTrackerServerTorrent addLink(java.lang.String link, TRTrackerServerTorrent target)
-
removeLink
public void removeLink(java.lang.String link, TRTrackerServerTorrent target)
-
setBiasedPeers
public void setBiasedPeers(java.util.Set peers)
- Specified by:
setBiasedPeers
in interfaceTRTrackerServer
-
getBiasedPeers
protected java.util.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(java.net.InetSocketAddress remote_ip, java.lang.String headers, java.net.URL resource, java.lang.String user, java.lang.String password)
-
performExternalAuthorisation
public byte[] performExternalAuthorisation(java.net.URL resource, java.lang.String user)
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceTRTrackerServer
-
isCompactEnabled
public boolean isCompactEnabled()
-
isKeyEnabled
public boolean isKeyEnabled()
-
getUsername
public java.lang.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 interfaceTRTrackerServer
-
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(java.lang.String _originator, byte[] _hash, boolean _explicit) throws TRTrackerServerException
- Specified by:
permit
in interfaceTRTrackerServer
- Throws:
TRTrackerServerException
-
permit
public TRTrackerServerTorrent permit(java.lang.String _originator, byte[] _hash, boolean _explicit, boolean _enabled) throws TRTrackerServerException
- Specified by:
permit
in interfaceTRTrackerServer
- Throws:
TRTrackerServerException
-
deny
public void deny(byte[] _hash, boolean _explicit) throws TRTrackerServerException
- Specified by:
deny
in interfaceTRTrackerServer
- Throws:
TRTrackerServerException
-
isKnownTorrent
public boolean isKnownTorrent(byte[] hash)
-
getTorrent
public TRTrackerServerTorrentImpl getTorrent(byte[] hash)
-
getTorrent
public TRTrackerServerTorrentImpl getTorrent(java.lang.String link)
-
getTorrents
public TRTrackerServerTorrentImpl[] getTorrents()
-
getTorrentCount
public int getTorrentCount()
-
getStats
public TRTrackerServerTorrentStats getStats(byte[] hash)
- Specified by:
getStats
in interfaceTRTrackerServer
-
getPeers
public TRTrackerServerPeer[] getPeers(byte[] hash)
- Specified by:
getPeers
in interfaceTRTrackerServer
-
addListener
public void addListener(TRTrackerServerListener l)
- Specified by:
addListener
in interfaceTRTrackerServer
-
removeListener
public void removeListener(TRTrackerServerListener l)
- Specified by:
removeListener
in interfaceTRTrackerServer
-
addListener2
public void addListener2(TRTrackerServerListener2 l)
- Specified by:
addListener2
in interfaceTRTrackerServer
-
removeListener2
public void removeListener2(TRTrackerServerListener2 l)
- Specified by:
removeListener2
in interfaceTRTrackerServer
-
addAuthenticationListener
public void addAuthenticationListener(TRTrackerServerAuthenticationListener l)
- Specified by:
addAuthenticationListener
in interfaceTRTrackerServer
-
removeAuthenticationListener
public void removeAuthenticationListener(TRTrackerServerAuthenticationListener l)
- Specified by:
removeAuthenticationListener
in interfaceTRTrackerServer
-
preProcess
public void preProcess(TRTrackerServerPeer peer, TRTrackerServerTorrent torrent, int type, java.lang.String request, java.util.Map response) throws TRTrackerServerException
- Throws:
TRTrackerServerException
-
postProcess
public void postProcess(TRTrackerServerPeer peer, TRTrackerServerTorrentImpl torrent, int type, java.lang.String request, java.util.Map response) throws TRTrackerServerException
- Throws:
TRTrackerServerException
-
addRequestListener
public void addRequestListener(TRTrackerServerRequestListener l)
- Specified by:
addRequestListener
in interfaceTRTrackerServer
-
removeRequestListener
public void removeRequestListener(TRTrackerServerRequestListener l)
- Specified by:
removeRequestListener
in interfaceTRTrackerServer
-
close
public void close()
- Specified by:
close
in interfaceTRTrackerServer
-
closeSupport
protected abstract void closeSupport()
-
destroySupport
protected void destroySupport()
-
-