org.griphyn.common.catalog.transformation
Class Windward

java.lang.Object
  extended by org.griphyn.common.catalog.transformation.Windward
All Implemented Interfaces:
Catalog, TransformationCatalog

public class Windward
extends Object
implements TransformationCatalog

The implementation that allows us to inteface with Windward Process Catalogs. Only a subset of query functions are implemented.

Version:
$Revision$
Author:
Karan Vahi

Field Summary
protected  LogManager mLogger
          The handle to the log manager.
protected  String mPCImpl
          The name of the Process Catalog implementation to interface to.
protected  edu.isi.ikcap.workflows.ac.ProcessCatalog mProcessCatalog
          The handle to the ProcessCatalog API.
protected  PegasusProperties mProps
          The handle to PegasusProperties.
static String PROCESS_CATALOG_IMPL_PROPERTY
          The property that designates which Process catalog impl to pick up.
 
Fields inherited from interface org.griphyn.common.catalog.Catalog
DB_ALL_PREFIX
 
Constructor Summary
Windward()
          The default constructor.
 
Method Summary
 boolean addTCEntry(List tcentry)
          Add multiple TCEntries to the Catalog.
 boolean addTCEntry(String namespace, String name, String version, String physicalname, TCType type, String resourceid, List lfnprofiles, List pfnprofiles, SysInfo sysinfo)
          Add an single entry into the transformation catalog.
 boolean addTCEntry(TransformationCatalogEntry tcentry)
          Add single TCEntry to the Catalog.
 boolean addTCEntry(TransformationCatalogEntry tcentry, boolean write)
          Add single TCEntry object temporarily to the in memory Catalog.
 boolean addTCLfnProfile(String namespace, String name, String version, List profiles)
          Add additional profile to a logical transformation .
 boolean addTCPfnProfile(String pfn, TCType type, String resourcename, List profiles)
          Add additional profile to a physical transformation.
 void close()
          Explicitely free resources before the garbage collection hits.
 boolean connect(Properties props)
          Establishes a link between the implementation and the thing the implementation is build upon.
 boolean deleteTC()
          Deletes the entire transformation catalog.
 boolean deleteTCbyLogicalName(String namespace, String name, String version, String resourceid, TCType type)
          Delete all entries in the transformation catalog for a give logical tranformation and/or on a resource and/or of a particular type
 boolean deleteTCbyPhysicalName(String physicalname, String namespace, String name, String version, String resourceid, TCType type)
          Delete all entries in the transformation catalog for pair of logical and physical transformation.
 boolean deleteTCbyResourceId(String resourceid)
          Delete all entries on a particular resource from the transformation catalog.
 boolean deleteTCbySysInfo(SysInfo sysinfo)
          Deletes entries from the catalog which have a particular system information.
 boolean deleteTCbyType(TCType type, String resourceid)
          Delete a paricular type of transformation, and/or on a particular resource
 boolean deleteTCLfnProfile(String namespace, String name, String version, List profiles)
          Delete a list of profiles or all the profiles associated with a logical transformation.
 boolean deleteTCPfnProfile(String physicalname, TCType type, String resourceid, List profiles)
          Delete a list of profiles or all the profiles associated with a pfn on a resource and of a type.
static TransformationCatalog getInstance()
          Returns an instance of the File TC.
 List getTC()
          List all the contents of the TC
 List getTCEntries(String namespace, String name, String version, List resourceids, TCType type)
          Returns TC entries for a particular logical transformation and/or on a number of resources and/or of a particular type.
 List getTCEntries(String namespace, String name, String version, String resourceid, TCType type)
          Returns TC entries for a particular logical transformation and/or on a particular resource and/or of a particular type.
 List getTCLfnProfiles(String namespace, String name, String version)
          Get the list of Profiles associated with a particular logical transformation.
 List getTCLogicalNames(String resourceid, TCType type)
          Get the list of LogicalNames available on a particular resource.
 String getTCMode()
          Returns the TC implementation being used
 List getTCPfnProfiles(String pfn, String resourceid, TCType type)
          Get the list of Profiles associated with a particular physical transformation.
 List getTCPhysicalNames(String namespace, String name, String version, String resourceid, TCType type)
          Get the list of PhysicalNames for a particular transformation on a site/sites for a particular type/types;
 List getTCResourceIds(String namespace, String name, String version, TCType type)
          Get the list of Resource ID's where a particular transformation may reside.
 boolean isClosed()
          Predicate to check, if the connection with the catalog's implementation is still active.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROCESS_CATALOG_IMPL_PROPERTY

