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

NPL interface of a Jabber-XMPP client proxy. More...

#include <IParaWebService.h>

Inheritance diagram for ParaEngine::INPLJabberClient:
ParaEngine::CNPLJabberClient

Public Member Functions

virtual void SetUser (const char *User)=0
 The username to connect as. More...
 
virtual const char * GetUser ()=0
 The username to connect as. More...
 
virtual void SetPriority (int nPriority)=0
 Priority for this connection. More...
 
virtual int GetPriority ()=0
 Priority for this connection. More...
 
virtual void SetPassword (const char *Password)=0
 The password to use for connecting. More...
 
virtual const char * GetPassword ()=0
 The password to use for connecting. More...
 
virtual void SetAutoLogin (bool AutoLogin)=0
 Automatically log in on connection. More...
 
virtual bool GetAutoLogin ()=0
 Automatically log in on connection. More...
 
virtual void SetAutoRoster (bool AutoRoster)=0
 Automatically retrieve roster on connection. More...
 
virtual bool GetAutoRoster ()=0
 Automatically retrieve roster on connection. More...
 
virtual void SetAutoIQErrors (bool AutoIQErrors)=0
 Automatically send back 501/feature-not-implemented to IQs that have not been handled. More...
 
virtual bool GetAutoIQErrors ()=0
 Automatically send back 501/feature-not-implemented to IQs that have not been handled. More...
 
virtual void SetAutoPresence (bool AutoPresence)=0
 Automatically send presence on connection. More...
 
virtual bool GetAutoPresence ()=0
 Automatically send presence on connection. More...
 
virtual void SetResource (const char *Resource)=0
 The connecting resource. More...
 
virtual const char * GetResource ()=0
 The connecting resource. More...
 
virtual void SetIsAuthenticated (bool IsAuthenticated)=0
 Are we currently connected?
 
virtual bool GetIsAuthenticated ()=0
 Are we currently connected?
 
virtual void SetServer (const char *Server)=0
 The name of the server to connect to. More...
 
virtual const char * GetServer ()=0
 The name of the server to connect to. More...
 
virtual void SetNetworkHost (const char *NetworkHost)=0
 The address to use on the "to" attribute of the stream:stream. More...
 
virtual const char * GetNetworkHost ()=0
 The address to use on the "to" attribute of the stream:stream. More...
 
virtual void SetPort (int Port)=0
 Automatically send presence on connection. More...
 
virtual int GetPort ()=0
 The TCP port to connect to. More...
 
virtual void SetPlaintextAuth (bool PlaintextAuth)=0
 Allow plaintext authentication? default to false.
 
virtual bool GetPlaintextAuth ()=0
 Allow plaintext authentication? default to false.
 
virtual bool IsSSLon ()=0
 Is the current connection SSL/TLS protected?
 
virtual bool IsCompressionOn ()=0
 Is the current connection XEP-138 compressed?
 
virtual void SetSSL (bool SSL)=0
 Do SSL3/TLS1 on startup.
 
virtual bool GetSSL ()=0
 Do SSL3/TLS1 on startup.
 
virtual void SetAutoStartTLS (bool AutoStartTLS)=0
 Allow Start-TLS on connection, if the server supports it.
 
virtual bool GetAutoStartTLS ()=0
 Allow Start-TLS on connection, if the server supports it.
 
virtual void SetAutoStartCompression (bool AutoStartCompression)=0
 Allow start compression on connection, if the server supports it.
 
virtual bool GetAutoStartCompression ()=0
 Allow start compression on connection, if the server supports it.
 
virtual void SetKeepAlive (float KeepAlive)=0
 Time, in seconds, between keep-alive spaces. More...
 
virtual float GetKeepAlive ()=0
 Time, in seconds, between keep-alive spaces. More...
 
virtual void SetAutoReconnect (float AutoReconnect)=0
 Seconds before automatically reconnecting if the connection drops. More...
 
virtual float GetAutoReconnect ()=0
 Seconds before automatically reconnecting if the connection drops. More...
 
