My Project
Public Member Functions | List of all members
ParaEngine::INPLWebServiceClient Class Referenceabstract

interface of NPL web service client. More...

#include <IParaWebService.h>

Inheritance diagram for ParaEngine::INPLWebServiceClient:
ParaEngine::CNPLNetClient

Public Member Functions

virtual INPLWebServiceGetWebService (const char *sURL)=0
 get the web service interface by its URL, if the web service does not exists it will return NULL, in which case one needs to call OpenWebService()
 
virtual INPLWebServiceOpenWebService (const char *sURL, const char *sUserName, const char *sPassword, const char *sDomain)=0
 open a new web service with optional credentials More...
 
virtual bool CloseWebService (const char *sURL)=0
 close a given web service. More...
 
virtual INPLJabberClientGetJabberClient (const char *sJID)=0
 get an existing jabber client instance interface by its JID. More...
 
virtual INPLJabberClientCreateJabberClient (const char *sJID)=0
 Create a new jabber client instance with the given jabber client ID. More...
 
virtual bool CloseJabberClient (const char *sJID)=0
 close a given jabber client instance. More...
 
virtual void AsyncDownload (const char *url, const char *destFolder, const char *callbackScript, const char *DownloaderName)=0
 Asynchronously download a file from the url. More...
 
virtual void CancelDownload (const char *DownloaderName)=0
 cancel all asynchronous downloads that matches a certain downloader name pattern More...
 
virtual int Download (const char *url, const char *destFolder, const char *callbackScript, const char *DownloaderName)=0
 Synchronous call of the function AsyncDownload(). More...
 
virtual int ProcessResults ()=0
 this function is called once on each frame to polling all results and calling the callbacks in scripting interface More...
 
virtual int ProcessDownloaderResults ()=0
 this function is called once on each frame to polling all results and calling the callbacks in scripting interface More...
 
virtual void DeleteThis ()=0
 delete this object when it is no longer needed. More...
 
virtual bool AppendURLRequest (CURLRequestTask *pUrlTask, const char *sPoolName=NULL)=0
 Append URL request to a pool. More...
 
virtual bool ChangeRequestPoolSize (const char *sPoolName, int nCount)=0
 There is generally no limit to the number of requests sent. More...
 
virtual int ProcessUrlRequests ()=0
 this function is called once on each frame to polling all results and calling the callbacks in scripting interface More...
 

Detailed Description

interface of NPL web service client.

this class is usually implemented by .Net plug-in. See ParaEnginePlugin/NPLWebServiceClient class ID is WEBSERVICECLIENT_CLASS_ID

Member Function Documentation

§ AppendURLRequest()

virtual bool ParaEngine::INPLWebServiceClient::AppendURLRequest ( CURLRequestTask pUrlTask,
const char *  sPoolName = NULL 
)
pure virtual

Append URL request to a pool.

connections in the same pool are reused as much as possible. There is generally no limit to the number of requests sent. However, each pool has a specified maximum number of concurrent worker slots. the default number is 1. One can change this number with ChangeRequestPoolSize.

Parameters
pUrlTaskmust be new CURLRequestTask(), the ownership of the task is transfered to the manager. so the caller should never delete the pointer.
sPoolNamethe request pool name. If the pool does not exist, it will be created. If null, the default pool is used.

Implemented in ParaEngine::CNPLNetClient.

§ AsyncDownload()

virtual void ParaEngine::INPLWebServiceClient::AsyncDownload ( const char *  url,
const char *  destFolder,
const char *  callbackScript,
const char *  DownloaderName 
)
pure virtual

Asynchronously download a file from the url.

Parameters
callbackScriptscript code to be called, a global variable called msg is assigned, as below msg = {DownloadState=""|"complete"|"terminated", totalFileSize=number, currentFileSize=number, PercentDone=number}

Implemented in ParaEngine::CNPLNetClient.

§ CancelDownload()

virtual void ParaEngine::INPLWebServiceClient::CancelDownload ( const char *  DownloaderName)
pure virtual

cancel all asynchronous downloads that matches a certain downloader name pattern

Parameters
DownloaderName:regularexpression. such as "proc1", "proc1.*", ".*"

Implemented in ParaEngine::CNPLNetClient.

§ ChangeRequestPoolSize()

