com.sun.faban.harness.util
Class CmdMap

java.lang.Object
  extended by com.sun.faban.harness.util.CmdMap

public class CmdMap
extends Object

Checks the binary paths and the command mapping file and creates the exec map.

Author:
Akara Sucharitakul

Constructor Summary
CmdMap()
           
 
Method Summary
static HashMap<String,List<String>> getCmdMap(String benchName)
          Scans the bin directories and command map file and returns the command map.
static String[] getPathExt()
          Obtains a list of path extensions valid in this environment.
static HashMap<String,List<String>> getServiceBinMap(String serviceName)
          Obtains the command map for a service/tool deployment.
static void main(String[] args)
          Main to test the command map.
static void replaceFirst(List orig, List replacement)
          Replace the first element of the command list with the relacement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CmdMap

public CmdMap()
Method Detail

getCmdMap

public static HashMap<String,List<String>> getCmdMap(String benchName)
                                              throws Exception
Scans the bin directories and command map file and returns the command map.

Parameters:
benchName - The name of the benchmark, null if the map is not benchmark-specific
Returns:
The command map
Throws:
Exception - Something went wrong obtaining the command map.

getServiceBinMap

public static HashMap<String,List<String>> getServiceBinMap(String serviceName)
                                                     throws Exception
Obtains the command map for a service/tool deployment.

Parameters:
serviceName - The name of the service
Returns:
The command map, if applicable, for that service
Throws:
Exception - Something went wrong obtaining the command map.

getPathExt

public static String[] getPathExt()
Obtains a list of path extensions valid in this environment.

Returns:
A string array of valid path extensions

replaceFirst

public static void replaceFirst(List orig,
                                List replacement)
Replace the first element of the command list with the relacement. The original list will likely grow.

Parameters:
orig - The original command list
replacement - The replacement for the first entry in the list

main

public static void main(String[] args)
                 throws Exception
Main to test the command map.

Parameters:
args - The command line argument
Throws:
Exception - If the mapping shows any errors