LimeWire Consolidated API

com.limegroup.gnutella
Interface Uploader

All Superinterfaces:
Address, BandwidthTracker, Connectable, IpPort
All Known Implementing Classes:
AbstractUploader, BTUploader, HTTPUploader

public interface Uploader
extends BandwidthTracker, Connectable

This interface outlines the basic functionality for a class that performs uploads.

A single instance should be reused for multiple chunks of a single file in an HTTP/1.1 session. However, multiple HTTPUploaders should be used for multiple files in a single HTTP/1.1 session.


Nested Class Summary
static class Uploader.UploadStatus
           
 
Nested classes/interfaces inherited from interface org.limewire.io.IpPort
IpPort.IpComparator, IpPort.IpPortComparator
 
Nested classes/interfaces inherited from interface org.limewire.io.Address
Address.EventType
 
Field Summary
static String BITTORRENT_UPLOAD
          Marker string for bt-specific values.
 
Fields inherited from interface org.limewire.io.Connectable
COMPARATOR, EMPTY_LIST, EMPTY_SET
 
Fields inherited from interface org.limewire.io.IpPort
IP_COMPARATOR
 
Method Summary
 long amountUploaded()
          Returns the amount that of data that has been uploaded.
 String getCustomIconDescriptor()
           
 File getFile()
          Returns the file backing this uploader.
 FileDesc getFileDesc()
          Returns the FileDesc of the file being uploaded.
 String getFileName()
          returns the name of the file being uploaded.
 long getFileSize()
          returns the length of the file being uploaded.
 int getGnutellaPort()
          return the port of the gnutella-client host (not the HTTP port)
 String getHost()
          returns the string representation of the IP Address of the host being uploaded to.
 int getIndex()
          returns the index of the file being uploaded.
 Uploader.UploadStatus getLastTransferState()
          Returns the last transfer state of this uploader.
 int getNumUploadConnections()
          Returns the number of connections we are currently uplaoding to.
 int getQueuePosition()
          Returns the current queue position if queued.
 Uploader.UploadStatus getState()
          Returns the current state of this uploader.
 long getTotalAmountUploaded()
          Returns the amount of data that this uploader and all previous uploaders exchanging this file have uploaded.
 UploadType getUploadType()
          Returns the kind of upload this is (shared file, browse host, malformed request, etc..)
 URN getUrn()
          Returns the URN for the file backing this uploader.
 String getUserAgent()
          return the userAgent
 boolean isBrowseHostEnabled()
          returns true if browse host is enabled, false if it is not.
 boolean isInactive()
          Returns whether or not the uploader is in an inactive state.
 void stop()
          Stops this upload.
 
Methods inherited from interface com.limegroup.gnutella.BandwidthTracker
getAverageBandwidth, getMeasuredBandwidth, measureBandwidth
 
Methods inherited from interface org.limewire.io.Connectable
isTLSCapable
 
Methods inherited from interface org.limewire.io.IpPort
getAddress, getInetAddress, getInetSocketAddress, getPort
 
Methods inherited from interface org.limewire.io.Address
equals, getAddressDescription, hashCode
 

Field Detail

BITTORRENT_UPLOAD

static final String BITTORRENT_UPLOAD
Marker string for bt-specific values.

See Also:
Constant Field Values
Method Detail

stop

void stop()
Stops this upload. If the download is already stopped, it does nothing.


getFileName

String getFileName()
returns the name of the file being uploaded.


getFileSize

long getFileSize()
returns the length of the file being uploaded.


getFileDesc

FileDesc getFileDesc()
Returns the FileDesc of the file being uploaded.

Returns:
null if the file can not be found

getIndex

int getIndex()
returns the index of the file being uploaded.


amountUploaded

long amountUploaded()
Returns the amount that of data that has been uploaded. For HTTP/1.1 transfers, this number is the amount uploaded for this specific chunk only. Uses getTotalAmountUploaded() for the entire amount uploaded.

Note: This method was previously called "amountRead", but the name was changed to make more sense.


getTotalAmountUploaded

long getTotalAmountUploaded()
Returns the amount of data that this uploader and all previous uploaders exchanging this file have uploaded.


getHost

String getHost()
returns the string representation of the IP Address of the host being uploaded to.


getState

Uploader.UploadStatus getState()
Returns the current state of this uploader.


getLastTransferState

Uploader.UploadStatus getLastTransferState()
Returns the last transfer state of this uploader. Transfers states are all states except INTERRUPTED, COMPLETE, and CONNECTING.


isBrowseHostEnabled

boolean isBrowseHostEnabled()
returns true if browse host is enabled, false if it is not.


getGnutellaPort

int getGnutellaPort()
return the port of the gnutella-client host (not the HTTP port)


getUserAgent

String getUserAgent()
return the userAgent


getQueuePosition

int getQueuePosition()
Returns the current queue position if queued.


isInactive

boolean isInactive()
Returns whether or not the uploader is in an inactive state.


getCustomIconDescriptor

String getCustomIconDescriptor()
Returns:
a custom icon descriptor, null if the file icon should be used.

getUploadType

UploadType getUploadType()
Returns the kind of upload this is (shared file, browse host, malformed request, etc..)


getFile

File getFile()
Returns the file backing this uploader.

Returns:
null if an entity different from a file is uploaded

getUrn

URN getUrn()
Returns the URN for the file backing this uploader.


getNumUploadConnections

int getNumUploadConnections()
Returns the number of connections we are currently uplaoding to.


LimeWire Consolidated API

Copyright © 2009. All Rights Reserved.