#include <DummyCatalog.h>
Inherits dmlite::Catalog.
Public Member Functions | |
DummyCatalog (Catalog *decorated) throw (DmException) | |
virtual | ~DummyCatalog () |
Destructor. | |
virtual void | setStackInstance (StackInstance *) throw (DmException) |
virtual void | setSecurityContext (const SecurityContext *) throw (DmException) |
Set the security context. | |
virtual void | changeDir (const std::string &) throw (DmException) |
virtual std::string | getWorkingDir (void) throw (DmException) |
virtual ExtendedStat | extendedStat (const std::string &, bool) throw (DmException) |
virtual DmStatus | extendedStat (ExtendedStat &xstat, const std::string &, bool) throw (DmException) |
virtual ExtendedStat | extendedStatByRFN (const std::string &rfn) throw (DmException) |
virtual bool | access (const std::string &path, int mode) throw (DmException) |
virtual bool | accessReplica (const std::string &replica, int mode) throw (DmException) |
virtual void | addReplica (const Replica &) throw (DmException) |
virtual void | deleteReplica (const Replica &) throw (DmException) |
virtual std::vector< Replica > | getReplicas (const std::string &) throw (DmException) |
virtual void | symlink (const std::string &, const std::string &) throw (DmException) |
std::string | readLink (const std::string &path) throw (DmException) |
virtual void | unlink (const std::string &) throw (DmException) |
virtual void | create (const std::string &, mode_t) throw (DmException) |
virtual mode_t | umask (mode_t) throw () |
virtual void | setMode (const std::string &, mode_t) throw (DmException) |
virtual void | setOwner (const std::string &, uid_t, gid_t, bool) throw (DmException) |
virtual void | setSize (const std::string &, size_t) throw (DmException) |
virtual void | setChecksum (const std::string &, const std::string &, const std::string &) throw (DmException) |
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) throw (DmException) |
virtual void | setAcl (const std::string &, const Acl &) throw (DmException) |
virtual void | utime (const std::string &, const struct utimbuf *) throw (DmException) |
virtual std::string | getComment (const std::string &) throw (DmException) |
virtual void | setComment (const std::string &, const std::string &) throw (DmException) |
virtual void | setGuid (const std::string &, const std::string &) throw (DmException) |
virtual void | updateExtendedAttributes (const std::string &, const Extensible &) throw (DmException) |
virtual Directory * | openDir (const std::string &) throw (DmException) |
virtual void | closeDir (Directory *) throw (DmException) |
virtual struct dirent * | readDir (Directory *) throw (DmException) |
virtual ExtendedStat * | readDirx (Directory *) throw (DmException) |
virtual void | makeDir (const std::string &, mode_t) throw (DmException) |
virtual void | rename (const std::string &, const std::string &) throw (DmException) |
virtual void | removeDir (const std::string &) throw (DmException) |
virtual Replica | getReplicaByRFN (const std::string &rfn) throw (DmException) |
virtual void | updateReplica (const Replica &replica) throw (DmException) |
Protected Attributes | |
Catalog * | decorated_ |
dmlite::DummyCatalog::DummyCatalog | ( | Catalog * | decorated | ) | throw (DmException) |
Constructor
decorated | The underlying decorated catalog. |
virtual dmlite::DummyCatalog::~DummyCatalog | ( | ) | [virtual] |
Destructor.
virtual bool dmlite::DummyCatalog::access | ( | const std::string & | path, | |
int | mode | |||
) | throw (DmException) [virtual] |
Checks wether the process would be allowed to read, write, or check existence.
lfn | Logical filename. | |
mode | A mask consisting of one or more of R_OK, W_OK, X_OK and F_OK. |
Reimplemented from dmlite::Catalog.
virtual bool dmlite::DummyCatalog::accessReplica | ( | const std::string & | replica, | |
int | mode | |||
) | throw (DmException) [virtual] |
Checks wether the process would be allowed to read, write, or check existence.
rfn | Replica filename. | |
mode | A mask consisting of one or more of R_OK, W_OK, X_OK and F_OK. |
Reimplemented from dmlite::Catalog.
virtual void dmlite::DummyCatalog::addReplica | ( | const Replica & | replica | ) | throw (DmException) [virtual] |
Add a new replica for a file.
replica | Stores the data that is going to be added. fileid must point to the id of the logical file in the catalog. |
Reimplemented from dmlite::Catalog.
virtual void dmlite::DummyCatalog::changeDir | ( | const std::string & | path | ) | throw (DmException) [virtual] |
Change the working dir. Future not-absolute paths will use this as root.
path | The new working dir. |
Reimplemented from dmlite::Catalog.
virtual void dmlite::DummyCatalog::closeDir | ( | Directory * | dir | ) | throw (DmException) [virtual] |
Close a directory opened previously.
dir | The directory handle as returned by NsInterface::openDir. |
Reimplemented from dmlite::Catalog.
virtual void dmlite::DummyCatalog::create | ( | const std::string & | path, | |
mode_t | mode | |||
) | throw (DmException) [virtual] |
Creates an entry in the catalog.
path | The new file. | |
mode | The creation mode. |
Reimplemented from dmlite::Catalog.
virtual void dmlite::DummyCatalog::deleteReplica | ( | const Replica & | replica | ) | throw (DmException) [virtual] |
virtual DmStatus dmlite::DummyCatalog::extendedStat | ( | ExtendedStat & | xstat, | |
const std::string & | path, | |||
bool | followSym | |||
) | throw (DmException) [virtual] |
Do an extended stat of a file or directory. Exception-safe version, returns a status
path | The path of the file or directory. | |
followSym | If true, symlinks will be followed. | |
xstat | The extended status of the file. |
Reimplemented from dmlite::Catalog.
virtual ExtendedStat dmlite::DummyCatalog::extendedStat | ( | const std::string & | path, | |
bool | followSym | |||
) | throw (DmException) [virtual] |
Do an extended stat of a file or directory.
path | The path of the file or directory. | |
followSym | If true, symlinks will be followed. |
Reimplemented from dmlite::Catalog.
virtual ExtendedStat dmlite::DummyCatalog::extendedStatByRFN | ( | const std::string & | rfn | ) | throw (DmException) [virtual] |
Do an extended stat of a logical file using an associated replica file name.
rfn | The replica. |
Reimplemented from dmlite::Catalog.
virtual void dmlite::DummyCatalog::getChecksum | ( | const std::string & | path, | |
const std::string & | csumtype, | |||
std::string & | csumvalue, | |||
const std::string & | pfn, | |||
const bool | forcerecalc = false , |
|||
const int | waitsecs = 0 | |||
) | throw (DmException) [virtual] |
Get the checksum of a file, eventually waiting for it to be calculated.
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 from dmlite::Catalog.
virtual std::string dmlite::DummyCatalog::getComment | ( | const std::string & | path | ) | throw (DmException) [virtual] |
Get the comment associated with a file.
path | The file or directory. |
Reimplemented from dmlite::Catalog.
virtual Replica dmlite::DummyCatalog::getReplicaByRFN | ( | const std::string & | rfn | ) | throw (DmException) [virtual] |
virtual std::vector<Replica> dmlite::DummyCatalog::getReplicas | ( | const std::string & | path | ) | throw (DmException) [virtual] |
Get replicas for a file.
path | The file for which replicas will be retrieved. |
Reimplemented from dmlite::Catalog.
virtual std::string dmlite::DummyCatalog::getWorkingDir | ( | void | ) | throw (DmException) [virtual] |
virtual void dmlite::DummyCatalog::makeDir | ( | const std::string & | path, | |
mode_t | mode | |||
) | throw (DmException) [virtual] |
Create a new empty directory.
path | The path of the new directory. | |
mode | The creation mode. |
Reimplemented from dmlite::Catalog.
virtual Directory* dmlite::DummyCatalog::openDir | ( | const std::string & | path | ) | throw (DmException) [virtual] |
Open a directory for reading.
path | The directory to open. |
Reimplemented from dmlite::Catalog.
virtual struct dirent* dmlite::DummyCatalog::readDir | ( | Directory * | dir | ) | throw (DmException) [read, virtual] |
Read next entry from a directory (simple read).
dir | The directory handle as returned by NsInterface::openDir. |
Reimplemented from dmlite::Catalog.
virtual ExtendedStat* dmlite::DummyCatalog::readDirx | ( | Directory * | dir | ) | throw (DmException) [virtual] |
Read next entry from a directory (stat information added).
dir | The directory handle as returned by NsInterface::openDir. |
Reimplemented from dmlite::Catalog.
std::string dmlite::DummyCatalog::readLink | ( | const std::string & | path | ) | throw (DmException) [virtual] |
Returns the path pointed by the symlink path
path | The symlink file. |
Reimplemented from dmlite::Catalog.
virtual void dmlite::DummyCatalog::removeDir | ( | const std::string & | path | ) | throw (DmException) [virtual] |
Remove a directory.
path | The path of the directory to remove. |
Reimplemented from dmlite::Catalog.
virtual void dmlite::DummyCatalog::rename | ( | const std::string & | oldPath, | |
const std::string & | newPath | |||
) | throw (DmException) [virtual] |
Rename a file or directory.
oldPath | The old name. | |
newPath | The new name. |
Reimplemented from dmlite::Catalog.
virtual void dmlite::DummyCatalog::setAcl | ( | const std::string & | path, | |
const Acl & | acl | |||
) | throw (DmException) [virtual] |
Set the ACLs
path | The file to modify. | |
acl | The Access Control List. |
Reimplemented from dmlite::Catalog.
virtual void dmlite::DummyCatalog::setChecksum | ( | const std::string & | path, | |
const std::string & | csumtype, | |||
const std::string & | csumvalue | |||
) | throw (DmException) [virtual] |
Set the checksum of a file.
path | The file to modify. | |
csumtype | The checksum type cc | |
csumvalue | The checksum value. |
Reimplemented from dmlite::Catalog.
virtual void dmlite::DummyCatalog::setComment | ( | const std::string & | path, | |
const std::string & | comment | |||
) | throw (DmException) [virtual] |
Set the comment associated with a file.
path | The file or directory. | |
comment | The new comment. |
Reimplemented from dmlite::Catalog.
virtual void dmlite::DummyCatalog::setGuid | ( | const std::string & | path, | |
const std::string & | guid | |||
) | throw (DmException) [virtual] |
Set GUID of a file.
path | The file. | |
guid | The new GUID. |
Reimplemented from dmlite::Catalog.
virtual void dmlite::DummyCatalog::setMode | ( | const std::string & | path, | |
mode_t | mode | |||
) | throw (DmException) [virtual] |
Set the mode of a file.
path | The file to modify. | |
mode | The new mode as an integer (i.e. 0755) |
Reimplemented from dmlite::Catalog.
virtual void dmlite::DummyCatalog::setOwner | ( | const std::string & | path, | |
uid_t | newUid, | |||
gid_t | newGid, | |||
bool | followSymLink | |||
) | throw (DmException) [virtual] |
Set the owner of a file.
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 from dmlite::Catalog.
virtual void dmlite::DummyCatalog::setSecurityContext | ( | const SecurityContext * | ctx | ) | throw (DmException) [virtual] |
Set the security context.
Reimplemented from dmlite::BaseInterface.
virtual void dmlite::DummyCatalog::setSize | ( | const std::string & | path, | |
size_t | newSize | |||
) | throw (DmException) [virtual] |
Set the size of a file.
path | The file to modify. | |
newSize | The new file size. |
Reimplemented from dmlite::Catalog.
virtual void dmlite::DummyCatalog::setStackInstance | ( | StackInstance * | si | ) | throw (DmException) [virtual] |
Set the StackInstance. Some plugins may need to access other stacks (i.e. the pool may need the catalog) However, at construction time not all the stacks have been populated, so this will be called once all are instantiated.
Reimplemented from dmlite::BaseInterface.
virtual void dmlite::DummyCatalog::symlink | ( | const std::string & | path, | |
const std::string & | symlink | |||
) | throw (DmException) [virtual] |
Creates a new symlink.
path | The existing path. | |
symlink | The new access path. |
Reimplemented from dmlite::Catalog.
virtual mode_t dmlite::DummyCatalog::umask | ( | mode_t | mask | ) | throw () [virtual] |
Sets the calling process’s file mode creation mask to mask & 0777.
mask | The new mask. |
Reimplemented from dmlite::Catalog.
virtual void dmlite::DummyCatalog::unlink | ( | const std::string & | path | ) | throw (DmException) [virtual] |
virtual void dmlite::DummyCatalog::updateExtendedAttributes | ( | const std::string & | path, | |
const Extensible & | attr | |||
) | throw (DmException) [virtual] |
Update extended metadata on the catalog.
path | The file to update. | |
attr | The extended attributes struct. |
Reimplemented from dmlite::Catalog.
virtual void dmlite::DummyCatalog::updateReplica | ( | const Replica & | replica | ) | throw (DmException) [virtual] |
Update a replica.
replica | The replica to modify. |
Reimplemented from dmlite::Catalog.
virtual void dmlite::DummyCatalog::utime | ( | const std::string & | path, | |
const struct utimbuf * | buf | |||
) | throw (DmException) [virtual] |
Set access and/or modification time.
path | The file path. | |
buf | A struct holding the new times. |
Reimplemented from dmlite::Catalog.
Catalog* dmlite::DummyCatalog::decorated_ [protected] |