edu.isi.pegasus.planner.catalog.transformation.classes

## Class TransformationStore

- java.lang.Object
- - edu.isi.pegasus.planner.catalog.transformation.classes.TransformationStore

    public class TransformationStore
    extends java.lang.Object

A container data class that is used to store transformations. The transformation are stored internally indexed by transformation name.

Version:
  $Revision$
Author:
  Karan Vahi

### Field Summary

Fields
`private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TransformationCatalogEntry>>>` `mTCStore` The internal store map.

### Constructor Summary

Constructors
Constructor and Description
`TransformationStore()` The default constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addEntry(TransformationCatalogEntry entry)` Adds an entry into the store.
`void` `clear()` Clears all the entries in the store.
`boolean` `containsTransformation(java.lang.String completeName)` Returns a boolean indicating whether the store contains an entry corresponding to a particular transformation or not.
`boolean` `containsTransformation(java.lang.String namespace, java.lang.String name, java.lang.String version)` Returns a boolean indicating whether the store contains an entry corresponding to a particular transformation or not.
`java.util.List<TransformationCatalogEntry>` `getAllEntries()` Returns all the entries in the Transformation Store
`java.util.List<TransformationCatalogEntry>` `getEntries(java.lang.String completeName, java.lang.String site)` Returns List of TransformationCatalogEntry objects for a transformation on a particular site.
`java.util.List<TransformationCatalogEntry>` `getEntries(java.lang.String completeName, java.lang.String site, TCType type)` Returns List of TransformationCatalogEntry objects for a transformation on a particular site and a type.
`java.util.List<TransformationCatalogEntry>` `getEntries(java.lang.String site, TCType type)` Returns a list of TransformationCatalogEntry objects matching on a site and transformation type.
`java.util.List<java.lang.String>` `getTransformations(java.lang.String site, TCType type)` Returns a list of transformation names matching on a site and transformation type.
`private void` `initialize()` Intializes the store.

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

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

### Field Detail

#### mTCStore

    private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.List<TransformationCatalogEntry>>> mTCStore

The internal store map. The Map is indexed by transformation names. The corresponding value is a Map that contains entries for all sites for a particular transformation . This map is indexed by site name and corresponding values are Lists of TransformationCatalogEntry objects.

### Constructor Detail

#### TransformationStore

    public TransformationStore()

The default constructor.

### Method Detail

#### initialize

    private void initialize()

Intializes the store.

#### clear

    public void clear()

Clears all the entries in the store.

#### addEntry

    public void addEntry(TransformationCatalogEntry entry)

Adds an entry into the store. If the entry already exists i.e entry for a site and corresponding PFN exists it's overriden.

Parameters:
  `entry` - the transformation catalog object.

#### getEntries

    public java.util.List<TransformationCatalogEntry> getEntries(java.lang.String completeName,
                                                                 java.lang.String site,
                                                                 TCType type)

Returns List of TransformationCatalogEntry objects for a transformation on a particular site and a type. If the site parameter passed is null, then all entries are returned corresponding to a tranformation. If type is null, then all entries associated with a site are returned.

Parameters:
  `completeName` - the complete name of the transformation
  `site` - the site on which to search for entries. null means all
  `type` - the type to match on . null means all types.
Returns:
  List if entries are found , else empty list.

#### getEntries

    public java.util.List<TransformationCatalogEntry> getEntries(java.lang.String completeName,
                                                                 java.lang.String site)

Returns List of TransformationCatalogEntry objects for a transformation on a particular site. If the site parameter passed is null, then all entries are returned corresponding to a tranformation.

Parameters:
  `completeName` - the complete name of the transformation
  `site` - the site on which to search for entries. null means all sites
Returns:
  List if entries are found , else empty list.

#### getAllEntries

    public java.util.List<TransformationCatalogEntry> getAllEntries()

Returns all the entries in the Transformation Store

Returns:
  all entries.

#### getEntries

    public java.util.List<TransformationCatalogEntry> getEntries(java.lang.String site,
                                                                 TCType type)

Returns a list of TransformationCatalogEntry objects matching on a site and transformation type.

Parameters:
  `site` - the site on which to search for entries. null means all
  `type` - the type to match on . null means all types.
Returns:
  List if transformations exist

#### getTransformations

    public java.util.List<java.lang.String> getTransformations(java.lang.String site,
                                                               TCType type)

Returns a list of transformation names matching on a site and transformation type.

Parameters:
  `site` - the site on which to search for entries. null means all
  `type` - the type to match on . null means all types.
Returns:
  List if transformations exist

#### containsTransformation

    public boolean containsTransformation(java.lang.String namespace,
                                          java.lang.String name,
                                          java.lang.String version)

Returns a boolean indicating whether the store contains an entry corresponding to a particular transformation or not.

Parameters:
  `namespace` - the namespace associated with the transformation
  `name` - the logical name
  `version` - the version of the transformation
Returns:
  boolean

#### containsTransformation

    public boolean containsTransformation(java.lang.String completeName)

Returns a boolean indicating whether the store contains an entry corresponding to a particular transformation or not.

Parameters:
  `completeName` - the complete name of the transformation as constructed from namespace, name and version
Returns:
  boolean