dmlite
0.6
|
#include <Catalog.h>
Public Member Functions | |
BuiltInCatalog (bool updateATime, unsigned symLinkLimit) throw (DmException) | |
~BuiltInCatalog () | |
std::string | getImplId (void) const throw () |
String ID of the implementation. More... | |
void | setStackInstance (StackInstance *si) throw (DmException) |
void | setSecurityContext (const SecurityContext *) throw (DmException) |
Set the security context. More... | |
void | changeDir (const std::string &) throw (DmException) |
std::string | getWorkingDir (void) throw (DmException) |
ExtendedStat | extendedStat (const std::string &path, bool followSym=true) throw (DmException) |
ExtendedStat | extendedStatByRFN (const std::string &rfn) throw (DmException) |
bool | access (const std::string &path, int mode) throw (DmException) |
bool | accessReplica (const std::string &replica, int mode) 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 | 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) |
struct dirent * | readDir (Directory *dir) throw (DmException) |
ExtendedStat * | readDirx (Directory *dir) throw (DmException) |
Replica | getReplicaByRFN (const std::string &rfn) throw (DmException) |
void | updateReplica (const Replica &replica) throw (DmException) |
![]() | |
virtual | ~Catalog () |
Destructor. More... | |
virtual void | setChecksum (const std::string &path, const std::string &csumtype, const std::string &csumvalue) throw (DmException) |
![]() | |
virtual | ~BaseInterface () |
Virtual destructor. More... | |
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) More... | |
void | traverseBackwards (const ExtendedStat &meta) throw (DmException) |
void | addFileSizeToParents (const std::string &fname, bool subtract) throw (DmException) |
void | addFileSizeToParents (const ExtendedStat &statinfo, bool subtract) throw (DmException) |
Private Attributes | |
StackInstance * | si_ |
const SecurityContext * | secCtx_ |
std::string | cwdPath_ |
ino_t | cwd_ |
mode_t | umask_ |
bool | updateATime_ |
unsigned | symLinkLimit_ |
Additional Inherited Members | |
![]() | |
static void | setStackInstance (BaseInterface *i, StackInstance *si) throw (DmException) |
These method allows plugins to call other plugins setStackInstance and setSecurityContext. More... | |
static void | setSecurityContext (BaseInterface *i, const SecurityContext *ctx) throw (DmException) |
dmlite::BuiltInCatalog::BuiltInCatalog | ( | bool | updateATime, |
unsigned | symLinkLimit | ||
) | |||
throw | ( | DmException | |
) |
dmlite::BuiltInCatalog::~BuiltInCatalog | ( | ) |
|
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 |
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.
|
protected |
addFileSizeToParents Add (or subtract) the size of the given file from all its parent directories
fname | The logical file name (SFN) of the file in question |
subtract | If true then subtract instead of adding |
|
protected |
addFileSizeToParents Add (or subtract) the size of the given file from all its parent directories
st | The stat information about the file in question |
subtract | If true then subtract instead of adding |
|
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 |
Change the working dir. Future not-absolute paths will use this as root.
path | The new working dir. |
Reimplemented from dmlite::Catalog.
|
virtual |
Close a directory opened previously.
dir | The directory handle as returned by NsInterface::openDir. |
Reimplemented from dmlite::Catalog.
|
virtual |
Creates an entry in the catalog.
path | The new file. |
mode | The creation mode. |
Reimplemented from dmlite::Catalog.
|
virtual |
|
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 |
Do an extended stat of a logical file using an associated replica file name.
rfn | The replica. |
Reimplemented from dmlite::Catalog.
Location dmlite::BuiltInCatalog::get | ( | const std::string & | path | ) | |
throw | ( | DmException | |||
) |
|
virtual |
Get the comment associated with a file.
path | The file or directory. |
Reimplemented from dmlite::Catalog.
|
virtual |
String ID of the implementation.
Implements dmlite::BaseInterface.
|
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 /). |
|
virtual |
|
virtual |
Get replicas for a file.
path | The file for which replicas will be retrieved. |
Reimplemented from dmlite::Catalog.
|
virtual |
|
virtual |
Create a new empty directory.
path | The path of the new directory. |
mode | The creation mode. |
Reimplemented from dmlite::Catalog.
|
virtual |
Open a directory for reading.
path | The directory to open. |
Reimplemented from 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 | |
) |
|
virtual |
Read next entry from a directory (simple read).
dir | The directory handle as returned by NsInterface::openDir. |
Reimplemented from dmlite::Catalog.
|
virtual |
Read next entry from a directory (stat information added).
dir | The directory handle as returned by NsInterface::openDir. |
Reimplemented from dmlite::Catalog.
|
virtual |
Returns the path pointed by the symlink path
path | The symlink file. |
Reimplemented from dmlite::Catalog.
|
virtual |
Remove a directory.
path | The path of the directory to remove. |
Reimplemented from dmlite::Catalog.
|
virtual |
Rename a file or directory.
oldPath | The old name. |
newPath | The new name. |
Reimplemented from dmlite::Catalog.
|
virtual |
Set the ACLs
path | The file to modify. |
acl | The Access Control List. |
Reimplemented from dmlite::Catalog.
|
virtual |
Set the comment associated with a file.
path | The file or directory. |
comment | The new comment. |
Reimplemented from dmlite::Catalog.
|
virtual |
|
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 |
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 |
Set the security context.
Reimplemented from dmlite::BaseInterface.
|
virtual |
Set the size of a file.
path | The file to modify. |
newSize | The new file size. |
Reimplemented from dmlite::Catalog.
|
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 |
Creates a new symlink.
path | The existing path. |
symlink | The new access path. |
Reimplemented from dmlite::Catalog.
|
protected |
Traverse backwards to check permissions.
meta | The file at the end |
|
virtual |
Sets the calling process’s file mode creation mask to mask & 0777.
mask | The new mask. |
Reimplemented from dmlite::Catalog.
|
virtual |
|
protected |
Update access time (if updateATime is true)
|
virtual |
Update extended metadata on the catalog.
path | The file to update. |
attr | The extended attributes struct. |
Reimplemented from dmlite::Catalog.
|
virtual |
Update a replica.
replica | The replica to modify. |
Reimplemented from dmlite::Catalog.
|
virtual |
Set access and/or modification time.
path | The file path. |
buf | A struct holding the new times. |
Reimplemented from dmlite::Catalog.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |