libzypp 17.37.17
zyppng::ProvideMessage Class Reference

#include <zypp-media/ng/private/providemessage_p.h>

Public Types

using Code = MessageCodes
using FieldVal = HeaderValue

Public Member Functions

 ProvideMessage (const ProvideMessage &)=default
 ProvideMessage (ProvideMessage &&)=default
ProvideMessageoperator= (const ProvideMessage &)=default
ProvideMessageoperator= (ProvideMessage &&)=default
expected< zypp::PluginFrametoStompMessage () const
uint requestId () const
void setRequestId (const uint id)
Code code () const
void setCode (const Code newCode)
const std::vector< ProvideMessage::FieldVal > & values (const std::string_view &str) const
const std::vector< ProvideMessage::FieldVal > & values (const std::string &str) const
const HeaderValueMapheaders () const
FieldVal value (const std::string_view &str, const FieldVal &defaultVal=FieldVal()) const
FieldVal value (const std::string &str, const FieldVal &defaultVal=FieldVal()) const
void setValue (const std::string &name, const FieldVal &value)
void setValue (const std::string_view &name, const FieldVal &value)
void addValue (const std::string &name, const FieldVal &value)
void addValue (const std::string_view &name, const FieldVal &value)

Static Public Member Functions

static expected< ProvideMessagecreate (const zypp::PluginFrame &message)
static expected< ProvideMessagefromStompMessage (const zypp::PluginFrame &msg)
static ProvideMessage createProvideStarted (const uint32_t reqId, const zypp::Url &url, const std::optional< std::string > &localFilename={}, const std::optional< std::string > &stagingFilename={})
static ProvideMessage createProvideFinished (const uint32_t reqId, const std::string &localFilename, bool cacheHit)
static ProvideMessage createAttachFinished (const uint32_t reqId, const std::optional< std::string > &localMountPoint={})
static ProvideMessage createDetachFinished (const uint32_t reqId)
static ProvideMessage createAuthInfo (const uint32_t reqId, const std::string &user, const std::string &pw, int64_t timestamp, const std::map< std::string, std::string > &extraValues={})
static ProvideMessage createMediaChanged (const uint32_t reqId)
static ProvideMessage createRedirect (const uint32_t reqId, const zypp::Url &newUrl)
static ProvideMessage createMetalinkRedir (const uint32_t reqId, const std::vector< zypp::Url > &newUrls)
static ProvideMessage createErrorResponse (const uint32_t reqId, const Code code, const std::string &reason, bool transient=false)
static ProvideMessage createProvide (const uint32_t reqId, const zypp::Url &url, const std::optional< std::string > &filename={}, const std::optional< std::string > &deltaFile={}, const std::optional< int64_t > &expFilesize={}, bool checkExistOnly=false)
static ProvideMessage createCancel (const uint32_t reqId)
static ProvideMessage createAttach (const uint32_t reqId, const zypp::Url &url, const std::string attachId, const std::string &label, const std::optional< std::string > &verifyType={}, const std::optional< std::string > &verifyData={}, const std::optional< int32_t > &mediaNr={})
static ProvideMessage createDetach (const uint32_t reqId, const zypp::Url &attachUrl)
static ProvideMessage createAuthDataRequest (const uint32_t reqId, const zypp::Url &effectiveUrl, const std::string &lastTriedUser="", const std::optional< int64_t > &lastAuthTimestamp={}, const std::map< std::string, std::string > &extraValues={})
static ProvideMessage createMediaChangeRequest (const uint32_t reqId, const std::string &label, int32_t mediaNr, const std::vector< std::string > &devices, const std::optional< std::string > &desc)

Static Public Attributes

static constexpr std::string_view typeName = "ProvideMessage"

Private Member Functions

 ProvideMessage ()

Private Attributes

uint _reqId = -1
Code _code = NoCode
HeaderValueMap _headers

Detailed Description

Definition at line 520 of file providemessage_p.h.

Member Typedef Documentation

◆ Code

Definition at line 523 of file providemessage_p.h.

◆ FieldVal

Constructor & Destructor Documentation

◆ ProvideMessage() [1/3]

zyppng::ProvideMessage::ProvideMessage ( const ProvideMessage & )
default

◆ ProvideMessage() [2/3]

zyppng::ProvideMessage::ProvideMessage ( ProvideMessage && )
default

◆ ProvideMessage() [3/3]

zyppng::ProvideMessage::ProvideMessage ( )
private

Definition at line 144 of file providemessage.cc.

Member Function Documentation

◆ operator=() [1/2]

ProvideMessage & zyppng::ProvideMessage::operator= ( const ProvideMessage & )
default

◆ operator=() [2/2]

ProvideMessage & zyppng::ProvideMessage::operator= ( ProvideMessage && )
default

◆ create()

expected< zyppng::ProvideMessage > zyppng::ProvideMessage::create ( const zypp::PluginFrame & message)
static

Definition at line 147 of file providemessage.cc.

◆ toStompMessage()

expected< zypp::PluginFrame > zyppng::ProvideMessage::toStompMessage ( ) const

Definition at line 430 of file providemessage.cc.

◆ fromStompMessage()

expected< ProvideMessage > zyppng::ProvideMessage::fromStompMessage ( const zypp::PluginFrame & msg)
static

Definition at line 453 of file providemessage.cc.

◆ createProvideStarted()

ProvideMessage zyppng::ProvideMessage::createProvideStarted ( const uint32_t reqId,
const zypp::Url & url,
const std::optional< std::string > & localFilename = {},
const std::optional< std::string > & stagingFilename = {} )
static

Definition at line 458 of file providemessage.cc.

◆ createProvideFinished()

ProvideMessage zyppng::ProvideMessage::createProvideFinished ( const uint32_t reqId,
const std::string & localFilename,
bool cacheHit )
static

Definition at line 472 of file providemessage.cc.

◆ createAttachFinished()

ProvideMessage zyppng::ProvideMessage::createAttachFinished ( const uint32_t reqId,
const std::optional< std::string > & localMountPoint = {} )
static

Definition at line 483 of file providemessage.cc.

◆ createDetachFinished()

ProvideMessage zyppng::ProvideMessage::createDetachFinished ( const uint32_t reqId)
static

Definition at line 495 of file providemessage.cc.

◆ createAuthInfo()

ProvideMessage zyppng::ProvideMessage::createAuthInfo ( const uint32_t reqId,
const std::string & user,
const std::string & pw,
int64_t timestamp,
const std::map< std::string, std::string > & extraValues = {} )
static

Definition at line 504 of file providemessage.cc.

◆ createMediaChanged()

ProvideMessage zyppng::ProvideMessage::createMediaChanged ( const uint32_t reqId)
static

Definition at line 518 of file providemessage.cc.

◆ createRedirect()

ProvideMessage zyppng::ProvideMessage::createRedirect ( const uint32_t reqId,
const zypp::Url & newUrl )
static

Definition at line 527 of file providemessage.cc.

◆ createMetalinkRedir()

ProvideMessage zyppng::ProvideMessage::createMetalinkRedir ( const uint32_t reqId,
const std::vector< zypp::Url > & newUrls )
static

Definition at line 537 of file providemessage.cc.

◆ createErrorResponse()

ProvideMessage zyppng::ProvideMessage::createErrorResponse ( const uint32_t reqId,
const Code code,
const std::string & reason,
bool transient = false )
static

Definition at line 548 of file providemessage.cc.

◆ createProvide()

ProvideMessage zyppng::ProvideMessage::createProvide ( const uint32_t reqId,
const zypp::Url & url,
const std::optional< std::string > & filename = {},
const std::optional< std::string > & deltaFile = {},
const std::optional< int64_t > & expFilesize = {},
bool checkExistOnly = false )
static

Definition at line 560 of file providemessage.cc.

◆ createCancel()

ProvideMessage zyppng::ProvideMessage::createCancel ( const uint32_t reqId)
static

Definition at line 578 of file providemessage.cc.

◆ createAttach()

