Loading...
Searching...
No Matches
XrdCksWrapper Class Reference

`#include <XrdCksWrapper.hh>`

Inheritance diagram for XrdCksWrapper:
Collaboration diagram for XrdCksWrapper:

## Public Member Functions

| XrdCksWrapper (XrdCks &prevPI, XrdSysError *errP)
virtual | ~XrdCksWrapper ()
| Destructor.
virtual int | Calc (const char *Xfn, XrdCksData &Cks, int doSet=1)
virtual int | Calc (const char *Xfn, XrdCksData &Cks, XrdCksPCB *pcbP, int doSet=1)
virtual int | Config (const char *Token, char *Line)
virtual int | Del (const char *Xfn, XrdCksData &Cks)
virtual int | Get (const char *Xfn, XrdCksData &Cks)
virtual int | Init (const char *ConfigFN, const char *DfltCalc=0)
virtual char * | List (const char *Xfn, char *Buff, int Blen, char Sep=' ')
virtual const char * | Name (int seqNum=0)
virtual XrdCksCalc * | Object (const char *name)
virtual int | Set (const char *Xfn, XrdCksData &Cks, int myTime=0)
virtual int | Size (const char *Name=0)
virtual int | Ver (const char *Xfn, XrdCksData &Cks)
virtual int | Ver (const char *Xfn, XrdCksData &Cks, XrdCksPCB *pcbP)
Public Member Functions inherited from XrdCks
| XrdCks (XrdSysError *erP)
| Constructor.
virtual | ~XrdCks ()
| Destructor.

## Protected Attributes

XrdCks & | cksPI
Protected Attributes inherited from XrdCks
XrdSysError * | eDest

## Detailed Description

This class defines the wrapper for the checksum management interface. It should be used as the base class for a stacked plugin. When used that way, the shared library holding the plugin must define a "C" entry point named XrdCksAdd2() as described at the end of this include file. Note you pass a reference to the previous plugin-in in the plug-in chain as a constructor argument as supplied to the XrdCksAdd2() function. Override the methods you wish to wrap. Methods that are not overridden are forwarded to the previous plug-in.

Definition at line 51 of file XrdCksWrapper.hh.

## Constructor & Destructor Documentation

## XrdCksWrapper()

XrdCksWrapper::XrdCksWrapper | ( | XrdCks & | prevPI,
|  | XrdSysError * | errP )

inline

Constructor

Parameters

  prevPI | Reference to the antecedent plugin.
  errP | Pointer to error message object

Definition at line 239 of file XrdCksWrapper.hh.

: XrdCks(errP), cksPI(prevPI) {}
XrdCksWrapper::cksPI
XrdCks & cksPI
Definition XrdCksWrapper.hh:250
XrdCks::XrdCks
XrdCks(XrdSysError *erP)
Constructor.
Definition XrdCks.hh:272

References XrdCks::XrdCks(), and cksPI.

Here is the call graph for this function:

## ~XrdCksWrapper()

virtual XrdCksWrapper::~XrdCksWrapper | ( |  | ) |

inline virtual

Destructor.

Definition at line 246 of file XrdCksWrapper.hh.

{}

## Member Function Documentation

## Calc() [1/2]

virtual int XrdCksWrapper::Calc | ( | const char * | Xfn,
|  | XrdCksData & | Cks,
|  | int | doSet = 1 )

inline virtual

Calculate a new checksum for a physical file using the checksum algorithm named in the Cks parameter.

Parameters

  Xfn | The logical or 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 Xfn's extended file attributes.
  pcbP | In the second form, the pointer to the callback object. A nil pointer does not invoke any callback.

Returns
  Success: zero with Cks structure holding the checksum value. Failure: -errno (see significant error numbers below).

Implements XrdCks.

Definition at line 71 of file XrdCksWrapper.hh.

{return cksPI.Calc(Xfn, Cks, doSet);}

References cksPI.

Referenced by Calc().

Here is the caller graph for this function:

## Calc() [2/2]

virtual int XrdCksWrapper::Calc | ( | const char * | Xfn,
|  | XrdCksData & | Cks,
|  | XrdCksPCB * | pcbP,
|  | int | doSet = 1 )

inline virtual

Reimplemented from XrdCks.

Definition at line 75 of file XrdCksWrapper.hh.

{(void)pcbP; return Calc(Xfn, Cks, doSet);}
XrdCksWrapper::Calc
virtual int Calc(const char *Xfn, XrdCksData &Cks, int doSet=1)
Definition XrdCksWrapper.hh:71

References Calc().

Here is the call graph for this function:

## Config()

virtual int XrdCksWrapper::Config | ( | const char * | Token,
|  | char * | Line )

inline virtual

Parse a configuration directives specific to the checksum manager.

Parameters

  Token | Points to the directive that triggered the call.
  Line | All the characters after the directive.

Returns
  Success: 1 Failure: 0

Implements XrdCks.

Definition at line 117 of file XrdCksWrapper.hh.

{return cksPI.Config(Token, Line);}

References cksPI.

## Del()

virtual int XrdCksWrapper::Del | ( | const char * | Xfn,
|  | XrdCksData & | Cks )

inline virtual

Delete the checksum from the Xfn's xattrs.

Parameters

  Xfn | The logical or physical name of the file to be checksumed.
  Cks | Specifies the checksum type to delete.

Returns
  Success: 0 Failure: -errno (see significant error numbers below).

Implements XrdCks.

Definition at line 88 of file XrdCksWrapper.hh.

