planet.generic.commonapi.behaviours
Class BehavioursPropertiesImpl

java.lang.Object
  extended byplanet.generic.commonapi.behaviours.BehavioursPropertiesImpl
All Implemented Interfaces:
PropertiesInitializer, java.io.Serializable

public class BehavioursPropertiesImpl
extends java.lang.Object
implements PropertiesInitializer

This class allows to add new behaviours to bad nodes on the overlay. Each behaviour is binded to the type of message exchanged between nodes. The message are defined by a type and mode field. It also allow the use of the wildcard '*', that means, whatever type if is specified in type's field or either whatever mode if is specified in mode's field. Through the method init(), so that their values are initialized.

Author:
Marc Sanchez Date: 10/10/2004
See Also:
Serialized Form

Field Summary
static java.lang.String BEHAVIOUR_CHAIN_MALICIOUS_DISTRIBUTION
          Behaviours property: Specifies a chain malicious distribution into the current overlay.
static int BEHAVIOUR_CHAIN_MALICIOUS_DISTRIBUTION_MASK
          Behaviours property: Specifies a chain malicious distribution into the current overlay.
static java.lang.String BEHAVIOUR_UNIFORM_MALICIOUS_DISTRIBUTION
          Behaviours property: Specifies an uniform malicious distribution into the current overlay.
static int BEHAVIOUR_UNIFORM_MALICIOUS_DISTRIBUTION_MASK
          Behaviours property: Specifies an uniform malicious distribution into the current overlay.
static java.lang.String BEHAVIOURS_PROPERTIES_DEBUG
          Behaviours property: Default key specified in the properties file that identifies when to show specific debug info for behaviours applying.
static java.lang.String BEHAVIOURS_PROPERTIES_FAULTY_NODES
          Behaviours property: Default key specified in the properties file that identifies percentage of faulty nodes.
static java.lang.String BEHAVIOURS_PROPERTIES_INSTANCE
          Behaviours property: Default starting string for the keys that identifies concrete instances for the required behaviours.
static java.lang.String BEHAVIOURS_PROPERTIES_MALICIOUS_DISTRIBUTION
          Behaviours property: Default key specified in the properties file that identifies distribution of malicious node.
 boolean debug
          Behaviours property: Identifies when to show specific debug information for behaviours applying.
 int faultyNodes
          Behaviours property: Identifies percentage [0..100]% of faulty nodes.
 java.lang.String maliciousDistribution
          Behaviours property: Identifies distribution of malicious node.
 int maliciousDistributionAsInt
          Behaviours property: Identifies distribution of malicious node.
 java.util.Vector patterns
          Internal behaviours property: once this instance has been initialized, will contain all specified patterns into the configuration file.
 
Constructor Summary
BehavioursPropertiesImpl()
           
 
Method Summary
 void init(PropertiesWrapper properties)
          Initialize correctly the configuration properties.
 void postinit(PropertiesWrapper properties)
          Load all patterns once the simulator context has been initialized.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BEHAVIOURS_PROPERTIES_FAULTY_NODES

public static final java.lang.String BEHAVIOURS_PROPERTIES_FAULTY_NODES
Behaviours property: Default key specified in the properties file that identifies percentage of faulty nodes.

See Also:
Constant Field Values

BEHAVIOURS_PROPERTIES_MALICIOUS_DISTRIBUTION

public static final java.lang.String BEHAVIOURS_PROPERTIES_MALICIOUS_DISTRIBUTION
Behaviours property: Default key specified in the properties file that identifies distribution of malicious node.

See Also:
Constant Field Values

BEHAVIOURS_PROPERTIES_DEBUG

public static final java.lang.String BEHAVIOURS_PROPERTIES_DEBUG
Behaviours property: Default key specified in the properties file that identifies when to show specific debug info for behaviours applying.

See Also:
Constant Field Values

BEHAVIOURS_PROPERTIES_INSTANCE

public static final java.lang.String BEHAVIOURS_PROPERTIES_INSTANCE
Behaviours property: Default starting string for the keys that identifies concrete instances for the required behaviours. Each key must be ended with a incremental integer number to make them different.

See Also:
Constant Field Values

faultyNodes

public int faultyNodes
Behaviours property: Identifies percentage [0..100]% of faulty nodes.


maliciousDistribution

public java.lang.String maliciousDistribution
Behaviours property: Identifies distribution of malicious node.


maliciousDistributionAsInt

public int maliciousDistributionAsInt
Behaviours property: Identifies distribution of malicious node.


BEHAVIOUR_UNIFORM_MALICIOUS_DISTRIBUTION

public static final java.lang.String BEHAVIOUR_UNIFORM_MALICIOUS_DISTRIBUTION
Behaviours property: Specifies an uniform malicious distribution into the current overlay.

See Also:
Constant Field Values

BEHAVIOUR_CHAIN_MALICIOUS_DISTRIBUTION

public static final java.lang.String BEHAVIOUR_CHAIN_MALICIOUS_DISTRIBUTION
Behaviours property: Specifies a chain malicious distribution into the current overlay.

See Also:
Constant Field Values

BEHAVIOUR_UNIFORM_MALICIOUS_DISTRIBUTION_MASK

public static final int BEHAVIOUR_UNIFORM_MALICIOUS_DISTRIBUTION_MASK
Behaviours property: Specifies an uniform malicious distribution into the current overlay.

See Also:
Constant Field Values

BEHAVIOUR_CHAIN_MALICIOUS_DISTRIBUTION_MASK

public static final int BEHAVIOUR_CHAIN_MALICIOUS_DISTRIBUTION_MASK
Behaviours property: Specifies a chain malicious distribution into the current overlay.

See Also:
Constant Field Values

debug

public boolean debug
Behaviours property: Identifies when to show specific debug information for behaviours applying.


patterns

public java.util.Vector patterns
Internal behaviours property: once this instance has been initialized, will contain all specified patterns into the configuration file.

Constructor Detail

BehavioursPropertiesImpl

public BehavioursPropertiesImpl()
Method Detail

init

public void init(PropertiesWrapper properties)
          throws InitializationException
Description copied from interface: PropertiesInitializer
Initialize correctly the configuration properties.

Specified by:
init in interface PropertiesInitializer
Parameters:
properties -
Throws:
InitializationException
See Also:
PropertiesInitializer.init(planet.util.PropertiesWrapper)

postinit

public void postinit(PropertiesWrapper properties)
              throws InitializationException
Load all patterns once the simulator context has been initialized.

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)