Table of Contents

Class: Collection ./pyGlobus/replicaCatalog.py

The main interface to the replica catatlog collection module.

It is mainly a proxy class for the replicaCatalogc module collection functions. It provides a higher level interface designed to simplify usage. Exceptions are used to indicate all error conditions.

Methods   
__del__
__init__
add_attribute
add_filenames
delete
delete_attribute
delete_filenames
find_locations
list_attributes
list_collections
list_locations
list_logicalfiles
list_rollback_entries
location_add_attribute
location_add_filenames
location_create
location_delete
location_delete_attribute
location_delete_filenames
location_list_filenames
logicalfile_add_attribute
logicalfile_create
logicalfile_delete
logicalfile_delete_attribute
logicalfile_list_attributes
set_dn
  __del__ 
__del__ ( self )

Destroys an instance.

It will close the connection, and deactivate the globus_replica_catalog module when the object is destroyed.

Raises:

A CollectionException is thrown if unable to destroy the module. This exception can't be caught, and should never happend. It's there mainly for debugging if it does happen. :-)

Exceptions   
ex
  __init__ 
__init__ (
        self,
        url,
        authMode,
        attr=None,
        bindDN=None,
        passwd=None,
        handle=None,
        activated=0,
        )

Open a connection to a given collection.

This will activate the globus_replica_catalog_module, and open a connection to the collection at the given url.

Arguments

  • url The ldap url of the collection to connect to.

  • authMode The authentication mode to use when connecting to the collection. If the mode is secure, bindDN and passwd should be None.

  • attr CollectionAttr object containg the attributes for the collection handle. If None, default attributes will be used.

  • bindDN A string containing the DN to authenticate as to the ldap server when doing cleartext authentication.

  • passwd A string containing the password to use when authenticating to the ldap server when doing cleartext authentication.

  • handle A SWIG'ized pointer to a globus_replica_catalog_collection_handle. This should only be used by create.

  • activated A boolean indicating if the module has already been activated. Used by create.

Raises:

A CollectionException is thrown if unable to activate the module, or open the connection.

Exceptions   
ex
  add_attribute 
add_attribute (
        self,
        name,
        value,
        )

Add attribute information (other than filenames) to a collection.

Does not replace existing attribute values.

Note that the arbitrary information associated with a collection may apply either to the collection itself or to all the filenames in the collection depending on the meaning the caller wants to associate with a particular attribute.

Arguments

  • name A string containing the name of the attribute to be added.

  • value A string containing the value of the attribute to add.

Raises

A CollectionException is thrown if unable to add the attribute.

Exceptions   
ex
  add_filenames 
add_filenames (
        self,
        filenames,
        add=0,
        )

Add filenames to a collection.

If some of the given filenames already exist in the collection, and add is add is true, then add those that don't. Otherwise, fail if some of the given filenames already exist and add is false.

Arguments

  • filenames A list of string filenames to add.

  • add whether to add given filenames that don't exist in the collection even if there are some given filenames that do exist

Raises

A CollectionException is thrown if unable to add the filenames.

Exceptions   
ex
  delete 
delete ( self )

Delete a collection and close the connection.

There must be no locations in the collection. This method does not check for the presence of logical files in the collection.

Raises

A CollectionException is thrown if unable to delete the collection.

Exceptions   
ex
  delete_attribute 
delete_attribute (
        self,
        name,
        value,
        )

Delete attribute information (other than filenames) from a collection.

Arguments

  • name A string containing the name of the attribute to be deleted.

  • value A string containing the value of the attribute to delete.

Raises

A CollectionException is thrown if unable to delete the attribute.

Exceptions   
ex
  delete_filenames 
delete_filenames ( self,  filenames )

Delete filenames from a collection.

If one or more of the given filenames is not associated with the collection then no deletions are done.

There must be no correspondingly named logical files or corresponding filenames in any of the locations in the collection.

Arguments

  • filenames A list of string filenames to delete.

Raises

A CollectionException is thrown if unable to delete the filenames.

Exceptions   
ex
  find_locations 
find_locations (
        self,
        filenames,
        all,
        attrNames=None,
        )

Search for locations with all (or any) of the given filenames.

Only return attribute information for the given attribute names.