{return cksPI.Del(Xfn, Cks);}

References cksPI.

## Get()

virtual int XrdCksWrapper::Get | ( | const char * | Xfn,
|  | XrdCksData & | Cks )

inline virtual

Retreive the checksum from the Xfn'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).

Parameters

  Xfn | The logical or 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.

Returns
  Success: The length of the binary checksum in the Cks structure. Failure: -errno (see significant error numbers below).

Implements XrdCks.

Definition at line 104 of file XrdCksWrapper.hh.

{return cksPI.Get(Xfn, Cks);}

References cksPI.

## Init()

virtual int XrdCksWrapper::Init | ( | const char * | ConfigFN,
|  | const char * | DfltCalc = 0 )

inline virtual

Fully initialize the manager which includes loading any plugins.

Parameters

  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.

Returns
  Success: 1 Failure: 0

Implements XrdCks.

Definition at line 133 of file XrdCksWrapper.hh.

{return cksPI.Init(ConfigFN, DfltCalc);}

References cksPI.

## List()

virtual char * XrdCksWrapper::List | ( | const char * | Xfn,
|  | char * | Buff,
|  | int | Blen,
|  | char | Sep = ' ' )

inline virtual

List names of the checksums associated with a Xfn or all supported ones.

Parameters

  Xfn | The logical or physical file name whose checksum names are to be returned. When Xfn 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.

Returns
  Success: Pointer to Buff holding at least one checksum name. Failure: A nil pointer is returned.

Implements XrdCks.

Definition at line 151 of file XrdCksWrapper.hh.

{return cksPI.List(Xfn, Buff, Blen, Sep);}

References cksPI.

## Name()

virtual const char * XrdCksWrapper::Name | ( | int | seqNum = 0 | ) |

inline 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.

Parameters

  seqNum | The sequence number. Zero signifies the default name. Higher numbers are alternates.

Returns
  Success: Pointer to the name. Failure: A nil pointer is returned (no more alternates exist).

Implements XrdCks.

Definition at line 165 of file XrdCksWrapper.hh.

{return cksPI.Name(seqNum);}

References cksPI.

Referenced by Size().

Here is the caller graph for this function:

## Object()

virtual XrdCksCalc * XrdCksWrapper::Object | ( | const char * | name | ) |

inline virtual

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.

Parameters

  name | The name of the checksum algorithm. If null, use the default one.

Returns
  Success: A pointer to the object is returned. Failure: Zero if no corresponding object exists.

Reimplemented from XrdCks.

Definition at line 180 of file XrdCksWrapper.hh.

{return cksPI.Object(name);}

References cksPI.

## Set()

virtual int XrdCksWrapper::Set | ( | const char * | Xfn,
|  | XrdCksData & | Cks,
|  | int | myTime = 0 )

inline virtual

Set a file's checksum in the extended attributes along with the file's mtime and the time of setting.

Parameters

  Xfn | The logical or 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.

Returns
  Success: zero is returned. Failure: -errno (see significant error numbers below).

Implements XrdCks.

Definition at line 206 of file XrdCksWrapper.hh.

{return cksPI.Set(Xfn, Cks, myTime);}

References cksPI.

## Size()

virtual int XrdCksWrapper::Size | ( | const char * | Name = 0 | ) |

inline virtual

Get the binary length of the checksum with the corresponding name.

Parameters

  Name | The checksum algorithm name. If null, use the default name.

Returns
  Success: checksum length. Failure: Zero if the checksum name does not exist.

Implements XrdCks.

Definition at line 191 of file XrdCksWrapper.hh.

{return cksPI.Size(Name);}
XrdCksWrapper::Name
virtual const char * Name(int seqNum=0)
Definition XrdCksWrapper.hh:165

References cksPI, and Name().

Here is the call graph for this function:

## Ver() [1/2]

virtual int XrdCksWrapper::Ver | ( | const char * | Xfn,
|  | XrdCksData & | Cks )

inline virtual

Retreive the checksum from the Xfn'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.

Parameters

  Xfn | The logical or physical name of the file to be verified.
  Cks | Specifies the checksum name and value.
  pcbP | In the second form, the pointer to the callback object. A nil pointer does not invoke any callback.

Returns
  Success: True Failure: False (the checksums do not match) or -errno indicating that verification could not be performed (see significant error numbers below).

Implements XrdCks.

Definition at line 225 of file XrdCksWrapper.hh.

{return cksPI.Ver(Xfn, Cks);}

References cksPI.

Referenced by Ver().

Here is the caller graph for this function:

## Ver() [2/2]

virtual int XrdCksWrapper::Ver | ( | const char * | Xfn,
|  | XrdCksData & | Cks,
|  | XrdCksPCB * | pcbP )

inline virtual

Reimplemented from XrdCks.

Definition at line 229 of file XrdCksWrapper.hh.

{(void)pcbP; return Ver(Xfn, Cks);}
XrdCksWrapper::Ver
virtual int Ver(const char *Xfn, XrdCksData &Cks)
Definition XrdCksWrapper.hh:225

References Ver().

Here is the call graph for this function:

## Member Data Documentation

## cksPI

XrdCks& XrdCksWrapper::cksPI

protected

Definition at line 250 of file XrdCksWrapper.hh.

Referenced by XrdCksWrapper(), Calc(), Config(), Del(), Get(), Init(), List(), Name(), Object(), Set(), Size(), and Ver().

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

- XrdCksWrapper.hh