tools
Class Parameters

java.lang.Object
  extended by tools.Parameters

public class Parameters
extends java.lang.Object

Represents default parameters for various situations.

Author:
Leo Bosnjak

Field Summary
private  double bwLimitForSingleNodeGroup
          The minimum required bandwidth to the nodes of a group to form a group with them
private  java.lang.String defaultCopyDir
          proposed directory when copying files to nodes.
private  java.lang.String defaultExecCmd
          proposed command to execute on the nodes.
private  java.lang.String defaultLocalDir
          proposed directory when copying files from nodes.
private  java.lang.String defaultMap
          Defines the default map on program start
private  java.lang.String defaultMountDir
          Default directory to mount nodes to
private  java.lang.String defaultRemoteDir
          proposed remote directory when copying files to/from nodes.
static Parameters INSTANCE
          Singleton instance
private  int orbPort
          The port of the ORB daemon on the PlanetLab nodes.
private static java.lang.String parametersFile
          The file where the above parameters are saved.
private  boolean showstartDialog
          Show help dialog at start?
private  int sshPort
          The port on which the launched sshd of the PlanetLab nodes should listen for incoming connections.
private  java.lang.String testFilePath
          This path defines the file which is transferred to a node to measure the bandwidth to this node.
private  int testFileSize
          the size of the testFile in Bytes
 
Constructor Summary
Parameters()
          construct a new Parameters instance
 
Method Summary
 double getBwLimitForSingleNodeGroup()
           
 java.lang.String getDefaultCopyDir()
           
 java.lang.String getDefaultExecCmd()
           
 java.lang.String getDefaultLocalDir()
           
 java.lang.String getDefaultMap()
           
 java.lang.String getDefaultMountDir()
           
 java.lang.String getDefaultRemoteDir()
           
static Parameters getInstance()
          This method is used whenever a parameter is needed e.g.
 int getOrbPort()
          Get the ORB-Port number
static java.lang.String getParametersFile()
           
 int getSshPort()
          Get the SSH-Port number
 java.lang.String getTestFilePath()
           
 int getTestFileSize()
           
 boolean isShowstartDialog()
           
static boolean loadParameters()
          Loads the parameters from the config file
static boolean saveParameters()
          Saves the parameters to a config file
 void setBwLimitForSingleNodeGroup(double bwLimitForSingleNodeGroup)
           
 void setDefaultCopyDir(java.lang.String defaultCopyDir)
           
 void setDefaultExecCmd(java.lang.String defaultExecCmd)
           
 void setDefaultLocalDir(java.lang.String defaultLocalDir)
           
 void setDefaultMap(java.lang.String defaultMap)
           
 void setDefaultMountDir(java.lang.String defaultMountDir)
           
 void setDefaultRemoteDir(java.lang.String defaultRemoteDir)
           
 void setOrbPort(int orbPort)
          Set the ORB-Port number
static void setParametersFile(java.lang.String parametersFile)
           
 void setShowstartDialog(boolean showstartDialog)
           
 void setSshPort(int sshPort)
          Set the SSH-Port number
 void setTestFilePath(java.lang.String testFilePath)
           
 void setTestFileSize(int testFileSize)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

orbPort

private int orbPort
The port of the ORB daemon on the PlanetLab nodes. The orbd is listening on this port for incoming RMI calls. PlanetLabClient is executing these RPC calls. Note that you need to bootstrap a node to make a change take effect.


sshPort

private int sshPort
The port on which the launched sshd of the PlanetLab nodes should listen for incoming connections. Note that you need to bootstrap a node to make a change take effect.


testFilePath

private java.lang.String testFilePath
This path defines the file which is transferred to a node to measure the bandwidth to this node.


testFileSize

private int testFileSize
the size of the testFile in Bytes


bwLimitForSingleNodeGroup

private double bwLimitForSingleNodeGroup
The minimum required bandwidth to the nodes of a group to form a group with them


showstartDialog

private boolean showstartDialog
Show help dialog at start?


defaultCopyDir

private java.lang.String defaultCopyDir
proposed directory when copying files to nodes.


defaultLocalDir

private java.lang.String defaultLocalDir
proposed directory when copying files from nodes.


defaultRemoteDir

private java.lang.String defaultRemoteDir
proposed remote directory when copying files to/from nodes.


