|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gudy.azureus2.pluginsimpl.local.peers.PeerForeignDelegate
public class PeerForeignDelegate
Field Summary | |
---|---|
protected int |
_lastPiece
|
protected AEMonitor |
this_mon
|
Fields inherited from interface org.gudy.azureus2.core3.peer.impl.PEPeerTransport |
---|
CONNECTION_CONNECTING, CONNECTION_FULLY_ESTABLISHED, CONNECTION_PENDING, CONNECTION_WAITING_FOR_HANDSHAKE |
Fields inherited from interface org.gudy.azureus2.core3.peer.PEPeer |
---|
CLOSING, CONNECTING, DISCONNECTED, HANDSHAKING, MESSAGING_AZMP, MESSAGING_BT_ONLY, MESSAGING_EXTERN, MESSAGING_LTEP, StateNames, TRANSFERING |
Fields inherited from interface com.aelitis.azureus.core.tag.Taggable |
---|
TT_DOWNLOAD, TT_PEER |
Constructor Summary | |
---|---|
protected |
PeerForeignDelegate(PeerManagerImpl _manager,
Peer _foreign)
|
Method Summary | |
---|---|
void |
addListener(PEPeerListener l)
Add peer listener. |
void |
addRateLimiter(LimitedRateGroup limiter,
boolean upload)
|
void |
addReservedPieceNumber(int piece_number)
adds the reserved piece for piece picking by this peer |
void |
checkInterested()
Nothing to do if called |
void |
clearAvailabilityAdded()
Nothing to do if called |
void |
clearRequestHint()
|
void |
closeConnection(java.lang.String reason)
Close the peer connection |
protected void |
dataReceived()
|
void |
doKeepAliveCheck()
Check if we need to send a keep-alive message. |
void |
doPerformanceTuningCheck()
Perform checks related to performance optimizations, i.e. |
boolean |
doTimeoutChecks()
Check for possible connection timeouts. |
boolean |
equals(java.lang.Object other)
|
void |
generateEvidence(IndentWriter writer)
|
java.net.InetAddress |
getAlternativeIPv6()
|
BitFlags |
getAvailable()
|
long |
getBytesRemaining()
|
java.lang.String |
getClient()
|
java.lang.String |
getClientNameFromExtensionHandshake()
|
java.lang.String |
getClientNameFromPeerID()
|
int |
getConnectionState()
Get the specific peer connection state. |
int |
getConsecutiveNoRequestCount()
|
PEPeerControl |
getControl()
|
java.lang.Object |
getData(java.lang.String key)
To retreive arbitrary objects against a peer. |
int |
getDownloadRateLimitBytesPerSecond()
|
java.lang.String |
getEncryption()
Returns name of encryption used by the peer |
java.util.List |
getExpiredRequests()
|
byte[] |
getHandshakeReservedBytes()
|
byte[] |
getId()
|
int |
getIncomingRequestCount()
|
int[] |
getIncomingRequestedPieceNumbers()
get a list of piece numbers the peer has requested |
java.lang.String |
getIp()
|
java.lang.String |
getIPHostName()
Gets the host name for the IP, if possible, IP as string otherwise |
long |
getLastMessageSentTime()
|
int |
getLastPiece()
|
long |
getLatency()
|
PEPeerManager |
getManager()
|
int |
getMaxNbRequests()
peer-specific request max. |
int |
getMessagingMode()
|
int |
getNbRequests()
|
java.lang.String |
getNetwork()
|
int |
getOutboundDataQueueSize()
amount of data queued for delivery to peer |
int |
getOutgoingRequestCount()
|
int[] |
getOutgoingRequestedPieceNumbers()
get a list of piece numbers the we have requested from peer |
PeerItem |
getPeerItemIdentity()
Get the peer's address + port identification item. |
java.lang.String |
getPeerSource()
|
int |
getPeerState()
|
int |
getPercentDoneInThousandNotation()
Get the peer's torrent completion percentage in thousand-notation, i.e. |
int |
getPercentDoneOfCurrentIncomingRequest()
|
int |
getPercentDoneOfCurrentOutgoingRequest()
|
Connection |
getPluginConnection()
Get the connection that backs this peer. |
int |
getPort()
Get the peer's local TCP connection port. |
int[] |
getPriorityOffsets()
Any priority offsets this peer has, or null if none |
java.lang.String |
getProtocol()
|
java.lang.String |
getProtocolQualifier()
|
LimitedRateGroup[] |
getRateLimiters(boolean upload)
|
int[] |
getRequestHint()
Get current request hint for a given piece for this peer. |
int |
getRequestIndex(DiskManagerReadRequest request)
Returns the index of this request in the peer's queue or -1 if not found |
int[] |
getReservedPieceNumbers()
Get the reserved pieces for piece picking by this peer |
long |
getSnubbedTime()
|
PEPeerStats |
getStats()
|
Message[] |
getSupportedMessages()
Get the list of messages that this peer and us both understand. |
java.lang.String |
getTaggableID()
|
TaggableResolver |
getTaggableResolver()
|
java.lang.Object |
getTaggableTransientProperty(java.lang.String key)
|
int |
getTaggableType()
|
int |
getTCPListenPort()
Get the TCP port this peer is listening for incoming connections on. |
long |
getTimeSinceConnectionEstablished()
Get the time since this connection was first established. |
long |
getTimeSinceGoodDataReceived()
Get the time since the most-recent data that was actually written to disk was received. |
long |
getTimeSinceLastDataMessageReceived()
Get the time since the last (most-recent) data (payload) message was received. |
long |
getTimeSinceLastDataMessageSent()
Get the time since the last (most-recent) data (payload) message was sent. |
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 |
long |
getUnchokedForMillis()
|
int |
getUniqueAnnounce()
|
int |
getUploadHint()
|
int |
getUploadRateLimitBytesPerSecond()
|
java.lang.Object |
getUserData(java.lang.Object key)
To retreive arbitrary objects against a peer. |
int |
hashCode()
|
boolean |
hasReceivedBitField()
|
boolean |
isAvailabilityAdded()
Apaprently nothing significant to do if called |
boolean |
isChokedByMe()
Am I choking the peer. |
boolean |
isChokingMe()
Is the peer choking me. |
boolean |
isClosed()
|
boolean |
isDownloadDisabled()
|
boolean |
isDownloadPossible()
checks several factors within the object so the caller wouldn't need to for convienience and speed. |
boolean |
isIncoming()
|
boolean |
isInterested()
Is the peer Interested in me. |
boolean |
isInteresting()
Am I Interested in the peer. |
boolean |
isLANLocal()
Is the connection within the local LAN network. |
boolean |
isOptimisticUnchoke()
|
boolean |
isPieceAvailable(int pieceNumber)
|
boolean |
isPriorityConnection()
|
boolean |
isRelativeSeed()
|
boolean |
isSafeForReconnect()
This method is called to check if it is safe to reconnect to a peer, i.e. |
boolean |
isSeed()
|
boolean |
isSnubbed()
|
boolean |
isStalledPendingLoad()
is peer waiting for a disk read with no network writes queued |
boolean |
isTCP()
|
boolean |
isUnchokeOverride()
|
boolean |
isUploadDisabled()
|
PEPeerTransport |
reconnect(boolean tryUDP,
boolean tryIPv6)
Attempts to reconnect to the same peer |
void |
removeListener(PEPeerListener l)
Remove peer listener. |
void |
removeRateLimiter(LimitedRateGroup limiter,
boolean upload)
|
void |
removeReservedPieceNumber(int piece_number)
|
DiskManagerReadRequest |
request(int pieceNumber,
int pieceOffset,
int pieceLength,
boolean return_duplicates)
|
void |
requestAllocationComplete()
|
boolean |
requestAllocationStarts(int[] base_priorities)
Two methods that allow a peer to aggregate the individual requests generated during an allocation cycle if so desired |
void |
sendBadPiece(int piece_number)
|
void |
sendCancel(DiskManagerReadRequest request)
|
void |
sendChoke()
Should never be called |
void |
sendHave(int piece)
Nothing to do if called |
void |
sendRejectRequest(DiskManagerReadRequest request)
|
boolean |
sendRequestHint(int piece_number,
int offset,
int length,
int life)
Send a request hint to the peer. |
void |
sendStatsReply(java.util.Map reply)
|
void |
sendStatsRequest(java.util.Map request)
|
void |
sendUnChoke()
Should never be called |
void |
setConsecutiveNoRequestCount(int num)
|
void |
setData(java.lang.String key,
java.lang.Object value)
To store arbitrary objects against a peer. |
void |
setDownloadDisabled(java.lang.Object key,
boolean disabled)
|
void |
setDownloadRateLimitBytesPerSecond(int bytes)
|
void |
setHaveAggregationEnabled(boolean enabled)
|
void |
setLastPiece(int pieceNumber)
|
void |
setOptimisticUnchoke(boolean is_optimistic)
|
void |
setPriorityConnection(boolean is_priority)
|
void |
setSnubbed(boolean b)
|
void |
setSuspendedLazyBitFieldEnabled(boolean enable)
Enable suspended lazy bitfield for this peer - we will appear incomplete until this is disabled, at which point (well, fairly soon after) the bitfield will be completed |
void |
setTaggableTransientProperty(java.lang.String key,
java.lang.Object value)
|
void |
setUniqueAnnounce(int uniquePieceNumber)
|
void |
setUploadDisabled(java.lang.Object key,
boolean disabled)
|
void |
setUploadHint(int timeToSpread)
|
void |
setUploadRateLimitBytesPerSecond(int bytes)
|
void |
setUserData(java.lang.Object key,
java.lang.Object value)
To store arbitrary objects against a peer. |
void |
start()
Start message processing for the peer |
protected void |
stop()
|
boolean |
supportsMessaging()
Whether or not this peer supports the advanced messaging API. |
boolean |
transferAvailable()
|
void |
updateAutoUploadPriority(java.lang.Object key,
boolean inc)
|
void |
updatePeerExchange()
Do any peer exchange processing/updating. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected volatile int _lastPiece
protected AEMonitor this_mon
Constructor Detail |
---|
protected PeerForeignDelegate(PeerManagerImpl _manager, Peer _foreign)
Method Detail |
---|
public void start()
PEPeerTransport
start
in interface PEPeerTransport
protected void stop()
public void sendChoke()
sendChoke
in interface PEPeerTransport
sendChoke
in interface PEPeer
public void sendHave(int piece)
sendHave
in interface PEPeerTransport
public void sendUnChoke()
sendUnChoke
in interface PEPeerTransport
sendUnChoke
in interface PEPeer
public java.net.InetAddress getAlternativeIPv6()
getAlternativeIPv6
in interface PEPeer
public boolean transferAvailable()
transferAvailable
in interface PEPeerTransport
transferAvailable
in interface PEPeer
public boolean isDownloadPossible()
PEPeer
isDownloadPossible
in interface PEPeer
public void sendCancel(DiskManagerReadRequest request)
sendCancel
in interface PEPeerTransport
public DiskManagerReadRequest request(int pieceNumber, int pieceOffset, int pieceLength, boolean return_duplicates)
request
in interface PEPeerTransport
pieceNumber
- pieceOffset
- pieceLength
- return_duplicates
- - if true and request already exists it will be returned, if false -> null
public int getRequestIndex(DiskManagerReadRequest request)
PEPeerTransport
getRequestIndex
in interface PEPeerTransport
protected void dataReceived()
public void closeConnection(java.lang.String reason)
PEPeerTransport
closeConnection
in interface PEPeerTransport
reason
- for closurepublic boolean isClosed()
isClosed
in interface PEPeer
public java.util.List getExpiredRequests()
getExpiredRequests
in interface PEPeerTransport
public long getLastMessageSentTime()
getLastMessageSentTime
in interface PEPeerTransport
public int getMaxNbRequests()
PEPeerTransport
getMaxNbRequests
in interface PEPeerTransport
public int getNbRequests()
getNbRequests
in interface PEPeerTransport
public int[] getPriorityOffsets()
PEPeerTransport
getPriorityOffsets
in interface PEPeerTransport
public boolean requestAllocationStarts(int[] base_priorities)
PEPeerTransport
requestAllocationStarts
in interface PEPeerTransport
public void requestAllocationComplete()
requestAllocationComplete
in interface PEPeerTransport
public PEPeerControl getControl()
getControl
in interface PEPeerTransport
public void updatePeerExchange()
PEPeerTransport
updatePeerExchange
in interface PEPeerTransport
public PeerItem getPeerItemIdentity()
PEPeerTransport
getPeerItemIdentity
in interface PEPeerTransport
public int getConnectionState()
PEPeerTransport
getConnectionState
in interface PEPeerTransport
public void doKeepAliveCheck()
PEPeerTransport
doKeepAliveCheck
in interface PEPeerTransport
public boolean doTimeoutChecks()
PEPeerTransport
doTimeoutChecks
in interface PEPeerTransport
public void doPerformanceTuningCheck()
PEPeerTransport
doPerformanceTuningCheck
in interface PEPeerTransport
public void setSuspendedLazyBitFieldEnabled(boolean enable)
PEPeer
setSuspendedLazyBitFieldEnabled
in interface PEPeer
public long getTimeSinceConnectionEstablished()
PEPeer
getTimeSinceConnectionEstablished
in interface PEPeer
public long getTimeSinceLastDataMessageReceived()
PEPeerTransport
getTimeSinceLastDataMessageReceived
in interface PEPeerTransport
public long getTimeSinceGoodDataReceived()
PEPeerTransport
getTimeSinceGoodDataReceived
in interface PEPeerTransport
public long getTimeSinceLastDataMessageSent()
PEPeerTransport
getTimeSinceLastDataMessageSent
in interface PEPeerTransport
public long getUnchokedForMillis()
getUnchokedForMillis
in interface PEPeerTransport
public long getLatency()
getLatency
in interface PEPeerTransport
public int getConsecutiveNoRequestCount()
getConsecutiveNoRequestCount
in interface PEPeer
public void setConsecutiveNoRequestCount(int num)
setConsecutiveNoRequestCount
in interface PEPeer
public PEPeerManager getManager()
getManager
in interface PEPeer
public java.lang.String getPeerSource()
getPeerSource
in interface PEPeer
public int getPeerState()
getPeerState
in interface PEPeer
public byte[] getId()
getId
in interface PEPeer
public java.lang.String getIp()
getIp
in interface PEPeer
public java.lang.String getIPHostName()
PEPeer
getIPHostName
in interface PEPeer
public int getPort()
PEPeer
getPort
in interface PEPeer
public int getTCPListenPort()
PEPeer
getTCPListenPort
in interface PEPeer
public int getUDPListenPort()
PEPeer
getUDPListenPort
in interface PEPeer
public int getUDPNonDataListenPort()
PEPeer
getUDPNonDataListenPort
in interface PEPeer
public BitFlags getAvailable()
getAvailable
in interface PEPeer
public boolean hasReceivedBitField()
hasReceivedBitField
in interface PEPeer
public boolean isPieceAvailable(int pieceNumber)
isPieceAvailable
in interface PEPeer
pieceNumber
- int
public void setSnubbed(boolean b)
setSnubbed
in interface PEPeer
public boolean isChokingMe()
PEPeer
isChokingMe
in interface PEPeer
public boolean isChokedByMe()
PEPeer
isChokedByMe
in interface PEPeer
public boolean isUnchokeOverride()
isUnchokeOverride
in interface PEPeer
public boolean isInteresting()
PEPeer
isInteresting
in interface PEPeer
public boolean isInterested()
PEPeer
isInterested
in interface PEPeer
public boolean isSeed()
isSeed
in interface PEPeer
public boolean isRelativeSeed()
isRelativeSeed
in interface PEPeer
public boolean isSnubbed()
isSnubbed
in interface PEPeer
public long getSnubbedTime()
getSnubbedTime
in interface PEPeer
public boolean isLANLocal()
PEPeerTransport
isLANLocal
in interface PEPeerTransport
isLANLocal
in interface PEPeer
public boolean sendRequestHint(int piece_number, int offset, int length, int life)
PEPeer
sendRequestHint
in interface PEPeer
public int[] getRequestHint()
PEPeer
getRequestHint
in interface PEPeer
public void clearRequestHint()
clearRequestHint
in interface PEPeer
public void sendRejectRequest(DiskManagerReadRequest request)
sendRejectRequest
in interface PEPeer
public void sendBadPiece(int piece_number)
sendBadPiece
in interface PEPeerTransport
public void sendStatsRequest(java.util.Map request)
sendStatsRequest
in interface PEPeerTransport
sendStatsRequest
in interface PEPeer
public void sendStatsReply(java.util.Map reply)
sendStatsReply
in interface PEPeerTransport
public boolean isTCP()
isTCP
in interface PEPeerTransport
public java.lang.String getNetwork()
getNetwork
in interface PEPeerTransport
public PEPeerStats getStats()
getStats
in interface PEPeer
public boolean isIncoming()
isIncoming
in interface PEPeer
public int getPercentDoneInThousandNotation()
PEPeer
getPercentDoneInThousandNotation
in interface PEPeer
public long getBytesRemaining()
getBytesRemaining
in interface PEPeer
public java.lang.String getClient()
getClient
in interface PEPeer
public byte[] getHandshakeReservedBytes()
getHandshakeReservedBytes
in interface PEPeer
public boolean isOptimisticUnchoke()
isOptimisticUnchoke
in interface PEPeer
public void setOptimisticUnchoke(boolean is_optimistic)
setOptimisticUnchoke
in interface PEPeer
public int getUniqueAnnounce()
getUniqueAnnounce
in interface PEPeer
public int getUploadHint()
getUploadHint
in interface PEPeer
public void setUniqueAnnounce(int uniquePieceNumber)
setUniqueAnnounce
in interface PEPeer
public void setUploadHint(int timeToSpread)
setUploadHint
in interface PEPeer
public boolean isStalledPendingLoad()
PEPeerTransport
isStalledPendingLoad
in interface PEPeerTransport
public void addListener(PEPeerListener l)
PEPeer
addListener
in interface PEPeer
public void removeListener(PEPeerListener l)
PEPeer
removeListener
in interface PEPeer
public Connection getPluginConnection()
PEPeer
getPluginConnection
in interface PEPeer
public int getPercentDoneOfCurrentIncomingRequest()
getPercentDoneOfCurrentIncomingRequest
in interface PEPeer
public int getPercentDoneOfCurrentOutgoingRequest()
getPercentDoneOfCurrentOutgoingRequest
in interface PEPeer
public boolean supportsMessaging()
PEPeer
supportsMessaging
in interface PEPeer
public int getMessagingMode()
getMessagingMode
in interface PEPeer
public java.lang.String getEncryption()
PEPeer
getEncryption
in interface PEPeer
public java.lang.String getProtocol()
getProtocol
in interface PEPeer
public java.lang.String getProtocolQualifier()
getProtocolQualifier
in interface PEPeer
public Message[] getSupportedMessages()
PEPeer
getSupportedMessages
in interface PEPeer
public java.lang.Object getData(java.lang.String key)
PEPeer
getData
in interface PEPeer
public void setData(java.lang.String key, java.lang.Object value)
PEPeer
setData
in interface PEPeer
public java.lang.Object getUserData(java.lang.Object key)
getUserData
in interface PEPeer
public void setUserData(java.lang.Object key, java.lang.Object value)
setUserData
in interface PEPeer
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int[] getReservedPieceNumbers()
PEPeer
getReservedPieceNumbers
in interface PEPeer
public void addReservedPieceNumber(int piece_number)
PEPeer
addReservedPieceNumber
in interface PEPeer
public void removeReservedPieceNumber(int piece_number)
removeReservedPieceNumber
in interface PEPeer
public int[] getIncomingRequestedPieceNumbers()
PEPeer
getIncomingRequestedPieceNumbers
in interface PEPeer
public int getIncomingRequestCount()
getIncomingRequestCount
in interface PEPeer
public int getOutgoingRequestCount()
getOutgoingRequestCount
in interface PEPeer
public int[] getOutgoingRequestedPieceNumbers()
PEPeer
getOutgoingRequestedPieceNumbers
in interface PEPeer
public int getOutboundDataQueueSize()
PEPeer
getOutboundDataQueueSize
in interface PEPeer
public int getLastPiece()
getLastPiece
in interface PEPeer
public void setLastPiece(int pieceNumber)
setLastPiece
in interface PEPeer
public void checkInterested()
checkInterested
in interface PEPeerTransport
public boolean isAvailabilityAdded()
public void clearAvailabilityAdded()
public PEPeerTransport reconnect(boolean tryUDP, boolean tryIPv6)
PEPeerTransport
reconnect
in interface PEPeerTransport
tryUDP
- try to initate a UDP connection if true, just reestablish the previous state otherwisetryIPv6
- TODO
public boolean isSafeForReconnect()
PEPeerTransport
isSafeForReconnect
in interface PEPeerTransport
public void setUploadRateLimitBytesPerSecond(int bytes)
setUploadRateLimitBytesPerSecond
in interface PEPeer
public void setDownloadRateLimitBytesPerSecond(int bytes)
setDownloadRateLimitBytesPerSecond
in interface PEPeer
public int getUploadRateLimitBytesPerSecond()
getUploadRateLimitBytesPerSecond
in interface PEPeer
public int getDownloadRateLimitBytesPerSecond()
getDownloadRateLimitBytesPerSecond
in interface PEPeer
public void updateAutoUploadPriority(java.lang.Object key, boolean inc)
updateAutoUploadPriority
in interface PEPeer
public void addRateLimiter(LimitedRateGroup limiter, boolean upload)
addRateLimiter
in interface PEPeer
public LimitedRateGroup[] getRateLimiters(boolean upload)
getRateLimiters
in interface PEPeer
public void removeRateLimiter(LimitedRateGroup limiter, boolean upload)
removeRateLimiter
in interface PEPeer
public void setUploadDisabled(java.lang.Object key, boolean disabled)
setUploadDisabled
in interface PEPeer
public void setDownloadDisabled(java.lang.Object key, boolean disabled)
setDownloadDisabled
in interface PEPeer
public boolean isUploadDisabled()
isUploadDisabled
in interface PEPeer
public boolean isDownloadDisabled()
isDownloadDisabled
in interface PEPeer
public void setHaveAggregationEnabled(boolean enabled)
setHaveAggregationEnabled
in interface PEPeer
public void setPriorityConnection(boolean is_priority)
setPriorityConnection
in interface PEPeer
public boolean isPriorityConnection()
isPriorityConnection
in interface PEPeer
public void generateEvidence(IndentWriter writer)
generateEvidence
in interface PEPeerTransport
public java.lang.String getClientNameFromExtensionHandshake()
getClientNameFromExtensionHandshake
in interface PEPeer
public java.lang.String getClientNameFromPeerID()
getClientNameFromPeerID
in interface PEPeer
public int getTaggableType()
public java.lang.String getTaggableID()
public TaggableResolver getTaggableResolver()
public java.lang.Object getTaggableTransientProperty(java.lang.String key)
public void setTaggableTransientProperty(java.lang.String key, java.lang.Object value)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |