Package com.biglybt.core.lws
Class LightWeightSeed
- java.lang.Object
-
- com.biglybt.core.logging.LogRelation
-
- com.biglybt.core.lws.LightWeightSeed
-
- All Implemented Interfaces:
PeerManagerRegistrationAdapter
public class LightWeightSeed extends LogRelation implements PeerManagerRegistrationAdapter
-
-
Field Summary
-
Fields inherited from interface com.biglybt.core.peermanager.PeerManagerRegistrationAdapter
AT_ACCEPTED, AT_ACCEPTED_PROBE, AT_DECLINED
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
LightWeightSeed(LightWeightSeedManager _manager, java.lang.String _name, HashWrapper _hash, java.net.URL _announce_url, java.io.File _data_location, java.lang.String _network, LightWeightSeedAdapter _adapter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
activate(java.lang.String reason_str, byte activation_reason)
int
activateRequest(java.net.InetSocketAddress remote_address)
protected void
checkDeactivation()
protected TRTrackerAnnouncer
createAnnouncer()
protected void
deactivate()
void
deactivateRequest(java.net.InetSocketAddress remote_address)
void
enqueueReadRequest(PEPeer peer, DiskManagerReadRequest request, DiskManagerReadRequestListener listener)
protected void
ensureActive(java.lang.String reason, byte a_reason)
java.net.URL
getAnnounceURL()
java.io.File
getDataLocation()
java.lang.String
getDescription()
int
getExtendedMessagingMode()
HashWrapper
getHash()
byte[]
getHashOverride()
int
getHashOverrideLocalPort(boolean only_if_allocated)
protected java.lang.String
getName()
int
getNbPieces()
java.lang.String
getNetwork()
byte[]
getPeerID()
java.lang.Object[]
getQueryableInterfaces()
Query this class for a reference to another class that it may holdLogRelation
getRelation()
java.lang.String
getRelationText()
A short description of what your class holds that can be printed by the loggerbyte[][]
getSecrets()
protected long
getSize()
protected java.lang.String
getString()
protected Torrent
getTorrent()
protected TOTorrent
getTOTorrent(boolean actual)
boolean
isPeerSourceEnabled(java.lang.String peer_source)
protected void
log(java.lang.String str)
protected void
log(java.lang.String str, java.lang.Throwable e)
boolean
manualRoute(NetworkConnection connection)
void
remove()
protected void
start()
protected void
stop()
-
Methods inherited from class com.biglybt.core.logging.LogRelation
propogatedRelationText, queryForClass
-
-
-
-
Field Detail
-
ACT_NONE
private static final byte ACT_NONE
- See Also:
- Constant Field Values
-
ACT_HAS_PEERS
private static final byte ACT_HAS_PEERS
- See Also:
- Constant Field Values
-
ACT_HAS_POTENTIAL_PEERS
private static final byte ACT_HAS_POTENTIAL_PEERS
- See Also:
- Constant Field Values
-
ACT_INCOMING
private static final byte ACT_INCOMING
- See Also:
- Constant Field Values
-
ACT_NO_PM
private static final byte ACT_NO_PM
- See Also:
- Constant Field Values
-
ACT_TIMING_OUT
private static final byte ACT_TIMING_OUT
- See Also:
- Constant Field Values
-
ACT_TRACKER_ANNOUNCE
private static final byte ACT_TRACKER_ANNOUNCE
- See Also:
- Constant Field Values
-
ACT_TRACKER_SCRAPE
private static final byte ACT_TRACKER_SCRAPE
- See Also:
- Constant Field Values
-
DEACTIVATION_TIMEOUT
private static final int DEACTIVATION_TIMEOUT
- See Also:
- Constant Field Values
-
DEACTIVATION_WITH_POTENTIAL_TIMEOUT
private static final int DEACTIVATION_WITH_POTENTIAL_TIMEOUT
- See Also:
- Constant Field Values
-
manager
private final LightWeightSeedManager manager
-
adapter
private final LightWeightSeedAdapter adapter
-
name
private final java.lang.String name
-
hash
private final HashWrapper hash
-
announce_url
private final java.net.URL announce_url
-
data_location
private final java.io.File data_location
-
network
private final java.lang.String network
-
peer_manager_registration
private PeerManagerRegistration peer_manager_registration
-
peer_manager
private volatile PEPeerManager peer_manager
-
disk_manager
private volatile LWSDiskManager disk_manager
-
pseudo_download
private LWSDownload pseudo_download
-
torrent_facade
private volatile LWSTorrent torrent_facade
-
announcer
private TRTrackerAnnouncer announcer
-
actual_torrent
private TOTorrent actual_torrent
-
is_running
private boolean is_running
-
last_activity_time
private long last_activity_time
-
activation_state
private int activation_state
-
-
Constructor Detail
-
LightWeightSeed
protected LightWeightSeed(LightWeightSeedManager _manager, java.lang.String _name, HashWrapper _hash, java.net.URL _announce_url, java.io.File _data_location, java.lang.String _network, LightWeightSeedAdapter _adapter)
-
-
Method Detail
-
getName
protected java.lang.String getName()
-
getTorrent
protected Torrent getTorrent()
-
getTOTorrent
protected TOTorrent getTOTorrent(boolean actual)
-
getHash
public HashWrapper getHash()
-
getHashOverride
public byte[] getHashOverride()
- Specified by:
getHashOverride
in interfacePeerManagerRegistrationAdapter
-
getPeerID
public byte[] getPeerID()
- Specified by:
getPeerID
in interfacePeerManagerRegistrationAdapter
-
getNbPieces
public int getNbPieces()
- Specified by:
getNbPieces
in interfacePeerManagerRegistrationAdapter
-
getExtendedMessagingMode
public int getExtendedMessagingMode()
- Specified by:
getExtendedMessagingMode
in interfacePeerManagerRegistrationAdapter
-
getHashOverrideLocalPort
public int getHashOverrideLocalPort(boolean only_if_allocated)
- Specified by:
getHashOverrideLocalPort
in interfacePeerManagerRegistrationAdapter
-
getAnnounceURL
public java.net.URL getAnnounceURL()
-
getDataLocation
public java.io.File getDataLocation()
-
getNetwork
public java.lang.String getNetwork()
-
getSize
protected long getSize()
-
isPeerSourceEnabled
public boolean isPeerSourceEnabled(java.lang.String peer_source)
- Specified by:
isPeerSourceEnabled
in interfacePeerManagerRegistrationAdapter
-
manualRoute
public boolean manualRoute(NetworkConnection connection)
- Specified by:
manualRoute
in interfacePeerManagerRegistrationAdapter
-
getSecrets
public byte[][] getSecrets()
- Specified by:
getSecrets
in interfacePeerManagerRegistrationAdapter
-
activateRequest
public int activateRequest(java.net.InetSocketAddress remote_address)
- Specified by:
activateRequest
in interfacePeerManagerRegistrationAdapter
- Returns:
- one of the AT_ constants
-
deactivateRequest
public void deactivateRequest(java.net.InetSocketAddress remote_address)
- Specified by:
deactivateRequest
in interfacePeerManagerRegistrationAdapter
-
getDescription
public java.lang.String getDescription()
- Specified by:
getDescription
in interfacePeerManagerRegistrationAdapter
-
start
protected void start()
-
stop
protected void stop()
-
activate
protected void activate(java.lang.String reason_str, byte activation_reason)
-
deactivate
protected void deactivate()
-
createAnnouncer
protected TRTrackerAnnouncer createAnnouncer() throws TRTrackerAnnouncerException
- Throws:
TRTrackerAnnouncerException
-
ensureActive
protected void ensureActive(java.lang.String reason, byte a_reason)
-
checkDeactivation
protected void checkDeactivation()
-
enqueueReadRequest
public void enqueueReadRequest(PEPeer peer, DiskManagerReadRequest request, DiskManagerReadRequestListener listener)
-
remove
public void remove()
-
getRelationText
public java.lang.String getRelationText()
Description copied from class:LogRelation
A short description of what your class holds that can be printed by the logger- Overrides:
getRelationText
in classLogRelation
- Returns:
-
getQueryableInterfaces
public java.lang.Object[] getQueryableInterfaces()
Description copied from class:LogRelation
Query this class for a reference to another class that it may hold- Overrides:
getQueryableInterfaces
in classLogRelation
- Returns:
- If found, the class desired. Otherwise, null.
-
getRelation
public LogRelation getRelation()
-
getString
protected java.lang.String getString()
-
log
protected void log(java.lang.String str)
-
log
protected void log(java.lang.String str, java.lang.Throwable e)
-
-