LimeWire Consolidated API

com.limegroup.gnutella.altlocs
Interface AlternateLocationFactory

All Known Implementing Classes:
AlternateLocationFactoryImpl

public interface AlternateLocationFactory


Method Summary
 AlternateLocation create(RemoteFileDesc rfd)
          Creates a new AlternateLocation for the data stored in a RemoteFileDesc.
 AlternateLocation create(String location, URN urn)
          Constructs a new AlternateLocation instance based on the specified string argument and URN.
 AlternateLocation create(String location, URN urn, boolean tlsCapable)
          Constructs a new AlternateLocation instance based on the specified string argument and URN.
 AlternateLocation create(URN urn)
          Creates a new AlternateLocation for a file stored locally with the specified URN.
 AlternateLocation createDirectAltLoc(IpPort ipp, URN urn)
          Creates a new direct AlternateLocation
 AlternateLocation createDirectDHTAltLoc(IpPort ipp, URN urn, long fileSize, byte[] ttroot)
          Creates a new direct AlternateLocation from information that was found in the DHT
 AlternateLocation createPushAltLoc(PushEndpoint pe, URN urn)
          Creates a new push AlternateLocation
 

Method Detail

create

AlternateLocation create(URN urn)
Creates a new AlternateLocation for a file stored locally with the specified URN. Note: the altloc created this way does not know the name of the file.

Parameters:
urn - the URN of the locally stored file

create

AlternateLocation create(RemoteFileDesc rfd)
                         throws IOException
Creates a new AlternateLocation for the data stored in a RemoteFileDesc.

Parameters:
rfd - the RemoteFileDesc to use in creating the AlternateLocation
Returns:
a new AlternateLocation
Throws:
IOException - if the rfd does not contain a valid urn or if it's a private address
NullPointerException - if the rfd is null
IOException - if the port is invalid
IOException

createPushAltLoc

AlternateLocation createPushAltLoc(PushEndpoint pe,
                                   URN urn)
Creates a new push AlternateLocation


createDirectDHTAltLoc

AlternateLocation createDirectDHTAltLoc(IpPort ipp,
                                        URN urn,
                                        long fileSize,
                                        byte[] ttroot)
                                        throws IOException
Creates a new direct AlternateLocation from information that was found in the DHT

Throws:
IOException

createDirectAltLoc

AlternateLocation createDirectAltLoc(IpPort ipp,
                                     URN urn)
                                     throws IOException
Creates a new direct AlternateLocation

Throws:
IOException

create

AlternateLocation create(String location,
                         URN urn,
                         boolean tlsCapable)
                         throws IOException
Constructs a new AlternateLocation instance based on the specified string argument and URN. The location created this way assumes the name "ALT" for the file.

Parameters:
location - a string containing one of the following: "http://my.address.com:port#/uri-res/N2R?urn:sha:SHA1LETTERS" or "1.2.3.4[:6346]" or http representation of a PushEndpoint. If the first is given, then the SHA1 in the string MUST match the SHA1 given.
location - the URL or IP[port]
URN - the urn to use when the location doesn't contain a URN
tlsCapable - if the alternate location is capable of receiving TLS connections. valid only if the location was not a full URL.
Throws:
IOException - if there is any problem constructing the new instance.
IOException

create

AlternateLocation create(String location,
                         URN urn)
                         throws IOException
Constructs a new AlternateLocation instance based on the specified string argument and URN. The location created this way assumes the name "ALT" for the file.

Parameters:
location - a string containing one of the following: "http://my.address.com:port#/uri-res/N2R?urn:sha:SHA1LETTERS" or "1.2.3.4[:6346]" or http representation of a PushEndpoint. If the first is given, then the SHA1 in the string MUST match the SHA1 given.
location - the URL or IP[port]
URN - the urn to use when the location doesn't contain a URN
Throws:
IOException - if there is any problem constructing the new instance.
IOException

LimeWire Consolidated API

Copyright © 2009. All Rights Reserved.