Class TRTrackerServerImpl
java.lang.Object
com.biglybt.core.tracker.server.impl.TRTrackerServerImpl
- All Implemented Interfaces:
TRTrackerServer
- Direct Known Subclasses:
TRTrackerServerDHT
,TRTrackerServerTCP
,TRTrackerServerUDP
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic boolean
static int
static int
private final boolean
private final List
<TRTrackerServerAuthenticationListener> private Set
protected final AEMonitor
static final int
private boolean
private final COConfigurationListener
private long
private int
private final int
private long
private long
private boolean
private boolean
static boolean
private final IpFilter
private boolean
private boolean
private boolean
private static final Map
protected final CopyOnWriteList
<TRTrackerServerListener> protected final CopyOnWriteList
<TRTrackerServerListener2> static int
static int
private final String
private byte[]
private String
static String[]
static String
private final Vector
<TRTrackerServerRequestListener> static boolean
static final int
static final int
private final boolean
static int
static int
static boolean
private final TRTrackerServerStatsImpl
static boolean
protected AEMonitor
static final int
private static final Map
private boolean
private boolean
private boolean
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
ConstructorsConstructorDescriptionTRTrackerServerImpl
(String _name, boolean _apply_ip_filter, boolean _start_up_ready, Map<String, Object> _properties) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addLink
(String link, TRTrackerServerTorrent target) void
void
void
void
close()
protected abstract void
void
deny
(byte[] _hash, boolean _explicit) protected void
protected static boolean
protected static int
protected static int
long
protected Set
protected static int
protected static int
long
long
getName()
byte[]
getPeers
(byte[] hash) protected static String[]
protected static int
long
long
protected static int
protected static boolean
getStats()
getStats
(byte[] hash) getTorrent
(byte[] hash) getTorrent
(String link) int
boolean
boolean
boolean
boolean
static boolean
protected boolean
isIPFiltered
(String ip) boolean
boolean
boolean
isKnownTorrent
(byte[] hash) final boolean
isReady()
boolean
boolean
boolean
boolean
performExternalAuthorisation
(InetSocketAddress remote_ip, String headers, URL resource, String user, String password) byte[]
performExternalAuthorisation
(URL resource, String user) 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
protected void
void
void
removeLink
(String link, TRTrackerServerTorrent target) void
void
void
void
setBiasedPeers
(Set peers) void
setEnabled
(boolean e) void
setEnableKeepAlive
(boolean enable) void
setReady()
static boolean
protected void
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 com.biglybt.core.tracker.server.TRTrackerServer
getBindIP, getHost, getPort, isSSL
-
Field Details
-
RETRY_MINIMUM_SECS
public static final int RETRY_MINIMUM_SECS- See Also:
-
RETRY_MINIMUM_MILLIS
public static final int RETRY_MINIMUM_MILLIS- See Also:
-
CLIENT_TIMEOUT_MULTIPLIER
public static final int CLIENT_TIMEOUT_MULTIPLIER- See Also:
-
TIMEOUT_CHECK
public static final int TIMEOUT_CHECK- See Also:
-
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
-
support_experimental_extensions
public static boolean support_experimental_extensions -
redirect_on_not_found
-
banned_clients
-
torrent_map
-
link_map
-
class_mon
-
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
-
name
-
apply_ip_filter
private final boolean apply_ip_filter -
properties
-
reverse_proxy
private final boolean reverse_proxy -
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
-
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
-
listeners2
-
auth_listeners
-
request_listeners
-
this_mon
-
config_listener
-
destroyed
private boolean destroyed -
biased_peers
-
is_ready
private boolean is_ready
-
-
Constructor Details
-
TRTrackerServerImpl
-
-
Method Details
-
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
-
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() -
isIPFiltered
-
addLink
-
removeLink
-
setBiasedPeers
- Specified by:
setBiasedPeers
in interfaceTRTrackerServer
-
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
-
getName
- Specified by:
getName
in interfaceTRTrackerServer
-
isCompactEnabled
public boolean isCompactEnabled() -
isKeyEnabled
public boolean isKeyEnabled() -
getUsername
-
getPassword
public byte[] getPassword() -
getMinAnnounceRetryInterval
public long getMinAnnounceRetryInterval() -
getAnnounceRetryInterval
-
getSeedAnnounceIntervalMultiplier
public long getSeedAnnounceIntervalMultiplier() -
getScrapeRetryInterval
-
getMinScrapeRetryInterval
public long getMinScrapeRetryInterval() -
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(String _originator, byte[] _hash, boolean _explicit) throws TRTrackerServerException - Specified by:
permit
in interfaceTRTrackerServer
- Throws:
TRTrackerServerException
-
permit
public TRTrackerServerTorrent permit(String _originator, byte[] _hash, boolean _explicit, boolean _enabled) throws TRTrackerServerException - Specified by:
permit
in interfaceTRTrackerServer
- Throws:
TRTrackerServerException
-
deny
- Specified by:
deny
in interfaceTRTrackerServer
- Throws:
TRTrackerServerException
-
isKnownTorrent
public boolean isKnownTorrent(byte[] hash) -
getTorrent
-
getTorrent
-
getTorrents
-
getTorrentCount
public int getTorrentCount() -
getStats
- Specified by:
getStats
in interfaceTRTrackerServer
-
getPeers
- Specified by:
getPeers
in interfaceTRTrackerServer
-
addListener
- Specified by:
addListener
in interfaceTRTrackerServer
-
removeListener
- Specified by:
removeListener
in interfaceTRTrackerServer
-
addListener2
- Specified by:
addListener2
in interfaceTRTrackerServer
-
removeListener2
- Specified by:
removeListener2
in interfaceTRTrackerServer
-
addAuthenticationListener
- Specified by:
addAuthenticationListener
in interfaceTRTrackerServer
-
removeAuthenticationListener
- Specified by:
removeAuthenticationListener
in interfaceTRTrackerServer
-
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
- Specified by:
addRequestListener
in interfaceTRTrackerServer
-
removeRequestListener
- Specified by:
removeRequestListener
in interfaceTRTrackerServer
-
close
public void close()- Specified by:
close
in interfaceTRTrackerServer
-
closeSupport
protected abstract void closeSupport() -
destroySupport
protected void destroySupport()
-