ConnectionListener Class Reference

Derived classes can be registered as ConnectionListeners with the Client. More...

#include <connectionlistener.h>

List of all members.

Public Types

enum  ResourceBindError { RB_UNKNOWN_ERROR, RB_BAD_REQUEST, RB_NOT_ALLOWED, RB_CONFLICT }
enum  SessionCreateError { SC_UNKNOWN_ERROR, SC_INTERNAL_SERVER_ERROR, SC_FORBIDDEN, SC_CONFLICT }

Public Member Functions

virtual ~ConnectionListener ()
virtual void onConnect ()=0
virtual void onDisconnect (ConnectionError e)=0
virtual void onResourceBindError (ResourceBindError)
virtual void onSessionCreateError (SessionCreateError)
virtual bool onTLSConnect (const CertInfo &info)=0


Detailed Description

Derived classes can be registered as ConnectionListeners with the Client.

Author:
Jakob Schroeter <js@camaya.net>

Definition at line 25 of file connectionlistener.h.


Member Enumeration Documentation

enum ResourceBindError
 

Describes the possible error conditions for resource binding.

Enumerator:
RB_UNKNOWN_ERROR  An unknown error occured.
RB_BAD_REQUEST  Resource identifier cannot be processed.
RB_NOT_ALLOWED  Client is not allowed to bind a resource.
RB_CONFLICT  Resource identifier is in use.

Definition at line 32 of file connectionlistener.h.

enum SessionCreateError
 

Describes the possible error conditions for session establishemnt.

Enumerator:
SC_UNKNOWN_ERROR  An unknown error occured.
SC_INTERNAL_SERVER_ERROR  Internal server error.
SC_FORBIDDEN  Username or resource not allowed to create session.
SC_CONFLICT  Server informs newly-requested session of resource conflict.

Definition at line 43 of file connectionlistener.h.


Constructor & Destructor Documentation

virtual ~ConnectionListener  )  [inline, virtual]
 

Virtual Destructor.

Definition at line 55 of file connectionlistener.h.


Member Function Documentation

virtual void onConnect  )  [pure virtual]
 

This function notifies about successful connections. It will be called either after all authentication is finished if username/password were supplied, or after a connection has been established if no credentials were supplied. Depending on the setting of AutoPresence, a presence stanza is sent or not.

virtual void onDisconnect ConnectionError  e  )  [pure virtual]
 

This function notifies about disconnection and its reason. If e indicates a stream error, you can use ClientBase::streamError() to find out what exactly went wrong, and ClientBase::streamErrorText() to retrieve any explaining text sent along with the error. If e indicates an authentication error, you can use ClientBase::authError() to get a finer grained reason.

Parameters:
e The reason for the disconnection.

virtual void onResourceBindError ResourceBindError   )  [inline, virtual]
 

This function is called (by a Client object) if an error occurs while trying to bind a resource.

Parameters:
error Describes the error condition.

Definition at line 80 of file connectionlistener.h.

virtual void onSessionCreateError SessionCreateError   )  [inline, virtual]
 

This function is called (by a Client object) if an error occurs while trying to establish a session.

Parameters:
error Describes the error condition.

Definition at line 87 of file connectionlistener.h.

virtual bool onTLSConnect const CertInfo info  )  [pure virtual]
 

This function is called when the connection was TLS/SSL secured.

Parameters:
info Comprehensive info on the certificate.
Returns:
True if cert credentials are accepted, false otherwise. If false is returned the connection is terminated.


The documentation for this class was generated from the following file:
Generated on Mon Jan 16 16:19:57 2006 for gloox by  doxygen 1.4.6