/* # Copyright (c) 2009 - OpenSLX Project, Computer Center University of Freiburg # # This program is free software distributed under the GPL version 2. # See http://openslx.org/COPYING # # If you have any feedback please consult http://openslx.org/feedback and # send your suggestions, praise, or complaints to feedback@openslx.org # # General information about OpenSLX can be found at http://openslx.org/ # ----------------------------------------------------------------------------- # src/net/pvsDiscoveredServer.h # - represents an entry in the list of available servers # - handles some extra things like validating the identity of the remote host # ----------------------------------------------------------------------------- */ #ifndef PVSDISCOVEREDSERVER_H_ #define PVSDISCOVEREDSERVER_H_ #include #include #include class PVSDiscoveredServer; class PVSDiscoveredServer : public QObject { Q_OBJECT private: QHostAddress _host; int _port; QByteArray _fingerprint; bool _validated; QSslSocket *_socket; QDateTime _lastCheck; QDateTime _lastUpdate; QString _name; public: PVSDiscoveredServer(QObject* parent, QHostAddress host, int port, QByteArray fingerprint, QString name); virtual ~PVSDiscoveredServer(); bool isValid() { return _validated; } bool hasFingerprint(QByteArray &fingerprint); bool hasHost(QHostAddress &host); void update(int port); int getAge(); QString getName(); QHostAddress getHost() { return _host; } QByteArray getFingerprint() { return _fingerprint; } int getPort() { return _port; } void validateCertificate(); private Q_SLOTS: void ssl_Error( const QList & errors ); void sock_dataArrival(); void sock_connected(); Q_SIGNALS: void validated(PVSDiscoveredServer*); }; #endif /* PVSDISCOVEREDSERVER_H_ */