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

#include <inode.h>

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

Public Member Functions

virtual ~INode ()
 Destructor. More...
 
virtual void begin (void) throw (DmException)
 Start a transaction. More...
 
virtual void commit (void) throw (DmException)
 Commit a transaction. More...
 
virtual void rollback (void) throw (DmException)
 Rollback changes. More...
 
virtual ExtendedStat create (const ExtendedStat &f) throw (DmException)
 
virtual void symlink (ino_t inode, const std::string &link) throw (DmException)
 
virtual void unlink (ino_t inode) throw (DmException)
 
virtual void move (ino_t inode, ino_t dest) throw (DmException)
 
virtual void rename (ino_t inode, const std::string &name) throw (DmException)
 
virtual ExtendedStat extendedStat (ino_t inode) throw (DmException)
 
virtual ExtendedStat extendedStat (ino_t parent, const std::string &name) throw (DmException)
 
virtual ExtendedStat extendedStat (const std::string &guid) throw (DmException)
 
virtual SymLink readLink (ino_t inode) throw (DmException)
 
virtual void addReplica (const Replica &replica) throw (DmException)
 
virtual void deleteReplica (const Replica &replica) throw (DmException)
 
virtual Replica getReplica (int64_t rid) throw (DmException)
 
virtual Replica getReplica (const std::string &rfn) throw (DmException)
 
virtual void updateReplica (const Replica &replica) throw (DmException)
 
virtual std::vector< ReplicagetReplicas (ino_t inode) throw (DmException)
 
virtual void utime (ino_t inode, const struct utimbuf *buf) throw (DmException)
 
virtual void setMode (ino_t inode, uid_t uid, gid_t gid, mode_t mode, const Acl &acl) throw (DmException)
 
virtual void setSize (ino_t inode, size_t size) throw (DmException)
 
virtual void setChecksum (ino_t inode, const std::string &csumtype, const std::string &csumvalue) throw (DmException)
 
virtual std::string getComment (ino_t inode) throw (DmException)
 
virtual void setComment (ino_t inode, const std::string &comment) throw (DmException)
 
virtual void deleteComment (ino_t inode) throw (DmException)
 
virtual void setGuid (ino_t inode, const std::string &guid) throw (DmException)
 
virtual void updateExtendedAttributes (ino_t inode, const Extensible &attr) throw (DmException)
 
virtual IDirectoryopenDir (ino_t inode) throw (DmException)
 
virtual void closeDir (IDirectory *dir) throw (DmException)
 
virtual ExtendedStatreadDirx (IDirectory *dir) throw (DmException)
 
virtual struct dirent * readDir (IDirectory *dir) 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

Low-level interface. Based on i-nodes.

Note
Security checks NOT done on this level.

Constructor & Destructor Documentation

virtual dmlite::INode::~INode ( )
virtual

Destructor.

Member Function Documentation

virtual void dmlite::INode::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.
virtual void dmlite::INode::begin ( void  )
throw (DmException
)
virtual

Start a transaction.

virtual void dmlite::INode::closeDir ( IDirectory dir)
throw (DmException
)
virtual

Close a directory.

Parameters
dirThe opaque structure to close.
virtual void dmlite::INode::commit ( void  )
throw (DmException
)
virtual

Commit a transaction.

virtual ExtendedStat dmlite::INode::create ( const ExtendedStat f)
throw (DmException
)
virtual

Create a new file or directory

Parameters
fThe file that will be inserted. Its fields must be initialized.
Returns
An stat of the created file.
virtual void dmlite::INode::deleteComment ( ino_t  inode)
throw (DmException
)
virtual

Remove the associated comment.

Parameters
inodeThe file whose comment will be removed.
virtual void dmlite::INode::deleteReplica ( const Replica replica)
throw (DmException
)
virtual

Delete a replica.

Parameters
replicaThe replica to remove.
virtual ExtendedStat dmlite::INode::extendedStat ( ino_t  inode)
throw (DmException
)
virtual

Do an extended stat of en entry using its inode.

Parameters
inodeThe inode of the file.
Returns
The extended status of the file.
virtual ExtendedStat dmlite::INode::extendedStat ( ino_t  parent,
const std::string &  name 
)
throw (DmException
)
virtual

Do an extended stat of an entry using the parent inode and the name.

Parameters
parentThe parent inode.
nameThe file or directory name.
Note
No security check will be done.
virtual ExtendedStat dmlite::INode::extendedStat ( const std::string &  guid)
throw (DmException
)
virtual

Do an extended stat using the GUID.

Parameters
guidThe file GUID.
virtual std::string dmlite::INode::getComment ( ino_t  inode)
throw (DmException
)
virtual

Get the comment associated to a file.

Parameters
inodeThe inode of the file.
Returns
The comment.
virtual Replica dmlite::INode::getReplica ( int64_t  rid)
throw (DmException
)
virtual

Get a replica using the replica ID.

Parameters
ridThe replica ID.
virtual Replica dmlite::INode::getReplica ( const std::string &  rfn)
throw (DmException
)
virtual

Get a replica.

Parameters
rfnThe replica to retrieve.
virtual std::vector<Replica> dmlite::INode::getReplicas ( ino_t  inode)
throw (DmException
)
virtual

Get replicas for a file.

Parameters
inodeThe entry inode.
virtual void dmlite::INode::move ( ino_t  inode,
ino_t  dest 
)
throw (DmException
)
virtual

Move a file between two directories.

Parameters
inodeFile to be moved.
destThe new parent.
virtual IDirectory* dmlite::INode::openDir ( ino_t  inode)
throw (DmException
)
virtual

Open a directory.

Parameters
inodeThe inode of the directory.
Returns
An opaque pointer to a directory.
virtual struct dirent* dmlite::INode::readDir ( IDirectory dir)
throw (DmException
)
virtual

Read the next entry.

Parameters
dirThe opaque structure of a directory.
Returns
NULL when finished. Extended stat of the next entry otherwise.
virtual ExtendedStat* dmlite::INode::readDirx ( IDirectory dir)
throw (DmException
)
virtual

Read the next entry.

Parameters
dirThe opaque structure of a directory.
Returns
NULL when finished. Extended stat of the next entry otherwise.
virtual SymLink dmlite::INode::readLink ( ino_t  inode)
throw (DmException
)
virtual

Get the symlink associated with a inode.

Parameters
inodeThe inode of the file.
Returns
A SymLink struct.
Note
If inode is not a symlink, an exception will be thrown.
virtual void dmlite::INode::rename ( ino_t  inode,
const std::string &  name 
)
throw (DmException
)
virtual

Change the name of a file.

Parameters
inodeThe inode of the file.
nameNew name.
virtual void dmlite::INode::rollback ( void  )
throw (DmException
)
virtual

Rollback changes.

virtual void dmlite::INode::setChecksum ( ino_t  inode,
const std::string &  csumtype,
const std::string &  csumvalue 
)
throw (DmException
)
virtual

Set the checksum of a file.

Parameters
inodeThe inode of the file.
csumtypeThe checksum type.
csumvalueThe checksum value.
virtual void dmlite::INode::setComment ( ino_t  inode,
const std::string &  comment 
)
throw (DmException
)
virtual

Set the comment associated to a file.

Parameters
inodeThe inode of the file.
commentThe new comment.
virtual void dmlite::INode::setGuid ( ino_t  inode,
const std::string &  guid 
)
throw (DmException
)
virtual

Set the GUID of a file.

Parameters
inodeThe inode of the file.
guidThe new GUID.
virtual void dmlite::INode::setMode ( ino_t  inode,
uid_t  uid,
gid_t  gid,
mode_t  mode,
const Acl acl 
)
throw (DmException
)
virtual

Set the mode of a file.

Parameters
inodeThe inode of the file.
uidThe owner. If -1, not changed.
gidThe group. If -1, not changed.
modeThe new mode. S_IFMT bits are cleared, and kept as they are in the DB.
aclThe new ACL. If empty, not changed.
virtual void dmlite::INode::setSize ( ino_t  inode,
size_t  size 
)
throw (DmException
)
virtual

Set the size of a file.

Parameters
inodeThe inode of the file.
sizeThe new size.
virtual void dmlite::INode::symlink ( ino_t  inode,
const std::string &  link 
)
throw (DmException
)
virtual

Create or modify the file inode to point to another file.

Parameters
inodeThe file to modify.
linkThe new symbolic link.
Note
This does NOT create the file. Use create first.
virtual void dmlite::INode::unlink ( ino_t  inode)
throw (DmException
)
virtual

Remove a file or directory. It will fail if it is a directory and it is not empty, or if it a file and it has replicas.

Parameters
inodeThe inode of the file.
Note
This will check for non empty directories.
This will remove associated comments and replicas.
virtual void dmlite::INode::updateExtendedAttributes ( ino_t  inode,
const Extensible attr 
)
throw (DmException
)
virtual

Update extended metadata on the catalog.

Parameters
attrThe extended attributes struct.
virtual void dmlite::INode::updateReplica ( const Replica replica)
throw (DmException
)
virtual

Modify a replica.

Parameters
replicaThe replica data.
virtual void dmlite::INode::utime ( ino_t  inode,
const struct utimbuf *  buf 
)
throw (DmException
)
virtual

Change access and/or modification time.

Parameters
inodeThe inode of the file.
bufA struct holding the new times.

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