public static final String PROCESS_CATALOG_IMPL_PROPERTY
The property that designates which Process catalog impl to pick up.

See Also:
Constant Field Values

mProcessCatalog

protected edu.isi.ikcap.workflows.ac.ProcessCatalog mProcessCatalog
The handle to the ProcessCatalog API.


mPCImpl

protected String mPCImpl
The name of the Process Catalog implementation to interface to.


mProps

protected PegasusProperties mProps
The handle to PegasusProperties.


mLogger

protected LogManager mLogger
The handle to the log manager.

Constructor Detail

Windward

public Windward()
The default constructor.

Method Detail

getInstance

public static TransformationCatalog getInstance()
Returns an instance of the File TC.

Returns:
TransformationCatalog

addTCEntry

public boolean addTCEntry(String namespace,
                          String name,
                          String version,
                          String physicalname,
                          TCType type,
                          String resourceid,
                          List lfnprofiles,
                          List pfnprofiles,
                          SysInfo sysinfo)
                   throws Exception
Add an single entry into the transformation catalog.

Specified by:
addTCEntry in interface TransformationCatalog
Parameters:
namespace - String The namespace of the transformation to be added (Can be null)
name - String The name of the transformation to be added.
version - String The version of the transformation to be added. (Can be null)
physicalname - String The physical name/location of the transformation to be added.
type - TCType The type of the physical transformation.
resourceid - String The resource location id where the transformation is located.
lfnprofiles - List The List of Profile objects associated with a Logical Transformation. (can be null)
pfnprofiles - List The List of Profile objects associated with a Physical Transformation. (can be null)
sysinfo - SysInfo The System information associated with a physical transformation.
Returns:
boolean Returns true if succesfully added, returns false if error and throws exception.
Throws:
Exception
See Also:
TransformationCatalogEntry, SysInfo, Profile

addTCEntry

public boolean addTCEntry(List tcentry)
                   throws Exception
Add multiple TCEntries to the Catalog.

Specified by:
addTCEntry in interface TransformationCatalog
Parameters:
tcentry - List Takes a list of TransformationCatalogEntry objects as input
Returns:
boolean Return true if succesful, false if error. Exception is thrown when error occurs.
Throws:
Exception
See Also:
TransformationCatalogEntry

addTCEntry

public boolean addTCEntry(TransformationCatalogEntry tcentry,
                          boolean write)
                   throws Exception
Add single TCEntry object temporarily to the in memory Catalog.

Specified by:
addTCEntry in interface TransformationCatalog
Parameters:
tcentry - Takes a single TransformationCatalogEntry object as input
write - boolean enable write commits to backed catalog or not.
Returns:
boolean Return true if succesful, false if error. Exception is thrown when error occurs.
Throws:
Exception
See Also:
TransformationCatalogEntry

addTCEntry

public boolean addTCEntry(TransformationCatalogEntry tcentry)
                   throws Exception
Add single TCEntry to the Catalog.

Specified by:
addTCEntry in interface TransformationCatalog
Parameters:
tcentry - Takes a single TransformationCatalogEntry object as input
Returns:
boolean Return true if succesful, false if error. Exception is thrown when error occurs.
Throws:
Exception
See Also:
TransformationCatalogEntry

addTCLfnProfile

public boolean addTCLfnProfile(String namespace,
                               String name,
                               String version,
                               List profiles)
                        throws Exception
Add additional profile to a logical transformation .

