planet.chord
Class ChordProperties

java.lang.Object
  extended byplanet.chord.ChordProperties
All Implemented Interfaces:
OverlayProperties, PropertiesInitializer, java.io.Serializable

public class ChordProperties
extends java.lang.Object
implements OverlayProperties

This class includes the initialization and the values for all configuration properties of the Chord overlay.

Author:
Jordi Pujol Date: 05/07/2004
See Also:
Serialized Form

Field Summary
 int bitsPerKey
          Number of bits per key.
static java.lang.String CHORD_BITS_PER_KEY
          Chord property: Default key for number of bits for ChordIds.
static java.lang.String CHORD_FIX_FINGER_STEPS
          Chord property: Default key for number of steps to fix finger tables.
static java.lang.String CHORD_STABILIZATION_STEPS
          Chord property: Default key for number of stabilize steps.
static java.lang.String CHORD_SUCCESSOR_LIST_SIZE
          Chord property: Default key for size of successor list.
 int fixFingerSteps
          Number of steps to fix fingers.
 int stabilizeSteps
          Number of steps for statibilization.
 int succListMax
          Max size for successor list.
 
Constructor Summary
ChordProperties()
           
 
Method Summary
 int getTypeForApplicationMessage()
          Returns RouteMessage type for Application level.
 void init(PropertiesWrapper properties)
          Initialize all configuration properties of the Chord overlay.
static boolean isValidValue(int bitsPerKey)
          Test if the bitsPerKey is multiple of 32 within the range [32..192].
 java.lang.String modeToString(int mode)
          Returns a string representation of each of event mode and RouteMessage mode.
 void postinit(PropertiesWrapper properties)
          Makes the postinitialization process.
 java.lang.String typeToString(int type)
          Returns a String representation of the constant specific values of type and mode of the RouteMessage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHORD_STABILIZATION_STEPS

public static final java.lang.String CHORD_STABILIZATION_STEPS
Chord property: Default key for number of stabilize steps.

See Also:
Constant Field Values

CHORD_FIX_FINGER_STEPS

public static final java.lang.String CHORD_FIX_FINGER_STEPS
Chord property: Default key for number of steps to fix finger tables.

See Also:
Constant Field Values

CHORD_SUCCESSOR_LIST_SIZE

public static final java.lang.String CHORD_SUCCESSOR_LIST_SIZE
Chord property: Default key for size of successor list.

See Also:
Constant Field Values

CHORD_BITS_PER_KEY

public static final java.lang.String CHORD_BITS_PER_KEY
Chord property: Default key for number of bits for ChordIds.

See Also:
Constant Field Values

stabilizeSteps

public int stabilizeSteps
Number of steps for statibilization.


fixFingerSteps

public int fixFingerSteps
Number of steps to fix fingers.


succListMax

public int succListMax
Max size for successor list.


bitsPerKey

public int bitsPerKey
Number of bits per key.

Constructor Detail

ChordProperties

public ChordProperties()
Method Detail

init

public void init(PropertiesWrapper properties)
          throws InitializationException
Initialize all configuration properties of the Chord overlay.

Specified by:
init in interface PropertiesInitializer
Parameters:
properties - Properties with all (key,value) pairs.
Throws:
InitializationException
See Also:
PropertiesInitializer.init(planet.util.PropertiesWrapper)

postinit

public void postinit(PropertiesWrapper properties)
              throws InitializationException
Makes the postinitialization process. Does nothing.

Specified by:
postinit in interface PropertiesInitializer
Parameters:
properties - A Properties instance with all required configuration properties.
Throws:
InitializationException - if an error occurs during the initialization of the different properties.
See Also:
PropertiesInitializer.postinit(planet.util.PropertiesWrapper)

isValidValue

public static boolean isValidValue(int bitsPerKey)
Test if the bitsPerKey is multiple of 32 within the range [32..192].

Parameters:
bitsPerKey - Number of bits per key to be tested.
Returns:
true if the preconditions are accomplished or false in other case.

typeToString

public java.lang.String typeToString(int type)
Returns a String representation of the constant specific values of type and mode of the RouteMessage. Its use is only for human readable logs. Based on ChordNode implementation.

Specified by:
typeToString in interface OverlayProperties
Parameters:
type - Value to get its String representation.
Returns:
The String representation of the type.

modeToString

public java.lang.String modeToString(int mode)
Returns a string representation of each of event mode and RouteMessage mode.

Specified by:
modeToString in interface OverlayProperties
Parameters:
mode - Mode of the RouteMessage to get its String representation.
Returns:
String representation of the mode of RouteMessage.

getTypeForApplicationMessage

public int getTypeForApplicationMessage()
Returns RouteMessage type for Application level.

Specified by:
getTypeForApplicationMessage in interface OverlayProperties
Returns:
RouteMessage type for Application level.