Google APIs Client Library for C++
ClientService Class Reference

Base class for denoting a cloud service. More...

#include "client/service/client_service.h"

List of all members.

Public Member Functions

 ClientService (const StringPiece &root_url, const StringPiece &service_path, HttpTransport *transport)
 Constructs a service instance acting as a proxy to a given service endpoint.
virtual ~ClientService ()
 Standard destructor.
const StringPiece & url_root () const
 Returns the bound url_root attribute.
const StringPiece & url_path () const
 Returns the bound url_path attribute.
const string & service_url () const
 Returns the complete url to the service.
void ChangeServiceUrl (const StringPiece &url_root, const StringPiece &url_path)
 Allows you to change the service_url.
HttpTransporttransport () const
 Returns the transport instance bound in the constructor.

Detailed Description

Base class for denoting a cloud service.

A ClientService is a proxy to some service endpoint in the cloud. It acts as a Facade to a particular service and Factory for specific ClientServiceRequest instances to make requests of specific service interfaces. There are no service methods common across all services so the base class has an empty Facade and no requests to provide a factory for. The specialized subclasses are more interesting with regard to these roles.


Constructor & Destructor Documentation

ClientService ( const StringPiece &  root_url,
const StringPiece &  service_path,
HttpTransport transport 
)

Constructs a service instance acting as a proxy to a given service endpoint.

Parameters:
[in]root_urlThe root_url to access the given service. Usually this is for the webserver that is hosting the service.
[in]service_pathThe additional path to append to the url to get at the particular service.
[in]transportA transport instance to use when sending requests to the service. The service instance will take ownership of the transport.
virtual ~ClientService ( ) [virtual]

Standard destructor.


Member Function Documentation

void ChangeServiceUrl ( const StringPiece &  url_root,
const StringPiece &  url_path 
)

Allows you to change the service_url.

This method is intended as a hook to change the service_url location from the default constructor, especially of specialized services that might be created elsewhere. It is intended to point to a different instance or location, such as for testing or staging.

If you are going to change the URL, you should do so before you start creating requests to send to it.

Parameters:
[in]url_rootThe root url for the web server.
[in]url_paththe path in the root_url for the service. The service_url will be JoinPath(url_root,url_path)
const string& service_url ( ) const [inline]

Returns the complete url to the service.

Returns:
url_root + url_path
HttpTransport* transport ( ) const [inline]

Returns the transport instance bound in the constructor.

const StringPiece& url_path ( ) const [inline]

Returns the bound url_path attribute.

const StringPiece& url_root ( ) const [inline]

Returns the bound url_root attribute.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines