planet.commonapi.factory
Interface NetworkFactory

All Known Implementing Classes:
NetworkFactoryImpl

public interface NetworkFactory

This interface is focused to allow the ability of build networks of different topologies, size and Nodes, using the factory method pattern design.

The future implementations must use the values specified at setValues(...) method as the default values to build networks. For all non specified values into the buildNetwork(...) methods you will use the default ones. Each Network implementation will interprete the actual network topology value. The default interpreted network topologies appear at planet.generic.commonapi.factory.Topology class.

Author:
Jordi Pujol 07-jul-2005

Method Summary
 Network buildNetwork()
          Generates a new Network with the actual size of the Network.
 Network buildNetwork(int size)
          Generates a new Network with the size of Nodes specified by parameter.
 Network buildNetwork(int size, NodeFactory nodeFactory)
          Generates a new Network with the size of Nodes specified by parameter.
 Network buildNetwork(int size, NodeFactory nodeFactory, java.lang.String topology)
          Generates a new Network with the size of Nodes specified by parameter.
 Network buildNetwork(int size, java.lang.String topology)
          Generates a new Network with the size of Nodes specified by parameter.
 NetworkFactory setValues(java.lang.Class network, int size, NodeFactory nodeFactory, java.lang.String topology)
          Sets the initial values for the NetworkFactory instance with the specified values.
 

Method Detail

setValues

public NetworkFactory setValues(java.lang.Class network,
                                int size,
                                NodeFactory nodeFactory,
                                java.lang.String topology)
                         throws InitializationException
Sets the initial values for the NetworkFactory instance with the specified values.

Parameters:
network - The Class reference for the current Network implementation.
size - Desired network size.
nodeFactory - The NodeFactory implementation to be used.
topology - Desired network topology.
Returns:
The same instance once it has been updated.
Throws:
InitializationException - if any error occurs during the initialization process.

buildNetwork

public Network buildNetwork()
                     throws InitializationException
Generates a new Network with the actual size of the Network. The class of Nodes is specified by the actual NodeFactory.

Returns:
A new instance of Network with the number of nodes specified.
Throws:
InitializationException

buildNetwork

public Network buildNetwork(int size)
                     throws InitializationException
Generates a new Network with the size of Nodes specified by parameter. The class of Nodes is specified by the actual NodeFactory.

Parameters:
size - Number of Nodes to generate in the network.
Returns:
A new instance of Network with the specified size.
Throws:
InitializationException

buildNetwork

public Network buildNetwork(int size,
                            NodeFactory nodeFactory)
                     throws InitializationException
Generates a new Network with the size of Nodes specified by parameter. The class of Nodes is specified by nodeFactory.

Parameters:
size - Number of Nodes to generate in the network.
nodeFactory - NodeFactory to use to build Nodes for the new network.
Returns:
A new instance of Network with the specified size.
Throws:
InitializationException

buildNetwork

public Network buildNetwork(int size,
                            java.lang.String topology)
                     throws InitializationException
Generates a new Network with the size of Nodes specified by parameter. The class of Nodes is the obtained by the default nodeFactory. The topology specifies the network topology for the new network.

Parameters:
size - Number of Nodes to generate in the network.
topology - The network topology for the new network.
Returns:
A new instance of Network with the specified size with the specified topology.
Throws:
InitializationException

buildNetwork

public Network buildNetwork(int size,
                            NodeFactory nodeFactory,
                            java.lang.String topology)
                     throws InitializationException
Generates a new Network with the size of Nodes specified by parameter. The class of Nodes is specified by nodeFactory. The topology specifies the network topology for the new network.

Parameters:
size - Number of Nodes to generate in the network.
nodeFactory - NodeFactory to use to build Nodes for the new network.
topology - The network topology for the new network.
Returns:
A new instance of Network with the specified size with the specified topology.
Throws:
InitializationException