|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.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 |
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 |
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 Peerpublic PeerManager getManager()
getManager in interface Peerpublic PEPeer getDelegate()
public Connection getConnection()
Peer
getConnection in interface Peerpublic boolean supportsMessaging()
Peer
supportsMessaging in interface Peerpublic Message[] getSupportedMessages()
Peer
getSupportedMessages in interface Peerpublic int getState()
getState in interface Peerpublic byte[] getId()
getId in interface Peerpublic String getIp()
Peer
getIp in interface Peerpublic int getPort()
getPort in interface Peerpublic int getTCPListenPort()
Peer
getTCPListenPort in interface Peerpublic int getUDPListenPort()
Peer
getUDPListenPort in interface Peerpublic int getUDPNonDataListenPort()
Peer
getUDPNonDataListenPort in interface Peerpublic boolean isLANLocal()
isLANLocal in interface Peerpublic final boolean[] getAvailable()
getAvailable in interface Peerpublic boolean isPieceAvailable(int pieceNumber)
isPieceAvailable in interface PeerpieceNumber - int
public boolean isTransferAvailable()
isTransferAvailable in interface Peerpublic boolean isDownloadPossible()
Peer
isDownloadPossible in interface Peerpublic boolean isChoked()
isChoked in interface Peerpublic boolean isChoking()
isChoking in interface Peerpublic boolean isInterested()
isInterested in interface Peerpublic boolean isInteresting()
isInteresting in interface Peerpublic boolean isSeed()
isSeed in interface Peerpublic boolean isSnubbed()
isSnubbed in interface Peerpublic long getSnubbedTime()
getSnubbedTime in interface Peerpublic void setSnubbed(boolean b)
setSnubbed in interface Peerpublic PeerStats getStats()
getStats in interface Peerpublic boolean isIncoming()
isIncoming in interface Peerpublic int getPercentDone()
getPercentDone in interface Peerpublic int getOutgoingRequestCount()
getOutgoingRequestCount in interface Peerpublic int[] getOutgoingRequestedPieceNumbers()
getOutgoingRequestedPieceNumbers in interface Peerpublic int getPercentDoneInThousandNotation()
getPercentDoneInThousandNotation in interface Peerpublic String getClient()
getClient in interface Peerpublic boolean isOptimisticUnchoke()
isOptimisticUnchoke in interface Peerpublic void setOptimisticUnchoke(boolean is_optimistic)
setOptimisticUnchoke in interface Peerpublic void initialize()
public List getExpiredRequests()
getExpiredRequests in interface Peerpublic List getRequests()
getRequests in interface Peerpublic int getNumberOfRequests()
getNumberOfRequests in interface Peerpublic int getMaximumNumberOfRequests()
getMaximumNumberOfRequests in interface Peerpublic int[] getPriorityOffsets()
getPriorityOffsets in interface Peerpublic boolean requestAllocationStarts(int[] base_priorities)
requestAllocationStarts in interface Peerpublic void requestAllocationComplete()
requestAllocationComplete in interface Peerpublic void cancelRequest(PeerReadRequest request)
cancelRequest in interface Peerpublic boolean addRequest(PeerReadRequest request)
addRequest in interface Peer
public void addRateLimiter(RateLimiter limiter,
boolean is_upload)
addRateLimiter in interface Peerlimiter - create via ConnectionManageris_upload - false -> download limit
public void removeRateLimiter(RateLimiter limiter,
boolean is_upload)
removeRateLimiter in interface Peerpublic RateLimiter[] getRateLimiters(boolean is_upload)
getRateLimiters in interface Peer
public void close(String reason,
boolean closedOnError,
boolean attemptReconnect)
close in interface Peerpublic int readBytes(int max)
Peer
readBytes in interface Peerpublic int writeBytes(int max)
writeBytes in interface Peerprotected void closed()
public int getPercentDoneOfCurrentIncomingRequest()
getPercentDoneOfCurrentIncomingRequest in interface Peerpublic int getPercentDoneOfCurrentOutgoingRequest()
getPercentDoneOfCurrentOutgoingRequest in interface Peerpublic void addListener(PeerListener l)
Peer
addListener in interface Peerpublic void removeListener(PeerListener l)
Peer
removeListener in interface Peerpublic void addListener(PeerListener2 l)
Peer
addListener in interface Peerpublic void removeListener(PeerListener2 l)
Peer
removeListener in interface Peerpublic boolean isPriorityConnection()
isPriorityConnection in interface Peerpublic void setPriorityConnection(boolean is_priority)
setPriorityConnection in interface Peer
public void setUserData(Object key,
Object value)
setUserData in interface Peerpublic Object getUserData(Object key)
getUserData in interface Peerpublic boolean equals(Object other)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic PEPeer getPEPeer()
public String getRelationText()
LogRelation
getRelationText in class LogRelationpublic Object[] getQueryableInterfaces()
LogRelation
getQueryableInterfaces in class LogRelationpublic byte[] getHandshakeReservedBytes()
getHandshakeReservedBytes in interface Peer
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||