virtual bool ParaEngine::INPLWebServiceClient::ChangeRequestPoolSize ( const char *  sPoolName,
int  nCount 
)
pure virtual

There is generally no limit to the number of requests sent.

However, each pool has a specified maximum number of concurrent worker slots. the default number is 1. One can change this number with this function.

Implemented in ParaEngine::CNPLNetClient.

§ CloseJabberClient()

virtual bool ParaEngine::INPLWebServiceClient::CloseJabberClient ( const char *  sJID)
pure virtual

close a given jabber client instance.

Basically, there is no need to close a web service, unless one wants to reopen it with different credentials

Parameters
sJIDsuch as "lixizhi@paraweb3d.com"

Implemented in ParaEngine::CNPLNetClient.

§ CloseWebService()

virtual bool ParaEngine::INPLWebServiceClient::CloseWebService ( const char *  sURL)
pure virtual

close a given web service.

Basically, there is no need to close a web service, unless one wants to reopen it with different credentials

Implemented in ParaEngine::CNPLNetClient.

§ CreateJabberClient()

virtual INPLJabberClient* ParaEngine::INPLWebServiceClient::CreateJabberClient ( const char *  sJID)
pure virtual

Create a new jabber client instance with the given jabber client ID.

It does not open a connection immediately.

Parameters
sJIDsuch as "lixizhi@paraweb3d.com"

Implemented in ParaEngine::CNPLNetClient.

§ DeleteThis()

virtual void ParaEngine::INPLWebServiceClient::DeleteThis ( )
pure virtual

delete this object when it is no longer needed.

Implemented in ParaEngine::CNPLNetClient.

§ Download()

virtual int ParaEngine::INPLWebServiceClient::Download ( const char *  url,
const char *  destFolder,
const char *  callbackScript,
const char *  DownloaderName 
)
pure virtual

Synchronous call of the function AsyncDownload().

This function will not return until download is complete or an error occurs. this function is rarely used. AsyncDownload() is used.

Returns
:1 if succeed, 0 if fail

Implemented in ParaEngine::CNPLNetClient.

§ GetJabberClient()

virtual INPLJabberClient* ParaEngine::INPLWebServiceClient::GetJabberClient ( const char *  sJID)
pure virtual

get an existing jabber client instance interface by its JID.

If the client is not created using CreateJabberClient() before, function may return NULL.

Parameters
sJIDsuch as "lixizhi@paraweb3d.com"

Implemented in ParaEngine::CNPLNetClient.

§ OpenWebService()

virtual INPLWebService* ParaEngine::INPLWebServiceClient::OpenWebService ( const char *  sURL,
const char *  sUserName,
const char *  sPassword,
const char *  sDomain 
)
pure virtual

open a new web service with optional credentials

Parameters
sURLurl of the web service, such as http://paraengine.com/test.asmx
sUserNamethe user name associated with the credentials
sPasswordthe password for the user name associated with the credentials.
sDomainthe domain or computer name that verifies the credentials

Implemented in ParaEngine::CNPLNetClient.

§ ProcessDownloaderResults()

virtual int ParaEngine::INPLWebServiceClient::ProcessDownloaderResults ( )
pure virtual

this function is called once on each frame to polling all results and calling the callbacks in scripting interface

Note
: this function must be called from the main NPL runtime thread,since it will execute NPL code internally.
Returns
the number of asynchronous download processed are returned.

Implemented in ParaEngine::CNPLNetClient.

§ ProcessResults()

virtual int ParaEngine::INPLWebServiceClient::ProcessResults ( )
pure virtual

this function is called once on each frame to polling all results and calling the callbacks in scripting interface

Note
: this function must be called from the main NPL runtime thread,since it will execute NPL code internally.
Returns
the number of asynchronous messages processed are returned.

Implemented in ParaEngine::CNPLNetClient.

§ ProcessUrlRequests()

virtual int ParaEngine::INPLWebServiceClient::ProcessUrlRequests ( )
pure virtual

this function is called once on each frame to polling all results and calling the callbacks in scripting interface

Note
: this function must be called from the main NPL runtime thread,since it will execute NPL code internally.
Returns
the number of asynchronous messages processed are returned.

Implemented in ParaEngine::CNPLNetClient.


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