org.globus.transfer.reliable.service
Class ReliableFileTransferResource

java.lang.Object
  extended byorg.globus.wsrf.impl.ReflectionResource
      extended byorg.globus.transfer.reliable.service.ReliableFileTransferResource
All Implemented Interfaces:
PersistenceCallback, RemoveCallback, Resource, ResourceIdentifier, ResourceLifetime, ResourceProperties, SecureResource, TopicListAccessor

public class ReliableFileTransferResource
extends ReflectionResource
implements TopicListAccessor, ResourceProperties, ResourceLifetime, Resource, SecureResource, RemoveCallback, PersistenceCallback

Resource Implementation


Field Summary
private  int concurrency
           
private  org.globus.gsi.GlobusCredential credential
           
private  ReliableFileTransferDbAdapter dbAdapter
           
private  boolean delete
           
private  DeleteRequestType deleteRequest
           
private  ResourceSecurityDescriptor desc
           
(package private)  String HOME_LOCATION
           
private static org.globus.util.I18n i18n
           
private  ResourceKey key
           
private static org.apache.commons.logging.Log logger
           
private  int maxAttempts
           
private  OverallStatus overallStatus
           
private  ResourceProperty overallStatusRP
           
private  FilePersistenceHelper persistenceHelper
           
private  ResourcePropertySet propSet
           
private  int requestId
           
private  ResourceProperty requestStatusRP
           
private  RequestStatusType requestStatusType
           
private  RequestStatusTypeEnumeration requestStatusTypeEnumeration
           
private  Calendar resourceCreationTime
           
private  RFTResourceManager resourceManager
           
private  int size
           
private  boolean started
           
private static String SUBSCRIPTION_FILE
           
private  Calendar terminationTime
           
private  TopicList topicList
           
private  TotalBytesTransferredResource totalBytesTransferred
           
private  ResourceProperty totalBytesTransferredRP
           
private  ResourceProperty totalTimeTakenResourceRP
           
private  TotalTimeTakenResource totalTimeTakenType
           
private  TransferRequestType transferRequest
           
private  int transfersActive
           
private  int transfersCancelled
           
private  int transfersFailed
           
private  int transfersFinished
           
private  int transfersPending
           
private  int transfersRestarted
           
private  commonj.work.WorkManager workManager
           
 
Fields inherited from class org.globus.wsrf.impl.ReflectionResource
 
Constructor Summary
ReliableFileTransferResource()
          Constructor for the ReliableFileTransferResource object
ReliableFileTransferResource(BaseRequestType req, String userSubject, String localUserId, Calendar initialTerminationTime)
          Constructor for the ReliableFileTransferResource object
 
Method Summary
static ReliableTransferProperties createResourceBean(Calendar initialTerminationTime, Calendar currentTime)
          This should be moved to resource
 int getConcurrency()
           
 Calendar getCurrentTime()
          Gets the currentTime attribute of the ReliableFileTransferResource object
 Object getID()
          Gets the iD attribute of the ReliableFileTransferResource object
 int getMaxAttempts()
          Return the max retries for this resource
protected  FilePersistenceHelper getPersistenceHelper()
           
 int getRequestId()
           
 int getRequestIdFromKey()
           
 boolean getRequestType()
           
protected  Class getResourceBeanClass()
          Gets the resourceBeanClass attribute of the ReliableFileTransferResource object
 RFTResourceManager getResourceManager()
           
 ResourcePropertySet getResourcePropertySet()
          Gets the resourcePropertySet attribute of the ReliableFileTransferResource object
 ResourceSecurityDescriptor getSecurityDescriptor()
          Gets the securityDescriptor attribute of the ReliableFileTransferResource object
 List getStoredResourceKeyValues()
          Gets the storedResourceKeyValues attribute of the ReliableFileTransferResource object
 Calendar getTerminationTime()
          Gets the terminationTime attribute of the ReliableFileTransferResource object
 TopicList getTopicList()
          Gets the topicList attribute of the ReliableFileTransferResource object
 commonj.work.WorkManager getWorkManager()
           
 void initialize(Object resourceBean, QName resourceElementQName, Object key)
          Initialize the rft resource
private  void initializeOverallStatusRP()
           
private  void intializeRequestStatusRP()
           
 boolean isStarted()
          Is started
 void load(ResourceKey key)
          Called when activating a Transfer resource by ResourceHomeImpl
private  void loadSecurityContext(RFTRecoveryData recoveryData)
           
 void loadSubscribers()
           
protected  void processDelegatedCredential()
           
private  void processDelegatedCredential(int requestId)
           
 void remove()
          Removes the resources from the container.
private  void sendUsagePacket()
           
 void setCredential(org.globus.gsi.GlobusCredential credential)
           
private  void setResourceProperties()
           
private  void setSecurityDescriptor(String userSubject, String localUserId)
           
 void setStartedTrue()
           
 void setTerminationTime(Calendar time)
          Sets the terminationTime attribute of the ReliableFileTransferResource object
 void store()
           
private  void storeSubscriptions()
           
 
Methods inherited from class org.globus.wsrf.impl.ReflectionResource
createNewResourceProperty, createNewResourceProperty, getResourceBean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HOME_LOCATION

String HOME_LOCATION

logger

private static org.apache.commons.logging.Log logger

i18n

private static org.globus.util.I18n i18n

propSet

private ResourcePropertySet propSet

topicList

private TopicList topicList

desc

private ResourceSecurityDescriptor desc

terminationTime

private Calendar terminationTime

resourceCreationTime

private Calendar resourceCreationTime

key

private ResourceKey key

requestId

private int requestId

overallStatusRP

private ResourceProperty overallStatusRP

totalBytesTransferredRP

private ResourceProperty totalBytesTransferredRP

requestStatusRP

private ResourceProperty requestStatusRP

totalTimeTakenResourceRP

private ResourceProperty totalTimeTakenResourceRP

totalBytesTransferred

private TotalBytesTransferredResource totalBytesTransferred

overallStatus

private OverallStatus overallStatus

requestStatusType

private RequestStatusType requestStatusType

requestStatusTypeEnumeration

private RequestStatusTypeEnumeration requestStatusTypeEnumeration

totalTimeTakenType

private TotalTimeTakenResource totalTimeTakenType

size

private int size

dbAdapter

private ReliableFileTransferDbAdapter dbAdapter

transferRequest

private TransferRequestType transferRequest

deleteRequest

private DeleteRequestType deleteRequest

concurrency

private int concurrency

transfersFinished

private int transfersFinished

transfersActive

private int transfersActive

transfersFailed

private int transfersFailed

transfersPending

private int transfersPending

transfersRestarted

private int transfersRestarted

transfersCancelled

private int transfersCancelled

workManager

private commonj.work.WorkManager workManager

started

private boolean started

maxAttempts

private int maxAttempts

persistenceHelper

private FilePersistenceHelper persistenceHelper

SUBSCRIPTION_FILE

private static String SUBSCRIPTION_FILE

delete

private boolean delete

resourceManager

private RFTResourceManager resourceManager

credential

private org.globus.gsi.GlobusCredential credential
Constructor Detail

ReliableFileTransferResource

public ReliableFileTransferResource()
Constructor for the ReliableFileTransferResource object


ReliableFileTransferResource

public ReliableFileTransferResource(BaseRequestType req,
                                    String userSubject,
                                    String localUserId,
                                    Calendar initialTerminationTime)
                             throws Exception
Constructor for the ReliableFileTransferResource object

Parameters:
req - BaseRequestType
userSubject -
localUserId -
initialTerminationTime -
Throws:
Exception
Method Detail

getRequestType

public boolean getRequestType()
Returns:
type of request

getConcurrency

public int getConcurrency()
Returns:
concurrency

setCredential

public void setCredential(org.globus.gsi.GlobusCredential credential)
                   throws RftException
Parameters:
credential -
Throws:
RftException

storeSubscriptions

private void storeSubscriptions()
                         throws Exception
Throws:
Exception

loadSecurityContext

private void loadSecurityContext(RFTRecoveryData recoveryData)
                          throws Exception
Throws:
Exception

store

public void store()
Specified by:
store in interface PersistenceCallback

loadSubscribers

public void loadSubscribers()

