edu.isi.pegasus.planner.common

## Class UserOptions

- java.lang.Object
- - edu.isi.pegasus.planner.common.UserOptions

    public class UserOptions
    extends java.lang.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$
Author:
  Karan Vahi, Gaurang Mehta
See Also:
  `org.griphyn.cPlanner.classes.PlannerOptions`

### Field Summary

Fields
`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

Constructors
`private` `UserOptions(PlannerOptions opt)` The private constructor that initializes the user options.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`boolean` `generateRandomDirectory()` Returns whether we want to create a Random Directory or not.
`java.util.Set` `getCacheFiles()` It returns the set of cache files.
`java.lang.String` `getDaxFile()` Returns the dax file, that was generated by Chimera containing the description of the Abstract plan.
`java.util.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.
`java.lang.String` `getOutputPool()` Returns output pool where the user wants the data products to be transferred to.
`java.lang.String` `getRandomDirName()` Returns the name of the random directory, only if the generate Random Dir flag is set.
`java.lang.String` `getSubmitFileDir()` Returns the directory where the user wants the submit files to be generated.
`void` `setExecutionSites(java.util.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:
  `java.lang.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 java.lang.String getDaxFile()

Returns the dax file, that was generated by Chimera containing the description of the Abstract plan.

#### getOutputPool

    public java.lang.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 java.lang.String getSubmitFileDir()

Returns the directory where the user wants the submit files to be generated.

#### getExecutionSites

    public java.util.Collection getExecutionSites()

Returns the list of execution pools where the user wants the data products to be computed.

#### setExecutionSites

    public void setExecutionSites(java.util.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 java.util.Set getCacheFiles()

It returns the set of cache files.

#### getRandomDirName

    public java.lang.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.