Package AccessGrid :: Module DataStore :: Class DataStore
[show private | hide private]
[frames | no frames]

Class DataStore


A DataStore implements a per-venue data storage server.
Method Summary
  __init__(self, callbackClass, pathname, prefix, transferEngine)
Create the datastore.
  AddPendingUpload(self, identityToken, filename)
Create a data description for filename with a state of 'pending' and add to the venue.
  AsINIBlock(self)
This serializes the data in the DataStore as a INI formatted block of text.
  CancelPendingUpload(self, filename)
  CanUploadFile(self, dn, file_info)
Used by the transfer engine to determine if a client is able to upload a new file.
  CompleteUpload(self, identityToken, file_info)
The upload is done.
  GetDataDescriptions(self)
Retreive data in the DataStore as a list of DataDescriptions.
  GetDescription(self, filename)
  GetDownloadDescriptor(self, filename)
Return the download descriptor for filename.
  GetDownloadFilename(self, id_token, url_path)
Return the full path of the given filename in this datastore.
  GetFiles(self)
Retrieve list of files in the data store
  GetTime(self)
Get current time to use in descriptions.
  GetUploadDescriptor(self)
Return the upload descriptor for this datastore.
  GetUploadFilename(self, dn, file_info)
Return the filename for a file to be uploaded.
  LoadPersistentData(self, dataList)
Adds a list of DataDescriptions.
  LoadPersistentInfo(self)
  ModifyData(self, data)
  RemoveFiles(self, dataDescriptionList)
  SetDescription(self, filename, descriptionStruct)
Given a data description and a filename, set the data description if the file exists
  Shutdown(self)
  StorePersistentData(self)
  UploadLocalFiles(self, fileList, dn, id)
Add file to a local datastore

Method Details

__init__(self, callbackClass, pathname, prefix, transferEngine)
(Constructor)

Create the datastore.

Files will be stored in the directory named by <pathname>. The URL prefix for this data store is <prefix>.

AddPendingUpload(self, identityToken, filename)

Create a data description for filename with a state of 'pending' and add to the venue.

AsINIBlock(self)

This serializes the data in the DataStore as a INI formatted
block of text.

**Returns**
    *string* The INI formatted list of DataDescriptions in the DataStore.

CanUploadFile(self, dn, file_info)

Used by the transfer engine to determine if a client is able to upload a new file.

Arguments:
  • dn is the distinguished name of the client
  • file_info is a file information dict for hte file the client is trying to upload
Current test is just to see if the file exists. Need to test to see if the client is currently logged into the venue.

CompleteUpload(self, identityToken, file_info)

The upload is done. Get the data description, update with the information from the file_info dict (which contains the information from the manifest).

GetDataDescriptions(self)

Retreive data in the DataStore as a list of DataDescriptions.

**Returns**
    *dataDescriptionList* A list of DataDescriptions representing data currently in the DataStore

GetDownloadDescriptor(self, filename)

Return the download descriptor for filename.

If filename is not present in the datastore, return None.

GetDownloadFilename(self, id_token, url_path)

Return the full path of the given filename in this datastore.

Used by the transfer engine to find a requested file. This method must perform an authorization check on dn, the distinguished name of the client requesting the file. If this fails, raise a NotAuthorized exception. If the file does not exist, raise a FileNotFound exception.

GetFiles(self)

Retrieve list of files in the data store

Note: files are represented as a tuple (name,size)

GetTime(self)

Get current time to use in descriptions.

GetUploadDescriptor(self)

Return the upload descriptor for this datastore.

GetUploadFilename(self, dn, file_info)

Return the filename for a file to be uploaded.

file_info is a file information dictionary.

The client is running with identity "dn".

This is used by the transfer engine to provide a destination for a file upload.

LoadPersistentData(self, dataList)

Adds a list of DataDescriptions. If the datastore location has changed, url of data passed in is changed. If data is no longer present in the file system, the DataDescription is not ignored.

SetDescription(self, filename, descriptionStruct)

Given a data description and a filename, set the data description if the file exists

UploadLocalFiles(self, fileList, dn, id)

Add file to a local datastore

Generated by Epydoc 2.1 on Thu Apr 14 16:39:26 2005 http://epydoc.sf.net