edu.isi.pegasus.planner.catalog.site.impl.old.classes

## Class SiteInfo

- java.lang.Object
- - edu.isi.pegasus.planner.catalog.site.impl.old.classes.SiteInfo

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

Name | Description
--- | ---
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 `VDSSysInfo` object 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
`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 java.util.List` `mGridFTPList` The list of `GridFTPServer` objects that contain the information about the gridftp servers on the remote site.
`private java.lang.String` `mGridLaunch` The path to the kickstart on the remote site.
`private java.lang.String` `mHandle` The handle to the site, usually name of the site.
`private java.util.List` `mJobManagerList` The list of `JobManager` objects that contain the information about the jobmanagers associated with the remote site.
`private java.util.List` `mLRCList` The list of `LRC` objects that contain the information about the various LRCs associated with the remote site.
`private java.util.List` `mProfileList` The list of `Profile` objects that contain the profile information associated with the remote site.
`private VDSSysInfo` `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 java.lang.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 `VDSSysInfo` site.
`static int` `WORKDIR` The constant to be passed to the accessor functions to get or set the List of `WorkDir` objects.

### Constructor Summary

Constructors
Constructor and Description
`SiteInfo()` Default Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`java.lang.String` `getExecMountPoint()` A helper method that returns the execution mount point.
`java.lang.Object` `getInfo(int key)` Returns an `Object` containing the attribute value corresponding to the key specified.
`java.util.List` `getJobmanagers()` It returns all the jobmanagers corresponding to a specified pool.
`java.util.List` `getJobmanagers(java.lang.String universe)` It returns all the jobmanagers corresponding to a specified pool and universe.
`java.lang.String` `getKickstartPath()` A helper method that returns the path to gridlaunch on the site.
`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.
`java.lang.String` `getURLPrefix(boolean random)` A helper method that returns the url prefix for one of the gridftp server associated with the pool.
`boolean` `removeGridFtp(java.lang.String urlPrefix)` Removes a grid ftp server from the soft state associated with the pool.
`boolean` `removeJobmanager(java.lang.String universe, java.lang.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(java.lang.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, java.lang.Object object)` Sets an attribute associated with the remote site.
`java.lang.String` `toMultiLine()` Returns the textual description of the contents of `SiteInfo` object in the multiline format.
`java.lang.String` `toString()` Returns the textual description of the contents of `SiteInfo` object.
`java.lang.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 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 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 `VDSSysInfo` 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 java.lang.String mGridLaunch

The path to the kickstart on the remote site.

#### mLRCList

    private java.util.List mLRCList

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

#### mProfileList

    private java.util.List mProfileList

The list of `Profile` objects that contain the profile information associated with the remote site.

#### mGridFTPList

    private java.util.List mGridFTPList

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

#### mJobManagerList

    private java.util.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 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.

### Constructor Detail

#### SiteInfo

    public SiteInfo()

Default Constructor.

### Method Detail

#### getInfo

    public java.lang.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:
  `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.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:
  `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 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:
  `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 matching `LRC</code< unless parameter random is set to true.</div>

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:
  `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 of `SiteInfo` object in the multiline format.

Returns:
  the textual description in multiline format.

#### toString

    public java.lang.String toString()

Returns the textual description of the contents of `SiteInfo` object.

Overrides:
  `toString` in class `java.lang.Object`
Returns:
  the textual description.

#### toXML

    public java.lang.String toXML()

Returns the XML description of the contents of `SiteInfo` object.

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