|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.aelitis.azureus.plugins.extseed.ExternalSeedPeer
public class ExternalSeedPeer
Field Summary |
---|
Fields inherited from interface org.gudy.azureus2.plugins.peers.Peer |
---|
CLOSING, CONNECTING, DISCONNECTED, HANDSHAKING, PR_PRIORITY_CONNECTION, PR_PROTOCOL, PR_PROTOCOL_QUALIFIER, TRANSFERING |
Constructor Summary | |
---|---|
protected |
ExternalSeedPeer(ExternalSeedPlugin _plugin,
Download _download,
ExternalSeedReader _reader)
|
Method Summary | |
---|---|
void |
addListener(PeerListener listener)
Add peer listener. |
void |
addListener(PeerListener2 listener)
Add peer listener. |
protected void |
addPeer()
|
void |
addRateLimiter(RateLimiter limiter,
boolean is_upload)
|
boolean |
addRequest(PeerReadRequest request)
|
void |
bindConnection(ConnectionStub stub)
|
void |
cancelRequest(PeerReadRequest request)
|
protected boolean |
checkConnection()
|
void |
close(java.lang.String reason,
boolean closedOnError,
boolean attemptReconnect)
|
protected void |
fireEvent(int type,
java.lang.Object data)
|
boolean[] |
getAvailable()
|
java.lang.String |
getClient()
|
Connection |
getConnection()
Get the network connection that backs this peer. |
protected Download |
getDownload()
|
java.util.List |
getExpiredRequests()
|
byte[] |
getHandshakeReservedBytes()
|
byte[] |
getId()
|
java.lang.String |
getIp()
Get the peer's local TCP connection port. |
PeerManager |
getManager()
|
int |
getMaximumNumberOfRequests()
|
java.lang.String |
getName()
|
int |
getNumberOfRequests()
|
int |
getOutgoingRequestCount()
|
int[] |
getOutgoingRequestedPieceNumbers()
|
int |
getPercentDone()
|
int |
getPercentDoneInThousandNotation()
|
int |
getPercentDoneOfCurrentIncomingRequest()
|
int |
getPercentDoneOfCurrentOutgoingRequest()
|
int |
getPort()
|
int[] |
getPriorityOffsets()
|
java.util.Map |
getProperties()
|
RateLimiter[] |
getRateLimiters(boolean is_upload)
|
protected ExternalSeedReader |
getReader()
|
java.util.List<PeerReadRequest> |
getRequests()
|
long |
getSnubbedTime()
|
int |
getState()
|
PeerStats |
getStats()
|
Message[] |
getSupportedMessages()
Get the list of messages that this peer and us mutually understand. |
int |
getTCPListenPort()
Get the TCP port this peer is listening for incoming connections on. |
int |
getUDPListenPort()
Get the UDP port this peer is listening for incoming connections on. |
int |
getUDPNonDataListenPort()
Get the UDP port this peer is listening on for non-data connections |
java.net.URL |
getURL()
|
java.lang.Object |
getUserData(java.lang.Object key)
|
boolean |
isChoked()
|
boolean |
isChoking()
|
boolean |
isDownloadPossible()
This is much list isTransferAvailable(), except is more comprehensive. |
boolean |
isIncoming()
|
boolean |
isInterested()
|
boolean |
isInteresting()
|
boolean |
isLANLocal()
|
boolean |
isOptimisticUnchoke()
|
boolean |
isPieceAvailable(int pieceNumber)
|
boolean |
isPriorityConnection()
|
boolean |
isSeed()
|
boolean |
isSnubbed()
|
boolean |
isTransferAvailable()
|
int |
readBytes(int max)
Rate control - gives the maximum number of bytes that can be read from this connection at this time and returns the actual number read |
void |
remove()
|
void |
removeListener(PeerListener listener)
Remove peer listener. |
void |
removeListener(PeerListener2 listener)
Remove peer listener. |
protected void |
removePeer()
|
void |
removeRateLimiter(RateLimiter limiter,
boolean is_upload)
|
void |
requestAllocationComplete()
|
boolean |
requestAllocationStarts(int[] base_priorities)
|
void |
requestCancelled(PeerReadRequest request)
|
void |
requestComplete(PeerReadRequest request,
PooledByteBuffer data)
|
void |
requestFailed(PeerReadRequest request)
|
protected boolean |
sameAs(ExternalSeedPeer other)
|
protected void |
setManager(PeerManager _manager)
|
void |
setOptimisticUnchoke(boolean _is_optimistic)
|
void |
setPriorityConnection(boolean is_priority)
|
void |
setSnubbed(boolean b)
|
protected void |
setState(int newState)
|
void |
setUserData(java.lang.Object key,
java.lang.Object value)
|
boolean |
supportsMessaging()
Whether or not this peer supports the advanced messaging API. |
int |
writeBytes(int max)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ExternalSeedPeer(ExternalSeedPlugin _plugin, Download _download, ExternalSeedReader _reader)
Method Detail |
---|
protected boolean sameAs(ExternalSeedPeer other)
protected void setManager(PeerManager _manager)
public PeerManager getManager()
getManager
in interface Peer
protected Download getDownload()
public void bindConnection(ConnectionStub stub)
bindConnection
in interface Peer
protected ExternalSeedReader getReader()
protected void setState(int newState)
protected boolean checkConnection()
protected void addPeer()
protected void removePeer()
public void requestComplete(PeerReadRequest request, PooledByteBuffer data)
requestComplete
in interface ExternalSeedReaderListener
public void requestCancelled(PeerReadRequest request)
requestCancelled
in interface ExternalSeedReaderListener
public void requestFailed(PeerReadRequest request)
requestFailed
in interface ExternalSeedReaderListener
public int getState()
getState
in interface Peer
public byte[] getId()
getId
in interface Peer
public java.net.URL getURL()
public java.lang.String getIp()
Peer
getIp
in interface Peer
public int getTCPListenPort()
Peer
getTCPListenPort
in interface Peer
public int getUDPListenPort()
Peer
getUDPListenPort
in interface Peer
public int getUDPNonDataListenPort()
Peer
getUDPNonDataListenPort
in interface Peer
public int getPort()
getPort
in interface Peer
public boolean isLANLocal()
isLANLocal
in interface Peer
public final boolean[] getAvailable()
getAvailable
in interface Peer
public final boolean isPieceAvailable(int pieceNumber)
isPieceAvailable
in interface Peer
pieceNumber
- int
public boolean isTransferAvailable()
isTransferAvailable
in interface Peer
public boolean isDownloadPossible()
Peer
isDownloadPossible
in interface Peer
public boolean isChoked()
isChoked
in interface Peer
public boolean isChoking()
isChoking
in interface Peer
public boolean isInterested()
isInterested
in interface Peer
public boolean isInteresting()
isInteresting
in interface Peer
public boolean isSeed()
isSeed
in interface Peer
public boolean isSnubbed()
isSnubbed
in interface Peer
public long getSnubbedTime()
getSnubbedTime
in interface Peer
public void setSnubbed(boolean b)
setSnubbed
in interface Peer
public boolean isOptimisticUnchoke()
isOptimisticUnchoke
in interface Peer
public void setOptimisticUnchoke(boolean _is_optimistic)
setOptimisticUnchoke
in interface Peer
public PeerStats getStats()
getStats
in interface Peer
public boolean isIncoming()
isIncoming
in interface Peer
public int getPercentDone()
getPercentDone
in interface Peer
public int getPercentDoneInThousandNotation()
getPercentDoneInThousandNotation
in interface Peer
public java.lang.String getClient()
getClient
in interface Peer
public java.util.List getExpiredRequests()
getExpiredRequests
in interface Peer
public java.util.List<PeerReadRequest> getRequests()
getRequests
in interface Peer
public int getMaximumNumberOfRequests()
getMaximumNumberOfRequests
in interface Peer
public int getNumberOfRequests()
getNumberOfRequests
in interface Peer
public int[] getPriorityOffsets()
getPriorityOffsets
in interface Peer
public boolean requestAllocationStarts(int[] base_priorities)
requestAllocationStarts
in interface Peer
public void requestAllocationComplete()
requestAllocationComplete
in interface Peer
public boolean addRequest(PeerReadRequest request)
addRequest
in interface Peer
public void cancelRequest(PeerReadRequest request)
cancelRequest
in interface Peer
public void close(java.lang.String reason, boolean closedOnError, boolean attemptReconnect)
close
in interface Peer
public void remove()
public void addListener(PeerListener listener)
Peer
addListener
in interface Peer
public void removeListener(PeerListener listener)
Peer
removeListener
in interface Peer
public void addListener(PeerListener2 listener)
Peer
addListener
in interface Peer
public void removeListener(PeerListener2 listener)
Peer
removeListener
in interface Peer
protected void fireEvent(int type, java.lang.Object data)
public Connection getConnection()
Peer
getConnection
in interface Peer
public boolean supportsMessaging()
Peer
supportsMessaging
in interface Peer
public Message[] getSupportedMessages()
Peer
getSupportedMessages
in interface Peer
public int readBytes(int max)
Peer
readBytes
in interface Peer
public int writeBytes(int max)
writeBytes
in interface Peer
public void addRateLimiter(RateLimiter limiter, boolean is_upload)
addRateLimiter
in interface Peer
limiter
- create via ConnectionManageris_upload
- false -> download limitpublic void removeRateLimiter(RateLimiter limiter, boolean is_upload)
removeRateLimiter
in interface Peer
public RateLimiter[] getRateLimiters(boolean is_upload)
getRateLimiters
in interface Peer
public int getPercentDoneOfCurrentIncomingRequest()
getPercentDoneOfCurrentIncomingRequest
in interface Peer
public int[] getOutgoingRequestedPieceNumbers()
getOutgoingRequestedPieceNumbers
in interface Peer
public int getOutgoingRequestCount()
getOutgoingRequestCount
in interface Peer
public int getPercentDoneOfCurrentOutgoingRequest()
getPercentDoneOfCurrentOutgoingRequest
in interface Peer
public java.util.Map getProperties()
public java.lang.String getName()
public void setUserData(java.lang.Object key, java.lang.Object value)
setUserData
in interface Peer
public java.lang.Object getUserData(java.lang.Object key)
getUserData
in interface Peer
public byte[] getHandshakeReservedBytes()
getHandshakeReservedBytes
in interface Peer
public boolean isPriorityConnection()
isPriorityConnection
in interface Peer
public void setPriorityConnection(boolean is_priority)
setPriorityConnection
in interface Peer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |