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

## Class SiteCatalogEntry

- java.lang.Object
- - edu.isi.pegasus.planner.catalog.site.classes.SiteData
  - - edu.isi.pegasus.planner.catalog.site.classes.AbstractSiteData
    - - edu.isi.pegasus.planner.catalog.site.classes.SiteCatalogEntry

All Implemented Interfaces:
  java.lang.Cloneable

    public class SiteCatalogEntry
    extends AbstractSiteData

This data class describes a site in the site catalog.

Version:
  $Revision$
Author:
  Karan Vahi

### Field Summary

Fields
`private java.util.Map<Directory.TYPE,Directory>` `mDirectories` A Map of different directories indexed by Directory.TYPE associated with the site catalog entry
`private java.util.Map<GridGateway.JOB_TYPE,GridGateway>` `mGridGateways` Map of grid gateways at the site for submitting different job types.
`private java.lang.String` `mID` The site identifier.
`private Profiles` `mProfiles` The profiles asscociated with the site.
`private java.util.List<ReplicaCatalog>` `mReplicaCatalogs` The list of replica catalog associated with the site.
`private SysInfo` `mSysInfo` The System Information for the Site.
`static java.lang.String` `PEGASUS_BIN_DIR` The name of the environment variable PEGASUS_BIN_DIR.
`static java.lang.String` `PEGASUS_HOME` The name of the environment variable PEGASUS_HOME.
`static java.lang.String` `VDS_HOME` The name of the environment variable VDS_HOME.

### Constructor Summary

Constructors
Constructor and Description
`SiteCatalogEntry()` The default constructor.
`SiteCatalogEntry(java.lang.String id)` The overloaded constructor.

### Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods
`void` `accept(SiteDataVisitor visitor)` Accept method for the visitor interface
`void` `addDirectory(Directory directory)` Adds a directory internally.
`void` `addGridGateway(GridGateway g)` Add a GridGateway to the site.
`void` `addProfile(Profile p)` Adds a profile.
`void` `addReplicaCatalog(ReplicaCatalog catalog)` Add a Replica Catalog to the site.
`java.lang.Object` `clone()` Returns the clone of the object.
`SysInfo.Architecture` `getArchitecture()` Returns the architecture of the site.
`Directory` `getDirectory(Directory.TYPE type)` Returns a directory corresponding to a particular type
`java.util.Iterator<Directory>` `getDirectoryIterator()` Returns a directory corresponding to a particular type
`java.lang.String` `getEnvironmentVariable(java.lang.String variable)` Returns an environment variable associated with the site.
`java.util.Iterator` `getFileServerIterator()` Not implmented as yet.
`java.util.List` `getFileServers()` Not implemented as yet.
`java.lang.String` `getGlibc()` Returns the glibc version of the site.
`GridGateway` `getGridGateway(GridGateway.JOB_TYPE type)` Returns a grid gateway object corresponding to a job type.
`java.util.Iterator<GridGateway>` `getGridGatewayIterator()` Return an iterator to value set of the Map.
`java.util.List` `getGridGateways()` Not implemented as yet
`Directory` `getHeadNodeStorageDirectory()` Returns the local-storage directory.
`java.lang.String` `getInternalMountPointOfWorkDirectory()` Returns the work directory for the compute jobs on a site.
`SysInfo.OS` `getOS()` Returns the OS of the site.
`java.lang.String` `getOSRelease()` Returns the OS release of the site.
`java.lang.String` `getOSVersion()` Returns the OS version of the site.
`java.lang.String` `getPegasusHome()` Deprecated.
`Profiles` `getProfiles()` Returns the profiles associated with the site.
`java.util.Iterator<ReplicaCatalog>` `getReplicaCatalogIterator()` Return an iterator to the replica catalog associated with the site.
`java.lang.String` `getSiteHandle()` Returns the site handle for the site
`SysInfo` `getSysInfo()` Returns the System Information associated with the Site.
`java.lang.String` `getVDSHome()` Deprecated.
`VDSSysInfo` `getVDSSysInfo()` Returns the sysinfo for the site.
`void` `initialize(java.lang.String id)` Initializes the object.
`boolean` `removeGridGateway(java.lang.String contact)` This is a soft state remove, that removes a GridGateway from a particular site.
`GridGateway` `selectGridGateway(GridGateway.JOB_TYPE type)` Selects a grid gateway object corresponding to a job type.
`FileServer` `selectHeadNodeScratchSharedFileServer(FileServerType.OPERATION operation)` A convenience method to select the FileServer for the shared scratch space on the HeadNode.
`java.lang.String` `selectHeadNodeScratchSharedFileServerURLPrefix(FileServerType.OPERATION operation)` Deprecated. should be removed
`ReplicaCatalog` `selectReplicaCatalog()` Selects a Random ReplicaCatalog.
`FileServer` `selectStorageFileServerForStageout(FileServerType.OPERATION operation)` A convenience method that selects a file server for staging the data out to a site.
`void` `setArchitecture(SysInfo.Architecture arch)` Sets the architecture of the site.
`void` `setDirectory(Directory directory)` Sets a directory corresponding to a particular type
`void` `setGlibc(java.lang.String version)` Sets the glibc version on the site.
`void` `setOS(SysInfo.OS os)` Sets the OS of the site.
`void` `setOSRelease(java.lang.String release)` Sets the OS release of the site.
`void` `setOSVersion(java.lang.String version)` Sets the OS version of the site.
`void` `setProfiles(Profiles profiles)` Sets the profiles associated with the file server.
`void` `setSiteHandle(java.lang.String id)` Sets the site handle for the site
`void` `setSysInfo(SysInfo sysinfo)` Sets the System Information associated with the Site.
`void` `setVDSSysInfo(VDSSysInfo sysinfo)` Sets the sysinfo for the site.
`void` `toXML(java.io.Writer writer, java.lang.String indent)` Writes out the xml description of the object.

