36 lines
1009 B
C
36 lines
1009 B
C
|
#ifndef STOMP_H
|
||
|
#define STOMP_H
|
||
|
|
||
|
#include <QObject>
|
||
|
#include "interface/iStompSubject.h"
|
||
|
|
||
|
#define MAX_OBSERVER 5
|
||
|
|
||
|
class Stomp : public QObject, public interface::iStompSubject{
|
||
|
public:
|
||
|
Stomp();
|
||
|
|
||
|
|
||
|
// iStompSubject interface
|
||
|
public:
|
||
|
bool subscribe(interface::iStompObserver* obs);
|
||
|
void unsubscribe(interface::iStompObserver* obs);
|
||
|
void connectRequest(QString host, int port, QString vhost, QString username, QString password);
|
||
|
void sendRequest(QString destination, QString body);
|
||
|
void subscribeRequest(QString destination, int id);
|
||
|
void disconnectRequest();
|
||
|
|
||
|
protected:
|
||
|
void notifyConnectConfirmation(bool success, int version);
|
||
|
void notifySendConfirmation(bool success);
|
||
|
void notifySubscribeConfirmation(bool success);
|
||
|
void notifyReceiveIndication(int id, QString destination, QString body);
|
||
|
void notifyDisconnectConfirmation();
|
||
|
void notifyDisconnectIndication();
|
||
|
|
||
|
protected:
|
||
|
interface::iStompObserver* observer_[MAX_OBSERVER];
|
||
|
};
|
||
|
|
||
|
#endif // STOMP_H
|