getPersistenceHelper

protected FilePersistenceHelper getPersistenceHelper()

processDelegatedCredential

protected void processDelegatedCredential()
                                   throws Exception
Throws:
Exception

processDelegatedCredential

private void processDelegatedCredential(int requestId)
                                 throws Exception
Throws:
Exception

setSecurityDescriptor

private void setSecurityDescriptor(String userSubject,
                                   String localUserId)

initialize

public void initialize(Object resourceBean,
                       QName resourceElementQName,
                       Object key)
                throws ResourceException
Initialize the rft resource

Parameters:
resourceBean -
resourceElementQName -
key -
Throws:
ResourceException

initializeOverallStatusRP

private void initializeOverallStatusRP()
                                throws RftDBException
Throws:
RftDBException

intializeRequestStatusRP

private void intializeRequestStatusRP()

setResourceProperties

private void setResourceProperties()
                            throws Exception
Throws:
Exception

getWorkManager

public commonj.work.WorkManager getWorkManager()
Returns:
this.workManager

getResourceManager

public RFTResourceManager getResourceManager()

getSecurityDescriptor

public ResourceSecurityDescriptor getSecurityDescriptor()
Gets the securityDescriptor attribute of the ReliableFileTransferResource object

Specified by:
getSecurityDescriptor in interface SecureResource
Returns:
The securityDescriptor value

getStoredResourceKeyValues

public List getStoredResourceKeyValues()
                                throws RftDBException
Gets the storedResourceKeyValues attribute of the ReliableFileTransferResource object

Returns:
The storedResourceKeyValues value
Throws:
RftDBException

getResourcePropertySet

public ResourcePropertySet getResourcePropertySet()
Gets the resourcePropertySet attribute of the ReliableFileTransferResource object

Specified by:
getResourcePropertySet in interface ResourceProperties
Returns:
The resourcePropertySet value

getTopicList

public TopicList getTopicList()
Gets the topicList attribute of the ReliableFileTransferResource object

Specified by:
getTopicList in interface TopicListAccessor
Returns:
The topicList value

getID

public Object getID()
Gets the iD attribute of the ReliableFileTransferResource object

Specified by:
getID in interface ResourceIdentifier
Returns:
The iD value

setTerminationTime

public void setTerminationTime(Calendar time)
Sets the terminationTime attribute of the ReliableFileTransferResource object

Specified by:
setTerminationTime in interface ResourceLifetime
Parameters:
time - The new terminationTime value

getRequestIdFromKey

public int getRequestIdFromKey()
Returns:
requestId of this resource

getRequestId

public int getRequestId()
Returns:
requestId of this resource

getTerminationTime

public Calendar getTerminationTime()
Gets the terminationTime attribute of the ReliableFileTransferResource object

Specified by:
getTerminationTime in interface ResourceLifetime
Returns:
The terminationTime value

getCurrentTime

public Calendar getCurrentTime()
Gets the currentTime attribute of the ReliableFileTransferResource object

Specified by:
getCurrentTime in interface ResourceLifetime
Returns:
The currentTime value

getResourceBeanClass

protected Class getResourceBeanClass()
Gets the resourceBeanClass attribute of the ReliableFileTransferResource object

Returns:
The resourceBeanClass value

isStarted

public boolean isStarted()
Is started

Returns:
if resource is already started

load

public void load(ResourceKey key)
          throws ResourceException
Called when activating a Transfer resource by ResourceHomeImpl

Specified by:
load in interface PersistenceCallback
Parameters:
key - resource key
Throws:
ResourceException

setStartedTrue

public void setStartedTrue()

getMaxAttempts

public int getMaxAttempts()
Return the max retries for this resource

Returns:
maxAttempts

remove

public void remove()
            throws ResourceException
Removes the resources from the container.

Specified by:
remove in interface RemoveCallback
Throws:
ResourceException

createResourceBean

public static ReliableTransferProperties createResourceBean(Calendar initialTerminationTime,
                                                            Calendar currentTime)
This should be moved to resource

Parameters:
initialTerminationTime -
currentTime - current time
Returns:
ReliableTransferProperties

sendUsagePacket

private void sendUsagePacket()