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

## Class Adapter

- java.lang.Object
- - edu.isi.pegasus.planner.catalog.site.classes.Adapter

    public class Adapter
    extends java.lang.Object

An adapter class that converts the SiteCatalogEntry class to older supported formats and vice-versa

Version:
  $Revision$
Author:
  Karan Vahi

### Constructor Summary

Constructors
Constructor and Description
`Adapter()`

### Method Summary

All Methods Static Methods Concrete Methods
`private static void` `addDirectory(SiteCatalogEntry3 entry, Directory directory)` Adds a directory to the site catalog entry object.
`static SiteCatalogEntry3` `convert(SiteCatalogEntry entry)` An adapter method that converts the `SiteCatalogEntry` object to `SiteCatalogEntry3` object.
`static SiteCatalogEntry` `convert(SiteCatalogEntry3 entry)` An adapter method that converts the `SiteCatalogEntry3` object to `SiteCatalogEntry` object.

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

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

### Constructor Detail

#### Adapter

    public Adapter()

### Method Detail

#### convert

    public static SiteCatalogEntry convert(SiteCatalogEntry3 entry)

An adapter method that converts the `SiteCatalogEntry3` object to `SiteCatalogEntry` object. For the directories, the following mapping is followed. Note that the adapter method while converting does not clone the members. The user need to call on the returned object if they want a cloned copy.

      HeadNodeFS shared scratch  -> shared-scratch
      HeadNodeFS shared storage  -> shared-storage
      HeadNodeFS local storage   -> local-storage
      WorkerNodeFS local scratch -> local-scratch

Parameters:
  `entry` - `SiteCatalogEntry3` to be converted.
Returns:
  the converted `SiteCatalogEntry3` object.

#### convert

    public static SiteCatalogEntry3 convert(SiteCatalogEntry entry)

An adapter method that converts the `SiteCatalogEntry` object to `SiteCatalogEntry3` object. For the directories, the following mapping is followed.

      shared-scratch  ->  HeadNodeFS shared scratch
      shared-storage  ->  HeadNodeFS shared storage
      local-scratch   ->  WorkerNodeFS local scratch
      local-storage   ->  HeadNodeFS local storage

Note that the adapter method while converting does not clone the members. The user need to call on the returned object if they want a cloned copy.

Parameters:
  `entry` - `SiteCatalogEntry` to be converted.
Returns:
  the converted `SiteCatalogEntry3` object.

#### addDirectory

    private static void addDirectory(SiteCatalogEntry3 entry,
                                     Directory directory)

Adds a directory to the site catalog entry object. Adding a directory automatically will add a head node filesystem and a worker node filesystem to the SiteCatalogEntry if it does not exist already. The mapping followed is

      shared-scratch  ->  HeadNodeFS shared scratch
      shared-storage  ->  HeadNodeFS shared storage
      local-scratch   ->  WorkerNodeFS local scratch
      local-storage   ->  HeadNodeFS local storage

Parameters:
  `entry` - the Site Catalog Entry object
  `directory` - the directory to be added