Arguments

  • filenames List of string filenames to return.

  • all whether to return locations that contain ALL the given filenames (true) or otherwise return locations that contain ANY of the given filenames (false)

  • attrNames A list of names of the attributes to return. If None, all attributes are returned.

Returns

An EntrySet object is returned containing the locations.

Raises

A CollectionException is thrown if unable to return the locations.

Exceptions   
ex
  list_attributes 
list_attributes ( self,  attrNames=None )

List attribute information (other then filenames) of a collection.

For each collection only return attribute information for the given attribute names.

Arguments

  • attrNames A list of names of the attributes to return. If None, all attributes are returned.

Returns

An AttributeSet object is returned containing the attributes

*Raises

A CollectionException is thrown if unable to return the attribute list.

Exceptions   
ex
  list_collections 
list_collections ( self,  attrNames=None )

List the collections in a replica catalog.

For each collection only return attribute information for the given attribute names.

Arguments

  • attrNames A list of names of the attributes to return. If None, the default attributes are returned.

Returns

An EntrySet object is returned containing the collections

*Raises

A CollectionException is thrown if unable to return the collection list.

Exceptions   
ex
  list_locations 
list_locations ( self,  attrNames=None )

List the locations in a collection.

For each location only return attribute information for the given attribute name

Arguments

  • attrNames A list of names of the attributes to return. If None, all attributes are returned.

Returns

An EntrySet object is returned containing the locations.

Raises

A CollectionException is thrown if unable to return the locations.

Exceptions   
ex
  list_logicalfiles 
list_logicalfiles ( self,  attrNames=None )

List the logicalfiles in a collection.

For each location only return attribute information for the given attribute name

Arguments

  • attrNames A list of names of the attributes to return. If None, all attributes are returned.

Returns

An EntrySet object is returned containing the logicalfiles.

Raises

A CollectionException is thrown if unable to return the logicalfiles.

Exceptions   
ex
  list_rollback_entries 
list_rollback_entries (
        self,
        url,
        attr=None,
        attrNames=None,
        )

List the rollback and restart information entries in replica catalog.

Arguments

  • url URL of the base to begin searching from.

  • attr A CollectionAttr object containing the attributes of the implied connection. If None, default attributes are used.

  • attrNames A list of names of the attributes to return. If None, the default attributes are returned.

Retuns

An EntrySet object is returned containing the rollback and restart entries.

Raises

A CollectionException is thrown if unable to return the rollback and restart entries.

Exceptions   
ex
  location_add_attribute 
location_add_attribute (
        self,
        location,
        name,
        value,
        )

Add attribute information (other than filenames) to a location.

Does not replace existing attribute values.

Note that the arbitrary information associated with a location may apply either to the location itself or to all the filenames in the location depending on the meaning the caller wants to associate with a particular attribute.

Arguments

  • location String location name of the existing location to add attribute information to.

  • name A string containing the name of the attribute to be added.

  • value A string containing the value of the attribute to add.

Raises

A CollectionException is thrown if unable to add the attribute.

Exceptions   
ex
  location_add_filenames 
location_add_filenames (
        self,
        location,
        filenames,
        add=0,
        )

Add filenames to a location.

If some of the given filenames already exist in the location, and add is add is true, then add those that don't. Otherwise, fail if some of the given filenames already exist and add is false. All the filenames must already exist in the collection.

It's assumed that the corresponding physical files have already been created and are accessible through the concatenation of the location's URL accessor with each given filename (which may include a path). This implementation does not check that this is the case.

Arguments

  • filenames A list of string filenames to add.

  • location name of the existing location to add filenames to.

  • add whether to add given filenames that don't exist in the location even if there are some given filenames that do exist

Raises

A CollectionException is thrown if unable to add the filenames.

Exceptions   
ex
  location_create 
location_create (
        self,
        location,
        url,
        fileNames=None,
        objectclass=replicaCatalogc.LOCATION_OBJECTCLASS,
        )

Create a location.

Create a location in a collection and associate it with both a given URL accessor of a corresponding physical collection and a given set of filenames. All the filenames must already exist in the collection, and the location itself must not already exist.

It's assumed a corresponding physical replica has already been created and is accessible through the concatenation of the given URL accessor with each given filename (which may include a path). This implementation does not check that this is the case.

Arguments

  • location String name of the location to create.

  • url String URL accessor of the corresponding physical replica.

  • filenames A list of string filenames to add. May be None.

  • objectclass objectclass name of the location to be created. Must be a subclass of LOCATION_OBJECTCLASS

Raises

A CollectionException is thrown if unable to create the location.

Exceptions   
ex
  location_delete 
location_delete ( self,  location )

Delete a location

Arguments

  • location String containg the location name to be deleted.

Raises

A CollectionException is thrown if unable to delete the location.

Exceptions   
ex
  location_delete_attribute 
location_delete_attribute (
        self,
        location,
        name,
        value,
        )

Delete attribute information (other than filenames) from a location.

Arguments

  • location A string containing the location to delete the attribute from.

  • name A string containing the name of the attribute to be deleted.

  • value A string containing the value of the attribute to delete.

Raises

A CollectionException is thrown if unable to delete the attribute.

Exceptions   
ex
  location_delete_filenames 
location_delete_filenames (
        self,
        location,
        filenames,
        delete=0,
        )

Delete filenames from a location.

If one or more of the given filenames is not associated with the location then no deletions are done.

Arguments

  • location A string containing the location to delete filenames from.

  • filenames A list of string filenames to delete.

Raises

A CollectionException is thrown if unable to delete the filenames.

Exceptions   
ex
  location_list_filenames 
location_list_filenames ( self,  location )

List the filenames in a location.

Arguments

  • location A string containing the location to list the filenames of.

Returns

A list of strings containing the names of the filenames in the location.

Raises

A CollectionException is thrown if unable to list the filenames.

Exceptions   
ex
  logicalfile_add_attribute 
logicalfile_add_attribute (
        self,
        logicalfile,
        name,
        value,
        )

Add attribute information (other than filenames) to a logicalfile.

Does not replace existing attribute values.

Arguments

  • logicalfile String name of the logicalfile to add attribute information to.

  • name A string containing the name of the attribute to be added.

  • value A string containing the value of the attribute to add.

Raises

A CollectionException is thrown if unable to add the attribute.

Exceptions   
ex
  logicalfile_create 
logicalfile_create (
        self,
        name,
        size,
        objectclass=replicaCatalogc.LOGICALFILE_OBJECTCLASS,
        )

Create a logical file in a collection.

The corresponding collection filename must exist. The logical file must not already exist.

Arguments

  • name String name of the logicalfile to create.

  • size Size in kilobytes of the logical file to add.

  • objectclass objectclass name of the logicalfile to be created. Must be a subclass of LOGICALFILE_OBJECTCLASS

Raises

A CollectionException is thrown if unable to create the logicalfile.

Exceptions   
ex
  logicalfile_delete 
logicalfile_delete ( self,  logicalfile )

Delete a logicalfile

Arguments

  • logicalfile String containg the logicalfile name to be deleted.

Raises

A CollectionException is thrown if unable to delete the logicalfile.

Exceptions   
ex
  logicalfile_delete_attribute 
logicalfile_delete_attribute (
        self,
        logicalfile,
        name,
        value,
        )

Delete attribute information from a logicalfile.

Arguments

  • logicalfile A string containing the logicalfile to delete the attribute from.

  • name A string containing the name of the attribute to be deleted.

  • value A string containing the value of the attribute to delete.

Raises

A CollectionException is thrown if unable to delete the attribute.

Exceptions   
ex
  logicalfile_list_attributes 
logicalfile_list_attributes (
        self,
        logicalfile,
        attrNames=None,
        )

List attribute information (other then filenames) of a collection.

For each collection only return attribute information for the given attribute names.

Arguments

  • logicalfile String name of the logical file to get the attributes from.

  • attrNames A list of names of the attributes to return. If None, all attributes are returned.

Returns

An AttributeSet object is returned containing the attributes

*Raises

A CollectionException is thrown if unable to return the attribute list.

Exceptions   
ex
  set_dn 
set_dn ( self,  dn )

Set the DN of the collection.

All subsequent operations will be done with respect to the given DN.

Arguments

  • dn String containing the DN to set for the collection.

Raises

A CollectionException is thrown if unable to set the DN.

Exceptions   
ex

Table of Contents

This document was automatically generated on Tue Feb 4 16:47:03 2003 by HappyDoc version 2.1