|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gudy.azureus2.core3.logging.LogRelation org.gudy.azureus2.pluginsimpl.local.peers.PeerImpl
public class PeerImpl
Field Summary | |
---|---|
protected PEPeer |
delegate
|
protected PeerManagerImpl |
manager
|
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 |
PeerImpl(PEPeer _delegate)
don't use me, use PeerManagerImpl.getPeerForPEPeer |
Method Summary | |
---|---|
void |
addListener(PeerListener l)
Add peer listener. |
void |
addListener(PeerListener2 l)
Add peer listener. |
void |
addRateLimiter(RateLimiter limiter,
boolean is_upload)
|
boolean |
addRequest(PeerReadRequest request)
|
void |
bindConnection(ConnectionStub stub)
|
void |
cancelRequest(PeerReadRequest request)
|
void |
close(String reason,
boolean closedOnError,
boolean attemptReconnect)
|
protected void |
closed()
|
boolean |
equals(Object other)
|
boolean[] |
getAvailable()
|
String |
getClient()
|
Connection |
getConnection()
Get the network connection that backs this peer. |
PEPeer |
getDelegate()
|
List |
getExpiredRequests()
|
byte[] |
getHandshakeReservedBytes()
|
byte[] |
getId()
|
String |
getIp()
Get the peer's local TCP connection port. |
PeerManager |
getManager()
|
int |
getMaximumNumberOfRequests()
|
int |
getNumberOfRequests()
|
int |
getOutgoingRequestCount()
|
int[] |
getOutgoingRequestedPieceNumbers()
|
PEPeer |
getPEPeer()
Core use only. |
int |
getPercentDone()
|
int |
getPercentDoneInThousandNotation()
|
int |
getPercentDoneOfCurrentIncomingRequest()
|
int |
getPercentDoneOfCurrentOutgoingRequest()
|
int |
getPort()
|
int[] |
getPriorityOffsets()
|
Object[] |
getQueryableInterfaces()
Query this class for a reference to another class that it may hold |
RateLimiter[] |
getRateLimiters(boolean is_upload)
|
String |
getRelationText()
A short description of what your class holds that can be printed by the logger |
List |
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 |
Object |
getUserData(Object key)
|
int |
hashCode()
|
void |
initialize()
|
boolean |
isChoked()
|
boolean |
isChoking()
|
boolean |
isDownloadPossible()
This is much list isTransferAvailable(), except is more comprehensive. |
boolean |
isIncoming()
|
boolean |
isInterested()
|
boolean |
isInteresting()
|
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 |
removeListener(PeerListener l)
Remove peer listener. |
void |
removeListener(PeerListener2 l)
Remove peer listener. |
void |
removeRateLimiter(RateLimiter limiter,
boolean is_upload)
|
void |
requestAllocationComplete()
|
boolean |
requestAllocationStarts(int[] base_priorities)
|
void |
setOptimisticUnchoke(boolean is_optimistic)
|
void |
setPriorityConnection(boolean is_priority)
|
void |
setSnubbed(boolean b)
|
void |
setUserData(Object key,
Object value)
|
boolean |
supportsMessaging()
Whether or not this peer supports the advanced messaging API. |
int |
writeBytes(int max)
|
Methods inherited from class org.gudy.azureus2.core3.logging.LogRelation |
---|
propogatedRelationText, queryForClass, queryForClass |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected PeerManagerImpl manager
protected PEPeer delegate
Constructor Detail |
---|
protected PeerImpl(PEPeer _delegate)
_delegate
- Method Detail |
---|
public void bindConnection(ConnectionStub stub)
bindConnection
in interface Peer
public PeerManager getManager()
getManager
in interface Peer
public PEPeer getDelegate()
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 getState()
getState
in interface Peer
public byte[] getId()
getId
in interface Peer
public String getIp()
Peer
getIp
in interface Peer
public int getPort()
getPort
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 final boolean[] getAvailable()
getAvailable
in interface Peer
public 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 PeerStats getStats()
getStats
in interface Peer
public boolean isIncoming()
isIncoming
in interface Peer
public int getPercentDone()
getPercentDone
in interface Peer
public int getOutgoingRequestCount()
getOutgoingRequestCount
in interface Peer
public int[] getOutgoingRequestedPieceNumbers()
getOutgoingRequestedPieceNumbers
in interface Peer
public int getPercentDoneInThousandNotation()
getPercentDoneInThousandNotation
in interface Peer
public String getClient()
getClient
in interface Peer
public boolean isOptimisticUnchoke()
isOptimisticUnchoke
in interface Peer
public void setOptimisticUnchoke(boolean is_optimistic)
setOptimisticUnchoke
in interface Peer
public void initialize()
public List getExpiredRequests()
getExpiredRequests
in interface Peer
public List getRequests()
getRequests
in interface Peer
public int getNumberOfRequests()
getNumberOfRequests
in interface Peer
public int getMaximumNumberOfRequests()
getMaximumNumberOfRequests
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 void cancelRequest(PeerReadRequest request)
cancelRequest
in interface Peer
public boolean addRequest(PeerReadRequest request)
addRequest
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 void close(String reason, boolean closedOnError, boolean attemptReconnect)
close
in interface Peer
public int readBytes(int max)
Peer
readBytes
in interface Peer
public int writeBytes(int max)
writeBytes
in interface Peer
protected void closed()
public int getPercentDoneOfCurrentIncomingRequest()
getPercentDoneOfCurrentIncomingRequest
in interface Peer
public int getPercentDoneOfCurrentOutgoingRequest()
getPercentDoneOfCurrentOutgoingRequest
in interface Peer
public void addListener(PeerListener l)
Peer
addListener
in interface Peer
public void removeListener(PeerListener l)
Peer
removeListener
in interface Peer
public void addListener(PeerListener2 l)
Peer
addListener
in interface Peer
public void removeListener(PeerListener2 l)
Peer
removeListener
in interface Peer
public boolean isPriorityConnection()
isPriorityConnection
in interface Peer
public void setPriorityConnection(boolean is_priority)
setPriorityConnection
in interface Peer
public void setUserData(Object key, Object value)
setUserData
in interface Peer
public Object getUserData(Object key)
getUserData
in interface Peer
public boolean equals(Object other)
equals
in class Object
public int hashCode()
hashCode
in class Object
public PEPeer getPEPeer()
public String getRelationText()
LogRelation
getRelationText
in class LogRelation
public Object[] getQueryableInterfaces()
LogRelation
getQueryableInterfaces
in class LogRelation
public byte[] getHandshakeReservedBytes()
getHandshakeReservedBytes
in interface Peer
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |