GWE::GXmlNetwork Class Reference

Interface for XML based network implementations. More...

#include <GXmlNetwork.h>

Inheritance diagram for GWE::GXmlNetwork:

Inheritance graph
[legend]
Collaboration diagram for GWE::GXmlNetwork:

Collaboration graph
[legend]
List of all members.

Public Slots

virtual void setNetworkId (const QString &id)=0
virtual void setMasterServer (const QString &master)=0
virtual bool initNetwork ()=0
virtual bool closeNetwork ()=0
virtual void setPassword (const QString &password)=0
virtual bool send (QDomElement data, const QString &destination)=0
virtual bool send (const QString &data)=0
virtual bool flushOutput ()=0
virtual void makeDestinationAvailable (const QString &destination)=0

Signals

void networkConnected ()
void networkDisconnected ()
void networkError (int error_num, const QString &description, const QString &peer)
void peerDisconnected (const QString &peerNetworkId)
void dataAvailable (QDomElement data, const QString &source_peer)
void presenceChanged (QString server, bool available)

Public Member Functions

 GXmlNetwork (QObject *parent=0)
virtual ~GXmlNetwork ()
virtual bool isConnected ()=0
virtual QString getNetworkId () const =0
virtual QString getMasterServer () const =0

Detailed Description

Interface for XML based network implementations.

GXmlNetwork GXmlNetwork.h

Author:
Raphael Langerhorst
This class is the abstract base class of all network implementations. A GWE Server might have different simultaneous network implementations active in case the GWE Server is routing between different network types. In such situations the server has a different network ID for every type of network.

The GWE Server management logic is implemented in the data controller, which also knows to which destination server data should be sent. Thus this class can concentrate on providing reliable data transportation.


Constructor & Destructor Documentation

GWE::GXmlNetwork::GXmlNetwork ( QObject *  parent = 0  )  [inline]

Constructor.

virtual GWE::GXmlNetwork::~GXmlNetwork (  )  [inline, virtual]

Virtaul Destructor.


Member Function Documentation

virtual bool GWE::GXmlNetwork::closeNetwork (  )  [pure virtual, slot]

Shuts down the network. This should be called when the GWE Server is shutting down, and AFTER all required tasks were performed to allow safe shutdown (moving data to other server, etc.).

Implemented in GWE::GXmlDirectNetwork, and GWE::GXmppNetwork.

void GWE::GXmlNetwork::dataAvailable ( QDomElement  data,
const QString &  source_peer 
) [signal]

Emitted when one complete DOM document was successfully read from given peer.

virtual bool GWE::GXmlNetwork::flushOutput (  )  [pure virtual, slot]

Send all pending output data. This call blocks until all data was sent.

Implemented in GWE::GXmlDirectNetwork, and GWE::GXmppNetwork.

virtual QString GWE::GXmlNetwork::getMasterServer (  )  const [pure virtual]

Returns:
the network ID of the master GWE Server instance.

Implemented in GWE::GXmlDirectNetwork.

virtual QString GWE::GXmlNetwork::getNetworkId (  )  const [pure virtual]

Returns:
the network ID of this GWE Server instance.

Implemented in GWE::GXmlDirectNetwork, and GWE::GXmppNetwork.

virtual bool GWE::GXmlNetwork::initNetwork (  )  [pure virtual, slot]

Initialization.

Implemented in GWE::GXmlDirectNetwork, and GWE::GXmppNetwork.

virtual bool GWE::GXmlNetwork::isConnected (  )  [pure virtual]

Returns:
true when the network is connected and usable, otherwise false

Implemented in GWE::GXmlDirectNetwork, and GWE::GXmppNetwork.

virtual void GWE::GXmlNetwork::makeDestinationAvailable ( const QString &  destination  )  [pure virtual, slot]

Try to establish a connection to given destination.

Implemented in GWE::GXmlDirectNetwork, and GWE::GXmppNetwork.

void GWE::GXmlNetwork::networkConnected (  )  [signal]

Emitted when the network has just been successfully connected.

void GWE::GXmlNetwork::networkDisconnected (  )  [signal]

Emitted when the network gets disconnetected. It is also emitted when closeNetwork was called to shut down the connection.

void GWE::GXmlNetwork::networkError ( int  error_num,
const QString &  description,
const QString &  peer 
) [signal]

Emitted for any kind of error.

Parameters:
peer The address of the communication partner. Empty if communication was not peer to peer.

void GWE::GXmlNetwork::peerDisconnected ( const QString &  peerNetworkId  )  [signal]

Emitted if a peer GWE Server is disconnected.

void GWE::GXmlNetwork::presenceChanged ( QString  server,
bool  available 
) [signal]

Emitted when a GWE Server changes its presence state, for example if the other server goes offline.

virtual bool GWE::GXmlNetwork::send ( const QString &  data  )  [pure virtual, slot]

Given string is directly sent, it's the responsibility of the application to make it XML compliant.

Implemented in GWE::GXmlDirectNetwork, and GWE::GXmppNetwork.

virtual bool GWE::GXmlNetwork::send ( QDomElement  data,
const QString &  destination 
) [pure virtual, slot]

Add data for transportation. It is up to the network implementation when the data is actually sent.

Parameters:
data The data that will be sent to the given network destination.
destination The GWE Server to which the data should be sent to.
See also:
flushOutput()

Implemented in GWE::GXmlDirectNetwork, and GWE::GXmppNetwork.

virtual void GWE::GXmlNetwork::setMasterServer ( const QString &  master  )  [pure virtual, slot]

Sets the ID of the master server.

Implemented in GWE::GXmlDirectNetwork.

virtual void GWE::GXmlNetwork::setNetworkId ( const QString &  id  )  [pure virtual, slot]

Sets the ID of this server.

Implemented in GWE::GXmlDirectNetwork.

virtual void GWE::GXmlNetwork::setPassword ( const QString &  password  )  [pure virtual, slot]

Sets the password to be used

Implemented in GWE::GXmlDirectNetwork, and GWE::GXmppNetwork.


The documentation for this class was generated from the following file:
Generated on Thu Nov 16 07:49:41 2006 for G System by  doxygen 1.4.7