planet.trivialp2p
Class TrivialProperties

java.lang.Object
  extended byplanet.trivialp2p.TrivialProperties
All Implemented Interfaces:
OverlayProperties, PropertiesInitializer, java.io.Serializable

public class TrivialProperties
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, Marc Sanchez Date: 05/07/2004
See Also:
Serialized Form

Field Summary
 boolean debug
          When true, shows information for debug purposes.
static java.lang.String TRIVIAL_DEBUG
          TrivialP2P property: Default key for 'debug' flag.
 
Constructor Summary
TrivialProperties()
           
 
Method Summary
 int getTypeForApplicationMessage()
          Returns RouteMessage type for Application level.
 void init(PropertiesWrapper properties)
          Initialize all configuration properties of the Symphony overlay.
 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 the RouteMessage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRIVIAL_DEBUG

public static final java.lang.String TRIVIAL_DEBUG
TrivialP2P property: Default key for 'debug' flag.

See Also:
Constant Field Values

debug

public boolean debug
When true, shows information for debug purposes.

Constructor Detail

TrivialProperties

public TrivialProperties()
Method Detail

init

public void init(PropertiesWrapper properties)
          throws InitializationException
Initialize all configuration properties of the Symphony 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)

typeToString

public java.lang.String typeToString(int type)
Returns a String representation of the constant specific values of type the RouteMessage. Its use is only for human readable logs. Based on SymphonyNode 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.