xrootd
|
#include <XrdCks.hh>
Public Member Functions | |
virtual int | Calc (const char *Pfn, XrdCksData &Cks, int doSet=1)=0 |
virtual int | Del (const char *Pfn, XrdCksData &Cks)=0 |
virtual int | Get (const char *Pfn, XrdCksData &Cks)=0 |
virtual int | Config (const char *Token, char *Line)=0 |
virtual int | Init (const char *ConfigFN, const char *DfltCalc=0)=0 |
virtual char * | List (const char *Pfn, char *Buff, int Blen, char Sep=' ')=0 |
virtual const char * | Name (int seqNum=0)=0 |
virtual XrdCksCalc * | Object (const char *name) |
virtual int | Size (const char *Name=0)=0 |
virtual int | Set (const char *Pfn, XrdCksData &Cks, int myTime=0)=0 |
virtual int | Ver (const char *Pfn, XrdCksData &Cks)=0 |
XrdCks (XrdSysError *erP) | |
Constructor. More... | |
virtual | ~XrdCks () |
Destructor. More... | |
Protected Attributes | |
XrdSysError * | eDest |
This class defines the checksum management interface. It should be used as the base class for a plugin. When used that way, the shared library holding the plugin must define a "C" entry point named XrdCksInit() as described at the end of this include file. Note that you can also base you plugin on the native implementation, XrdCks, and replace only selected methods.
|
inline |
Constructor.
|
inlinevirtual |
Destructor.
|
pure virtual |
Calculate a new checksum for a physical file using the checksum algorithm named in the Cks parameter.
Pfn | The physical name of the file to be checksumed. |
Cks | For input, it specifies the checksum algorithm to be used. For output, the checksum value is returned upon success. |
doSet | When true, the new value must replace any existing value in the Pfn's extended file attributes. |
Implemented in XrdCksManager.
|
pure virtual |
Parse a configuration directives specific to the checksum manager.
Token | Points to the directive that triggered the call. |
Line | All the characters after the directive. |
Implemented in XrdCksManager.
|
pure virtual |
Delete the checksum from the Pfn's xattrs.
Implemented in XrdCksManager.
|
pure virtual |
Retreive the checksum from the Pfn's xattrs and return it and indicate whether or not it is stale (i.e. the file modification has changed or the name and length are not the expected values).
Pfn | The physical name of the file to be checksumed. |
Cks | For input, it specifies the checksum type to return. For output, the checksum value is returned upon success. |
Implemented in XrdCksManager.
|
pure virtual |
Fully initialize the manager which includes loading any plugins.
ConfigFN | Points to the configuration file path. |
DfltCalc | Is the default checksum and should be defaulted if NULL. The default implementation defaults this to adler32. A default is only needed should the checksum name in the XrdCksData object be omitted. |
Implemented in XrdCksManager.
|
pure virtual |
List names of the checksums associated with a Pfn or all supported ones.
Pfn | The name of the physical file whose checksum names are to be returned. When Pfn is null, return all supported checksum algorithm names. |
Buff | Points to a buffer, at least 64 bytes in length, to hold a "Sep" separated list of checksum names. |
Blen | The length of the buffer. |
Sep | The separation character to be used between adjacent names. |
Implemented in XrdCksManager.
|
pure virtual |
Get the name of the checksums associated with a sequence number. Note that Name() may be called prior to final config to see if there are any chksums to configure and avoid unintended errors.
seqNum | The sequence number. Zero signifies the default name. Higher numbers are alternates. |
Implemented in XrdCksManager.
Referenced by Object().
|
inlinevirtual |
Get a new XrdCksCalc object that can calculate the checksum corresponding to the specified name or the default object if name is a null pointer. The object can be used to compute checksums on the fly. The object's Recycle() method must be used to delete it.
name | The name of the checksum algorithm. If null, use the default one. |
Reimplemented in XrdCksManager.
|
pure virtual |
Set a file's checksum in the extended attributes along with the file's mtime and the time of setting.
Pfn | The physical name of the file to be set. |
Cks | Specifies the checksum name and value. |
myTime | When true then the fmTime and gmTime in the Cks structure are to be used; as opposed to the current time. |
Implemented in XrdCksManager.
Referenced by Object().
|
pure virtual |
Get the binary length of the checksum with the corresponding name.
Name | The checksum algorithm name. If null, use the default name. |
Implemented in XrdCksManager.
Referenced by Object().
|
pure virtual |
Retreive the checksum from the Pfn's xattrs and compare it to the supplied checksum. If the checksum is not available or is stale, a new checksum is calculated and written to the extended attributes.
Pfn | The physical name of the file to be verified. |
Cks | Specifies the checksum name and value. |
Implemented in XrdCksManager.
Referenced by Object().
|
protected |
Significant errno values:
-EDOM The supplied checksum length is invalid for the checksum name. -ENOTSUP The supplied or default checksum name is not supported. -ESRCH Checksum does not exist for file. -ESTALE The file's checksum is no longer valid.