Difference between revisions of "Storage Manager"

From Gcube Wiki
Jump to: navigation, search
(Design)
(Operations)
Line 10: Line 10:
 
The StorageManger library implements many operation on remote file, the methods LFile and RFile refer to, respectively,  Local File (if needed) and Remote File. In the call's signature, there are preceded from a method that identify a operation:
 
The StorageManger library implements many operation on remote file, the methods LFile and RFile refer to, respectively,  Local File (if needed) and Remote File. In the call's signature, there are preceded from a method that identify a operation:
  
;put(boolean replace) - :put a local file in a remote directory. If replace is true then the remote file, if exist, will be replaced, false otherwise.
+
;put(boolean replace)
 +
:put a local file in a remote directory. If replace is true then the remote file, if exist, will be replaced, false otherwise.
 
:Example: put(true).LFile(“localPath”).RFile(“remotePath”)
 
:Example: put(true).LFile(“localPath”).RFile(“remotePath”)
  
;get() - downloads a file from a remote path to a local directory
+
;get()  
 +
:downloads a file from a remote path to a local directory
 
:Example: get().LFile(“localPath”).RFile(“remotePath”);
 
:Example: get().LFile(“localPath”).RFile(“remotePath”);
  
;remove() - removes a remote file
+
;remove()  
 +
:removes a remote file
 
:Example: remove().RFile(“remotePath”);
 
:Example: remove().RFile(“remotePath”);
  
;removeDir() - removes a remote directory
+
;removeDir()  
 +
:removes a remote directory
 
:Example removeDir().LFile(“remoteDirPath”);
 
:Example removeDir().LFile(“remoteDirPath”);
  
;showDir() - shows the content of a directory
+
;showDir()  
 +
:shows the content of a directory
 
:Example showDir.RFile(“remoteDirPAth”);
 
:Example showDir.RFile(“remoteDirPAth”);
  
;lock() - locks a remote file to prevent multiple access
+
;lock()  
 +
:locks a remote file to prevent multiple access
 
:Example lock().RFile(“remotePath”);
 
:Example lock().RFile(“remotePath”);
  
;unlock(String lockKey) - unlocks a remote file
+
;unlock(String lockKey)  
 +
:unlocks a remote file
 
:Example unlock(“key”).RFile(“remotePath”);
 
:Example unlock(“key”).RFile(“remotePath”);
  
;getTTL() - return the TimeToLive associated to a remote file if the file is currently locked
+
;getTTL()  
 +
:return the TimeToLive associated to a remote file if the file is currently locked
 
:Example getTTL().RFile("remote/path/to/dir");
 
:Example getTTL().RFile("remote/path/to/dir");
  
setTTL(int milliseconds) - set the TimeToLive to a remote file that is currently locked. This operation is consented max 5 times for any file.
+
;setTTL(int milliseconds)  
 +
:set the TimeToLive to a remote file that is currently locked. This operation is consented max 5 times for any file.
 
:Example setTTL(180000).RFile("remote/path/to/dir");
 
:Example setTTL(180000).RFile("remote/path/to/dir");
  
 
== Sample Usage ==
 
== Sample Usage ==

Revision as of 15:34, 3 April 2012

== Role ==



Design

Operations

The StorageManger library implements many operation on remote file, the methods LFile and RFile refer to, respectively, Local File (if needed) and Remote File. In the call's signature, there are preceded from a method that identify a operation:

put(boolean replace)
put a local file in a remote directory. If replace is true then the remote file, if exist, will be replaced, false otherwise.
Example: put(true).LFile(“localPath”).RFile(“remotePath”)
get()
downloads a file from a remote path to a local directory
Example: get().LFile(“localPath”).RFile(“remotePath”);
remove()
removes a remote file
Example: remove().RFile(“remotePath”);
removeDir()
removes a remote directory
Example removeDir().LFile(“remoteDirPath”);
showDir()
shows the content of a directory
Example showDir.RFile(“remoteDirPAth”);
lock()
locks a remote file to prevent multiple access
Example lock().RFile(“remotePath”);
unlock(String lockKey)
unlocks a remote file
Example unlock(“key”).RFile(“remotePath”);
getTTL()
return the TimeToLive associated to a remote file if the file is currently locked
Example getTTL().RFile("remote/path/to/dir");
setTTL(int milliseconds)
set the TimeToLive to a remote file that is currently locked. This operation is consented max 5 times for any file.
Example setTTL(180000).RFile("remote/path/to/dir");

Sample Usage