### Methods inherited from class edu.isi.pegasus.planner.catalog.site.classes.AbstractSiteData

`toString, toXML, writeAttribute`

### Methods inherited from class java.lang.Object

`equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### PEGASUS_BIN_DIR

    public static final java.lang.String PEGASUS_BIN_DIR

The name of the environment variable PEGASUS_BIN_DIR.

See Also:
  Constant Field Values

#### PEGASUS_HOME

    public static final java.lang.String PEGASUS_HOME

The name of the environment variable PEGASUS_HOME.

See Also:
  Constant Field Values

#### VDS_HOME

    public static final java.lang.String VDS_HOME

The name of the environment variable VDS_HOME.

See Also:
  Constant Field Values

#### mID

    private java.lang.String mID

The site identifier.

#### mSysInfo

    private SysInfo mSysInfo

The System Information for the Site.

#### mProfiles

    private Profiles mProfiles

The profiles asscociated with the site.

#### mDirectories

    private java.util.Map<Directory.TYPE,Directory> mDirectories

A Map of different directories indexed by Directory.TYPE associated with the site catalog entry

#### mGridGateways

    private java.util.Map<GridGateway.JOB_TYPE,GridGateway> mGridGateways

Map of grid gateways at the site for submitting different job types.

#### mReplicaCatalogs

    private java.util.List<ReplicaCatalog> mReplicaCatalogs

The list of replica catalog associated with the site.

### Constructor Detail

#### SiteCatalogEntry

    public SiteCatalogEntry()

The default constructor.

#### SiteCatalogEntry

    public SiteCatalogEntry(java.lang.String id)

The overloaded constructor.

Parameters:
  `id` - the site identifier.

### Method Detail

#### getFileServerIterator

    public java.util.Iterator getFileServerIterator()

Not implmented as yet.

Returns:
  UnsupportedOperationException

#### getFileServers

    public java.util.List getFileServers()

Not implemented as yet.

Returns:
  UnsupportedOperationException

#### getGridGateways

    public java.util.List getGridGateways()

Not implemented as yet

Returns:
  UnsupportedOperationException

#### initialize

    public void initialize(java.lang.String id)

Initializes the object.

Parameters:
  `id` - the site identifier.

#### setSiteHandle

    public void setSiteHandle(java.lang.String id)

Sets the site handle for the site

Parameters:
  `id` - the site identifier.

#### getSiteHandle

    public java.lang.String getSiteHandle()

Returns the site handle for the site

Returns:
  the site identifier.

#### setSysInfo

    public void setSysInfo(SysInfo sysinfo)

Sets the System Information associated with the Site.

Parameters:
  `sysinfo` - the system information of the site.

#### getSysInfo

    public SysInfo getSysInfo()

Returns the System Information associated with the Site.

Returns:
  SysInfo the system information.

#### setArchitecture

    public void setArchitecture(SysInfo.Architecture arch)

Sets the architecture of the site.

Parameters:
  `arch` - the architecture.

#### getArchitecture

    public SysInfo.Architecture getArchitecture()

Returns the architecture of the site.

Returns:
  the architecture.

#### setOS

    public void setOS(SysInfo.OS os)

Sets the OS of the site.

Parameters:
  `os` - the os of the site.

#### getOS

    public SysInfo.OS getOS()

Returns the OS of the site.

Returns:
  the OS

#### setVDSSysInfo

    public void setVDSSysInfo(VDSSysInfo sysinfo)

Sets the sysinfo for the site.

Parameters:
  `sysinfo` -

#### getVDSSysInfo

    public VDSSysInfo getVDSSysInfo()

Returns the sysinfo for the site.

Returns:
  getVDSSysInfo

#### setOSRelease

    public void setOSRelease(java.lang.String release)

Sets the OS release of the site.

Parameters:
  `release` - the os releaseof the site.

#### getOSRelease

    public java.lang.String getOSRelease()

Returns the OS release of the site.

Returns:
  the OS

#### setOSVersion

    public void setOSVersion(java.lang.String version)

Sets the OS version of the site.

Parameters:
  `version` - the os versionof the site.

#### getOSVersion

    public java.lang.String getOSVersion()

Returns the OS version of the site.

Returns:
  the OS

#### setGlibc

    public void setGlibc(java.lang.String version)

Sets the glibc version on the site.

Parameters:
  `version` - the glibc version of the site.

#### getGlibc

    public java.lang.String getGlibc()

Returns the glibc version of the site.

Returns:
  the OS

#### addDirectory

    public void addDirectory(Directory directory)

Adds a directory internally. Complains if directory of same type already exists

Parameters:
  `directory` - the directory to be added.

#### setDirectory

    public void setDirectory(Directory directory)

Sets a directory corresponding to a particular type

Parameters:
  `directory` - the directory to be set

#### getDirectoryIterator

    public java.util.Iterator<Directory> getDirectoryIterator()

Returns a directory corresponding to a particular type

Returns:
  the iterator

#### getDirectory

    public Directory getDirectory(Directory.TYPE type)

Returns a directory corresponding to a particular type

Parameters:
  `the` - type the directory type

#### getHeadNodeStorageDirectory

    public Directory getHeadNodeStorageDirectory()

Returns the local-storage directory. If it is not specified, then returns shared-storage If none is associated, then returns null

Returns:
  the appropriate directory

#### getInternalMountPointOfWorkDirectory

    public java.lang.String getInternalMountPointOfWorkDirectory()

Returns the work directory for the compute jobs on a site. Currently, the work directory is picked up from the head node shared filesystem.

Returns:
  the internal mount point, else null

#### addProfile

    public void addProfile(Profile p)

Adds a profile.

Parameters:
  `p` - the profile to be added

#### setProfiles

    public void setProfiles(Profiles profiles)

Sets the profiles associated with the file server.

Parameters:
  `profiles` - the profiles.

#### getProfiles

    public Profiles getProfiles()

Returns the profiles associated with the site.

Returns:
  profiles.

#### getVDSHome

    @Deprecated
    public java.lang.String getVDSHome()

Deprecated.
Returns the value of VDS_HOME for a site.

Returns:
  value if set else null.

#### getPegasusHome

    @Deprecated
    public java.lang.String getPegasusHome()

Deprecated.
Returns the value of PEGASUS_HOME for a site.

Returns:
  value if set else null.

#### getEnvironmentVariable

    public java.lang.String getEnvironmentVariable(java.lang.String variable)

Returns an environment variable associated with the site.

Parameters:
  `variable` - the environment variable whose value is required.
Returns:
  value of the environment variable if found, else null

#### getGridGateway

    public GridGateway getGridGateway(GridGateway.JOB_TYPE type)

Returns a grid gateway object corresponding to a job type.

Parameters:
  `type` - the job type
Returns:
  GridGateway

#### selectGridGateway

    public GridGateway selectGridGateway(GridGateway.JOB_TYPE type)

Selects a grid gateway object corresponding to a job type. It also defaults to other GridGateways if grid gateway not found for that job type.

Parameters:
  `type` - the job type
Returns:
  GridGateway

#### selectHeadNodeScratchSharedFileServerURLPrefix

    public java.lang.String selectHeadNodeScratchSharedFileServerURLPrefix(FileServerType.OPERATION operation)

Deprecated. should be removed
A convenience method to select the URL Prefix for the FileServer for the shared scratch space on the HeadNode matching a particular operation. For get and put operations, the results default back to searching for an ALL operation server.

Parameters:
  `operation` - the operation for which the file server is required
Returns:
  URL Prefix for the FileServer for the shared scratch space , else null

#### selectHeadNodeScratchSharedFileServer

    public FileServer selectHeadNodeScratchSharedFileServer(FileServerType.OPERATION operation)

A convenience method to select the FileServer for the shared scratch space on the HeadNode. For get and put operations, the results default back to searching for an ALL operation server.

Parameters:
  `operation` - the operation for which the file server is required
Returns:
  FileServer for the shared scratch space , else null

#### selectStorageFileServerForStageout

    public FileServer selectStorageFileServerForStageout(FileServerType.OPERATION operation)

A convenience method that selects a file server for staging the data out to a site. It returns the file server to which the generated data is staged out / published. The `FileServer` selected is associated with the HeadNode Filesystem. For get and put operations, the results default back to searching for an ALL server.

Parameters:
  `operation` - the operation for which the file server is required
Returns:
  the `FileServer` else null.

#### getGridGatewayIterator

    public java.util.Iterator<GridGateway> getGridGatewayIterator()

Return an iterator to value set of the Map.

Returns:
  Iterator<GridGateway>

#### addGridGateway

    public void addGridGateway(GridGateway g)

Add a GridGateway to the site.

Parameters:
  `g` - the grid gateway to be added.

#### removeGridGateway

    public boolean removeGridGateway(java.lang.String contact)

This is a soft state remove, that removes a GridGateway from a particular site.

Parameters:
  `contact` - the contact string for the grid gateway.
Returns:
  true if was able to remove the jobmanager from the cache false if unable to remove, or the matching entry is not found or if the implementing class does not maintain a soft state.

#### getReplicaCatalogIterator

    public java.util.Iterator<ReplicaCatalog> getReplicaCatalogIterator()

Return an iterator to the replica catalog associated with the site.

Returns:
  Iterator<ReplicaCatalog>

#### addReplicaCatalog

    public void addReplicaCatalog(ReplicaCatalog catalog)

Add a Replica Catalog to the site.

Parameters:
  `catalog` - the replica catalog to be added.

#### selectReplicaCatalog

    public ReplicaCatalog selectReplicaCatalog()

Selects a Random ReplicaCatalog.

Returns:
  `ReplicaCatalog if more than one associates else returns null.`

#### toXML

    public void toXML(java.io.Writer writer,
                      java.lang.String indent)
               throws java.io.IOException

Writes out the xml description of the object.

Specified by:
  `toXML` in class `AbstractSiteData`
Parameters:
  `writer` - is a Writer opened and ready for writing. This can also be a StringWriter for efficient output.
  `indent` - the indent to be used.
Throws:
  `java.io.IOException` - if something fishy happens to the stream.

#### clone

    public java.lang.Object clone()

Returns the clone of the object.

Overrides:
  `clone` in class `AbstractSiteData`
Returns:
  the clone

#### accept

    public void accept(SiteDataVisitor visitor)
                throws java.io.IOException

Accept method for the visitor interface

Specified by:
  `accept` in class `AbstractSiteData`
Parameters:
  `visitor` - the visitor
Throws:
  `java.io.IOException` - in case of error