ProvideMessage zyppng::ProvideMessage::createAttach ( const uint32_t reqId,
const zypp::Url & url,
const std::string attachId,
const std::string & label,
const std::optional< std::string > & verifyType = {},
const std::optional< std::string > & verifyData = {},
const std::optional< int32_t > & mediaNr = {} )
static

Definition at line 587 of file providemessage.cc.

◆ createDetach()

ProvideMessage zyppng::ProvideMessage::createDetach ( const uint32_t reqId,
const zypp::Url & attachUrl )
static

Definition at line 608 of file providemessage.cc.

◆ createAuthDataRequest()

ProvideMessage zyppng::ProvideMessage::createAuthDataRequest ( const uint32_t reqId,
const zypp::Url & effectiveUrl,
const std::string & lastTriedUser = "",
const std::optional< int64_t > & lastAuthTimestamp = {},
const std::map< std::string, std::string > & extraValues = {} )
static

Definition at line 618 of file providemessage.cc.

◆ createMediaChangeRequest()

ProvideMessage zyppng::ProvideMessage::createMediaChangeRequest ( const uint32_t reqId,
const std::string & label,
int32_t mediaNr,
const std::vector< std::string > & devices,
const std::optional< std::string > & desc )
static

Definition at line 632 of file providemessage.cc.

◆ requestId()

uint zyppng::ProvideMessage::requestId ( ) const

Definition at line 647 of file providemessage.cc.

◆ setRequestId()

void zyppng::ProvideMessage::setRequestId ( const uint id)

Definition at line 652 of file providemessage.cc.

◆ code()

ProvideMessage::Code zyppng::ProvideMessage::code ( ) const

Definition at line 657 of file providemessage.cc.

◆ setCode()

void zyppng::ProvideMessage::setCode ( const Code newCode)

Definition at line 662 of file providemessage.cc.

◆ values() [1/2]

const std::vector< ProvideMessage::FieldVal > & zyppng::ProvideMessage::values ( const std::string_view & str) const

Definition at line 667 of file providemessage.cc.

◆ values() [2/2]

const std::vector< ProvideMessage::FieldVal > & zyppng::ProvideMessage::values ( const std::string & str) const

Definition at line 672 of file providemessage.cc.

◆ headers()

const HeaderValueMap & zyppng::ProvideMessage::headers ( ) const

Definition at line 682 of file providemessage.cc.

◆ value() [1/2]

ProvideMessage::FieldVal zyppng::ProvideMessage::value ( const std::string_view & str,
const FieldVal & defaultVal = FieldVal() ) const

Returns the last entry with key str in the list of values or the default value specified in defaultVal

Definition at line 677 of file providemessage.cc.

◆ value() [2/2]

ProvideMessage::FieldVal zyppng::ProvideMessage::value ( const std::string & str,
const FieldVal & defaultVal = FieldVal() ) const

Definition at line 687 of file providemessage.cc.

◆ setValue() [1/2]

void zyppng::ProvideMessage::setValue ( const std::string & name,
const FieldVal & value )

Definition at line 692 of file providemessage.cc.

◆ setValue() [2/2]

void zyppng::ProvideMessage::setValue ( const std::string_view & name,
const FieldVal & value )

Definition at line 697 of file providemessage.cc.

◆ addValue() [1/2]

void zyppng::ProvideMessage::addValue ( const std::string & name,
const FieldVal & value )

Definition at line 702 of file providemessage.cc.

◆ addValue() [2/2]

void zyppng::ProvideMessage::addValue ( const std::string_view & name,
const FieldVal & value )

Definition at line 707 of file providemessage.cc.

Member Data Documentation

◆ typeName

std::string_view zyppng::ProvideMessage::typeName = "ProvideMessage"
staticconstexpr

Definition at line 531 of file providemessage_p.h.

◆ _reqId

uint zyppng::ProvideMessage::_reqId = -1
private

Definition at line 590 of file providemessage_p.h.

◆ _code

Code zyppng::ProvideMessage::_code = NoCode
private

Definition at line 591 of file providemessage_p.h.

◆ _headers

HeaderValueMap zyppng::ProvideMessage::_headers
private

Definition at line 592 of file providemessage_p.h.


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