Specified by:
addTCLfnProfile in interface TransformationCatalog
Parameters:
namespace - String The nsamespace of the transformation to be added. (can be null)
name - String The name of the transformation to be added.
version - String The version of the transformation to be added. (can be null)
profiles - List The List of Profile objects that are to be added to the transformation.
Returns:
boolean Returns true if success, false if error.
Throws:
Exception
See Also:
Profile

addTCPfnProfile

public boolean addTCPfnProfile(String pfn,
                               TCType type,
                               String resourcename,
                               List profiles)
                        throws Exception
Add additional profile to a physical transformation.

Specified by:
addTCPfnProfile in interface TransformationCatalog
Parameters:
pfn - String The physical name of the transformation
type - TCType The type of transformation that the profile is associated with.
resourcename - String The resource on which the physical transformation exists
profiles - List The List of Profile objects that are to be added to the transformation.
Returns:
boolean Returns true for success, false for error.
Throws:
Exception
See Also:
Profile

close

public void close()
Explicitely free resources before the garbage collection hits.

Specified by:
close in interface Catalog

connect

public boolean connect(Properties props)
Establishes a link between the implementation and the thing the implementation is build upon.

Specified by:
connect in interface Catalog
Parameters:
props - contains all necessary data to establish the link.
Returns:
true if connected now, or false to indicate a failure.

deleteTC

public boolean deleteTC()
                 throws Exception
Deletes the entire transformation catalog.

Specified by:
deleteTC in interface TransformationCatalog
Returns:
boolean Returns true if delete succeeds, false if any error occurs.
Throws:
Exception

deleteTCLfnProfile

public boolean deleteTCLfnProfile(String namespace,
                                  String name,
                                  String version,
                                  List profiles)
                           throws Exception
Delete a list of profiles or all the profiles associated with a logical transformation.

Specified by:
deleteTCLfnProfile in interface TransformationCatalog
Parameters:
namespace - String The namespace of the logical transformation.
name - String The name of the logical transformation.
version - String The version of the logical transformation.
profiles - List The List of profiles to be deleted. If NULL then all profiles for the logical transformation are deleted.
Returns:
boolean Returns true if success, false if any error occurs.
Throws:
Exception
See Also:
Profile

deleteTCPfnProfile

public boolean deleteTCPfnProfile(String physicalname,
                                  TCType type,
                                  String resourceid,
                                  List profiles)
                           throws Exception
Delete a list of profiles or all the profiles associated with a pfn on a resource and of a type.

Specified by:
deleteTCPfnProfile in interface TransformationCatalog
Parameters:
physicalname - String The physical name of the transformation.
type - TCType The type of the transformation.
resourceid - String The resource of the transformation.
profiles - List The list of profiles to be deleted. If NULL then all profiles for that pfn+resource+type are deleted.
Returns:
boolean Returns true if success, false if any error occurs.
Throws:
Exception
See Also:
Profile

deleteTCbyLogicalName

public boolean deleteTCbyLogicalName(String namespace,
                                     String name,
                                     String version,
                                     String resourceid,
                                     TCType type)
                              throws Exception
Delete all entries in the transformation catalog for a give logical tranformation and/or on a resource and/or of a particular type

Specified by:
deleteTCbyLogicalName in interface TransformationCatalog
Parameters:
namespace - String The namespace of the transformation to be added. (can be null)
name - String The name of the transformation to be added.
version - String The version of the transformation to be added. ( can be null)
resourceid - String The resource id for which the transformation is to be deleted. If NULL then transformation on all resource are deleted
type - TCType The type of the transformation. If NULL then all types are deleted for the transformation.
Returns:
boolean Returns true if success , false if there is any error.
Throws:
Exception
See Also:
TCType

deleteTCbyPhysicalName

public boolean deleteTCbyPhysicalName(String physicalname,
                                      String namespace,
                                      String name,
                                      String version,
                                      String resourceid,
                                      TCType type)
                               throws Exception
Delete all entries in the transformation catalog for pair of logical and physical transformation.

