#include <configmanager.h>
Public Member Functions |
| ConfigManager (const gloox::LogSink &_logInstance) |
virtual | ~ConfigManager () |
void | registerConfigHandler (ConfigHandler *ch) |
void | registerServerEventHandler (ServerEventHandler *seh) |
void | bindDomain (const std::string &domain, const std::string &interface=gloox::EmptyString, unsigned short port=5222) |
void | unbindDomain (const std::string &domain, const std::string &interface=gloox::EmptyString, unsigned short port=5222) |
bool | addC2SInterface (const std::string &interface=gloox::EmptyString, unsigned short port=5222) |
bool | removeC2SInterface (const std::string &interface=gloox::EmptyString, unsigned short port=5222) |
void | rebind () |
void | shutdown () |
virtual bool | checkDomain (const std::string &domain, const std::string &ip, int port) |
virtual void | handleC2SListening (bool yes) |
virtual void | handleS2SListening (bool yes) |
virtual void | handleClientConnected (const gloox::JID jid, const std::string localIP, int localPort, const std::string remoteIP, int remotePort) |
virtual void | handleClientDisconnected (const gloox::JID jid, gloox::ConnectionError e, gloox::StreamError se) |
Detailed Description
The manager for the server configuration.
- Author
- Jakob Schroeter js@ca.nosp@m.maya.nosp@m..net
- Since
- 0.2
Definition at line 42 of file configmanager.h.
Constructor & Destructor Documentation
Constructor.
- Parameters
-
_logInstance | The LogSink to use. |
Definition at line 37 of file configmanager.cpp.
Member Function Documentation
bool addC2SInterface |
( |
const std::string & |
interface = gloox::EmptyString , |
|
|
unsigned short |
port = 5222 |
|
) |
| |
Adds a C2S interface that can then be used with bindDomain().
- Parameters
-
interface | The interface to bind to. |
port | The port to listen on. |
Definition at line 111 of file configmanager.cpp.
void bindDomain |
( |
const std::string & |
domain, |
|
|
const std::string & |
interface = gloox::EmptyString , |
|
|
unsigned short |
port = 5222 |
|
) |
| |
Use this function to add a domain to a previously added interface. That is, use addC2SInterface() first, the bindDomain() (using the same interface/port).
- Parameters
-
domain | A domain to handle. |
interface | A local interface to bind to. Default: all local interfaces. |
port | A local port to listen on. Default: 5222 |
Definition at line 67 of file configmanager.cpp.
bool checkDomain |
( |
const std::string & |
domain, |
|
|
const std::string & |
ip, |
|
|
int |
port |
|
) |
| |
|
virtual |
Checks if the given domain is valid for the given interface/port.
- Parameters
-
domain | The domain to check. |
interface | The local interface. |
port | The local port. |
Definition at line 178 of file configmanager.cpp.
void handleC2SListening |
( |
bool |
yes | ) |
|
|
virtual |
This function is called with an parameter of true exactly once when one or more c2s interfaces have been added. I.e. it is called when the number of listening interfaces is exactly 1. It is called with a parameter of false when interfaces have been removed and the number of listening interfaces is now exactly 0.
- Parameters
-
yes | Whether or not there is at least one listening interface. |
Definition at line 197 of file configmanager.cpp.
void handleClientConnected |
( |
const gloox::JID |
jid, |
|
|
const std::string |
localIP, |
|
|
int |
localPort, |
|
|
const std::string |
remoteIP, |
|
|
int |
remotePort |
|
) |
| |
|
virtual |
This function is called when a client connected, authenticated, and requested creation of a session.
- Parameters
-
jid | The client's full JID. |
localIP | The local IP the client connected to. |
localPort | The local port the client connected to. |
remoteIP | The remote IP the client connected from. |
remotePort | The remote port the client connected from. |
Definition at line 209 of file configmanager.cpp.
void handleClientDisconnected |
( |
const gloox::JID |
jid, |
|
|
gloox::ConnectionError |
e, |
|
|
gloox::StreamError |
se |
|
) |
| |
|
virtual |
This function is called when a client disconnected or got disconnected. It will only be called for client connections that handleClientConnected() has been called for previously.
- Parameters
-
jid | The client's full JID. |
e | A connection error. |
se | A stanza error. |
Definition at line 218 of file configmanager.cpp.
void handleS2SListening |
( |
bool |
yes | ) |
|
|
virtual |
This function is called with an parameter of true exactly once when one or more s2s interfaces have been added. I.e. it is called when the number of listening interfaces is exactly 1. It is called with a parameter of false when interfaces have been removed and the number of listening interfaces is now exactly 0.
- Parameters
-
yes | Whether or not there is at least one listening interface. |
Definition at line 203 of file configmanager.cpp.
Causes the server to rebind its local interfaces. This is useful if one or more listening interfaces are 'wildcards', ie. the server is listening on all local interfaces, and an interface has been added to or removed from the system.
Definition at line 159 of file configmanager.cpp.
bool removeC2SInterface |
( |
const std::string & |
interface = gloox::EmptyString , |
|
|
unsigned short |
port = 5222 |
|
) |
| |
Stops listening on the given interface/port.
- Parameters
-
interface | The interface. |
port | The port. |
Definition at line 127 of file configmanager.cpp.
Prepares a system shutdown, that is, stops all listening interfaces and disconnects any connected clients, indicating that the disconnect is due to a server shutdown.
Definition at line 172 of file configmanager.cpp.
void unbindDomain |
( |
const std::string & |
domain, |
|
|
const std::string & |
interface = gloox::EmptyString , |
|
|
unsigned short |
port = 5222 |
|
) |
| |
Use this function to remove a domain from the given interface.
- Parameters
-
domain | A domain to remove. |
interface | A local interface. |
port | A local port. |
Definition at line 89 of file configmanager.cpp.
The documentation for this class was generated from the following files: