dmlite::DummyCatalog Class Reference

#include <DummyCatalog.h>

Inherits dmlite::Catalog.

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

List of all members.

Public Member Functions

 DummyCatalog (Catalog *decorated)
virtual ~DummyCatalog ()
 Destructor.
virtual void setStackInstance (StackInstance *)
virtual void setSecurityContext (const SecurityContext *)
 Set the security context.
virtual void changeDir (const std::string &)
virtual std::string getWorkingDir (void)
virtual ExtendedStat extendedStat (const std::string &, bool)
virtual DmStatus extendedStat (ExtendedStat &xstat, const std::string &, bool)
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 &)
virtual void deleteReplica (const Replica &)
virtual std::vector< ReplicagetReplicas (const std::string &)
virtual void symlink (const std::string &, const std::string &)
std::string readLink (const std::string &path)
virtual void unlink (const std::string &)
virtual void create (const std::string &, mode_t)
virtual mode_t umask (mode_t) throw ()
virtual void setMode (const std::string &, mode_t)
virtual void setOwner (const std::string &, uid_t, gid_t, bool)
virtual void setSize (const std::string &, size_t)
virtual void setChecksum (const std::string &, const std::string &, const std::string &)
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 &, const Acl &)
virtual void utime (const std::string &, const struct utimbuf *)
virtual std::string getComment (const std::string &)
virtual void setComment (const std::string &, const std::string &)
virtual void setGuid (const std::string &, const std::string &)
virtual void updateExtendedAttributes (const std::string &, const Extensible &)
virtual DirectoryopenDir (const std::string &)
virtual void closeDir (Directory *)
virtual struct dirent * readDir (Directory *)
virtual ExtendedStatreadDirx (Directory *)
virtual void makeDir (const std::string &, mode_t)
virtual void rename (const std::string &, const std::string &)
virtual void removeDir (const std::string &)
virtual Replica getReplicaByRFN (const std::string &rfn)
virtual void updateReplica (const Replica &replica)

Protected Attributes

Catalogdecorated_

Constructor & Destructor Documentation

dmlite::DummyCatalog::DummyCatalog ( Catalog decorated  ) 

Constructor

Parameters:
decorated The underlying decorated catalog.
virtual dmlite::DummyCatalog::~DummyCatalog (  )  [virtual]

Destructor.


Member Function Documentation

virtual bool dmlite::DummyCatalog::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 from dmlite::Catalog.

virtual bool dmlite::DummyCatalog::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 from dmlite::Catalog.

virtual void dmlite::DummyCatalog::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 from dmlite::Catalog.

virtual void dmlite::DummyCatalog::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 from dmlite::Catalog.

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

Close a directory opened previously.

Parameters:
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 
) [virtual]

Creates an entry in the catalog.

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

Reimplemented from dmlite::Catalog.

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

Delete a replica.

Parameters:
replica The replica to remove.

Reimplemented from dmlite::Catalog.

virtual DmStatus dmlite::DummyCatalog::extendedStat ( ExtendedStat xstat,
const std::string &  path,
bool  followSym 
) [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 from dmlite::Catalog.

virtual ExtendedStat dmlite::DummyCatalog::extendedStat ( const std::string &  path,
bool  followSym 
) [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 from dmlite::Catalog.

virtual ExtendedStat dmlite::DummyCatalog::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 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 
) [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 from dmlite::Catalog.

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

Get the comment associated with a file.

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

Reimplemented from dmlite::Catalog.

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

Get a replica.

Parameters:
rfn The replica file name.

Reimplemented from dmlite::Catalog.

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

Get replicas for a file.

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

Reimplemented from dmlite::Catalog.

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

Get the current working dir.

Returns:
The current working dir.

Reimplemented from dmlite::Catalog.

virtual void dmlite::DummyCatalog::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 from dmlite::Catalog.

virtual Directory* dmlite::DummyCatalog::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 from dmlite::Catalog.

virtual struct dirent* dmlite::DummyCatalog::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 from dmlite::Catalog.

virtual ExtendedStat* dmlite::DummyCatalog::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 from dmlite::Catalog.

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

Returns the path pointed by the symlink path

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

Reimplemented from dmlite::Catalog.

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

Remove a directory.

Parameters:
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 
) [virtual]

Rename a file or directory.

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

Reimplemented from dmlite::Catalog.

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

Set the ACLs

Parameters:
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 
) [virtual]

Set the checksum of a file.

Parameters:
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 
) [virtual]

Set the comment associated with a file.

Parameters:
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 
) [virtual]

Set GUID of a file.

Parameters:
path The file.
guid The new GUID.

Reimplemented from dmlite::Catalog.

virtual void dmlite::DummyCatalog::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 from dmlite::Catalog.

virtual void dmlite::DummyCatalog::setOwner ( const std::string &  path,
uid_t  newUid,
gid_t  newGid,
bool  followSymLink 
) [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 from dmlite::Catalog.

virtual void dmlite::DummyCatalog::setSecurityContext ( const SecurityContext ctx  )  [virtual]

Set the security context.

Reimplemented from dmlite::BaseInterface.

virtual void dmlite::DummyCatalog::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 from dmlite::Catalog.

virtual void dmlite::DummyCatalog::setStackInstance ( StackInstance si  )  [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 
) [virtual]

Creates a new symlink.

Parameters:
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.

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

Reimplemented from dmlite::Catalog.

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

Remove a file.

Parameters:
path The path to remove.

Reimplemented from dmlite::Catalog.

virtual void dmlite::DummyCatalog::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 from dmlite::Catalog.

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

Update a replica.

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

Reimplemented from dmlite::Catalog.

virtual void dmlite::DummyCatalog::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 from dmlite::Catalog.


Member Data Documentation


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

Generated on 19 Jul 2019 for dmlite by  doxygen 1.6.1