FileDocCategorySizeDatePackage
PEPeerManager.javaAPI DocAzureus 3.0.3.48186Sun Sep 23 10:13:26 BST 2007org.gudy.azureus2.core3.peer

PEPeerManager

public interface PEPeerManager
author
parg
author
MjrTom 2005/Oct/08: pieceAdded => addPiece to simplify new piece-picking, getAvgAvail

Fields Summary
Constructors Summary
Methods Summary
public voidaddListener(PEPeerManagerListener l)

public voidaddPeer(PEPeer peer)

public voidaddPeer(java.lang.String ip_address, int tcp_port, int udp_port, boolean use_crypto)
Add a new peer, using the default internal PEPeer implementation (like for peers given in announce reply), using the given address and port.

param
ip_address of peer to inject
param
tcp_port of peer to inject
param
udp_port of peer to inject (0 if unknown)
param
use_crypto use encrypted transport

public voidaddPiece(PEPiece piece, int pieceNumber)

public voidaddRateLimiter(com.aelitis.azureus.core.networkmanager.LimitedRateGroup group, boolean upload)

public booleancanToggleSuperSeedMode()

public DiskManagerReadRequestcreateDiskManagerRequest(int pieceNumber, int offset, int length)

public com.aelitis.azureus.core.peermanager.peerdb.PeerExchangerItemcreatePeerExchangeConnection(org.gudy.azureus2.core3.peer.impl.PEPeerTransport base_peer)
Register a peer connection for peer exchange handling. NOTE: Creation could fail if the peer is not eligible for peer exchange (like if it's remote port is unknown).

param
base_peer exchaning with
return
peer database connection item, or null if creation failed

public PEPeerStatscreatePeerStats(PEPeer owner)

public voiddataBytesReceived(PEPeer peer, int l)
Data bytes received.

param
l

public voiddataBytesSent(PEPeer peer, int l)
Data bytes sent.

param
l

public voiddiscarded(PEPeer peer, int l)

public voidgenerateEvidence(org.gudy.azureus2.core3.util.IndentWriter writer)

public PEPeerManagerAdaptergetAdapter()

public longgetAvailWentBadTime()

public int[]getAvailability()

public intgetAvailability(int pieceNumber)

public intgetAverageCompletionInThousandNotation()
Get the average completion percentage of connected peers.

return
average percent complete in thousand notation

public floatgetAvgAvail()

public java.lang.ObjectgetData(java.lang.String key)
To retreive arbitrary objects against this object.

public DiskManagergetDiskManager()

public java.lang.StringgetDisplayName()

public com.aelitis.azureus.core.networkmanager.LimitedRateGroupgetDownloadLimitedRateGroup()
Get the limited rate group used for download limiting.

return
download limit group

public intgetDownloadRateLimitBytesPerSecond()

public longgetETA()

public java.lang.StringgetElapsedTime()

public byte[]getHash()

public longgetLastRemoteConnectionTime()

public intgetMaxNewConnectionsAllowed()

public floatgetMinAvailability()

public intgetNbPeers()

public intgetNbRemoteConnectionsExcludingUDP()

public intgetNbSeeds()

public byte[]getPeerId()

public org.gudy.azureus2.core3.peer.util.PeerIdentityDataIDgetPeerIdentityDataID()

public java.util.ListgetPeers()

public java.util.ListgetPeers(java.lang.String address)

public org.gudy.azureus2.plugins.peers.PeerDescriptor[]getPendingPeers(java.lang.String address)

public PEPiecegetPiece(int pieceNumber)

return
PEPiece or null if piece not currently active

public intgetPieceLength(int pieceNumber)

public com.aelitis.azureus.core.peermanager.piecepicker.PiecePickergetPiecePicker()

public PEPiece[]getPieces()
Often better to use getPiece(pieceNumber)

public booleangetPreferUDP()

public longgetRemaining()

public PEPeerManagerStatsgetStats()

public longgetTimeStarted()

public longgetTimeStartedSeeding()

public org.gudy.azureus2.core3.peer.impl.PEPeerTransportgetTransportFromAddress(java.lang.String peer)
Locate an existing transport via [IP] Address.

param
peer String to look for
return
PEPeerTransport with matching address String, or null if no match is found

public org.gudy.azureus2.core3.peer.impl.PEPeerTransportgetTransportFromIdentity(byte[] peer_id)
Locate an existing transport via peer id byte identity.

param
peer_id to look for
return
transport with matching identity, or null if no match is found

public com.aelitis.azureus.core.networkmanager.LimitedRateGroupgetUploadLimitedRateGroup()
Get the limited rate group used for upload limiting.

return
upload limit group

public intgetUploadRateLimitBytesPerSecond()

public booleanhasDownloadablePiece()

public booleanhasPotentialConnections()

public booleanisInEndGameMode()
Are we in end-game mode?

return
true if in end game mode, false if not

public booleanisSeeding()

public booleanisSuperSeedMode()

public booleanisWritten(int piece_number, int offset)

public booleanneedsMD5CheckOnCompletion(int pieceNumber)

public voidpeerAdded(PEPeer pc)

public voidpeerConnectionClosed(org.gudy.azureus2.core3.peer.impl.PEPeerTransport peer, boolean connect_failed)
Notify the manager that the given peer connection has been closed.

param
peer closed

public voidpeerRemoved(PEPeer pc)

public voidpeerVerifiedAsSelf(org.gudy.azureus2.core3.peer.impl.PEPeerTransport self)
Notify that the given peer connection represents our own client.

param
self peer

public voidprocessTrackerResponse(org.gudy.azureus2.core3.tracker.client.TRTrackerAnnouncerResponse response)

public voidprotocolBytesReceived(PEPeer peer, int length)
Protocol bytes received.

param
length

public voidprotocolBytesSent(PEPeer peer, int length)
Protocol bytes sent.

param
length

public voidremoveListener(PEPeerManagerListener l)

public voidremovePeer(PEPeer peer)

public voidremovePeer(PEPeer peer, java.lang.String reason)

public voidremoveRateLimiter(com.aelitis.azureus.core.networkmanager.LimitedRateGroup group, boolean upload)

public voidrequestCanceled(DiskManagerReadRequest item)

public booleanrequestExists(java.lang.String peer_ip, int piece_number, int offset, int length)

public booleanseedPieceRecheck()

public voidsetData(java.lang.String key, java.lang.Object value)
To store arbitrary objects against this object.

public voidsetPreferUDP(boolean prefer)

public voidsetSuperSeedMode(boolean on)

public voidstart()

public voidstopAll()

public booleanvalidatePieceReply(org.gudy.azureus2.core3.peer.impl.PEPeerTransport originator, int pieceNumber, int offset, org.gudy.azureus2.core3.util.DirectByteBuffer data)

public voidwriteBlock(int pieceNumber, int offset, org.gudy.azureus2.core3.util.DirectByteBuffer data, PEPeer sender, boolean cancel)