org.griphyn.cPlanner.transfer.implementation
Class SRM

java.lang.Object
  extended by org.griphyn.cPlanner.transfer.implementation.Abstract
      extended by org.griphyn.cPlanner.transfer.implementation.AbstractMultipleFTPerXFERJob
          extended by org.griphyn.cPlanner.transfer.implementation.SRM
All Implemented Interfaces:
Implementation, MultipleFTPerXFERJob

public class SRM
extends AbstractMultipleFTPerXFERJob

The implementation that is used to create transfer jobs that callout to the SRMCP client, that can transfer files to and from a SRM server.

In order to use the transfer implementation implemented by this class,

        - the property pegasus.transfer.*.impl must be set to value SRM.
 

There should be an entry in the transformation catalog with the fully qualified name as SRM::srmcp for all the sites where workflow is run, or on the local site in case of third party transfers.

The arguments with which the client is invoked can be specified

       - by specifying the property pegasus.transfer.arguments
       - associating the VDS profile key transfer.arguments
 

Version:
$Revision: 145 $
Author:
Karan Vahi

Field Summary
static String DERIVATION_NAME
          The name of the underlying derivation.
static String DERIVATION_NAMESPACE
          The derivation namespace for for the transfer job.
static String DERIVATION_VERSION
          The derivation version number for the transfer job.
static String DESCRIPTION
          A short description of the transfer implementation.
private static String NEW_FILE_URL_SCHEME
          The new file URL scheme that replaces the old one.
private static String OLD_FILE_URL_SCHEME
          The old file URL scheme that needs to be replaced.
static String TRANSFORMATION_NAME
          The name of the underlying transformation that is queried for in the Transformation Catalog.
static String TRANSFORMATION_NAMESPACE
          The transformation namespace for the transfer job.
static String TRANSFORMATION_VERSION
          The version number for the transfer job.
 
Fields inherited from class org.griphyn.cPlanner.transfer.implementation.Abstract
CHANGE_XBIT_TRANSFORMATION, mDisabledChmodSites, mLocalUserProxy, mLocalUserProxyBasename, mLogger, mPOptions, mProps, mRefiner, mSCHandle, mTCHandle, NOOP_PREFIX, SET_XBIT_PREFIX, XBIT_DERIVATION_NS, XBIT_DERIVATION_VERSION, XBIT_TRANSFORMATION_NS, XBIT_TRANSFORMATION_VERSION
 
Fields inherited from interface org.griphyn.cPlanner.transfer.Implementation
TRANSFER_UNIVERSE, VERSION
 
Constructor Summary
SRM(PegasusProperties properties, PlannerOptions options)
          The overloaded constructor, that is called by the Factory to load the class.
 
Method Summary
 boolean doesPreserveXBit()
          Returns a boolean indicating whether the transfer protocol being used by the implementation preserves the X Bit or not while staging.
protected  String generateArgumentString(TransferJob job)
          Constructs the arguments to the transfer executable that need to be passed to the executable referred to in this transfer mode.
protected  String getCompleteTCName()
          Returns the complete name for the transformation.
protected  String getDerivationName()
          Returns the logical name of the derivation that this implementation refers to.
protected  String getDerivationNamespace()
          Returns the namespace of the derivation that this implementation refers to.
protected  String getDerivationVersion()
          Returns the version of the derivation that this implementation refers to.
 String getDescription()
          Returns a textual description of the transfer implementation.
protected  List getEnvironmentVariables(String site)
          Returns the environment profiles that are required for the default entry to sensibly work.
 TransformationCatalogEntry getTransformationCatalogEntry(String siteHandle)
          Retrieves the transformation catalog entry for the executable that is being used to transfer the files in the implementation.
 void postProcess(TransferJob job)
          Makes sure the stdin is transferred by the Condor File Transfer Mechanism.
private  String sanitizeURL(String url)
          Method that sanitizes file URL's to match with the SRM client.
 boolean useThirdPartyTransferAlways()
          Return a boolean indicating whether the transfers to be done always in a third party transfer mode.
protected  void writeJumboStdIn(FileWriter writer, Collection files)
          Writes to a FileWriter stream the input for the SRM job.
 
Methods inherited from class org.griphyn.cPlanner.transfer.implementation.AbstractMultipleFTPerXFERJob
createTransferJob, defaultTCEntry, prepareSTDIN
 
Methods inherited from class org.griphyn.cPlanner.transfer.implementation.Abstract
addSetXBitJobs, addSetXBitJobs, addSetXBitJobs, applyPriority, checkAndTransferProxy, construct, createNoOPJob, createSetXBitJob, determineDisabledChmodSites, disableChmodJobCreation, getNOOPJobName, getPathToUserProxy, getPriority, getSetXBitJobName, setRefiner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRANSFORMATION_NAMESPACE

public static final String TRANSFORMATION_NAMESPACE
The transformation namespace for the transfer job.

See Also:
Constant Field Values

TRANSFORMATION_NAME

public static final String TRANSFORMATION_NAME
The name of the underlying transformation that is queried for in the Transformation Catalog.

