dmlite  0.6
Public Member Functions | List of all members
dmlite::Catalog Class Reference

Interface for Catalog (Namespaces). More...

#include <catalog.h>

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

Public Member Functions

virtual ~Catalog ()
 Destructor. More...
 
virtual void changeDir (const std::string &path) throw (DmException)
 
virtual std::string getWorkingDir (void) throw (DmException)
 
virtual ExtendedStat extendedStat (const std::string &path, bool followSym=true) 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 &replica) throw (DmException)
 
virtual void deleteReplica (const Replica &replica) throw (DmException)
 
virtual std::vector< ReplicagetReplicas (const std::string &path) throw (DmException)
 
virtual void symlink (const std::string &path, const std::string &symlink) throw (DmException)
 
virtual std::string readLink (const std::string &path) throw (DmException)
 
virtual void unlink (const std::string &path) throw (DmException)
 
virtual void create (const std::string &path, mode_t mode) throw (DmException)
 
virtual mode_t umask (mode_t mask) throw ()
 
virtual void setMode (const std::string &path, mode_t mode) throw (DmException)
 
virtual void setOwner (const std::string &path, uid_t newUid, gid_t newGid, bool followSymLink=true) throw (DmException)
 
virtual void setSize (const std::string &path, size_t newSize) throw (DmException)
 
virtual void setChecksum (const std::string &path, const std::string &csumtype, const std::string &csumvalue) throw (DmException)
 
virtual void setAcl (const std::string &path, const Acl &acl) throw (DmException)
 
virtual void utime (const std::string &path, const struct utimbuf *buf) throw (DmException)
 
virtual std::string getComment (const std::string &path) throw (DmException)
 
virtual void setComment (const std::string &path, const std::string &comment) throw (DmException)
 
virtual void setGuid (const std::string &path, const std::string &guid) throw (DmException)
 
virtual void updateExtendedAttributes (const std::string &path, const Extensible &attr) throw (DmException)
 
virtual DirectoryopenDir (const std::string &path) throw (DmException)
 
virtual void closeDir (Directory *dir) throw (DmException)
 
virtual struct dirent * readDir (Directory *dir) throw (DmException)
 
virtual ExtendedStatreadDirx (Directory *dir) throw (DmException)
 
virtual void makeDir (const std::string &path, mode_t mode) throw (DmException)
 
virtual void rename (const std::string &oldPath, const std::string &newPath) throw (DmException)
 
virtual void removeDir (const std::string &path) throw (DmException)
 
virtual Replica getReplicaByRFN (const std::string &rfn) throw (DmException)
 
virtual void updateReplica (const Replica &replica) throw (DmException)
 
- Public Member Functions inherited from dmlite::BaseInterface
virtual ~BaseInterface ()
 Virtual destructor. More...
 
virtual std::string getImplId (void) const =0 throw ()
 String ID of the implementation. More...
 

Additional Inherited Members

- Protected Member Functions inherited from dmlite::BaseInterface
virtual void setStackInstance (StackInstance *si) throw (DmException)
 
virtual void setSecurityContext (const SecurityContext *ctx) throw (DmException)
 Set the security context. More...
 
- Static Protected Member Functions inherited from dmlite::BaseInterface
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)
 

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 
)
throw (DmException
)
virtual

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

Parameters
lfnLogical filename.
modeA 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::BuiltInCatalog, and dmlite::DummyCatalog.

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

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

Parameters
rfnReplica filename.
modeA 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::BuiltInCatalog, and dmlite::DummyCatalog.

virtual void dmlite::Catalog::addReplica ( const Replica replica)
throw (DmException
)
virtual

Add a new replica for a file.

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

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

virtual void dmlite::Catalog::changeDir ( const std::string &  path)
throw (DmException
)
virtual

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

Parameters
pathThe new working dir.

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

virtual void dmlite::Catalog::closeDir ( Directory dir)
throw (DmException
)
virtual

Close a directory opened previously.

Parameters
dirThe directory handle as returned by NsInterface::openDir.

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

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

Creates an entry in the catalog.

Parameters
pathThe new file.
modeThe creation mode.

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

