org.griphyn.cPlanner.common
Class UserOptions

java.lang.Object
  extended by org.griphyn.cPlanner.common.UserOptions

public class UserOptions
extends Object

A Singleton wrapper around the PlannerOptions class to get hold of the options specified by the user to run Pegasus. This allows us to get hold of the options anywhere without us messing up with the constructors of classes.

Version:
$Revision: 278 $
Author:
Karan Vahi, Gaurang Mehta
See Also:
PlannerOptions

Field Summary
private  LogManager mLogger
          The Logger object used to log the messages.
private  PlannerOptions mPlannerOpts
          The object containing all the user options.
private static UserOptions mPOptions
          The object holding the Singleton instance.
 
Constructor Summary
private UserOptions(PlannerOptions opt)
          The private constructor that initializes the user options.
 
Method Summary
 boolean generateRandomDirectory()
          Returns whether we want to create a Random Directory or not.
 Set getCacheFiles()
          It returns the set of cache files.
 String getDaxFile()
          Returns the dax file, that was generated by Chimera containing the description of the Abstract plan.
 Collection getExecutionSites()
          Returns the list of execution pools where the user wants the data products to be computed.
 boolean getForceOption()
          Returns true if the user had asked for the force option.
static UserOptions getInstance()
          The method used to invoke the singleton instance from the other classes.
static UserOptions getInstance(PlannerOptions opt)
          The method used to invoke the singleton instance the first time, from the CPlanner class.
 PlannerOptions getOptions()
          Returns the options passed to the planner.
 String getOutputPool()
          Returns output pool where the user wants the data products to be transferred to.
 String getRandomDirName()
          Returns the name of the random directory, only if the generate Random Dir flag is set.
 String getSubmitFileDir()
          Returns the directory where the user wants the submit files to be generated.
 void setExecutionSites(Collection sites)
          Sets the execution sites.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mPOptions

private static UserOptions mPOptions
The object holding the Singleton instance.


mLogger

private LogManager mLogger
The Logger object used to log the messages.


mPlannerOpts

private PlannerOptions mPlannerOpts
The object containing all the user options.

Constructor Detail

UserOptions

private UserOptions(PlannerOptions opt)
The private constructor that initializes the user options. This should be invoked from the CPlanner class in the toolkit package.

Throws:
RuntimeException - in case of incorrect initialization.
Method Detail

getInstance

public static UserOptions getInstance(PlannerOptions opt)
The method used to invoke the singleton instance the first time, from the CPlanner class.

Parameters:
opt - the object containing the options to the Planner.

getInstance

public static UserOptions getInstance()
The method used to invoke the singleton instance from the other classes.


getDaxFile

public String getDaxFile()
Returns the dax file, that was generated by Chimera containing the description of the Abstract plan.


getOutputPool

public String getOutputPool()
Returns output pool where the user wants the data products to be transferred to.


getOptions

public PlannerOptions getOptions()
Returns the options passed to the planner.

Returns:
PlannerOptions

getSubmitFileDir

public String getSubmitFileDir()
Returns the directory where the user wants the submit files to be generated.


getExecutionSites

public Collection getExecutionSites()
Returns the list of execution pools where the user wants the data products to be computed.


setExecutionSites

public void setExecutionSites(Collection sites)
Sets the execution sites.

Parameters:
sites - the Set containing the site names.

generateRandomDirectory

public boolean generateRandomDirectory()
Returns whether we want to create a Random Directory or not.


getCacheFiles

public Set getCacheFiles()
It returns the set of cache files.


getRandomDirName

public String getRandomDirName()
Returns the name of the random directory, only if the generate Random Dir flag is set. Else it returns null.


getForceOption

public boolean getForceOption()
Returns true if the user had asked for the force option.



Copyright © 2007 The University of Southern California. All Rights Reserved.