org.icenigrid.gridsam.core.hostenv
Class FileProviderUtil

java.lang.Object
  extended by org.icenigrid.gridsam.core.hostenv.FileProviderUtil

public class FileProviderUtil
extends java.lang.Object

Purpose:
to support different file-transfer module. This class uses the interface FileProvider. So different module just need to implement FileProvider's interface.

Version:
1.0.1 2008-7-21
Author:
Liu Jie, Yongqiang Zou

Constructor Summary
FileProviderUtil()
          constructor.
 
Method Summary
 boolean cancelFileJob(java.lang.String jobName)
          cancel file-transfer job.
 FileJobInfo getFileJobInfo(java.lang.String jobName)
          get a file job info
 java.lang.String getFileJobStatus(java.lang.String jobName)
          get status of file-transfer job.
 java.lang.String getFileProviderType()
          get the file provider type, which is defined in the FileProvider
 boolean pauseFileJob(java.lang.String jobName)
          pause a file-transfer job.
 java.lang.String stageIn(java.util.Map jobInfo)
          stage in a file.
 java.lang.String stageOut(java.util.Map jobInfo)
          stage out a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileProviderUtil

public FileProviderUtil()
                 throws ConfigurationException
constructor.

Throws:
JobManagerException - if registry does not contain service "gridsam.FileProvider"
ConfigurationException
Method Detail

getFileJobStatus

public java.lang.String getFileJobStatus(java.lang.String jobName)
                                  throws java.lang.Exception
get status of file-transfer job.

Parameters:
jobName - file-transfer job name.
Returns:
file-transfer job's status defined in org.icenigrid.gridsam.core.plugin.aft.util.AftJobConstants.
Throws:
java.lang.Exception - exception throws by file-transfer module.

getFileJobInfo

public FileJobInfo getFileJobInfo(java.lang.String jobName)
                           throws java.lang.Exception
get a file job info

Parameters:
jobName -
Returns:
FileJobInfo
Throws:
java.lang.Exception

stageIn

public java.lang.String stageIn(java.util.Map jobInfo)
                         throws SubmissionException
stage in a file.

Parameters:
jobInfo - A map contain info needed by file-transfer. This Map may contain keys : "BatchConstants.REMOTE_URL", "BatchConstants.LOCA_FILE_PATH", "BatchConstants.GLOBAL_USERDN", "BatchConstants.LOCAL_USERDN", "BatchConstants.AFTJOB_ACTION"
Returns:
String file-transfer job name.
Throws:
java.lang.Exception - exception throws by file-transfer module.
SubmissionException

stageOut

public java.lang.String stageOut(java.util.Map jobInfo)
                          throws SubmissionException
stage out a file.

Parameters:
jobInfo - A map contain info needed by file-transfer. This Map may contain keys : "BatchConstants.REMOTE_URL", "BatchConstants.LOCA_FILE_PATH", "BatchConstants.GLOBAL_USERDN", "BatchConstants.LOCAL_USERDN", "BatchConstants.AFTJOB_ACTION"
Returns:
String file-transfer job name.
Throws:
java.lang.Exception - exception throws by file-transfer module.
SubmissionException

cancelFileJob

public boolean cancelFileJob(java.lang.String jobName)
                      throws java.lang.Exception
cancel file-transfer job.

Parameters:
jobName - file-transfer job name.
Returns:
boolean true if success.
Throws:
java.lang.Exception - exception throws by file-transfer module.

pauseFileJob

public boolean pauseFileJob(java.lang.String jobName)
                     throws java.lang.Exception
pause a file-transfer job.

Parameters:
jobName - file-transfer job name.
Returns:
boolean true if success.
Throws:
java.lang.Exception - exception throws by file-transfer module.

getFileProviderType

public java.lang.String getFileProviderType()
get the file provider type, which is defined in the FileProvider

Returns:
file provider type


Copyright © 2008. All Rights Reserved.