Specified by:
deleteTCbyPhysicalName in interface TransformationCatalog
Parameters:
physicalname - String The physical name of the transformation
namespace - String The namespace assocaited in the logical name of the transformation.
name - String The name of the logical transformation.
version - String The version number of the logical transformation.
resourceid - String The resource on which the transformation is to be deleted. If NULL then it searches all the resource id.
type - TCType The type of transformation. If NULL then it search and deletes entries for all types.
Returns:
boolean Returns true if sucess, false if any error occurs.
Throws:
Exception
See Also:
TCType

deleteTCbyResourceId

public boolean deleteTCbyResourceId(String resourceid)
                             throws Exception
Delete all entries on a particular resource from the transformation catalog.

Specified by:
deleteTCbyResourceId in interface TransformationCatalog
Parameters:
resourceid - String The resource which you want to remove.
Returns:
boolean Returns true if successm false if any error occurs.
Throws:
Exception

deleteTCbySysInfo

public boolean deleteTCbySysInfo(SysInfo sysinfo)
                          throws Exception
Deletes entries from the catalog which have a particular system information.

Specified by:
deleteTCbySysInfo in interface TransformationCatalog
Parameters:
sysinfo - SysInfo The System Information by which you want to delete
Returns:
boolean Returns true for success, false if any error occurs.
Throws:
Exception
See Also:
SysInfo

deleteTCbyType

public boolean deleteTCbyType(TCType type,
                              String resourceid)
                       throws Exception
Delete a paricular type of transformation, and/or on a particular resource

Specified by:
deleteTCbyType in interface TransformationCatalog
Parameters:
type - TCType The type of the transformation
resourceid - String The resource on which the transformation exists. If NULL then that type of transformation is deleted from all the resources.
Returns:
boolean Returns true if success, false if any error occurs.
Throws:
Exception
See Also:
TCType

getTC

public List getTC()
           throws Exception
List all the contents of the TC

Specified by:
getTC in interface TransformationCatalog
Returns:
List Returns a List of TransformationCatalogEntry objects.
Throws:
Exception

getTCEntries

public List getTCEntries(String namespace,
                         String name,
                         String version,
                         List resourceids,
                         TCType type)
                  throws Exception
Returns TC entries for a particular logical transformation and/or on a number of resources and/or of a particular type.

Specified by:
getTCEntries in interface TransformationCatalog
Parameters:
namespace - String The namespace of the logical transformation.
name - String the name of the logical transformation.
version - String The version of the logical transformation.
resourceids - List The List resourceid where the transformation is located. If NULL it returns all resources.
type - TCType The type of the transformation to search for. If NULL it returns all types.
Returns:
List Returns a list of TransformationCatalogEntry objects containing the corresponding entries from the TC. Returns null if no entry found.
Throws:
Exception
See Also:
TCType, TransformationCatalogEntry

getTCEntries

public List getTCEntries(String namespace,
                         String name,
                         String version,
                         String resourceid,
                         TCType type)
                  throws Exception
Returns TC entries for a particular logical transformation and/or on a particular resource and/or of a particular type.

Specified by:
getTCEntries in interface TransformationCatalog
Parameters:
namespace - String The namespace of the logical transformation.
name - String the name of the logical transformation.
version - String The version of the logical transformation.
resourceid - String The resourceid where the transformation is located. If NULL it returns all resources.
type - TCType The type of the transformation to search for. If NULL it returns all types.
Returns:
List Returns a list of TransformationCatalogEntry objects containing the corresponding entries from the TC. Returns null if no entry found.
Throws:
Exception
See Also:
TCType, TransformationCatalogEntry

getTCLfnProfiles

public List getTCLfnProfiles(String namespace,
                             String name,
                             String version)
                      throws Exception
Get the list of Profiles associated with a particular logical transformation.

