Sirikata
Classes | Public Member Functions | Private Member Functions | Private Attributes
Sirikata::HttpServerIDMap Class Reference

A ServerIDMap which looks up servers with Http requests. More...

#include <HttpServerIDMap.hpp>

Inheritance diagram for Sirikata::HttpServerIDMap:
Collaboration diagram for Sirikata::HttpServerIDMap:

List of all members.

Classes

struct  RequestInfo

Public Member Functions

 HttpServerIDMap (Context *ctx, const String &internal_host, const String &internal_service, const String &internal_path, const String &external_host, const String &external_service, const String &external_path, uint32 retries)
virtual ~HttpServerIDMap ()
virtual void lookupInternal (const ServerID &sid, Address4LookupCallback cb)
 Lookup for internal addresses, i.e.
virtual void lookupExternal (const ServerID &sid, Address4LookupCallback cb)
 Lookup for external addresses, i.e.
virtual void lookupRandomExternal (Address4LookupCallback cb)
 Lookup a random external addres, e.g.

Private Member Functions

void startLookup (const RequestInfo &ri, const uint32 retry)
void finishLookup (const RequestInfo &ri, const uint32 retry, Transfer::HttpManager::HttpResponsePtr response, Transfer::HttpManager::ERR_TYPE error, const boost::system::error_code &boost_error)
bool retryOrFail (const RequestInfo &ri, const uint32 retry)

Private Attributes

const String mInternalHost
const String mInternalService
const String mInternalPath
const String mExternalHost
const String mExternalService
const String mExternalPath
const uint32 mRetries

Detailed Description

A ServerIDMap which looks up servers with Http requests.

Currently the implementation does a simple GET request with a query parameter "server" with a numeric value for the server ID to lookup.


Constructor & Destructor Documentation

Sirikata::HttpServerIDMap::HttpServerIDMap ( Context ctx,
const String &  internal_host,
const String &  internal_service,
const String &  internal_path,
const String &  external_host,
const String &  external_service,
const String &  external_path,
uint32  retries 
)
virtual Sirikata::HttpServerIDMap::~HttpServerIDMap ( ) [inline, virtual]

Member Function Documentation

void Sirikata::HttpServerIDMap::finishLookup ( const RequestInfo ri,
const uint32  retry,
Transfer::HttpManager::HttpResponsePtr  response,
Transfer::HttpManager::ERR_TYPE  error,
const boost::system::error_code &  boost_error 
) [private]
void Sirikata::HttpServerIDMap::lookupExternal ( const ServerID &  sid,
Address4LookupCallback  cb 
) [virtual]

Lookup for external addresses, i.e.

those used for object host to space server communication. Returns NullServerID or Address4::Null if the server can't be found.

Implements Sirikata::ServerIDMap.

References mExternalHost, mExternalPath, mExternalService, and startLookup().

void Sirikata::HttpServerIDMap::lookupInternal ( const ServerID &  sid,
Address4LookupCallback  cb 
) [virtual]

Lookup for internal addresses, i.e.

those used for space server to space server communication. Returns NullServerID or Address4::Null if the server can't be found.

Implements Sirikata::ServerIDMap.

References mInternalHost, mInternalPath, mInternalService, and startLookup().

void Sirikata::HttpServerIDMap::lookupRandomExternal ( Address4LookupCallback  cb) [virtual]

Lookup a random external addres, e.g.

to find any node to bootstrap a connection to the space.

Implements Sirikata::ServerIDMap.

References mExternalHost, mExternalPath, mExternalService, and startLookup().

bool Sirikata::HttpServerIDMap::retryOrFail ( const RequestInfo ri,
const uint32  retry 
) [private]
void Sirikata::HttpServerIDMap::startLookup ( const RequestInfo ri,
const uint32  retry 
) [private]

Member Data Documentation

Referenced by lookupInternal().

Referenced by lookupInternal().

Referenced by lookupInternal().

const uint32 Sirikata::HttpServerIDMap::mRetries [private]

Referenced by retryOrFail().


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