dmlite::Catalog Class Reference

Interface for Catalog (Namespaces). More...

#include <catalog.h>

Inherits dmlite::BaseInterface.

Inherited by dmlite::BuiltInCatalog, and dmlite::DummyCatalog.

Collaboration diagram for dmlite::Catalog:
Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~Catalog ()
 Destructor.
virtual void changeDir (const std::string &path)
virtual std::string getWorkingDir (void)
virtual ExtendedStat extendedStat (const std::string &path, bool followSym=true)
virtual DmStatus extendedStat (ExtendedStat &xstat, const std::string &path, bool followSym=true)
virtual ExtendedStat extendedStatByRFN (const std::string &rfn)
virtual bool access (const std::string &path, int mode)
virtual bool accessReplica (const std::string &replica, int mode)
virtual void addReplica (const Replica &replica)
virtual void deleteReplica (const Replica &replica)
virtual std::vector< ReplicagetReplicas (const std::string &path)
virtual void symlink (const std::string &path, const std::string &symlink)
virtual std::string readLink (const std::string &path)
virtual void unlink (const std::string &path)
virtual void create (const std::string &path, mode_t mode)
virtual mode_t umask (mode_t mask) throw ()
virtual void setMode (const std::string &path, mode_t mode)
virtual void setOwner (const std::string &path, uid_t newUid, gid_t newGid, bool followSymLink=true)
virtual void setSize (const std::string &path, size_t newSize)
virtual void setChecksum (const std::string &path, const std::string &csumtype, const std::string &csumvalue)
virtual void getChecksum (const std::string &path, const std::string &csumtype, std::string &csumvalue, const std::string &pfn, const bool forcerecalc=false, const int waitsecs=0)
virtual void setAcl (const std::string &path, const Acl &acl)
virtual void utime (const std::string &path, const struct utimbuf *buf)
virtual std::string getComment (const std::string &path)
virtual void setComment (const std::string &path, const std::string &comment)
virtual void setGuid (const std::string &path, const std::string &guid)
virtual void updateExtendedAttributes (const std::string &path, const Extensible &attr)
virtual DirectoryopenDir (const std::string &path)
virtual void closeDir (Directory *dir)
virtual struct dirent * readDir (Directory *dir)
virtual ExtendedStatreadDirx (Directory *dir)
virtual void makeDir (const std::string &path, mode_t mode)
virtual void rename (const std::string &oldPath, const std::string &newPath)
virtual void removeDir (const std::string &path)
virtual Replica getReplicaByRFN (const std::string &rfn)
virtual void updateReplica (const Replica &replica)

Detailed Description

Interface for Catalog (Namespaces).


Constructor & Destructor Documentation

virtual dmlite::Catalog::~Catalog (  )  [virtual]

Destructor.


Member Function Documentation

virtual bool dmlite::Catalog::access ( const std::string &  path,
int  mode 
) [virtual]

Checks wether the process would be allowed to read, write, or check existence.

Parameters:
lfn Logical filename.
mode A mask consisting of one or more of R_OK, W_OK, X_OK and F_OK.
Returns:
true if the file can be accessed.
Note:
If the file does not exist, an exception will be thrown.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual bool dmlite::Catalog::accessReplica ( const std::string &  replica,
int  mode 
) [virtual]

Checks wether the process would be allowed to read, write, or check existence.

Parameters:
rfn Replica filename.
mode A mask consisting of one or more of R_OK, W_OK, X_OK and F_OK.
Returns:
true if the file can be accessed.
Note:
If the file does not exist, an exception will be thrown.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual void dmlite::Catalog::addReplica ( const Replica replica  )  [virtual]

Add a new replica for a file.

Parameters:
replica Stores the data that is going to be added. fileid must point to the id of the logical file in the catalog.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual void dmlite::Catalog::changeDir ( const std::string &  path  )  [virtual]

Change the working dir. Future not-absolute paths will use this as root.

Parameters:
path The new working dir.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual void dmlite::Catalog::closeDir ( Directory dir  )  [virtual]

Close a directory opened previously.

Parameters:
dir The directory handle as returned by NsInterface::openDir.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual void dmlite::Catalog::create ( const std::string &  path,
mode_t  mode 
) [virtual]

Creates an entry in the catalog.

Parameters:
path The new file.
mode The creation mode.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual void dmlite::Catalog::deleteReplica ( const Replica replica  )  [virtual]

Delete a replica.

Parameters:
replica The replica to remove.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual DmStatus dmlite::Catalog::extendedStat ( ExtendedStat xstat,
const std::string &  path,
bool  followSym = true 
) [virtual]

Do an extended stat of a file or directory. Exception-safe version, returns a status

Parameters:
path The path of the file or directory.
followSym If true, symlinks will be followed.
xstat The extended status of the file.
Returns:
A status object

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual ExtendedStat dmlite::Catalog::extendedStat ( const std::string &  path,
bool  followSym = true 
) [virtual]

Do an extended stat of a file or directory.

Parameters:
path The path of the file or directory.
followSym If true, symlinks will be followed.
Returns:
The extended status of the file.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual ExtendedStat dmlite::Catalog::extendedStatByRFN ( const std::string &  rfn  )  [virtual]

Do an extended stat of a logical file using an associated replica file name.

Parameters:
rfn The replica.
Returns:
The extended status of the file.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual void dmlite::Catalog::getChecksum ( const std::string &  path,
const std::string &  csumtype,
std::string &  csumvalue,
const std::string &  pfn,
const bool  forcerecalc = false,
const int  waitsecs = 0 
) [virtual]

Get the checksum of a file, eventually waiting for it to be calculated.

