libmusicbrainz3  3.0.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
MusicBrainz::IWebService Class Referenceabstract

An interface all concrete web service classes have to implement. More...

Inheritance diagram for MusicBrainz::IWebService:
MusicBrainz::WebService

Public Member Functions

virtual ~IWebService ()
 
virtual std::string get (const std::string &entity, const std::string &id, const IIncludes::IncludeList &include, const IFilter::ParameterList &filter, const std::string &version="1")=0
 Query the web service. More...
 
virtual void post (const std::string &entity, const std::string &id, const std::string &data, const std::string &version="1")=0
 Submit data to the web service. More...
 

Detailed Description

An interface all concrete web service classes have to implement.

All web service classes have to implement this and follow the method specifications.

Constructor & Destructor Documentation

virtual MusicBrainz::IWebService::~IWebService ( )
inlinevirtual

Member Function Documentation

virtual std::string MusicBrainz::IWebService::get ( const std::string &  entity,
const std::string &  id,
const IIncludes::IncludeList include,
const IFilter::ParameterList filter,
const std::string &  version = "1" 
)
pure virtual

Query the web service.

Using this method, you can either get a resource by id (using the id parameter, or perform a query on all resources of a type.

The filter and the id parameter exclude each other. If you are using a filter, you may not set id and vice versa.

Returns a file-like object containing the result or raises a WebServiceError or one of its subclasses in case of an error. Which one is used depends on the implementing class.

Parameters
entitya string containing the entity's name
ida string containing a UUID, or the empty string
includea tuple containing values for the 'inc' parameter
filterparameters, depending on the entity
versiona string containing the web service version to use
Returns
a string contaning the returned data
Exceptions
WebServiceError,:in case of errors

Implemented in MusicBrainz::WebService.

virtual void MusicBrainz::IWebService::post ( const std::string &  entity,
const std::string &  id,
const std::string &  data,
const std::string &  version = "1" 
)
pure virtual

Submit data to the web service.

Parameters
entitya string containing the entity's name
ida string containing a UUID, or the empty string
dataa string containing the data to post
versiona string containing the web service version to use
Exceptions
WebServiceErrorin case of errors

Implemented in MusicBrainz::WebService.