#include <Catalog.h>
Inherits dmlite::Catalog.
Inheritance diagram for dmlite::BuiltInCatalog:
Public Member Functions | |
BuiltInCatalog (bool updateATime, unsigned symLinkLimit) throw (DmException) | |
~BuiltInCatalog () | |
std::string | getImplId (void) const throw () |
String ID of the implementation. | |
void | setStackInstance (StackInstance *si) throw (DmException) |
void | setSecurityContext (const SecurityContext *) throw (DmException) |
Set the security context. | |
void | changeDir (const std::string &) throw (DmException) |
std::string | getWorkingDir (void) throw (DmException) |
ExtendedStat | extendedStat (const std::string &path, bool followSym=true) throw (DmException) |
void | addReplica (const Replica &replica) throw (DmException) |
void | deleteReplica (const Replica &replica) throw (DmException) |
std::vector< Replica > | getReplicas (const std::string &path) throw (DmException) |
Location | get (const std::string &path) throw (DmException) |
Location | put (const std::string &path) throw (DmException) |
void | putDone (const std::string &host, const std::string &rfn, const std::map< std::string, std::string > ¶ms) throw (DmException) |
void | symlink (const std::string &oldpath, const std::string &newpath) throw (DmException) |
std::string | readLink (const std::string &path) throw (DmException) |
void | unlink (const std::string &path) throw (DmException) |
void | create (const std::string &path, mode_t mode) throw (DmException) |
void | makeDir (const std::string &path, mode_t mode) throw (DmException) |
void | removeDir (const std::string &path) throw (DmException) |
void | rename (const std::string &oldPath, const std::string &newPath) throw (DmException) |
mode_t | umask (mode_t mask) throw () |
void | setMode (const std::string &path, mode_t mode) throw (DmException) |
void | setOwner (const std::string &path, uid_t newUid, gid_t newGid, bool followSymLink=true) throw (DmException) |
void | setSize (const std::string &path, size_t newSize) throw (DmException) |
void | setChecksum (const std::string &path, const std::string &csumtype, const std::string &csumvalue) throw (DmException) |
void | setAcl (const std::string &path, const Acl &acls) throw (DmException) |
void | utime (const std::string &path, const struct utimbuf *buf) throw (DmException) |
std::string | getComment (const std::string &path) throw (DmException) |
void | setComment (const std::string &path, const std::string &comment) throw (DmException) |
void | setGuid (const std::string &path, const std::string &guid) throw (DmException) |
void | updateExtendedAttributes (const std::string &path, const Extensible &attr) throw (DmException) |
Directory * | openDir (const std::string &path) throw (DmException) |
void | closeDir (Directory *dir) throw (DmException) |
dirent * | readDir (Directory *dir) throw (DmException) |
ExtendedStat * | readDirx (Directory *dir) throw (DmException) |
Replica | getReplica (const std::string &rfn) throw (DmException) |
void | updateReplica (const Replica &replica) throw (DmException) |
Protected Member Functions | |
ExtendedStat | getParent (const std::string &path, std::string *parentPath, std::string *name) throw (DmException) |
void | updateAccessTime (const ExtendedStat &meta) throw (DmException) |
Update access time (if updateATime is true). | |
void | traverseBackwards (const ExtendedStat &meta) throw (DmException) |
Private Attributes | |
StackInstance * | si_ |
const SecurityContext * | secCtx_ |
std::string | cwdPath_ |
ino_t | cwd_ |
mode_t | umask_ |
bool | updateATime_ |
unsigned | symLinkLimit_ |
BuiltInCatalog::BuiltInCatalog | ( | bool | updateATime, | |
unsigned | symLinkLimit | |||
) | throw (DmException) |
BuiltInCatalog::~BuiltInCatalog | ( | ) |
void BuiltInCatalog::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. |
Implements dmlite::Catalog.
void BuiltInCatalog::changeDir | ( | const std::string & | ) | throw (DmException) [virtual] |
Change the working dir. Future not-absolute paths will use this as root.
path | The new working dir. |
Implements dmlite::Catalog.
void BuiltInCatalog::closeDir | ( | Directory * | dir | ) | throw (DmException) [virtual] |
Close a directory opened previously.
dir | The directory handle as returned by NsInterface::openDir. |
Implements dmlite::Catalog.
void BuiltInCatalog::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. |
Implements dmlite::Catalog.
void BuiltInCatalog::deleteReplica | ( | const Replica & | replica | ) | throw (DmException) [virtual] |
ExtendedStat BuiltInCatalog::extendedStat | ( | const std::string & | path, | |
bool | followSym = true | |||
) | 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. |
Implements dmlite::Catalog.
Location dmlite::BuiltInCatalog::get | ( | const std::string & | path | ) | throw (DmException) |
std::string BuiltInCatalog::getComment | ( | const std::string & | path | ) | throw (DmException) [virtual] |
Get the comment associated with a file.
path | The file or directory. |
Implements dmlite::Catalog.
std::string BuiltInCatalog::getImplId | ( | void | ) | const throw () [virtual] |
ExtendedStat BuiltInCatalog::getParent | ( | const std::string & | path, | |
std::string * | parentPath, | |||
std::string * | name | |||
) | throw (DmException) [protected] |
Get the parent of a directory.
path | The path to split. | |
parentPath | Where to put the parent path. | |
name | Where to put the file name (stripping last /). |
Replica BuiltInCatalog::getReplica | ( | const std::string & | rfn | ) | throw (DmException) [virtual] |
std::vector< Replica > BuiltInCatalog::getReplicas | ( | const std::string & | path | ) | throw (DmException) [virtual] |
Get replicas for a file.
path | The file for which replicas will be retrieved. |
Implements dmlite::Catalog.
std::string BuiltInCatalog::getWorkingDir | ( | void | ) | throw (DmException) [virtual] |
void BuiltInCatalog::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. |
Implements dmlite::Catalog.
Directory * BuiltInCatalog::openDir | ( | const std::string & | path | ) | throw (DmException) [virtual] |
Open a directory for reading.
path | The directory to open. |
Implements dmlite::Catalog.
Location dmlite::BuiltInCatalog::put | ( | const std::string & | path | ) | throw (DmException) |
void dmlite::BuiltInCatalog::putDone | ( | const std::string & | host, | |
const std::string & | rfn, | |||
const std::map< std::string, std::string > & | params | |||
) | throw (DmException) |
struct dirent * BuiltInCatalog::readDir | ( | Directory * | dir | ) | throw (DmException) [virtual] |
Read next entry from a directory (simple read).
dir | The directory handle as returned by NsInterface::openDir. |
Implements dmlite::Catalog.
ExtendedStat * BuiltInCatalog::readDirx | ( | Directory * | dir | ) | throw (DmException) [virtual] |
Read next entry from a directory (stat information added).
dir | The directory handle as returned by NsInterface::openDir. |
Implements dmlite::Catalog.
std::string BuiltInCatalog::readLink | ( | const std::string & | path | ) | throw (DmException) [virtual] |
Returns the path pointed by the symlink path
path | The symlink file. |
Implements dmlite::Catalog.
void BuiltInCatalog::removeDir | ( | const std::string & | path | ) | throw (DmException) [virtual] |
Remove a directory.
path | The path of the directory to remove. |
Implements dmlite::Catalog.
void BuiltInCatalog::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. |
Implements dmlite::Catalog.
void BuiltInCatalog::setAcl | ( | const std::string & | path, | |
const Acl & | acls | |||
) | throw (DmException) [virtual] |
Set the ACLs
path | The file to modify. | |
acl | The Access Control List. |
Implements dmlite::Catalog.
void BuiltInCatalog::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 (CS, AD or MD). | |
csumvalue | The checksum value. |
Implements dmlite::Catalog.
void BuiltInCatalog::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. |
Implements dmlite::Catalog.
void BuiltInCatalog::setGuid | ( | const std::string & | path, | |
const std::string & | guid | |||
) | throw (DmException) [virtual] |
void BuiltInCatalog::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) |
Implements dmlite::Catalog.
void BuiltInCatalog::setOwner | ( | const std::string & | path, | |
uid_t | newUid, | |||
gid_t | newGid, | |||
bool | followSymLink = true | |||
) | 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. |
Implements dmlite::Catalog.
void BuiltInCatalog::setSecurityContext | ( | const SecurityContext * | ) | throw (DmException) [virtual] |
void BuiltInCatalog::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. |
Implements dmlite::Catalog.
void BuiltInCatalog::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.
Implements dmlite::BaseInterface.
void BuiltInCatalog::symlink | ( | const std::string & | oldpath, | |
const std::string & | newpath | |||
) | throw (DmException) [virtual] |
Creates a new symlink.
path | The existing path. | |
symlink | The new access path. |
Implements dmlite::Catalog.
void BuiltInCatalog::traverseBackwards | ( | const ExtendedStat & | meta | ) | throw (DmException) [protected] |
Traverse backwards to check permissions.
meta | The file at the end |
mode_t BuiltInCatalog::umask | ( | mode_t | mask | ) | throw () [virtual] |
Sets the calling process’s file mode creation mask to mask & 0777.
mask | The new mask. |
Implements dmlite::Catalog.
void BuiltInCatalog::unlink | ( | const std::string & | path | ) | throw (DmException) [virtual] |
void BuiltInCatalog::updateAccessTime | ( | const ExtendedStat & | meta | ) | throw (DmException) [protected] |
Update access time (if updateATime is true).
void BuiltInCatalog::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. |
Implements dmlite::Catalog.
void BuiltInCatalog::updateReplica | ( | const Replica & | replica | ) | throw (DmException) [virtual] |
Update a replica.
replica | The replica to modify. |
Implements dmlite::Catalog.
void BuiltInCatalog::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. |
Implements dmlite::Catalog.
ino_t dmlite::BuiltInCatalog::cwd_ [private] |
std::string dmlite::BuiltInCatalog::cwdPath_ [private] |
const SecurityContext* dmlite::BuiltInCatalog::secCtx_ [private] |
StackInstance* dmlite::BuiltInCatalog::si_ [private] |
unsigned dmlite::BuiltInCatalog::symLinkLimit_ [private] |
mode_t dmlite::BuiltInCatalog::umask_ [private] |
bool dmlite::BuiltInCatalog::updateATime_ [private] |