Parameters:
path The file to query
csumtype The checksum type (CS, AD or MD. We can also pass a long checksum name (e.g. checksum.adler32)).
csumvalue The checksum value.
forcerecalc Force recalculation of the checksum (may take long and throw EAGAIN)
waitsecs Seconds to wait for a checksum to be calculated. Throws EAGAIN if timeouts. Set to 0 for blocking behavior.

Reimplemented in dmlite::DummyCatalog.

virtual std::string dmlite::Catalog::getComment ( const std::string &  path  )  [virtual]

Get the comment associated with a file.

Parameters:
path The file or directory.
Returns:
The associated comment.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual Replica dmlite::Catalog::getReplicaByRFN ( const std::string &  rfn  )  [virtual]

Get a replica.

Parameters:
rfn The replica file name.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual std::vector<Replica> dmlite::Catalog::getReplicas ( const std::string &  path  )  [virtual]

Get replicas for a file.

Parameters:
path The file for which replicas will be retrieved.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual std::string dmlite::Catalog::getWorkingDir ( void   )  [virtual]

Get the current working dir.

Returns:
The current working dir.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual void dmlite::Catalog::makeDir ( const std::string &  path,
mode_t  mode 
) [virtual]

Create a new empty directory.

Parameters:
path The path of the new directory.
mode The creation mode.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual Directory* dmlite::Catalog::openDir ( const std::string &  path  )  [virtual]

Open a directory for reading.

Parameters:
path The directory to open.
Returns:
A pointer to a handle that can be used for later calls.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual struct dirent* dmlite::Catalog::readDir ( Directory dir  )  [read, virtual]

Read next entry from a directory (simple read).

Parameters:
dir The directory handle as returned by NsInterface::openDir.
Returns:
0x00 on failure or end of directory.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual ExtendedStat* dmlite::Catalog::readDirx ( Directory dir  )  [virtual]

Read next entry from a directory (stat information added).

Parameters:
dir The directory handle as returned by NsInterface::openDir.
Returns:
0x00 on failure (and errno is set) or end of directory.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual std::string dmlite::Catalog::readLink ( const std::string &  path  )  [virtual]

Returns the path pointed by the symlink path

Parameters:
path The symlink file.
Returns:
The symlink target.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual void dmlite::Catalog::removeDir ( const std::string &  path  )  [virtual]

Remove a directory.

Parameters:
path The path of the directory to remove.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual void dmlite::Catalog::rename ( const std::string &  oldPath,
const std::string &  newPath 
) [virtual]

Rename a file or directory.

Parameters:
oldPath The old name.
newPath The new name.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual void dmlite::Catalog::setAcl ( const std::string &  path,
const Acl acl 
) [virtual]

Set the ACLs

Parameters:
path The file to modify.
acl The Access Control List.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual void dmlite::Catalog::setChecksum ( const std::string &  path,
const std::string &  csumtype,
const std::string &  csumvalue 
) [virtual]

Set the checksum of a file.

Parameters:
path The file to modify.
csumtype The checksum type cc
csumvalue The checksum value.

Reimplemented in dmlite::DummyCatalog.

virtual void dmlite::Catalog::setComment ( const std::string &  path,
const std::string &  comment 
) [virtual]

Set the comment associated with a file.

Parameters:
path The file or directory.
comment The new comment.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual void dmlite::Catalog::setGuid ( const std::string &  path,
const std::string &  guid 
) [virtual]

Set GUID of a file.

Parameters:
path The file.
guid The new GUID.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual void dmlite::Catalog::setMode ( const std::string &  path,
mode_t  mode 
) [virtual]

Set the mode of a file.

Parameters:
path The file to modify.
mode The new mode as an integer (i.e. 0755)

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual void dmlite::Catalog::setOwner ( const std::string &  path,
uid_t  newUid,
gid_t  newGid,
bool  followSymLink = true 
) [virtual]

Set the owner of a file.

Parameters:
path The file to modify.
newUid The uid of the new owneer.
newGid The gid of the new group.
followSymLink If set to true, symbolic links will be followed.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual void dmlite::Catalog::setSize ( const std::string &  path,
size_t  newSize 
) [virtual]

Set the size of a file.

Parameters:
path The file to modify.
newSize The new file size.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual void dmlite::Catalog::symlink ( const std::string &  path,
const std::string &  symlink 
) [virtual]

Creates a new symlink.

Parameters:
path The existing path.
symlink The new access path.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual mode_t dmlite::Catalog::umask ( mode_t  mask  )  throw () [virtual]

Sets the calling process’s file mode creation mask to mask & 0777.

Parameters:
mask The new mask.
Returns:
The value of the previous mask.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual void dmlite::Catalog::unlink ( const std::string &  path  )  [virtual]

Remove a file.

Parameters:
path The path to remove.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual void dmlite::Catalog::updateExtendedAttributes ( const std::string &  path,
const Extensible attr 
) [virtual]

Update extended metadata on the catalog.

Parameters:
path The file to update.
attr The extended attributes struct.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual void dmlite::Catalog::updateReplica ( const Replica replica  )  [virtual]

Update a replica.

Parameters:
replica The replica to modify.
Returns:
0 on success, error code otherwise.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.

virtual void dmlite::Catalog::utime ( const std::string &  path,
const struct utimbuf *  buf 
) [virtual]

Set access and/or modification time.

Parameters:
path The file path.
buf A struct holding the new times.

Reimplemented in dmlite::DummyCatalog, and dmlite::BuiltInCatalog.


The documentation for this class was generated from the following file:

Generated on 24 Sep 2019 for dmlite by  doxygen 1.6.1