ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
VP1WebWatcher::Imp::HttpThread Class Reference
Inheritance diagram for VP1WebWatcher::Imp::HttpThread:
Collaboration diagram for VP1WebWatcher::Imp::HttpThread:

Public Member Functions

 HttpThread (const QString &url, VP1WebWatcher *)
 
 ~HttpThread ()
 
QString result () const
 
QString url () const
 
int httpStartTime () const
 
void run ()
 
bool handleDone (bool, QObject *)
 

Private Attributes

const QString m_url
 
QString m_result
 
unsigned m_httpStartTime
 

Detailed Description

Definition at line 39 of file VP1WebWatcher.cxx.

Constructor & Destructor Documentation

◆ HttpThread()

VP1WebWatcher::Imp::HttpThread::HttpThread ( const QString &  url,
VP1WebWatcher  
)
inline

Definition at line 42 of file VP1WebWatcher.cxx.

43  : QThread(),
44  m_url(url),
45  m_result(VP1WebWatcher_ResultNotReady),
47  // m_http(0)
48  {
49  }

◆ ~HttpThread()

VP1WebWatcher::Imp::HttpThread::~HttpThread ( )
inline

Definition at line 52 of file VP1WebWatcher.cxx.

52 { /*delete m_http;*/ }

Member Function Documentation

◆ handleDone()

bool VP1WebWatcher::Imp::HttpThread::handleDone ( bool  ,
QObject *   
)
inline

Definition at line 92 of file VP1WebWatcher.cxx.

92  {
93 
94  // TODO: replace with QNetworkManager!!
95  std::cout << "WARNING!! - VP1WebWatcher::handleDone() needs to be ported to QNetworkManager. Returning..." << std::endl;
96 
97  // if (sender!=m_http)
98  // return false;
99  // if (!m_http) {
100  // quit();
101  // return false;
102  // }
103  // if (error) {
104  // m_result = VP1WebWatcher_httpProblems;
105  // quit();
106  // return true;
107  // }
108  // QHttpResponseHeader response = m_http->lastResponse();
109  // if (!response.isValid()||!response.hasKey("last-modified")) {
110  // int sc = response.statusCode();
111  // m_result = (sc==404||sc==410)? VP1WebWatcher_FileNotExist : VP1WebWatcher_httpProblems;
112  // quit();
113  // return true;
114  // }
115  // m_result = response.value("last-modified");
116  // quit();
117  // return true;
118  return true;
119 
120  }

◆ httpStartTime()

int VP1WebWatcher::Imp::HttpThread::httpStartTime ( ) const
inline

Definition at line 64 of file VP1WebWatcher.cxx.

64 { return m_httpStartTime; }

◆ result()

QString VP1WebWatcher::Imp::HttpThread::result ( ) const
inline

Definition at line 55 of file VP1WebWatcher.cxx.

55 { return m_result; }

◆ run()

void VP1WebWatcher::Imp::HttpThread::run ( )
inline

Definition at line 67 of file VP1WebWatcher.cxx.

68  {
69  // TODO: replace with QNetworkManager!!
70 
71  std::cout << "WARNING!! - VP1WebWatcher::run() needs to be ported to QNetworkManager. Returning..." << std::endl;
72 
73  // QUrl qurl(m_url);
74  // if (!qurl.isValid()) {
75  // m_result = VP1WebWatcher_UrlInvalid;
76  // return;
77  // }
78  // m_http = new QHttp;
79  // QHttpRequestHeader header("HEAD", m_url);
80  // header.setValue("Host", qurl.host());
81  // header.setValue("User-Agent", "ATLASVP1");
82  // m_http->setHost(qurl.host());
83  // m_httpStartTime = QDateTime::currentDateTime().toTime_t();
84  // m_http->request(header);
85  // connect(m_http,SIGNAL(done(bool)),m_watcher,SLOT(httpRequestDone(bool)),Qt::QueuedConnection);
86  // exec();
87  // m_http->deleteLater();
88  // m_http = 0;
89  }

◆ url()

QString VP1WebWatcher::Imp::HttpThread::url ( ) const
inline

Definition at line 61 of file VP1WebWatcher.cxx.

61 { return m_url; }

Member Data Documentation

◆ m_httpStartTime

unsigned VP1WebWatcher::Imp::HttpThread::m_httpStartTime
private

Definition at line 130 of file VP1WebWatcher.cxx.

◆ m_result

QString VP1WebWatcher::Imp::HttpThread::m_result
private

Definition at line 129 of file VP1WebWatcher.cxx.

◆ m_url

const QString VP1WebWatcher::Imp::HttpThread::m_url
private

Definition at line 128 of file VP1WebWatcher.cxx.


The documentation for this class was generated from the following file:
VP1WebWatcher::Imp::HttpThread::m_result
QString m_result
Definition: VP1WebWatcher.cxx:129
VP1WebWatcher::Imp::HttpThread::m_httpStartTime
unsigned m_httpStartTime
Definition: VP1WebWatcher.cxx:130
VP1WebWatcher::Imp::HttpThread::url
QString url() const
Definition: VP1WebWatcher.cxx:61
VP1WebWatcher::Imp::HttpThread::m_url
const QString m_url
Definition: VP1WebWatcher.cxx:128