Specified by:
getTCLfnProfiles in interface TransformationCatalog
Parameters:
namespace - String The namespace of the transformation to search for.
name - String The name of the transformation to search for.
version - String The version of the transformation to search for.
Returns:
List Returns a list of Profile Objects containing profiles assocaited with the transformation. Returns NULL if no profiles found.
Throws:
UnsupportedOperationException
Exception - NotImplementedException if not implemented.
See Also:
Profile

getTCLogicalNames

public List getTCLogicalNames(String resourceid,
                              TCType type)
                       throws Exception
Get the list of LogicalNames available on a particular resource.

Specified by:
getTCLogicalNames in interface TransformationCatalog
Parameters:
resourceid - String The id of the resource on which you want to search
type - TCType The type of the transformation to search for.
(Enumerated type includes source, binary, dynamic-binary, pacman, installed)
If NULL then return logical name for all types.
Returns:
List Returns a list of String Arrays. Each array contains the resourceid, logical transformation in the format namespace::name:version and type. The last entry in the list is an array of integers specifying the column length for pretty print. Returns NULL if no results found.
Throws:
UnsupportedOperationException
Exception - NotImplementedException if not implemented.

getTCMode

public String getTCMode()
Returns the TC implementation being used

Specified by:
getTCMode in interface TransformationCatalog
Returns:
String

getTCPfnProfiles

public List getTCPfnProfiles(String pfn,
                             String resourceid,
                             TCType type)
                      throws Exception
Get the list of Profiles associated with a particular physical transformation.

Specified by:
getTCPfnProfiles in interface TransformationCatalog
Parameters:
pfn - The physical file name to search the transformation by.
resourceid - String The id of the resource on which you want to search.
type - TCType The type of the transformation to search for.
(Enumerated type includes source, binary, dynamic-binary, pacman, installed)
Returns:
List Returns a list of Profile Objects containing profiles assocaited with the transformation. Returns NULL if no profiless found.
Throws:
Exception - NotImplementedException if not implemented.
UnsupportedOperationException
See Also:
Profile

getTCPhysicalNames

public List getTCPhysicalNames(String namespace,
                               String name,
                               String version,
                               String resourceid,
                               TCType type)
                        throws Exception
Get the list of PhysicalNames for a particular transformation on a site/sites for a particular type/types;

Specified by:
getTCPhysicalNames in interface TransformationCatalog
Parameters:
namespace - String The namespace of the transformation to search for.
name - String The name of the transformation to search for.
version - String The version of the transformation to search for.
resourceid - String The id of the resource on which you want to search.
If NULL then returns entries on all resources
type - TCType The type of the transformation to search for.
(Enumerated type includes source, binary, dynamic-binary, pacman, installed)
If NULL then returns entries of all types.
Returns:
List Returns a list of String Arrays. Each array contains the resourceid, the physical transformation, the type of the tr and the systeminfo. The last entry in the List is a int array containing the column lengths for pretty print. Returns NULL if no results found.
Throws:
UnsupportedOperationException
Exception - NotImplementedException if not implemented.
See Also:
TCType, SysInfo

getTCResourceIds

public List getTCResourceIds(String namespace,
                             String name,
                             String version,
                             TCType type)
                      throws Exception
Get the list of Resource ID's where a particular transformation may reside.

Specified by:
getTCResourceIds in interface TransformationCatalog
Parameters:
namespace - String The namespace of the transformation to search for.
name - String The name of the transformation to search for.
version - String The version of the transformation to search for.
type - TCType The type of the transformation to search for.
(Enumerated type includes SOURCE, STATIC-BINARY, DYNAMIC-BINARY, PACMAN, INSTALLED, SCRIPT)
If NULL it returns all types.
Returns:
List Returns a list of Resource Id's as strings. Returns NULL if no results found.
Throws:
Exception - NotImplementedException if not implemented
See Also:
TCType

isClosed

public boolean isClosed()
Predicate to check, if the connection with the catalog's implementation is still active.

Specified by:
isClosed in interface Catalog
Returns:
true, if the implementation is disassociated, false otherwise.
See Also:
Catalog.close()


Copyright © 2007 The University of Southern California. All Rights Reserved.