Package pyGlobus :: Module rlsClient :: Class RlsClient
[show private | hide private]
[frames | no frames]

Class RlsClient


A class to wrap the RLS client functions
Method Summary
  __init__(self, url)
Constructs an instance.
  __del__(self)
Destroy an instance.
  lrc_add(self, lfn, pfn)
Add a mapping for a PFN to an existing LFN.
  lrc_attr_add(self, fn, attr)
Set an attribute value for an entry (LFN or PFN) in the LRC
  lrc_attr_create(self, attr)
Define an attribute in the LRC
  lrc_attr_delete(self, attr, clear)
Delete an attribute definition in the LRC
  lrc_attr_get(self, objtype, name)
Get definitions of attributes from LRC.
  lrc_attr_remove(self, fn, attr)
Remove an attribute value from an entry (LFN or PFN) in the LRC
  lrc_attr_search(self, attr1, op, attr2, offset, reslimit)
Search for objects (LFNs or PFNs) in a LRC database that have the specified attribute whose value matches a boolean expression.
  lrc_attr_value_get(self, fn, objtype, attrname)
Get attributes in LRC for a specific object (LFN or PFN)
  lrc_clear(self)
Clear all mappings from LRC database.
  lrc_create_lfn(self, lfn, pfn)
Create LFN with associated PFN in LRC
  lrc_delete(self, lfn, pfn)
Delete a mapping for a PFN to an existing LFN.
  lrc_exists(self, fn, objtype)
Query LRC for existence of a LFN or PFN
  lrc_get_lfn(self, pfn, offset, reslimit)
Query LRC with PFN to obtain LFNs
  lrc_get_lfn_wc(self, pfnpat, offset, reslimit)
Query LRC with PFN wildcard expression to obtain LFNs.
  lrc_get_pfn(self, lfn, offset, reslimit)
Query LRC with LFN to obtain PFNs
  lrc_get_pfn_wc(self, lfnpat, offset, reslimit)
Query LRC with LFN wildcard expression to obtain PFNs.
  lrc_rli_add(self, url, pattern, bloom)
LRC servers send information about LFNs in their database to the the list of RLI servers in the database, added with this function.
  lrc_rli_delete(self, url, pattern)
Delete an entry from the LRC rli/partition tables.
  lrc_rli_get_part(self, url, pattern)
Get RLI update partitions from LRC server.
  lrc_rli_info(self, url)
Get info about RLI server updated by an LRC server.
  lrc_rli_list(self)
Return URLs of RLIs that LRC sends updates to.
  rli_get_lrc(self, lfn, offset, reslimit)
Return LRCs mapped to LFN in the RLI database.
  rli_get_lrc_wc(self, lfnpat, offset, reslimit)
Query RLI with LFN wildcard expression to obtain LRCs.
  rli_lfn_exists(self, lfn)
Check if LFN exists in RLI database.

Method Details

__init__(self, url)
(Constructor)

Constructs an instance.

Create a new RlsClient instance. This will init the RLS Globus module and open a connection to the RLS server pointed to by url.
Parameters:
url - url for the RLS server to establish a connection with
Returns:
An instance of class RlsClient
Raises:
RlsClientException - A RlsClientException is thrown if unable to init the module or open the connection to the server.

__del__(self)
(Destructor)

Destroy an instance.

Destroys the handle thus terminating the connection to the server and deactivates the Globus modules.
Returns:
None

lrc_add(self, lfn, pfn)

Add a mapping for a PFN to an existing LFN. The LFN must exist.
Parameters:
lfn - LFN to which the PFN is to be mapped
pfn - PFN to map to the LFN
Returns:
None
Raises:
RlsClientException - A RlsClientException is raised if unable to add the PFN.

lrc_attr_add(self, fn, attr)

Set an attribute value for an entry (LFN or PFN) in the LRC
Parameters:
fn - The filename object for which the attribute value will be set.
attr - An instance of class RlsAttr or a derived class with name, objtype, type, and value set. See documentation for class RlsAttr.
Returns:
None
Raises:
RlsClientException - A RlsClientException is raised if unable to contact the LRC or add the attribute.

lrc_attr_create(self, attr)

Define an attribute in the LRC
Parameters:
attr - Instance of class RlsAttr or a derived class. The instance must have name, objtype, and type set. See documentation for methods of class RlsAttr.
Returns:
None
Raises:
RlsClientException - A RlsClientException is raised if unable to define the attribute.

lrc_attr_delete(self, attr, clear=0)

Delete an attribute definition in the LRC
Parameters:
attr - Instance of class RlsAttr or a derived class. The instance must have name, objtype, and type set. See documentation for methods of class RlsAttr.
Returns:
None
Raises:
RlsClientException - A RlsClientException is raised if unable to delete the attribute definition.

lrc_attr_get(self, objtype, name=None)

Get definitions of attributes from LRC.
Parameters:
objtype - The type of object (LFN or PFN) for which to get attribute definitions. Should be one of obj_lrc_lfn or obj_lrc_pfn, which are both defined in this module.
name - Name of particular attribute to get. If None all attributes for the specified object type are returned.
Returns:
A list of instances of class RlsAttr.
Raises:
RlsClientException - A RlsClientException is raised if unable to contact the LRC or get the definition.

lrc_attr_remove(self, fn, attr)

Remove an attribute value from an entry (LFN or PFN) in the LRC
Parameters:
fn - The filename object for which the attribute value will be removed.
attr - An instance of class RlsAttr or a derived class with name, objtype, type, and value set. See documentation for class RlsAttr.
Returns:
None
Raises:
RlsClientException - A RlsClientException is raised if unable to contact the LRC or remove the attribute.

lrc_attr_search(self, attr1, op, attr2=None, offset=0, reslimit=0)

Search for objects (LFNs or PFNs) in a LRC database that have the specified attribute whose value matches a boolean expression.
Parameters:
attr1 - An instance of class RlsAttr or a derived class with name, objtype, type, and value set and which is used to search on. See documentation for class RlsAttr.
op -

Operator to be used in searching for values. Should be one of:

attr_op_all all values returned

attr_op_eq values matching operand 1 returned

attr_op_ne values not matching operand 1

attr_op_gt values greater than operand 1

attr_op_ge values greater than or equal to attr1 value

attr_op_lt values less than operand 1

attr_op_le values less than or equal to attr1 value

attr_op_btw values between attr1 and attr2 value

attr_op_like Strings "like" operand1 (SQL like)
attr2 - Second instance of class RlsAttr if a second operand for operator is required
offset - Offset into result list. Used in conjunction with reslimit to retrieve results a few at a time. Use 0 to begin with first result.
reslimit - Maximum number of results to return. Used in conjunction with offset to retrieve results a few at a time. Use 0 to retrieve all results.
Returns:
A dictionary object with attribute names as keys and attribute values as values.
Raises:
RlsClientException - A RlsClientException is raised if unable to contact the LRC or perform the search.

lrc_attr_value_get(self, fn, objtype, attrname=None)

Get attributes in LRC for a specific object (LFN or PFN)
Parameters:
fn - The filename of the object (LFN or PFN) for which to get attributes.
objtype - The type of object (LFN or PFN) for which to get attribute. Should be one of obj_lrc_lfn or obj_lrc_pfn, which are both defined in this module.
attrname - Name of particular attribute to get. If None all attributes for the specified filename are returned.
Returns:
A list of instances of class RlsAttr.
Raises:
RlsClientException - A RlsClientException is raised if unable to contact the LRC or get the definition.

lrc_clear(self)

Clear all mappings from LRC database. User needs both ADMIN and LRCUPDATE privileges to perform this operation.

Note that if the LRC is cleared this will not be reflected in any RLI servers updated by the LRC until the next softstate update, even if immediate updates are enabled.
Returns:
None
Raises:
RlsClientException - A RlsClientException is raised if unable to contact the LRC or clear the LRC.

lrc_create_lfn(self, lfn, pfn)

Create LFN with associated PFN in LRC
Parameters:
lfn - The LFN to create in LRC
pfn - The PFN to associate with LFN
Returns:
None
Raises:
RlsClientException - A RlsClientException is raised if unable to create the LFN.

lrc_delete(self, lfn, pfn)

Delete a mapping for a PFN to an existing LFN.
Parameters:
lfn - LFN to which the PFN was mapped
pfn - PFN for which the map to LFN is to be deleted
Returns:
None
Raises:
RlsClientException - A RlsClientException is raised if unable to delete the PFN.

lrc_exists(self, fn, objtype)

Query LRC for existence of a LFN or PFN
Parameters:
fn - LFN or PFN object for which to check existence
objtype - Type of object argument fn refers to. Should be either obj_lrc_lfn or obj_lrc_pfn, both of which are defined in this module.
Returns:
1 if exists or 0 if not
Raises:
RlsClientException - A RlsClientException is raised if unable to query the LRC.

lrc_get_lfn(self, pfn, offset=0, reslimit=0)

Query LRC with PFN to obtain LFNs
Parameters:
pfn - The PFN to query the LRC with
offset - Offset into result list. Used in conjunction with reslimit to retrieve results a few at a time. Use 0 to begin with first result.
reslimit - Maximum number of results to return. Used in conjunction with offset to retrieve results a few at a time. Use 0 to retrieve all results.
Returns:
A list of LFNs.
Raises:
RlsClientException - A RlsClientException is raised if unable to query the LRC or if the PFN is not known to the LRC.

lrc_get_lfn_wc(self, pfnpat, offset=0, reslimit=0)

Query LRC with PFN wildcard expression to obtain LFNs.
Parameters:
pfnpat - The wildcard expression to search with. Can contain either Unix file globbing chars (* matches 0 or more characters, ? matches any single character) or SQL "like" wildcard characters (% matches 0 or more charactes, _ matches any single character)
offset - Offset into result list. Used in conjunction with reslimit to retrieve results a few at a time. Use 0 to begin with first result.
reslimit - Maximum number of results to return. Used in conjunction with offset to retrieve results a few at a time. Use 0 to retrieve all results.
Returns:
A dictionary object with PFNs as keys and LFNs as values.
Raises:
RlsClientException - A RlsClientException is raised if unable to query the LRC.

