org.griphyn.cPlanner.classes
Class SiteInfo

java.lang.Object
  extended by org.griphyn.cPlanner.classes.SiteInfo

public class SiteInfo
extends Object

This is a data class that is used to store information about a single remote site (pool).

The various types of information that can be associated with the the remote site are displayed in the following table.

NameDescription
grid launch the path to kickstart on the remote site.
work directory the WorkDir object containing the information about the scratch space on the remote site.
grid ftp servers the list of GridFTPServer objects each containing information about one grid ftp server.
job managers the list of JobManager objects each containing information about one jobmanager.
profiles the list of Profile objects each containing one profile.
system info the SysInfo object containing the remote sites system information.

Version:
$Revision: 178 $
Author:
Gaurang Mehta gmehta@isi.edu, Karan Vahi vahi@isi.edu
See Also:
GlobusVersion, GridFTPServer, GridFTPBandwidth, JobManager, LRC, Profile, SiteInfo, SysInfo, WorkDir

Field Summary
static int GRIDFTP
          The constant to be passed to the accessor functions to get or set the list of GridFTP objects for the remote site.
static int GRIDLAUNCH
          The constant to be passed to the accessor functions to get or set the path to kickstart.
static int HANDLE
          The name of the remote site.
static int JOBMANAGER
          The constant to be passed to the accessor functions to get or set the list of JobManager objects for the remote site.
static int LRC
          The constant to be passed to the accessor functions to get or set the list of LRC objects for the remote site.
private  List mGridFTPList
          The list of GridFTPServer objects that contain the information about the gridftp servers on the remote site.
private  String mGridLaunch
          The path to the kickstart on the remote site.
private  String mHandle
          The handle to the site, usually name of the site.
private  List mJobManagerList
          The list of JobManager objects that contain the information about the jobmanagers associated with the remote site.
private  List mLRCList
          The list of LRC objects that contain the information about the various LRCs associated with the remote site.
private  List mProfileList
          The list of Profile objects that contain the profile information associated with the remote site.
private  SysInfo mSysInfo
          The system information of the remote site.
private  WorkDir mWorkDir
          Contains the information about the work directory on the remote site.
static int PROFILE
          The constant to be passed to the accessor functions to get or set the list of Profile objects for the remote site.
static String[] SITEINFO
          Array storing the names of the attributes that are stored with the site.
static int SYSINFO
          The constant to be passed to the accessor functions to get or set the SysInfo site.
static int WORKDIR
          The constant to be passed to the accessor functions to get or set the List of WorkDir objects.
 
Constructor Summary
SiteInfo()
          Default Constructor.
 
Method Summary
 String getExecMountPoint()
          A helper method that returns the execution mount point.
 Object getInfo(int key)
          Returns an Object containing the attribute value corresponding to the key specified.
 List getJobmanagers()
          It returns all the jobmanagers corresponding to a specified pool.
 List getJobmanagers(String universe)
          It returns all the jobmanagers corresponding to a specified pool and universe.
 String getKickstartPath()
          A helper method that returns the path to gridlaunch on the site.
private  List getMatchingJMList(List superList, String universe)
          Returns a list containing only those jobmanager entries that match a particular universe.
 String getURLPrefix(boolean random)
          A helper method that returns the url prefix for one of the gridftp server associated with the pool.
 boolean removeGridFtp(String urlPrefix)
          Removes a grid ftp server from the soft state associated with the pool.
 boolean removeJobmanager(String universe, String jobManagerContact)
          It removes a jobmanager from the pool.
 GridFTPServer selectGridFTP(boolean random)
          Returns a gridftp server from the list of gridftp servers associated with the site.
 JobManager selectJobManager(String universe, boolean random)
          Returns a selected jobmanager corresponding to a particular VDS universe.
 LRC selectLRC(boolean random)
          Returns an LRC from the list of LRCs associated with the site.
 void setInfo(int key, Object object)
          Sets an attribute associated with the remote site.
 String toMultiLine()
          Returns the textual description of the contents of SiteInfo object in the multiline format.
 String toString()
          Returns the textual description of the contents of SiteInfo object.
 String toXML()
          Returns the XML description of the contents of SiteInfo object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SITEINFO

public static final String[] SITEINFO
Array storing the names of the attributes that are stored with the site.


GRIDFTP

public static final int GRIDFTP
The constant to be passed to the accessor functions to get or set the list of GridFTP objects for the remote site.

See Also:
Constant Field Values

JOBMANAGER

public static final int JOBMANAGER
The constant to be passed to the accessor functions to get or set the list of JobManager objects for the remote site.

See Also:
Constant Field Values

PROFILE

public static final int PROFILE
The constant to be passed to the accessor functions to get or set the list of Profile objects for the remote site.

See Also:
Constant Field Values

LRC

public static final int LRC
The constant to be passed to the accessor functions to get or set the list of LRC objects for the remote site.

See Also:
Constant Field Values

WORKDIR

public static final int WORKDIR
The constant to be passed to the accessor functions to get or set the List of WorkDir objects.

See Also:
Constant Field Values

GRIDLAUNCH

public static final int GRIDLAUNCH
The constant to be passed to the accessor functions to get or set the path to kickstart.

See Also:
Constant Field Values

SYSINFO

public static final int SYSINFO
The constant to be passed to the accessor functions to get or set the SysInfo site.

See Also:
Constant Field Values

HANDLE

public static final int HANDLE
The name of the remote site. This is acts as the key by which to query a site catalog for information regarding a particular remote site.

See Also:
Constant Field Values

mGridLaunch

private String mGridLaunch
The path to the kickstart on the remote site.


mLRCList

private List mLRCList
The list of LRC objects that contain the information about the various LRCs associated with the remote site.


mProfileList

private List mProfileList
The list of Profile objects that contain the profile information associated with the remote site.


mGridFTPList

private List mGridFTPList
The list of GridFTPServer objects that contain the information about the gridftp servers on the remote site.


mJobManagerList

private List mJobManagerList
The list of JobManager objects that contain the information about the jobmanagers associated with the remote site.


mWorkDir

private WorkDir mWorkDir
Contains the information about the work directory on the remote site.


mSysInfo

private SysInfo mSysInfo
The system information of the remote site.


mHandle

private String mHandle
The handle to the site, usually name of the site.

Constructor Detail

SiteInfo

public SiteInfo()
Default Constructor.

Method Detail

getInfo

public Object getInfo(int key)
Returns an Object containing the attribute value corresponding to the key specified.

Parameters:
key - the key.
Returns:
Object corresponding to the key value.
Throws:
RuntimeException - if illegal key defined.
See Also:
HANDLE, GRIDFTP, GRIDLAUNCH, JOBMANAGER, LRC, PROFILE, SYSINFO, WORKDIR

getExecMountPoint

public String getExecMountPoint()
A helper method that returns the execution mount point.

Returns:
the execution mount point, else null if no mount point associated with the pool.

getKickstartPath

public String getKickstartPath()
A helper method that returns the path to gridlaunch on the site.

Returns:
the path to the kickstart.

getURLPrefix

public String getURLPrefix(boolean random)
A helper method that returns the url prefix for one of the gridftp server associated with the pool. If more than one gridftp servers is associated with the pool, then the function returns url prefix for the first gridftp server in the list, unless the parameter random is set to true.

Parameters:
random - boolean denoting whether to select a random gridftp server.
Returns:
the url prefix for the grid ftp server, else null if no gridftp server mentioned.

getJobmanagers

public List getJobmanagers()
It returns all the jobmanagers corresponding to a specified pool.

Returns:
list of JobManager, each referring to one jobmanager contact string. An empty list if no jobmanagers found.

getJobmanagers

public List getJobmanagers(String universe)
It returns all the jobmanagers corresponding to a specified pool and universe.

Parameters:
universe - the gvds universe with which it is associated.
Returns:
list of JobManager, each referring to one jobmanager contact string. An empty list if no jobmanagers found.

setInfo

public void setInfo(int key,
                    Object object)
             throws RuntimeException
Sets an attribute associated with the remote site. It actually adds to the list where there is a list maintained like for grid ftp servers, jobmanagers, profiles, and LRCs.

Parameters:
key - the attribute key, which is one of the predefined keys.
object - the object containing the attribute value.
Throws:
RuntimeException - if the object passed for the key is not of valid type.
Exception - if illegal key defined.
See Also:
HANDLE, GRIDFTP, GRIDLAUNCH, JOBMANAGER, LRC, PROFILE, SYSINFO, WORKDIR

removeJobmanager

public boolean removeJobmanager(String universe,
                                String jobManagerContact)
It removes a jobmanager from the pool. It calls the underlying equals method of the associated jobmanager object to remove it.

Parameters:
universe - the gvds universe with which it is associated.
jobManagerContact - the contact string to the jobmanager.
Returns:
true if was able to remove successfully else false.

removeGridFtp

public boolean removeGridFtp(String urlPrefix)
Removes a grid ftp server from the soft state associated with the pool.

Parameters:
urlPrefix - the urlprefix associated with the server.
Returns:
boolean

selectGridFTP

public GridFTPServer selectGridFTP(boolean random)
Returns a gridftp server from the list of gridftp servers associated with the site. If more than one candidate GridFTPServer is found , then the function returns the first matching GridFTPServer unless parameter random is set to true.

Parameters:
random - boolean denoting whether to select a random gridftp server.
Returns:
the selected GridFTPServer corresponding to the grid ftp server, else null if list is null.
See Also:
GridFTPServer

selectLRC

public LRC selectLRC(boolean random)
Returns an LRC from the list of LRCs associated with the site. If more than one candidate LRC is found , then the function the first matching LRC
Parameters:
random - boolean denoting whether to select a random gridftp server.
Returns:
the selected LRC corresponding to the selected LRC. else null if list is null.
See Also:
LRC

selectJobManager

public JobManager selectJobManager(String universe,
                                   boolean random)
Returns a selected jobmanager corresponding to a particular VDS universe. If more than one candidate jobmanager is found , then the function the first matching jobmanager unless parameter random is set to true.

Parameters:
universe - the VDS universe with which the jobmanager is associated.
random - boolean denoting whether to select a random gridftp server.
Returns:
the selected jobmanager, else null if list is null.
See Also:
JobManager

toMultiLine

public String toMultiLine()
Returns the textual description of the contents of SiteInfo object in the multiline format.

Returns:
the textual description in multiline format.

toString

public String toString()
Returns the textual description of the contents of SiteInfo object.

Overrides:
toString in class Object
Returns:
the textual description.

toXML

public String toXML()
Returns the XML description of the contents of SiteInfo object.

Returns:
the xml description.

getMatchingJMList

private List getMatchingJMList(List superList,
                               String universe)
Returns a list containing only those jobmanager entries that match a particular universe.

Parameters:
superList - the list containing all the entries of type JobManager.
universe - the universe against which you want to match the entries.
Returns:
List which is a subset of the elements in the superList


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