See Also:
Constant Field Values

TRANSFORMATION_VERSION

public static final String TRANSFORMATION_VERSION
The version number for the transfer job.


DERIVATION_NAMESPACE

public static final String DERIVATION_NAMESPACE
The derivation namespace for for the transfer job.

See Also:
Constant Field Values

DERIVATION_NAME

public static final String DERIVATION_NAME
The name of the underlying derivation.

See Also:
Constant Field Values

DERIVATION_VERSION

public static final String DERIVATION_VERSION
The derivation version number for the transfer job.

See Also:
Constant Field Values

DESCRIPTION

public static final String DESCRIPTION
A short description of the transfer implementation.

See Also:
Constant Field Values

OLD_FILE_URL_SCHEME

private static final String OLD_FILE_URL_SCHEME
The old file URL scheme that needs to be replaced.

See Also:
Constant Field Values

NEW_FILE_URL_SCHEME

private static final String NEW_FILE_URL_SCHEME
The new file URL scheme that replaces the old one.

See Also:
Constant Field Values
Constructor Detail

SRM

public SRM(PegasusProperties properties,
           PlannerOptions options)
The overloaded constructor, that is called by the Factory to load the class.

Parameters:
properties - the properties object.
options - the options passed to the Planner.
Method Detail

writeJumboStdIn

protected void writeJumboStdIn(FileWriter writer,
                               Collection files)
                        throws Exception
Writes to a FileWriter stream the input for the SRM job.

Specified by:
writeJumboStdIn in class AbstractMultipleFTPerXFERJob
Parameters:
writer - the writer to the stdin file.
files - Collection of FileTransfer objects containing the information about sourceam fin and destURL's.
Throws:
Exception

generateArgumentString

protected String generateArgumentString(TransferJob job)
Constructs the arguments to the transfer executable that need to be passed to the executable referred to in this transfer mode. The STDIN of the job is passed as an argument.

Specified by:
generateArgumentString in class AbstractMultipleFTPerXFERJob
Parameters:
job - the object containing the transfer node.
Returns:
the argument string

postProcess

public void postProcess(TransferJob job)
Makes sure the stdin is transferred by the Condor File Transfer Mechanism. In addition, the stdin is set to null, after the file has been marked for transfer by Condor File Transfer Mechanism.

Overrides:
postProcess in class AbstractMultipleFTPerXFERJob
Parameters:
job - the TransferJob that has been created.

doesPreserveXBit

public boolean doesPreserveXBit()
Returns a boolean indicating whether the transfer protocol being used by the implementation preserves the X Bit or not while staging.

Returns:
boolean

useThirdPartyTransferAlways

public boolean useThirdPartyTransferAlways()
Return a boolean indicating whether the transfers to be done always in a third party transfer mode. A value of false, results in the direct or peer to peer transfers being done.

A value of false does not preclude third party transfers. They still can be done, by setting the property "pegasus.transfer.*.thirdparty.sites".

Returns:
boolean indicating whether to always use third party transfers or not.
See Also:
PegasusProperties.getThirdPartySites(String)

getDescription

public String getDescription()
Returns a textual description of the transfer implementation.

Returns:
a short textual description

getTransformationCatalogEntry

public TransformationCatalogEntry getTransformationCatalogEntry(String siteHandle)
Retrieves the transformation catalog entry for the executable that is being used to transfer the files in the implementation.

Parameters:
siteHandle - the handle of the site where the transformation is to be searched.
Returns:
the transformation catalog entry if found, else null.

getEnvironmentVariables

protected List getEnvironmentVariables(String site)
Returns the environment profiles that are required for the default entry to sensibly work. Returns an empty list.

Specified by:
getEnvironmentVariables in class AbstractMultipleFTPerXFERJob
Parameters:
site - the site where the job is going to run.
Returns:
List of environment variables, else null in case where the required environment variables could not be found.

getCompleteTCName

protected String getCompleteTCName()
Returns the complete name for the transformation.

Specified by:
getCompleteTCName in class AbstractMultipleFTPerXFERJob
Returns:
the complete name.

getDerivationNamespace

protected String getDerivationNamespace()
Returns the namespace of the derivation that this implementation refers to.

Specified by:
getDerivationNamespace in class AbstractMultipleFTPerXFERJob
Returns:
the namespace of the derivation.

getDerivationName

protected String getDerivationName()
Returns the logical name of the derivation that this implementation refers to.

Specified by:
getDerivationName in class AbstractMultipleFTPerXFERJob
Returns:
the name of the derivation.

getDerivationVersion

protected String getDerivationVersion()
Returns the version of the derivation that this implementation refers to.

Specified by:
getDerivationVersion in class AbstractMultipleFTPerXFERJob
Returns:
the version of the derivation.

sanitizeURL

private String sanitizeURL(String url)
Method that sanitizes file URL's to match with the SRM client. It replaces file:/// with file://// in the URL.

Parameters:
url - the URL to be santized.
Returns:
the sanitized URL if it is a file URL, else the URL that is passed.


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