gov.nist.antd.merlin.util
Class DefaultDML

java.lang.Object
  |
  +--gov.nist.antd.merlin.util.DefaultDML

public class DefaultDML
extends java.lang.Object

The defaultDML is a tool to create default DML configuration for component.

 This class was developed at the National Institute of Standards and
 Technology by employees of the Federal Government in the course of
 their official duties. Pursuant to title 17 Section 105 of the United
 States Code this software is not subject to copyright protection and
 is in the public domain.
NIST assumes no responsibility whatsoever for its use by other parties, and makes no guarantees, expressed or implied, about its quality, reliability, or any other characteristic.
We would appreciate acknowledgement if the software is used.
NIST ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION AND DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.

Author:
borchert
, rouil , gallo

Constructor Summary
private DefaultDML()
          private constructor to avoid instantiation
 
Method Summary
static void createConfig(com.renesys.raceway.DML.dmlConfig dmlCfg, java.lang.String str)
          Add the DML configuration represented in a String object to the given dmlConfig object.
private static void createConfig(com.renesys.raceway.DML.dmlConfig dmlCfg, java.util.StringTokenizer strToken)
          Add the DML configuration represented in a StringTokenizer object to the given dmlConfig object.
static com.renesys.raceway.DML.Configuration getCentralizedAlgoConfig(java.lang.String name, java.lang.String use, java.lang.String option)
          Create a configuration for a centralized algorithm
static com.renesys.raceway.DML.Configuration getHostConfiguration(int id)
          create a configuration that contains the protocol IP
static com.renesys.raceway.DML.Configuration getLinksConfiguration(Glass net)
          Return a configuration object that contains all the links of the net
static com.renesys.raceway.DML.Configuration getOXCConfiguration(int id)
          create a configuration that contains OXCSwitch and IP.
static com.renesys.raceway.DML.Configuration getProtocolConfiguration(int id, java.lang.String name, java.lang.String use, java.lang.String option)
          Return a configuration that contains the required protocol
static com.renesys.raceway.DML.Configuration getScriptedEventConfiguration(java.lang.String type, double time, java.lang.String option)
          Return a configuration that contains the scripted event
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDML

private DefaultDML()
private constructor to avoid instantiation

Method Detail

getLinksConfiguration

public static com.renesys.raceway.DML.Configuration getLinksConfiguration(Glass net)
Return a configuration object that contains all the links of the net

Parameters:
net - The net that contains the links
Returns:
The Configuration object or null if an error occured.

getOXCConfiguration

public static com.renesys.raceway.DML.Configuration getOXCConfiguration(int id)
create a configuration that contains OXCSwitch and IP.

Parameters:
id - The id of this OXC or OXCEdgeRouter
Returns:
The configuration object or null if an error occured.

getHostConfiguration

public static com.renesys.raceway.DML.Configuration getHostConfiguration(int id)
create a configuration that contains the protocol IP

Parameters:
id - The id of this host
Returns:
The configuration object or null if an error occured.

getCentralizedAlgoConfig

public static com.renesys.raceway.DML.Configuration getCentralizedAlgoConfig(java.lang.String name,
                                                                             java.lang.String use,
                                                                             java.lang.String option)
Create a configuration for a centralized algorithm

Parameters:
name - The name of the algorithm
use - The class name of the algorithm
option - The optional attributes of this algorithm
Returns:
the configuration object or null if an error occured.

getProtocolConfiguration

public static com.renesys.raceway.DML.Configuration getProtocolConfiguration(int id,
                                                                             java.lang.String name,
                                                                             java.lang.String use,
                                                                             java.lang.String option)
Return a configuration that contains the required protocol

Parameters:
id - The id of this host
name - The name of the protocol
use - The class name of the protocol
option - The optional attributes of this algorithm
Returns:
The configuration file or null if an error occured.

getScriptedEventConfiguration

public static com.renesys.raceway.DML.Configuration getScriptedEventConfiguration(java.lang.String type,
                                                                                  double time,
                                                                                  java.lang.String option)
Return a configuration that contains the scripted event

Parameters:
type - The event's type
time - The time to fire this event
option - The attributes other than type and time (like id)
Returns:
The configuration file

createConfig

public static void createConfig(com.renesys.raceway.DML.dmlConfig dmlCfg,
                                java.lang.String str)
                         throws com.renesys.raceway.DML.dmlException
Add the DML configuration represented in a String object to the given dmlConfig object.

Parameters:
dmlCfg - The DMLConfiguration where to add the element.
str - The string that represents the DML.
Throws:
com.renesys.raceway.DML.dmlException - if str contains an error.

createConfig

private static void createConfig(com.renesys.raceway.DML.dmlConfig dmlCfg,
                                 java.util.StringTokenizer strToken)
                          throws com.renesys.raceway.DML.dmlException
Add the DML configuration represented in a StringTokenizer object to the given dmlConfig object.

Parameters:
dmlCfg - The DMLConfiguration where to add the element.
strToken - The String that contain the information.
Throws:
com.renesys.raceway.DML.dmlException - if strToken contains an error.