#include <Notes.h>

Inheritance diagram for Note:
Collaboration diagram for Note:

Classes

class  Value
 Stores a value for the note. More...
 

Public Types

typedef RefCount< NotePointer
 
typedef std::vector< Value::PointerValues
 

Public Member Functions

 Note (const char *aKey, const size_t keyLen)
 
 Note (const SBuf aKey)
 
 Note (const Note &)=delete
 
Noteoperator= (const Note &)=delete
 
Value::Pointer addValue (const char *value, const bool quoted, const char *descr, const Value::Method m=Value::mhAppend)
 
bool match (HttpRequest *request, HttpReply *reply, const AccessLogEntryPointer &al, SBuf &matched)
 
const SBufkey () const
 
void updateNotePairs (NotePairsPointer pairs, const CharacterSet *delimiters, const AccessLogEntryPointer &al)
 
void printAsNoteDirective (StoreEntry *, const char *directiveName) const
 Prints key and value(s) using a "note" directive format (including directive name). More...
 
void printAsAnnotationAclParameters (std::ostream &) const
 

Private Attributes

SBuf theKey
 The note key. More...
 
Values values
 The possible values list for the note. More...
 

Detailed Description

Used to store a note configuration. The notes are custom key:value pairs ICAP request headers or ECAP options used to pass custom transaction-state related meta information to squid internal subsystems or to adaptation services.

Definition at line 37 of file Notes.h.

Member Typedef Documentation

◆ Pointer

Definition at line 40 of file Notes.h.

◆ Values

Definition at line 75 of file Notes.h.

Constructor & Destructor Documentation

◆ Note() [1/3]

Note::Note ( const char *  aKey,
const size_t  keyLen 
)
inline

Definition at line 77 of file Notes.h.

◆ Note() [2/3]

Note::Note ( const SBuf  aKey)
inlineexplicit

Definition at line 78 of file Notes.h.

◆ Note() [3/3]

Note::Note ( const Note )
delete

Member Function Documentation

◆ addValue()

Note::Value::Pointer Note::addValue ( const char *  value,
const bool  quoted,
const char *  descr,
const Value::Method  m = Value::mhAppend 
)

Adds a value to the note and returns a pointer to the related Value object.

Definition at line 63 of file Notes.cc.

References values.

◆ key()

const SBuf& Note::key ( ) const
inline

Definition at line 92 of file Notes.h.

References theKey.

Referenced by printAsAnnotationAclParameters(), printAsNoteDirective(), and updateNotePairs().

◆ match()

bool Note::match ( HttpRequest request,
HttpReply reply,
const AccessLogEntryPointer al,
SBuf matched 
)

Walks through the possible values list of the note, selects the first value, matching the given HttpRequest and HttpReply and assigns the given 'matched' to it.

Returns
true if matched, false otherwise

Definition at line 70 of file Notes.cc.

References assert, SBuf::clear(), debugs, ACLChecklist::fastCheck(), ACLFilledChecklist::syncAle(), theKey, ACLFilledChecklist::updateAle(), ACLFilledChecklist::updateReply(), and values.

◆ operator=()

Note& Note::operator= ( const Note )
delete

◆ printAsAnnotationAclParameters()

void Note::printAsAnnotationAclParameters ( std::ostream &  os) const

Prints using "annotate_transaction acl parameter" format, one key=value or key+=value parameter per stored value.

Definition at line 126 of file Notes.cc.

References key(), Note::Value::mhReplace, and values.

◆ printAsNoteDirective()

void Note::printAsNoteDirective ( StoreEntry entry,
const char *  directiveName 
) const

◆ updateNotePairs()

void Note::updateNotePairs ( NotePairsPointer  pairs,
const CharacterSet delimiters,
const AccessLogEntryPointer al 
)

Member Data Documentation

◆ theKey

SBuf Note::theKey
private

Definition at line 103 of file Notes.h.

Referenced by key(), match(), and updateNotePairs().

◆ values

Values Note::values
private

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

 

Introduction

Documentation

Support

Miscellaneous