PoolXMLCatalog

POOL XML Catalog Class This class handles simple XML-based File Catalog following the POOL project schema. It presents a DIRAC generic File Catalog interface although not complete and with several extensions

class DIRAC.Resources.Catalog.PoolXMLCatalog.PoolFile(dom=None)

Bases: object

A Pool XML File Catalog entry

@author A.Tsaregorodtsev

__init__(dom=None)
addLfn(lfn)

Adds one LFN

addPfn(pfn, pfntype=None, se=None)

Adds one PFN

dump()

Dumps the contents to the standard output

getLfns()

Retrieves all the LFNs

getPfns()

Retrieves all the PFNs

toXML(metadata)

Output the contents as an XML string

class DIRAC.Resources.Catalog.PoolXMLCatalog.PoolXMLCatalog(xmlfile='')

Bases: object

A Pool XML File Catalog

__init__(xmlfile='')

PoolXMLCatalog constructor.

Constructor takes one of the following argument types: xml string; list of xml strings; file name; list of file names

addFile(fileTuple)

Add one or more files to the catalog

addLfnByGuid(guid, lfn, pfn, se, pfntype)

Add LFN for a given GUID - not standard

addPfnByGuid(lfn, guid, pfn, pfntype=None, se=None)

Add PFN for a given GUID - not standard

addReplica(replicaTuple)

This adds a replica to the catalogue The tuple to be supplied is of the following form:

(lfn,pfn,se,master)

where master = True or False

analyseCatalog(dom)

Create the catalog from a DOM object

Creates the contents of the catalog from the DOM XML object

dump()

Dump catalog

Dumps the contents of the catalog to the std output

exists(lfn)

Check for the given LFN existence

flush()

Flush the contents of the catalog to a file

Flushes the contents of the catalog to a file from which the catalog was instanciated or which was set explicitely with setBackend() method

getFileByGuid(guid)

Get PoolFile object by GUID

getGuidByLfn(lfn)

Get GUID for a given LFN

getGuidByPfn(pfn)

Get GUID for a given PFN

getLfnsByGuid(guid)

Get LFN for a given GUID

getLfnsList()

Get list of LFNs in catalogue.

getName()

Get the catalog type name

getPfnsByGuid(guid)

Get replicas for a given GUID

getPfnsByLfn(lfn)

Get replicas for a given LFN

getTypeByPfn(pfn)

Get Type for a given PFN

removeFileByGuid(guid)

Remove file for a given GUID

removeFileByLfn(lfn)

Remove file for a given LFN

setBackend(fname)

Set the backend file name

Sets the name of the file which will receive the contents of the catalog when the flush() method will be called

toXML(metadata=False)

Convert the contents into an XML string