virtual void dmlite::Catalog::deleteReplica ( const Replica replica)
throw (DmException
)
virtual

Delete a replica.

Parameters
replicaThe replica to remove.

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

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

Do an extended stat of a file or directory.

Parameters
pathThe path of the file or directory.
followSymIf true, symlinks will be followed.
Returns
The extended status of the file.

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

virtual ExtendedStat dmlite::Catalog::extendedStatByRFN ( const std::string &  rfn)
throw (DmException
)
virtual

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

Parameters
rfnThe replica.
Returns
The extended status of the file.

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

virtual std::string dmlite::Catalog::getComment ( const std::string &  path)
throw (DmException
)
virtual

Get the comment associated with a file.

Parameters
pathThe file or directory.
Returns
The associated comment.

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

virtual Replica dmlite::Catalog::getReplicaByRFN ( const std::string &  rfn)
throw (DmException
)
virtual

Get a replica.

Parameters
rfnThe replica file name.

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

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

Get replicas for a file.

Parameters
pathThe file for which replicas will be retrieved.

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

virtual std::string dmlite::Catalog::getWorkingDir ( void  )
throw (DmException
)
virtual

Get the current working dir.

Returns
The current working dir.

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

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

Create a new empty directory.

Parameters
pathThe path of the new directory.
modeThe creation mode.

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

virtual Directory* dmlite::Catalog::openDir ( const std::string &  path)
throw (DmException
)
virtual

Open a directory for reading.

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

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

virtual struct dirent* dmlite::Catalog::readDir ( Directory dir)
throw (DmException
)
virtual

Read next entry from a directory (simple read).

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

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

virtual ExtendedStat* dmlite::Catalog::readDirx ( Directory dir)
throw (DmException
)
virtual

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

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

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

virtual std::string dmlite::Catalog::readLink ( const std::string &  path)
throw (DmException
)
virtual

Returns the path pointed by the symlink path

Parameters
pathThe symlink file.
Returns
The symlink target.

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

virtual void dmlite::Catalog::removeDir ( const std::string &  path)
throw (DmException
)
virtual

Remove a directory.

Parameters
pathThe 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 
)
throw (DmException
)
virtual

Rename a file or directory.

Parameters
oldPathThe old name.
newPathThe new name.

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

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

Set the ACLs

Parameters
pathThe file to modify.
aclThe Access Control List.

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

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

Set the checksum of a file.

Parameters
pathThe file to modify.
csumtypeThe checksum type (CS, AD or MD).
csumvalueThe checksum value.

Reimplemented in dmlite::DummyCatalog.

virtual void dmlite::Catalog::setComment ( const std::string &  path,
const std::string &  comment 
)
throw (DmException
)
virtual

Set the comment associated with a file.

Parameters
pathThe file or directory.
commentThe new comment.

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

virtual void dmlite::Catalog::setGuid ( const std::string &  path,
const std::string &  guid 
)
throw (DmException
)
virtual

Set GUID of a file.

Parameters
pathThe file.
guidThe new GUID.

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

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

Set the mode of a file.

Parameters
pathThe file to modify.
modeThe new mode as an integer (i.e. 0755)

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

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

Set the owner of a file.

Parameters
pathThe file to modify.
newUidThe uid of the new owneer.
newGidThe gid of the new group.
followSymLinkIf set to true, symbolic links will be followed.

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

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

Set the size of a file.

Parameters
pathThe file to modify.
newSizeThe new file size.

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

virtual void dmlite::Catalog::symlink ( const std::string &  path,
const std::string &  symlink 
)
throw (DmException
)
virtual

Creates a new symlink.

Parameters
pathThe existing path.
symlinkThe new access path.

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

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

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

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

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

virtual void dmlite::Catalog::unlink ( const std::string &  path)
throw (DmException
)
virtual

Remove a file.

Parameters
pathThe path to remove.

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

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

Update extended metadata on the catalog.

Parameters
pathThe file to update.
attrThe extended attributes struct.

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

virtual void dmlite::Catalog::updateReplica ( const Replica replica)
throw (DmException
)
virtual

Update a replica.

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

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

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

Set access and/or modification time.

Parameters
pathThe file path.
bufA struct holding the new times.

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


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