lrc_get_pfn(self, lfn, offset=0, reslimit=0)

Query LRC with LFN to obtain PFNs
Parameters:
lfn - The LFN to query the LRC with
offset - Offset into result list. Used in conjunction with reslimit to retrieve results a few at a time. Use 0 to begin with first result.
reslimit - Maximum number of results to return. Used in conjunction with offset to retrieve results a few at a time. Use 0 to retrieve all results.
Returns:
A list of PFNs.
Raises:
RlsClientException - A RlsClientException is raised if unable to query the LRC or if the LFN is not known to the LRC.

lrc_get_pfn_wc(self, lfnpat, offset=0, reslimit=0)

Query LRC with LFN wildcard expression to obtain PFNs.
Parameters:
lfnpat - The wildcard expression to search with. Can contain either Unix file globbing chars (* matches 0 or more characters, ? matches any single character) or SQL "like" wildcard characters (% matches 0 or more charactes, _ matches any single character)
offset - Offset into result list. Used in conjunction with reslimit to retrieve results a few at a time. Use 0 to begin with first result.
reslimit - Maximum number of results to return. Used in conjunction with offset to retrieve results a few at a time. Use 0 to retrieve all results.
Returns:
A dictionary object with LFNs as keys and PFNs as values.
Raises:
RlsClientException - A RlsClientException is raised if unable to query the LRC.

lrc_rli_add(self, url, pattern='', bloom=0)

LRC servers send information about LFNs in their database to the the list of RLI servers in the database, added with this function. Updates may be partitioned amongst multiple RLIs by specifying one or more patterns for an RLI.
Parameters:
url - URL of RLI server to add
pattern - If not empty str used to filter which LFNs are sent to url. Standard Unix wildcard characters (*, ?) may be used to do wildcard matches.
bloom - If non-zero then update RLI using bloom filters
Returns:
None
Raises:
RlsClientException - A RlsClientException is raised if unable to contact the LRC or add the RLI URL.

lrc_rli_delete(self, url, pattern='')

Delete an entry from the LRC rli/partition tables.
Parameters:
url - URL of RLI server to remove
pattern - If not empty str then only the specific RLI URL/pattern is removed, else all partition information for URL is removed.
Returns:
None
Raises:
RlsClientException - A RlsClientException is raised if unable to contact the LRC or delete the RLI URL.

lrc_rli_get_part(self, url='', pattern='')

Get RLI update partitions from LRC server.
Parameters:
url - URL of RLI server to retrieve info for. If not empty str identifies RLI that partition data will be retrieved for. If None then all RLIs are retrieved.
pattern - If not empty str returns only partitions with matching patterns, otherwise all patterns are retrieved.
Returns:
A list of lists. Each individual list has the URL as the first element and the associate pattern as the second element.
Raises:
RlsClientException - A RlsClientException is raised if unable to contact the LRC or query the LRC.

lrc_rli_info(self, url)

Get info about RLI server updated by an LRC server.
Parameters:
url - URL of RLI server to retrieve info for
Returns:
A dictionary object with RLI URLs as keys and lists as values where the list elements are update interval, flags, and last update.
Raises:
RlsClientException - A RlsClientException is raised if unable to contact the LRC or query for RLI URLs.

lrc_rli_list(self)

Return URLs of RLIs that LRC sends updates to.
Returns:
A dictionary object with RLI URLs as keys and lists as values where the list elements are update interval, flags, and last update.
Raises:
RlsClientException - A RlsClientException is raised if unable to contact the LRC or query for RLI URLs.

rli_get_lrc(self, lfn, offset=0, reslimit=0)

Return LRCs mapped to LFN in the RLI database.
Parameters:
lfn - LFN for which to return LRC mappings
Returns:
List of LRCs.
Raises:
RlsClientException - A RlsClientException is raised if unable to contact the RLI or query on the LFN.

rli_get_lrc_wc(self, lfnpat, offset=0, reslimit=0)

Query RLI with LFN wildcard expression to obtain LRCs.
Parameters:
lfnpat - The wildcard expression to search with. Can contain either Unix file globbing chars (* matches 0 or more characters, ? matches any single character) or SQL "like" wildcard characters (% matches 0 or more charactes, _ matches any single character)
offset - Offset into result list. Used in conjunction with reslimit to retrieve results a few at a time. Use 0 to begin with first result.
reslimit - Maximum number of results to return. Used in conjunction with offset to retrieve results a few at a time. Use 0 to retrieve all results.
Returns:
A dictionary object with LFNs as keys and LRCs as values.
Raises:
RlsClientException - A RlsClientException is raised if unable to query the RLI.

rli_lfn_exists(self, lfn)

Check if LFN exists in RLI database.
Parameters:
lfn - LFN for which to check existence, also could be an lrc
Returns:
One if the LFN exists or zero if it does not.
Raises:
RlsClientException - A RlsClientException is raised if unable to contact the RLI or query on the LFN.

Generated by Epydoc 2.1 on Tue Apr 4 14:32:53 2006 http://epydoc.sf.net