LimeWire Consolidated API

com.limegroup.gnutella.altlocs
Interface AlternateLocation

All Superinterfaces:
Comparable<AlternateLocation>, HTTPHeaderValue
All Known Implementing Classes:
AbstractAlternateLocation, DirectAltLoc, DirectDHTAltLoc, PushAltLoc

public interface AlternateLocation
extends HTTPHeaderValue, Comparable<AlternateLocation>

This interface defines classes that encapsulate the data for an alternate resource location, as specified in HUGE v0.93. This also provides utility methods for such operations as comparing alternate locations based on the date they were stored. Firewalled hosts can also be alternate locations, although the format is slightly different.


Field Summary
static String ALT_VENDOR
          The vendor to use.
static int MESH_LEGACY
           
static int MESH_PING
          The three types of medium altlocs travel through
static int MESH_RESPONSE
           
 
Method Summary
 boolean canBeSent(int meshType)
           
 boolean canBeSentAny()
           
 AlternateLocation createClone()
          could return null
 RemoteFileDesc createRemoteFileDesc(long size, RemoteFileDescFactory remoteFileDescFactory)
          Creates a new RemoteFileDesc from this AlternateLocation
 int getCount()
          Accessor to find if this has been demoted
 URN getSHA1Urn()
          Accessor for the SHA1 urn for this AlternateLocation.
 void increment()
          increment the count.
 boolean isDemoted()
          package access, accessor to the value of _demoted
 boolean isMe()
           
 void send(long now, int meshType)
           
 
Methods inherited from interface com.limegroup.gnutella.http.HTTPHeaderValue
httpStringValue
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

ALT_VENDOR

static final String ALT_VENDOR
The vendor to use.

See Also:
Constant Field Values

MESH_PING

static final int MESH_PING
The three types of medium altlocs travel through

See Also:
Constant Field Values

MESH_LEGACY

static final int MESH_LEGACY
See Also:
Constant Field Values

MESH_RESPONSE

static final int MESH_RESPONSE
See Also:
Constant Field Values
Method Detail

getSHA1Urn

URN getSHA1Urn()
Accessor for the SHA1 urn for this AlternateLocation.

Returns:
the SHA1 urn for the this AlternateLocation

getCount

int getCount()
Accessor to find if this has been demoted


isDemoted

boolean isDemoted()
package access, accessor to the value of _demoted


createRemoteFileDesc

RemoteFileDesc createRemoteFileDesc(long size,
                                    RemoteFileDescFactory remoteFileDescFactory)
Creates a new RemoteFileDesc from this AlternateLocation

Parameters:
size - the size of the file for the new RemoteFileDesc -- this is necessary to make sure the download bucketing works correctly
Returns:
new RemoteFileDesc based off of this, or null if the RemoteFileDesc could not be created

isMe

boolean isMe()
Returns:
whether this is an alternate location pointing to myself.

increment

void increment()
increment the count.

See Also:
demote

createClone

AlternateLocation createClone()
could return null


send

void send(long now,
          int meshType)

canBeSent

boolean canBeSent(int meshType)

canBeSentAny

boolean canBeSentAny()

LimeWire Consolidated API

Copyright © 2009. All Rights Reserved.