Package com.biglybt.core.peermanager
Class PeerManager.PeerManagerRegistrationImpl
- java.lang.Object
-
- com.biglybt.core.peermanager.PeerManager.PeerManagerRegistrationImpl
-
- All Implemented Interfaces:
PeerManagerRegistration
- Enclosing class:
- PeerManager
private class PeerManager.PeerManagerRegistrationImpl extends java.lang.Object implements PeerManagerRegistration
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
PeerManager.PeerManagerRegistrationImpl.ProbeControl
-
Field Summary
Fields Modifier and Type Field Description private PEPeerControl
active_control
private PeerManagerRegistrationAdapter
adapter
private PEPeerControl
download
private HashWrapper
hash
private BloomFilter
known_seeds
private java.util.Map<java.lang.String,TOTorrentFile>
links
private java.util.List<java.lang.Object[]>
pending_connections
private PeerManager.PeerManagerRegistrationImpl.ProbeControl
probe_control
-
Constructor Summary
Constructors Modifier Constructor Description protected
PeerManagerRegistrationImpl(HashWrapper _hash, PeerManagerRegistrationAdapter _adapter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate(PEPeerControl _active_control)
void
addLink(java.lang.String link, TOTorrentFile target)
void
deactivate()
protected PEPeerControl
getActiveControl()
protected PeerManagerRegistrationAdapter
getAdapter()
protected byte[]
getHash()
int
getHashOverrideLocalPort(boolean only_if_allocated)
TOTorrentFile
getLink(java.lang.String target)
java.util.List<PeerManagerRegistration>
getOtherRegistrationsForHash()
boolean
isActive()
protected boolean
isKnownSeed(java.net.InetSocketAddress address)
void
removeLink(java.lang.String link)
protected void
route(NetworkConnection connection, PeerManagerRoutingListener listener)
protected void
route(PEPeerControl control, NetworkConnection connection, boolean is_activation, PeerManagerRoutingListener listener)
protected void
setKnownSeed(java.net.InetSocketAddress address)
protected boolean
timeoutCheck()
void
unregister()
-
-
-
Field Detail
-
hash
private final HashWrapper hash
-
adapter
private final PeerManagerRegistrationAdapter adapter
-
probe_control
private final PeerManager.PeerManagerRegistrationImpl.ProbeControl probe_control
-
download
private PEPeerControl download
-
active_control
private volatile PEPeerControl active_control
-
pending_connections
private java.util.List<java.lang.Object[]> pending_connections
-
known_seeds
private BloomFilter known_seeds
-
links
private java.util.Map<java.lang.String,TOTorrentFile> links
-
-
Constructor Detail
-
PeerManagerRegistrationImpl
protected PeerManagerRegistrationImpl(HashWrapper _hash, PeerManagerRegistrationAdapter _adapter)
-
-
Method Detail
-
getAdapter
protected PeerManagerRegistrationAdapter getAdapter()
-
getHash
protected byte[] getHash()
-
getHashOverrideLocalPort
public int getHashOverrideLocalPort(boolean only_if_allocated)
- Specified by:
getHashOverrideLocalPort
in interfacePeerManagerRegistration
-
getOtherRegistrationsForHash
public java.util.List<PeerManagerRegistration> getOtherRegistrationsForHash()
- Specified by:
getOtherRegistrationsForHash
in interfacePeerManagerRegistration
-
getLink
public TOTorrentFile getLink(java.lang.String target)
- Specified by:
getLink
in interfacePeerManagerRegistration
-
addLink
public void addLink(java.lang.String link, TOTorrentFile target) throws java.lang.Exception
- Specified by:
addLink
in interfacePeerManagerRegistration
- Throws:
java.lang.Exception
-
removeLink
public void removeLink(java.lang.String link)
- Specified by:
removeLink
in interfacePeerManagerRegistration
-
isActive
public boolean isActive()
-
activate
public void activate(PEPeerControl _active_control)
- Specified by:
activate
in interfacePeerManagerRegistration
-
deactivate
public void deactivate()
- Specified by:
deactivate
in interfacePeerManagerRegistration
-
unregister
public void unregister()
- Specified by:
unregister
in interfacePeerManagerRegistration
-
isKnownSeed
protected boolean isKnownSeed(java.net.InetSocketAddress address)
-
setKnownSeed
protected void setKnownSeed(java.net.InetSocketAddress address)
-
getActiveControl
protected PEPeerControl getActiveControl()
-
route
protected void route(NetworkConnection connection, PeerManagerRoutingListener listener)
-
timeoutCheck
protected boolean timeoutCheck()
-
route
protected void route(PEPeerControl control, NetworkConnection connection, boolean is_activation, PeerManagerRoutingListener listener)
-
-