LimeWire Consolidated API

com.limegroup.gnutella.altlocs
Class AlternateLocationFactoryImpl

java.lang.Object
  extended by com.limegroup.gnutella.altlocs.AlternateLocationFactoryImpl
All Implemented Interfaces:
AlternateLocationFactory

public class AlternateLocationFactoryImpl
extends Object
implements AlternateLocationFactory


Constructor Summary
AlternateLocationFactoryImpl(NetworkManager networkManager, PushEndpointFactory pushEndpointFactory, ApplicationServices applicationServices, ConnectionServices connectionServices, NetworkInstanceUtils networkInstanceUtils, IpPortForSelf ipPortForSelf)
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AlternateLocationFactoryImpl

@Inject
public AlternateLocationFactoryImpl(NetworkManager networkManager,
                                           PushEndpointFactory pushEndpointFactory,
                                           ApplicationServices applicationServices,
                                           ConnectionServices connectionServices,
                                           NetworkInstanceUtils networkInstanceUtils,
                                           IpPortForSelf ipPortForSelf)
Method Detail

create

public AlternateLocation create(URN urn)
Description copied from interface: AlternateLocationFactory
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.

Specified by:
create in interface AlternateLocationFactory
Parameters:
urn - the URN of the locally stored file

create

public AlternateLocation create(RemoteFileDesc rfd)
                         throws IOException
Description copied from interface: AlternateLocationFactory
Creates a new AlternateLocation for the data stored in a RemoteFileDesc.

Specified by:
create in interface AlternateLocationFactory
Parameters:
rfd - the RemoteFileDesc to use in creating the AlternateLocation
Returns:
a new AlternateLocation
Throws:
IOException

createPushAltLoc

public AlternateLocation createPushAltLoc(PushEndpoint pe,
                                          URN urn)
Description copied from interface: AlternateLocationFactory
Creates a new push AlternateLocation

Specified by:
createPushAltLoc in interface AlternateLocationFactory

createDirectDHTAltLoc

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

Specified by:
createDirectDHTAltLoc in interface AlternateLocationFactory
Throws:
IOException

createDirectAltLoc

public AlternateLocation createDirectAltLoc(IpPort ipp,
                                            URN urn)
                                     throws IOException
Description copied from interface: AlternateLocationFactory
Creates a new direct AlternateLocation

Specified by:
createDirectAltLoc in interface AlternateLocationFactory
Throws:
IOException

create

public AlternateLocation create(String location,
                                URN urn,
                                boolean tlsCapable)
                         throws IOException
Description copied from interface: AlternateLocationFactory
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.

Specified by:
create in interface AlternateLocationFactory
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.
tlsCapable - if the alternate location is capable of receiving TLS connections. valid only if the location was not a full URL.
Throws:
IOException

create

public AlternateLocation create(String location,
                                URN urn)
                         throws IOException
Description copied from interface: AlternateLocationFactory
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.

Specified by:
create in interface AlternateLocationFactory
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.
Throws:
IOException

LimeWire Consolidated API

Copyright © 2009. All Rights Reserved.