virtual const char * GetServerVersion ()=0
 The version string returned in the server's open stream element. More...
 
virtual void SetRequiresSASL (bool RequiresSASL)=0
 Is SASL required? This will default to true in the future. More...
 
virtual bool GetRequiresSASL ()=0
 Is SASL required? This will default to true in the future. More...
 
virtual bool Connect ()=0
 Connect to the server. More...
 
virtual void Close ()=0
 Close down the connection, as gracefully as possible. More...
 
virtual bool WriteNPLMessage (const char *to, const char *neuronfile, const char *sCode)=0
 Send a NPL message. More...
 
virtual bool WriteRawString (const char *rawstring)=0
 Send raw string. More...
 
virtual bool Login ()=0
 Initiate the auth process. More...
 
virtual bool SetPresence (int t, const char *status, const char *show, int priority)=0
 / Send a presence packet to the server /

Parameters
tWhat kind? public enum PresenceType { / None specified available = -1, / May I subscribe to you? subscribe, / Yes, you may subscribe.
More...
 
virtual bool SendMessage (int t, const char *to, const char *body)=0
 / Send a message packet to another user /

Parameters
tWhat kind? public enum MessageType { / Normal message normal = -1, / Error message error, / Chat (one-to-one) message chat, / Groupchat groupchat, / Headline headline }

/

Parameters
toWho to send it to?

/

Parameters
bodyThe message.
More...
 
virtual bool SendMessage (const char *to, const char *body)=0
 Send a message packet to another user

Parameters
toWho to send it to?
bodyThe message.
More...
 
virtual const char * GetRoster ()=0
 Request a new copy of the roster. More...
 
virtual bool Subscribe (const char *to, const char *nickname, const char *groups, const char *msg)=0
 
      in Jabber, a contact list is called a roster

/ Send a presence subscription request and update the roster for a new roster contact. More...

 
virtual void Unsubscribe (const char *to, const char *msg)=0
 
      in Jabber, a contact list is called a roster

/ Remove an item from the roster. More...

 
virtual void RemoveRosterItem (const char *to, const char *msg)=0
 
virtual bool AllowSubscription (const char *to, bool bAllow)=0
 this function is called in OnSubscription method to confirm or refuse a subscription request from another user. More...
 
virtual void GetAgents ()=0
 Request a list of agents from the server.
 
virtual bool Register (const char *jid)=0
 Attempt to register a new user. More...
 
virtual const char * GetRosterItemDetail (const char *jid)=0
 Retrieve details of a given roster item. More...
 
virtual const char * GetRosterGroups ()=0
 The group names for the roster as a string. More...
 
virtual const char * GetRosterItems ()=0
 The Roster Item names as a string. More...
 
virtual void RegisterCreateAccount (const char *username, const char *password)=0
 to create an account: More...
 
virtual void RegisterChangePassword (const char *password)=0
 to change an account's password: More...
 
virtual void RegisterRemoveAccount ()=0
 to delete an account: More...
 
virtual StatisticsJabber GetStatistics ()=0
 Returns a StatisticsJabber containing byte and stanza counts for the current active connection. More...
 
virtual void AddEventListener (int nListenerType, const char *callbackScript)=0
 add a NPL call back script to a given even listener More...
 
virtual void AddEventListener1 (const char *sListenerType, const char *callbackScript)=0
 
virtual void RemoveEventListener (int nListenerType, const char *callbackScript)=0
 remove a NPL call back script from a given even listener More...
 
virtual void RemoveEventListener1 (const char *sListenerType, const char *callbackScript)=0
 
virtual void ClearEventListener (int nListenerType)=0
 clear all NPL call back script from a given even listener More...
 
virtual void ClearEventListener1 (const char *sListenerType)=0
 
virtual void ResetAllEventListeners ()=0
 clear all registered event listeners More...
 

Detailed Description

NPL interface of a Jabber-XMPP client proxy.

Member Function Documentation

§ AddEventListener()

virtual void ParaEngine::INPLJabberClient::AddEventListener ( int  nListenerType,
const char *  callbackScript 
)
pure virtual

add a NPL call back script to a given even listener

Parameters
nListenerTypetype of message listener. The user can register NPL callback script with any one listener type.
callbackScriptthe script to be called when the listener event is raised. Usually parameters are stored in a NPL parameter called "msg".

Implemented in ParaEngine::CNPLJabberClient.

§ AllowSubscription()

virtual bool ParaEngine::INPLJabberClient::AllowSubscription ( const char *  to,
bool  bAllow 
)
pure virtual

this function is called in OnSubscription method to confirm or refuse a subscription request from another user.

Parameters
tothe JID
bAllowtrue to allow subscription, false to deny

Implemented in ParaEngine::CNPLJabberClient.

§ ClearEventListener()

virtual void ParaEngine::INPLJabberClient::ClearEventListener ( int  nListenerType)
pure virtual

clear all NPL call back script from a given even listener

Parameters
nListenerTypetype of message listener. The user can register NPL callback script with any one listener type.

Implemented in ParaEngine::CNPLJabberClient.

§ Close()

virtual void ParaEngine::INPLJabberClient::Close ( )
pure virtual

Close down the connection, as gracefully as possible.

Implemented in ParaEngine::CNPLJabberClient.

§ Connect()

virtual bool ParaEngine::INPLJabberClient::Connect ( )
pure virtual

Connect to the server.

This happens asynchronously, and could take a couple of seconds to get the full handshake completed. This will auth, send presence, and request roster info, if the Auto* properties are set.

Implemented in ParaEngine::CNPLJabberClient.

§ GetAutoIQErrors()

virtual bool ParaEngine::INPLJabberClient::GetAutoIQErrors ( )
pure virtual

Automatically send back 501/feature-not-implemented to IQs that have not been handled.

Implemented in ParaEngine::CNPLJabberClient.

§ GetAutoLogin()

virtual bool ParaEngine::INPLJabberClient::GetAutoLogin ( )
pure virtual

Automatically log in on connection.

Implemented in ParaEngine::CNPLJabberClient.

§ GetAutoPresence()

virtual bool ParaEngine::INPLJabberClient::GetAutoPresence ( )
pure virtual

Automatically send presence on connection.

Implemented in ParaEngine::CNPLJabberClient.

§ GetAutoReconnect()

virtual float ParaEngine::INPLJabberClient::GetAutoReconnect ( )
pure virtual

Seconds before automatically reconnecting if the connection drops.

-1 to disable, 0 for immediate. Default to 30 seconds

Implemented in ParaEngine::CNPLJabberClient.

§ GetAutoRoster()

virtual bool ParaEngine::INPLJabberClient::GetAutoRoster ( )
pure virtual

Automatically retrieve roster on connection.

Implemented in ParaEngine::CNPLJabberClient.

§ GetKeepAlive()

virtual float ParaEngine::INPLJabberClient::GetKeepAlive ( )
pure virtual

Time, in seconds, between keep-alive spaces.

default to 20f

Implemented in ParaEngine::CNPLJabberClient.

§ GetNetworkHost()

virtual const char* ParaEngine::INPLJabberClient::GetNetworkHost ( )
pure virtual

The address to use on the "to" attribute of the stream:stream.

/ You can put the network hostname or IP address of the server to connect to. / If none is specified, the Server will be used. / Eventually, when SRV is supported, this will be deprecated.

Implemented in ParaEngine::CNPLJabberClient.

§ GetPassword()

virtual const char* ParaEngine::INPLJabberClient::GetPassword ( )
pure virtual

The password to use for connecting.

This may be sent across the wire plaintext, if the server doesn't support digest and PlaintextAuth is true.

Implemented in ParaEngine::CNPLJabberClient.

§ GetPort()

virtual int ParaEngine::INPLJabberClient::GetPort ( )
pure virtual

The TCP port to connect to.

default to 5222

Implemented in ParaEngine::CNPLJabberClient.

§ GetPriority()

virtual int ParaEngine::INPLJabberClient::GetPriority ( )
pure virtual

Priority for this connection.

Implemented in ParaEngine::CNPLJabberClient.

§ GetRequiresSASL()

virtual bool ParaEngine::INPLJabberClient::GetRequiresSASL ( )
pure virtual

Is SASL required? This will default to true in the future.

Implemented in ParaEngine::CNPLJabberClient.

§ GetResource()

virtual const char* ParaEngine::INPLJabberClient::GetResource ( )
pure virtual

The connecting resource.

Used to identify a unique connection.

Implemented in ParaEngine::CNPLJabberClient.

§ GetRoster()

virtual const char* ParaEngine::INPLJabberClient::GetRoster ( )
pure virtual

Request a new copy of the roster.

Implemented in ParaEngine::CNPLJabberClient.

§ GetRosterGroups()

virtual const char* ParaEngine::INPLJabberClient::GetRosterGroups ( )
pure virtual

The group names for the roster as a string.

each group name is separated by ; such as "general;friends;relatives;"

Implemented in ParaEngine::CNPLJabberClient.

§ GetRosterItemDetail()

virtual const char* ParaEngine::INPLJabberClient::GetRosterItemDetail ( const char *  jid)
pure virtual

Retrieve details of a given roster item.

Parameters
jid
Returns
null or string. the string is an NPL table of the following format "{ [1]={text=[[NickName(status)]], presence=number,groupname=[[name]]}, [2]=...}" Usually a roster item only belongs to one group. so the table usually contains only one item at index 1.

Implemented in ParaEngine::CNPLJabberClient.

§ GetRosterItems()

virtual const char* ParaEngine::INPLJabberClient::GetRosterItems ( )
pure virtual

The Roster Item names as a string.

each name is separated by ; such as "Xizhi;Andy;Clayman;"

Implemented in ParaEngine::CNPLJabberClient.

§ GetServer()

virtual const char* ParaEngine::INPLJabberClient::GetServer ( )
pure virtual

The name of the server to connect to.

Implemented in ParaEngine::CNPLJabberClient.

§ GetServerVersion()

virtual const char* ParaEngine::INPLJabberClient::GetServerVersion ( )
pure virtual

The version string returned in the server's open stream element.

Implemented in ParaEngine::CNPLJabberClient.

§ GetStatistics()

virtual StatisticsJabber ParaEngine::INPLJabberClient::GetStatistics ( )
pure virtual

Returns a StatisticsJabber containing byte and stanza counts for the current active connection.

Returns
: a struct containing the current connection's statistics.

Implemented in ParaEngine::CNPLJabberClient.

§ GetUser()

virtual const char* ParaEngine::INPLJabberClient::GetUser ( )
pure virtual

The username to connect as.

Implemented in ParaEngine::CNPLJabberClient.

§ Login()

virtual bool ParaEngine::INPLJabberClient::Login ( )
pure virtual

Initiate the auth process.

Implemented in ParaEngine::CNPLJabberClient.

§ Register()

virtual bool ParaEngine::INPLJabberClient::Register ( const char *  jid)
pure virtual

Attempt to register a new user.

This will fire OnRegisterInfo to retrieve information about the new user, and OnRegistered when the registration is complete or failed.

Parameters
jidThe user to register

Implemented in ParaEngine::CNPLJabberClient.

§ RegisterChangePassword()

virtual void ParaEngine::INPLJabberClient::RegisterChangePassword ( const char *  password)
pure virtual

to change an account's password:

  • connect to the server as usual
  • in onConnect() or at any later time call Registration::changePassword()

Implemented in ParaEngine::CNPLJabberClient.

§ RegisterCreateAccount()

virtual void ParaEngine::INPLJabberClient::RegisterCreateAccount ( const char *  username,
const char *  password 
)
pure virtual

to create an account:

  • create the Client instance by passing it the server only, e.g. j = new Client( "example.net" );
  • in onConnect() (or some similar place) call Registration::fetchRegistrationFields()
  • in RegistrationHandler::handleRegistrationFields() set up an RegistrationFields struct with the desired username/password and call Registration::createAccount()

Implemented in ParaEngine::CNPLJabberClient.

§ RegisterRemoveAccount()

virtual void ParaEngine::INPLJabberClient::RegisterRemoveAccount ( )
pure virtual

to delete an account:

  • connect to teh server as usual
  • in onConnect() or at any later time call Registration::removeAccount()

Implemented in ParaEngine::CNPLJabberClient.

§ RemoveEventListener()

virtual void ParaEngine::INPLJabberClient::RemoveEventListener ( int  nListenerType,
const char *  callbackScript 
)
pure virtual

remove a NPL call back script from a given even listener

Parameters
nListenerTypetype of message listener. The user can register NPL callback script with any one listener type.
callbackScriptthe script to be called when the listener event is raised. Usually parameters are stored in a NPL parameter called "msg".

Implemented in ParaEngine::CNPLJabberClient.

§ ResetAllEventListeners()

virtual void ParaEngine::INPLJabberClient::ResetAllEventListeners ( )
pure virtual

clear all registered event listeners

Implemented in ParaEngine::CNPLJabberClient.

§ SendMessage() [1/2]

virtual bool ParaEngine::INPLJabberClient::SendMessage ( int  t,
const char *  to,
const char *  body 
)
pure virtual

/ Send a message packet to another user /

Parameters
tWhat kind? public enum MessageType { / Normal message normal = -1, / Error message error, / Chat (one-to-one) message chat, / Groupchat groupchat, / Headline headline }

/

Parameters
toWho to send it to?

/

Parameters
bodyThe message.

Implemented in ParaEngine::CNPLJabberClient.

§ SendMessage() [2/2]

virtual bool ParaEngine::INPLJabberClient::SendMessage ( const char *  to,
const char *  body 
)
pure virtual

Send a message packet to another user

Parameters
toWho to send it to?
bodyThe message.

Implemented in ParaEngine::CNPLJabberClient.

§ SetAutoIQErrors()

virtual void ParaEngine::INPLJabberClient::SetAutoIQErrors ( bool  AutoIQErrors)
pure virtual

Automatically send back 501/feature-not-implemented to IQs that have not been handled.

Implemented in ParaEngine::CNPLJabberClient.

§ SetAutoLogin()

virtual void ParaEngine::INPLJabberClient::SetAutoLogin ( bool  AutoLogin)
pure virtual

Automatically log in on connection.

Implemented in ParaEngine::CNPLJabberClient.

§ SetAutoPresence()

virtual void ParaEngine::INPLJabberClient::SetAutoPresence ( bool  AutoPresence)
pure virtual

Automatically send presence on connection.

Implemented in ParaEngine::CNPLJabberClient.

§ SetAutoReconnect()

virtual void ParaEngine::INPLJabberClient::SetAutoReconnect ( float  AutoReconnect)
pure virtual

Seconds before automatically reconnecting if the connection drops.

-1 to disable, 0 for immediate. Default to 30 seconds

Implemented in ParaEngine::CNPLJabberClient.

§ SetAutoRoster()

virtual void ParaEngine::INPLJabberClient::SetAutoRoster ( bool  AutoRoster)
pure virtual

Automatically retrieve roster on connection.

Implemented in ParaEngine::CNPLJabberClient.

§ SetKeepAlive()

virtual void ParaEngine::INPLJabberClient::SetKeepAlive ( float  KeepAlive)
pure virtual

Time, in seconds, between keep-alive spaces.

default to 20f

Implemented in ParaEngine::CNPLJabberClient.

§ SetNetworkHost()

virtual void ParaEngine::INPLJabberClient::SetNetworkHost ( const char *  NetworkHost)
pure virtual

The address to use on the "to" attribute of the stream:stream.

/ You can put the network hostname or IP address of the server to connect to. / If none is specified, the Server will be used. / Eventually, when SRV is supported, this will be deprecated.

Implemented in ParaEngine::CNPLJabberClient.

§ SetPassword()

virtual void ParaEngine::INPLJabberClient::SetPassword ( const char *  Password)
pure virtual

The password to use for connecting.

This may be sent across the wire plaintext, if the server doesn't support digest and PlaintextAuth is true.

Implemented in ParaEngine::CNPLJabberClient.

§ SetPort()

virtual void ParaEngine::INPLJabberClient::SetPort ( int  Port)
pure virtual

Automatically send presence on connection.

Implemented in ParaEngine::CNPLJabberClient.

§ SetPresence()

virtual bool ParaEngine::INPLJabberClient::SetPresence ( int  t,
const char *  status,
const char *  show,
int  priority 
)
pure virtual

/ Send a presence packet to the server /

Parameters
tWhat kind? public enum PresenceType { / None specified available = -1, / May I subscribe to you? subscribe, / Yes, you may subscribe.

subscribed, / Unsubscribe from this entity. unsubscribe, / No, you may not subscribe. unsubscribed, / Offline unavailable, / server-side only. probe, / A presence error. error, / Invisible presence: we're unavailable to them, but still see theirs. invisible }

/

Parameters
statusHow to show us?

/

Parameters
showaway, dnd, etc.

/

Parameters
priorityHow to prioritize this connection. / Higher number mean higher priority. 0 minumum, 127 max. / -1 means this is a presence-only connection.

Implemented in ParaEngine::CNPLJabberClient.

§ SetPriority()

virtual void ParaEngine::INPLJabberClient::SetPriority ( int  nPriority)
pure virtual

Priority for this connection.

Implemented in ParaEngine::CNPLJabberClient.

§ SetRequiresSASL()

virtual void ParaEngine::INPLJabberClient::SetRequiresSASL ( bool  RequiresSASL)
pure virtual

Is SASL required? This will default to true in the future.

Implemented in ParaEngine::CNPLJabberClient.

§ SetResource()

virtual void ParaEngine::INPLJabberClient::SetResource ( const char *  Resource)
pure virtual

The connecting resource.

Used to identify a unique connection.

Implemented in ParaEngine::CNPLJabberClient.

§ SetServer()

virtual void ParaEngine::INPLJabberClient::SetServer ( const char *  Server)
pure virtual

The name of the server to connect to.

Implemented in ParaEngine::CNPLJabberClient.

§ SetUser()

virtual void ParaEngine::INPLJabberClient::SetUser ( const char *  User)
pure virtual

The username to connect as.

Implemented in ParaEngine::CNPLJabberClient.

§ Subscribe()

virtual bool ParaEngine::INPLJabberClient::Subscribe ( const char *  to,
const char *  nickname,
const char *  groups,
const char *  msg 
)
pure virtual

      in Jabber, a contact list is called a roster

/ Send a presence subscription request and update the roster for a new roster contact.

/

Parameters
toThe JID of the contact (required)

/

Parameters
nicknameThe nickname to show for the user.

/

Parameters
groupsA list of groups to put the contact in. Groups are separated by ';'. May be null. Hint: "foo;bar;" or "foo"

Implemented in ParaEngine::CNPLJabberClient.

§ Unsubscribe()

virtual void ParaEngine::INPLJabberClient::Unsubscribe ( const char *  to,
const char *  msg 
)
pure virtual

      in Jabber, a contact list is called a roster

/ Remove an item from the roster.

/ This will have the side-effect of bi-directionally unsubscribing to/from the user. /

Parameters
toThe JID to remove

Implemented in ParaEngine::CNPLJabberClient.

§ WriteNPLMessage()

virtual bool ParaEngine::INPLJabberClient::WriteNPLMessage ( const char *  to,
const char *  neuronfile,
const char *  sCode 
)
pure virtual

Send a NPL message.

Parameters
msga NPL table converted to secure code.

Implemented in ParaEngine::CNPLJabberClient.

§ WriteRawString()

virtual bool ParaEngine::INPLJabberClient::WriteRawString ( const char *  rawstring)
pure virtual

Send raw string.

Implemented in ParaEngine::CNPLJabberClient.


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