Class SiteInfo
- java.lang.Object
-
- edu.isi.pegasus.planner.catalog.site.impl.old.classes.SiteInfo
-
public class SiteInfo extends java.lang.ObjectThis 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.
Name Description grid launch the path to kickstart on the remote site. work directory the WorkDirobject containing the information about the scratch space on the remote site.grid ftp servers the list of GridFTPServerobjects each containing information about one grid ftp server.job managers the list of JobManagerobjects each containing information about one jobmanager.profiles the list of Profileobjects each containing one profile.system info the VDSSysInfoobject containing the remote sites system information.- Version:
- $Revision$
- Author:
- Gaurang Mehta gmehta@isi.edu, Karan Vahi vahi@isi.edu
- See Also:
GlobusVersion,GridFTPServer,GridFTPBandwidth,JobManager,LRC,Profile,SiteInfo,org.griphyn.common.classes.VDSSysInfo,WorkDir
-
-
Field Summary
Fields Modifier and Type Field Description static intGRIDFTPThe constant to be passed to the accessor functions to get or set the list ofGridFTPobjects for the remote site.static intGRIDLAUNCHThe constant to be passed to the accessor functions to get or set the path to kickstart.static intHANDLEThe name of the remote site.static intJOBMANAGERThe constant to be passed to the accessor functions to get or set the list ofJobManagerobjects for the remote site.static intLRCThe constant to be passed to the accessor functions to get or set the list ofLRCobjects for the remote site.private java.util.ListmGridFTPListThe list ofGridFTPServerobjects that contain the information about the gridftp servers on the remote site.private java.lang.StringmGridLaunchThe path to the kickstart on the remote site.private java.lang.StringmHandleThe handle to the site, usually name of the site.private java.util.ListmJobManagerListThe list ofJobManagerobjects that contain the information about the jobmanagers associated with the remote site.private java.util.ListmLRCListThe list ofLRCobjects that contain the information about the various LRCs associated with the remote site.private java.util.ListmProfileListThe list ofProfileobjects that contain the profile information associated with the remote site.private VDSSysInfomSysInfoThe system information of the remote site.private WorkDirmWorkDirContains the information about the work directory on the remote site.static intPROFILEThe constant to be passed to the accessor functions to get or set the list ofProfileobjects for the remote site.static java.lang.String[]SITEINFOArray storing the names of the attributes that are stored with the site.static intSYSINFOThe constant to be passed to the accessor functions to get or set theVDSSysInfosite.static intWORKDIRThe constant to be passed to the accessor functions to get or set the List ofWorkDirobjects.
-
Constructor Summary
Constructors Constructor Description SiteInfo()Default Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetExecMountPoint()A helper method that returns the execution mount point.java.lang.ObjectgetInfo(int key)Returns anObjectcontaining the attribute value corresponding to the key specified.java.util.ListgetJobmanagers()It returns all the jobmanagers corresponding to a specified pool.java.util.ListgetJobmanagers(java.lang.String universe)It returns all the jobmanagers corresponding to a specified pool and universe.java.lang.StringgetKickstartPath()A helper method that returns the path to gridlaunch on the site.private java.util.ListgetMatchingJMList(java.util.List superList, java.lang.String universe)Returns a list containing only those jobmanager entries that match a particular universe.java.lang.StringgetURLPrefix(boolean random)A helper method that returns the url prefix for one of the gridftp server associated with the pool.booleanremoveGridFtp(java.lang.String urlPrefix)Removes a grid ftp server from the soft state associated with the pool.booleanremoveJobmanager(java.lang.String universe, java.lang.String jobManagerContact)It removes a jobmanager from the pool.GridFTPServerselectGridFTP(boolean random)Returns a gridftp server from the list of gridftp servers associated with the site.JobManagerselectJobManager(java.lang.String universe, boolean random)Returns a selected jobmanager corresponding to a particular VDS universe.LRCselectLRC(boolean random)Returns an LRC from the list of LRCs associated with the site.voidsetInfo(int key, java.lang.Object object)Sets an attribute associated with the remote site.java.lang.StringtoMultiLine()Returns the textual description of the contents ofSiteInfoobject in the multiline format.java.lang.StringtoString()Returns the textual description of the contents ofSiteInfoobject.java.lang.StringtoXML()Returns the XML description of the contents ofSiteInfoobject.
-
-
-
Field Detail
-
SITEINFO
public static final java.lang.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 ofGridFTPobjects 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 ofJobManagerobjects 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 ofProfileobjects 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 ofLRCobjects 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 ofWorkDirobjects.- 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 theVDSSysInfosite.- 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 java.lang.String mGridLaunch
The path to the kickstart on the remote site.
-
mLRCList
private java.util.List mLRCList
The list ofLRCobjects that contain the information about the various LRCs associated with the remote site.
-
mProfileList
private java.util.List mProfileList
The list ofProfileobjects that contain the profile information associated with the remote site.
-
mGridFTPList
private java.util.List mGridFTPList
The list ofGridFTPServerobjects that contain the information about the gridftp servers on the remote site.
-
mJobManagerList
private java.util.List mJobManagerList
The list ofJobManagerobjects 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 VDSSysInfo mSysInfo
The system information of the remote site.
-
mHandle
private java.lang.String mHandle
The handle to the site, usually name of the site.
-
-
Method Detail
-
getInfo
public java.lang.Object getInfo(int key)
Returns anObjectcontaining the attribute value corresponding to the key specified.- Parameters:
key- the key.- Returns:
Objectcorresponding to the key value.- Throws:
java.lang.RuntimeException- if illegal key defined.- See Also:
HANDLE,GRIDFTP,GRIDLAUNCH,JOBMANAGER,LRC,PROFILE,SYSINFO,WORKDIR
-
getExecMountPoint
public java.lang.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 java.lang.String getKickstartPath()
A helper method that returns the path to gridlaunch on the site.- Returns:
- the path to the kickstart.
-
getURLPrefix
public java.lang.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 java.util.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 java.util.List getJobmanagers(java.lang.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, java.lang.Object object) throws java.lang.RuntimeExceptionSets 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:
java.lang.RuntimeException- if the object passed for the key is not of valid type.java.lang.Exception- if illegal key defined.- See Also:
HANDLE,GRIDFTP,GRIDLAUNCH,JOBMANAGER,LRC,PROFILE,SYSINFO,WORKDIR
-
removeJobmanager
public boolean removeJobmanager(java.lang.String universe, java.lang.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(java.lang.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 matchingGridFTPServerunless parameter random is set to true.- Parameters:
random- boolean denoting whether to select a random gridftp server.- Returns:
- the selected
GridFTPServercorresponding to the grid ftp server, else null if list is null. - See Also:
org.griphyn.cPlanner.classes.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 matchingLRC- Parameters:
random- boolean denoting whether to select a random gridftp server.- Returns:
- the selected
LRCcorresponding to the selected LRC. else null if list is null. - See Also:
org.griphyn.cPlanner.classes.LRC
-
selectJobManager
public JobManager selectJobManager(java.lang.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:
org.griphyn.cPlanner.classes.JobManager
-
toMultiLine
public java.lang.String toMultiLine()
Returns the textual description of the contents ofSiteInfoobject in the multiline format.- Returns:
- the textual description in multiline format.
-
toString
public java.lang.String toString()
Returns the textual description of the contents ofSiteInfoobject.- Overrides:
toStringin classjava.lang.Object- Returns:
- the textual description.
-
toXML
public java.lang.String toXML()
Returns the XML description of the contents ofSiteInfoobject.- Returns:
- the xml description.
-
getMatchingJMList
private java.util.List getMatchingJMList(java.util.List superList, java.lang.String universe)Returns a list containing only those jobmanager entries that match a particular universe.- Parameters:
superList- the list containing all the entries of typeJobManager.universe- the universe against which you want to match the entries.- Returns:
- List which is a subset of the elements in the superList
-
-