LimeWire Consolidated API

com.limegroup.gnutella.dht.db
Class AbstractAltLocValue

java.lang.Object
  extended by com.limegroup.gnutella.dht.db.AbstractAltLocValue
All Implemented Interfaces:
AltLocValue, Serializable, DHTValue

public abstract class AbstractAltLocValue
extends Object
implements AltLocValue

An implementation of DHTValue for for Gnutella Alternate Locations

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.limewire.mojito.db.DHTValue
DHTValue.EmptyValue
 
Field Summary
static DHTValueType ALT_LOC
          DHTValueType for AltLocs
protected  Version version
           
static Version VERSION
          Version of AltLocDHTValue
static Version VERSION_ONE
           
 
Fields inherited from interface org.limewire.mojito.db.DHTValue
EMPTY_VALUE
 
Constructor Summary
AbstractAltLocValue(Version version)
           
 
Method Summary
abstract  long getFileSize()
          The length of the file
abstract  byte[] getGUID()
          The GUID of the AltLoc
abstract  int getPort()
          The (Gnutella) Port of the AltLoc
abstract  byte[] getRootHash()
          The TigerTree root hash
 DHTValueType getValueType()
          Returns the type of the value.
 Version getVersion()
          Returns the version of the value.
abstract  boolean isFirewalled()
          Returns true if the AltLoc is firewalled
protected static byte[] serialize(AbstractAltLocValue value)
          A helper method to serialize AltLocValues
 int size()
          Returns the size of the value payload in byte
abstract  boolean supportsTLS()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.limewire.mojito.db.DHTValue
getValue, write
 

Field Detail

ALT_LOC

public static final DHTValueType ALT_LOC
DHTValueType for AltLocs


VERSION_ONE

public static final Version VERSION_ONE

VERSION

public static final Version VERSION
Version of AltLocDHTValue


version

protected final Version version
Constructor Detail

AbstractAltLocValue

public AbstractAltLocValue(Version version)
Method Detail

getVersion

public Version getVersion()
Description copied from interface: DHTValue
Returns the version of the value.

Specified by:
getVersion in interface AltLocValue
Specified by:
getVersion in interface DHTValue

getValueType

public DHTValueType getValueType()
Description copied from interface: DHTValue
Returns the type of the value.

Specified by:
getValueType in interface AltLocValue
Specified by:
getValueType in interface DHTValue

size

public int size()
Description copied from interface: DHTValue
Returns the size of the value payload in byte

Specified by:
size in interface AltLocValue
Specified by:
size in interface DHTValue

getGUID

public abstract byte[] getGUID()
Description copied from interface: AltLocValue
The GUID of the AltLoc

Specified by:
getGUID in interface AltLocValue

getPort

public abstract int getPort()
Description copied from interface: AltLocValue
The (Gnutella) Port of the AltLoc

Specified by:
getPort in interface AltLocValue

getFileSize

public abstract long getFileSize()
Description copied from interface: AltLocValue
The length of the file

Specified by:
getFileSize in interface AltLocValue

getRootHash

public abstract byte[] getRootHash()
Description copied from interface: AltLocValue
The TigerTree root hash

Specified by:
getRootHash in interface AltLocValue

isFirewalled

public abstract boolean isFirewalled()
Description copied from interface: AltLocValue
Returns true if the AltLoc is firewalled

Specified by:
isFirewalled in interface AltLocValue

supportsTLS

public abstract boolean supportsTLS()
Specified by:
supportsTLS in interface AltLocValue
Returns:
true if the alternative location supports TLS

toString

public String toString()
Overrides:
toString in class Object

serialize

protected static byte[] serialize(AbstractAltLocValue value)
A helper method to serialize AltLocValues


LimeWire Consolidated API

Copyright © 2009. All Rights Reserved.