CMSDK  2.0.1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
cmlabs::RequestGateway Class Reference
Inheritance diagram for cmlabs::RequestGateway:
cmlabs::Runnable cmlabs::NetworkReceiver

Public Member Functions

 RequestGateway (uint32 id, const char *version=NULL)
bool init (const char *sslCertPath=NULL, const char *sslKeyPath=NULL)
bool setWebServerInfo (const char *name, const char *rootdir, const char *indexfile)
bool setExternalAPILabel (const char *label)
bool setInternalAPILabel (const char *label)
bool setCacheFiles (bool cache)
bool setResponseType (const char *type)
bool setLongRequestLimit (uint32 limit)
bool setExecutorHeartbeatTimeout (uint32 timeout)
bool setQueuingParameters (uint32 maxRequestQueueSize, uint32 maxRequestProcessingSize, uint32 priorityThreshold)
bool addPort (uint16 port, uint8 encryption, bool enableHTTP=false, uint32 timeout=3000)
bool addGateway (uint32 id, std::string addr, uint16 port)
bool addAuthUser (const char *user, const char *password)
bool receiveNetworkEvent (NetworkEvent *evt, NetworkChannel *channel, uint64 conid)
bool receiveMessage (DataMessage *msg, NetworkChannel *channel, uint64 conid)
bool receiveHTTPRequest (HTTPRequest *req, NetworkChannel *channel, uint64 conid)
- Public Member Functions inherited from cmlabs::Runnable
virtual bool stop (uint32 timeout=200)
- Public Member Functions inherited from cmlabs::NetworkReceiver
virtual bool receiveTelnetLine (TelnetLine *line, NetworkChannel *channel, uint64 conid)
virtual bool receiveHTTPReply (HTTPReply *reply, HTTPRequest *req, NetworkChannel *channel, uint64 conid)

Static Public Member Functions

static bool UnitTest ()

Protected Member Functions

bool runExec ()
bool runClient ()
bool callInternalAPI (const char *apiName, HTTPRequest *req, NetworkChannel *channel, uint64 conid)
bool callExternalAPI (const char *apiName, HTTPRequest *req, NetworkChannel *channel, uint64 conid)
bool sendRestartToExecutor (uint64 id)
bool distributeDeadExecutorRequests (std::list< RequestReply *> &shortQueue, std::list< RequestReply *> &longQueue)
uint64 getBestExecutorID (std::string requestString, uint32 reqSize, bool &isLongReq)
bool replyToClient (DataMessage *msg)
bool addToRequestQueue (DataMessage *msg, uint64 origin, uint64 conID, uint64 clientRef)
bool addRequestReplyToRequestQueue (RequestReply *reply)

Protected Attributes

std::map< uint64, RequestConnectionexecutors
std::map< uint64, RequestConnectionclients
std::map< uint64, RequestConnectionwebClients
utils::WaitQueue< RequestReply * > execQ
utils::WaitQueuePointer< DataMessage * > replyQ
std::map< uint64, RequestReply * > requestMap
std::vector< std::string > longReqNames
std::map< std::string, uint64 > httpAuth
utils::Mutex mutex
uint64 systemStartTime
uint32 threadIDClient
uint64 lastRefID
uint64 clientSentCount
uint64 clientReceivedCount
uint64 execSentCount
uint64 execReceivedCount
uint32 id
uint16 port
uint32 longReqLimit
uint32 executorHeartbeatTimeout
uint32 maxRequestQueueSize
uint32 maxRequestProcessingSize
uint32 priorityThreshold
bool sslSupport
bool cacheFiles
bool replyXML
std::string webServerName
std::string rootdir
std::string indexFilename
std::string versionString
std::string internalAPITitle
std::string externalAPITitle
MovingAverage shortAvgStats
MovingAverage longAvgStats
- Protected Attributes inherited from cmlabs::Runnable
uint32 threadID
bool shouldContinue
bool isRunning



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