Class ExternalSeedReaderGetRight
- java.lang.Object
-
- com.biglybt.plugin.extseed.impl.ExternalSeedReaderImpl
-
- com.biglybt.plugin.extseed.impl.getright.ExternalSeedReaderGetRight
-
- All Implemented Interfaces:
PiecePriorityProvider
,PeerManagerListener2
,ExternalSeedReader
public class ExternalSeedReaderGetRight extends ExternalSeedReaderImpl implements PiecePriorityProvider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.biglybt.plugin.extseed.impl.ExternalSeedReaderImpl
ExternalSeedReaderImpl.MutableInteger
-
-
Field Summary
Fields Modifier and Type Field Description private long[]
downloader_lengths
private long[]
downloader_offsets
private ExternalSeedHTTPDownloader[]
http_downloaders
private boolean
linear_download
private int
piece_group_size
private long[]
piece_priorities
private int
piece_size
private int
port
private static int
TARGET_REQUEST_SIZE_DEFAULT
private java.net.URL
url
-
Fields inherited from class com.biglybt.plugin.extseed.impl.ExternalSeedReaderImpl
INITIAL_DELAY, RECONNECT_DEFAULT, STALLED_DOWNLOAD_SPEED, STALLED_PEER_SPEED, TOP_PIECE_PRIORITY
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ExternalSeedReaderGetRight(ExternalSeedPlugin _plugin, Torrent _torrent, java.net.URL _url, java.util.Map _params)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
calculatePriorityOffsets(PeerManager peer_manager, int[] base_priorities)
java.lang.String
getName()
protected int
getPieceGroupSize()
int
getPort()
protected boolean
getRequestCanSpanPieces()
java.lang.String
getType()
java.net.URL
getURL()
protected void
readData(int start_piece_number, int start_piece_offset, int length, ExternalSeedHTTPDownloaderListener listener)
protected void
readData(ExternalSeedReaderRequest request)
boolean
sameAs(ExternalSeedReader other)
protected void
setActiveSupport(PeerManager peer_manager, boolean active)
private void
setupDownloaders()
long[]
updatePriorities(PiecePicker picker)
-
Methods inherited from class com.biglybt.plugin.extseed.impl.ExternalSeedReaderImpl
addListener, addRequests, cancelAllRequests, cancelRequest, checkActivation, deactivate, eventOccurred, getBooleanParam, getExpiredRequests, getFailureCount, getIntParam, getIP, getLastFailTime, getMaximumNumberOfRequests, getOutgoingRequestCount, getOutgoingRequestedPieceNumbers, getPercentDoneOfCurrentIncomingRequest, getPermittedBytes, getPriorityOffsets, getRequestCount, getRequests, getStatus, getSystemTime, getTorrent, getUserAgent, informCancelled, informComplete, informFailed, isActive, isPermanentlyUnavailable, isTransient, log, processRequests, processRequests, read, readBytes, readyToActivate, readyToDeactivate, removeListener, reportBytesRead, selectRequests, setActive, setReconnectDelay
-
-
-
-
Field Detail
-
TARGET_REQUEST_SIZE_DEFAULT
private static final int TARGET_REQUEST_SIZE_DEFAULT
- See Also:
- Constant Field Values
-
url
private java.net.URL url
-
port
private int port
-
http_downloaders
private ExternalSeedHTTPDownloader[] http_downloaders
-
downloader_offsets
private long[] downloader_offsets
-
downloader_lengths
private long[] downloader_lengths
-
piece_size
private int piece_size
-
piece_group_size
private int piece_group_size
-
piece_priorities
private long[] piece_priorities
-
linear_download
private boolean linear_download
-
-
Constructor Detail
-
ExternalSeedReaderGetRight
protected ExternalSeedReaderGetRight(ExternalSeedPlugin _plugin, Torrent _torrent, java.net.URL _url, java.util.Map _params) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-
Method Detail
-
setupDownloaders
private void setupDownloaders()
-
sameAs
public boolean sameAs(ExternalSeedReader other)
- Specified by:
sameAs
in interfaceExternalSeedReader
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceExternalSeedReader
-
getType
public java.lang.String getType()
- Specified by:
getType
in interfaceExternalSeedReader
-
getURL
public java.net.URL getURL()
- Specified by:
getURL
in interfaceExternalSeedReader
-
getPort
public int getPort()
- Specified by:
getPort
in interfaceExternalSeedReader
-
getPieceGroupSize
protected int getPieceGroupSize()
- Specified by:
getPieceGroupSize
in classExternalSeedReaderImpl
-
getRequestCanSpanPieces
protected boolean getRequestCanSpanPieces()
- Specified by:
getRequestCanSpanPieces
in classExternalSeedReaderImpl
-
setActiveSupport
protected void setActiveSupport(PeerManager peer_manager, boolean active)
- Overrides:
setActiveSupport
in classExternalSeedReaderImpl
-
updatePriorities
public long[] updatePriorities(PiecePicker picker)
- Specified by:
updatePriorities
in interfacePiecePriorityProvider
-
calculatePriorityOffsets
public void calculatePriorityOffsets(PeerManager peer_manager, int[] base_priorities)
- Specified by:
calculatePriorityOffsets
in interfaceExternalSeedReader
- Overrides:
calculatePriorityOffsets
in classExternalSeedReaderImpl
-
readData
protected void readData(ExternalSeedReaderRequest request) throws ExternalSeedException
- Overrides:
readData
in classExternalSeedReaderImpl
- Throws:
ExternalSeedException
-
readData
protected void readData(int start_piece_number, int start_piece_offset, int length, ExternalSeedHTTPDownloaderListener listener) throws ExternalSeedException
- Specified by:
readData
in classExternalSeedReaderImpl
- Throws:
ExternalSeedException
-
-