defaultMountDir

private java.lang.String defaultMountDir
Default directory to mount nodes to


defaultExecCmd

private java.lang.String defaultExecCmd
proposed command to execute on the nodes.


defaultMap

private java.lang.String defaultMap
Defines the default map on program start


parametersFile

private static java.lang.String parametersFile
The file where the above parameters are saved.


INSTANCE

public static Parameters INSTANCE
Singleton instance

Constructor Detail

Parameters

public Parameters()
construct a new Parameters instance

Method Detail

getInstance

public static Parameters getInstance()
This method is used whenever a parameter is needed e.g. Parameters.getInstance().getDefaultCopyDir() Note that the first call is done in the main() of the PlanetLabVisualizer, to ensure that there are no multithreading problems.

Returns:
a singleton Parameters object

getOrbPort

public int getOrbPort()
Get the ORB-Port number

Returns:
int - the orbPort

setOrbPort

public void setOrbPort(int orbPort)
Set the ORB-Port number

Parameters:
orbPort - - the port number

getSshPort

public int getSshPort()
Get the SSH-Port number

Returns:
int - the sshPort

setSshPort

public void setSshPort(int sshPort)
Set the SSH-Port number

Parameters:
sshPort -

getTestFilePath

public java.lang.String getTestFilePath()

setTestFilePath

public void setTestFilePath(java.lang.String testFilePath)

getTestFileSize

public int getTestFileSize()
Returns:
the testFileSize

setTestFileSize

public void setTestFileSize(int testFileSize)
Parameters:
testFileSize - the testFileSize to set

getBwLimitForSingleNodeGroup

public double getBwLimitForSingleNodeGroup()
Returns:
the bwLimitForSingleNodeGroup

setBwLimitForSingleNodeGroup

public void setBwLimitForSingleNodeGroup(double bwLimitForSingleNodeGroup)
Parameters:
bwLimitForSingleNodeGroup - the bwLimitForSingleNodeGroup to set

isShowstartDialog

public boolean isShowstartDialog()
Returns:
the showstartDialog

setShowstartDialog

public void setShowstartDialog(boolean showstartDialog)
Parameters:
showstartDialog - the showstartDialog to set

getDefaultCopyDir

public java.lang.String getDefaultCopyDir()
Returns:
the defaultCopyDir

setDefaultCopyDir

public void setDefaultCopyDir(java.lang.String defaultCopyDir)
Parameters:
defaultCopyDir - the defaultCopyDir to set

getDefaultLocalDir

public java.lang.String getDefaultLocalDir()
Returns:
the defaultLocalDir

setDefaultLocalDir

public void setDefaultLocalDir(java.lang.String defaultLocalDir)
Parameters:
defaultLocalDir - the defaultLocalDir to set

getDefaultRemoteDir

public java.lang.String getDefaultRemoteDir()
Returns:
the defaultRemoteDir

setDefaultRemoteDir

public void setDefaultRemoteDir(java.lang.String defaultRemoteDir)
Parameters:
defaultRemoteDir - the defaultRemoteDir to set

getDefaultExecCmd

public java.lang.String getDefaultExecCmd()
Returns:
the defaultExecCmd

setDefaultExecCmd

public void setDefaultExecCmd(java.lang.String defaultExecCmd)
Parameters:
defaultExecCmd - the defaultExecCmd to set

getParametersFile

public static java.lang.String getParametersFile()
Returns:
the parametersFile

setParametersFile

public static void setParametersFile(java.lang.String parametersFile)
Parameters:
parametersFile - the parametersFile to set

saveParameters

public static boolean saveParameters()
Saves the parameters to a config file

Returns:
true if successful

loadParameters

public static boolean loadParameters()
Loads the parameters from the config file

Returns:
true if successful

getDefaultMap

public java.lang.String getDefaultMap()
Returns:
the defaultMap

setDefaultMap

public void setDefaultMap(java.lang.String defaultMap)
Parameters:
defaultMap - the defaultMap to set

getDefaultMountDir

public java.lang.String getDefaultMountDir()
Returns:
the defaultMountDir

setDefaultMountDir

public void setDefaultMountDir(java.lang.String defaultMountDir)
Parameters:
defaultMountDir - the defaultMountDir to set