|
ATLAS Offline Software
|
#include <VP1AvailEvtsHttps.h>
|
void | start (QNetworkAccessManager *netmanager) |
|
Definition at line 27 of file VP1AvailEvtsHttps.h.
◆ VP1AvailEvtsHttps()
VP1AvailEvtsHttps::VP1AvailEvtsHttps |
( |
QString |
fileinfoUrl, |
|
|
int |
updateInterval, |
|
|
int |
timeCutForNew, |
|
|
const QString & |
tmpcopydir, |
|
|
int |
maxLocalFilesToKeep = -1 , |
|
|
QObject * |
parent = 0 |
|
) |
| |
◆ ~VP1AvailEvtsHttps()
VP1AvailEvtsHttps::~VP1AvailEvtsHttps |
( |
| ) |
|
|
virtual |
◆ actualCheckForEventListChanges
void VP1AvailEvents::actualCheckForEventListChanges |
( |
| ) |
|
|
privateslotinherited |
◆ actualCleanup
void VP1AvailEvents::actualCleanup |
( |
| ) |
|
|
privateslotinherited |
◆ allEventFilesInDir()
QList< VP1EventFile > VP1AvailEvents::allEventFilesInDir |
( |
const QString & |
dir | ) |
const |
|
protectedinherited |
Definition at line 202 of file VP1AvailEvents.cxx.
205 return QList<VP1EventFile>();
207 QFileInfo fi_dir(
dir);
208 if (!fi_dir.exists()||!fi_dir.isDir())
209 return QList<VP1EventFile>();
211 QDateTime modtime = fi_dir.lastModified();
212 if (abs(modtime.time().msecsTo(QTime::currentTime()))>50) {
215 return it->second.second;
219 filters <<
"*_*.pool.root";
221 QDirIterator itDir(
dir,filters,
QDir::Files | QDir::NoDotAndDotDot | QDir::Readable | QDir::CaseSensitive);
223 QList<VP1EventFile>
l;
224 while (itDir.hasNext()) {
225 QString
fn = itDir.next();
226 fn.replace(
"//",
"/");
231 message(
"Could not decode event file name: "+
fn);
◆ allLocalEvents()
QList< VP1EventFile > VP1AvailEvents::allLocalEvents |
( |
| ) |
const |
|
inherited |
◆ allLocalEventsChanged
void VP1AvailEvents::allLocalEventsChanged |
( |
| ) |
|
|
signalinherited |
◆ checkForStall
void VP1AvailEvtsHttps::checkForStall |
( |
| ) |
|
|
privateslot |
Definition at line 389 of file VP1AvailEvtsHttps.cxx.
391 unsigned currentTime = QDateTime::currentDateTime().toTime_t();
◆ cleanupAndCheckForEventListChanges()
void VP1AvailEvents::cleanupAndCheckForEventListChanges |
( |
| ) |
|
|
protectedinherited |
◆ dataReadProgress
void VP1AvailEvtsHttps::dataReadProgress |
( |
qint64 |
received, |
|
|
qint64 |
|
|
) |
| |
|
privateslot |
◆ error
void VP1AvailEvtsHttps::error |
( |
QNetworkReply::NetworkError |
err | ) |
|
|
privateslot |
Definition at line 357 of file VP1AvailEvtsHttps.cxx.
361 +
"\n Error decoding here: http://doc.trolltech.com/4.4/qnetworkreply.html#NetworkError-enum");
◆ fileinfoLocation()
const QString & VP1AvailEvtsHttps::fileinfoLocation |
( |
| ) |
|
◆ finished
void VP1AvailEvtsHttps::finished |
( |
| ) |
|
|
privateslot |
-— For logging std::cout << "VP1AvailEvtsHttps stage -- " << m_d->m_stage << " -- finished with error=" << (int)m_d->m_netreply->error() << ", sc=" << sc << ", LM=" << lastModified.toStdString() << std::endl;
-— For logging std::cout << " Active Ret Dir: " << activeRetrievalDir.toStdString() << std::endl; std::cout << " Target : " << target.toStdString() << std::endl;
-— For logging std::cout << "\t\t" << target.toStdString() << " written and closed" << std::endl;
Definition at line 233 of file VP1AvailEvtsHttps.cxx.
237 QVariant
val =
m_d->
m_netreply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
238 if(
val.type()==QVariant::Int)
239 sc =
val.value<
int>();
240 else if(
val.type()==QVariant::Invalid)
242 else if(!
val.canConvert<
int>())
243 message(
"Cannot convert status code to int while processing " +
m_d->
m_netreply->url().toString());
245 sc =
val.value<
int>();
249 QString lastModified;
250 QVariant lastModHeader =
m_d->
m_netreply->header(QNetworkRequest::LastModifiedHeader);
251 if(lastModHeader.type()!=QVariant::Invalid &&
252 lastModHeader.canConvert<QDateTime>()) {
253 QDateTime lastModTime = lastModHeader.value<QDateTime>();
254 lastModified = lastModTime.toString();
277 QString
target = activeRetrievalDir +
"downloadedfileinfo.txt";
285 message(
"ERROR: Could not remove the old fileinfo " +
target);
292 QFile localfileinfo(
target);
293 if(!localfileinfo.open(QIODevice::WriteOnly)) {
302 localfileinfo.write(ba);
303 localfileinfo.close();
309 if(!targetFile.open(QIODevice::WriteOnly)) {
318 targetFile.write(ba);
327 message(
"Checksum did not match");
335 if(!QFile::rename(
target,finalTarget)) {
336 message(
"ERROR: Could not move " +
target +
" to " + finalTarget);
◆ freshEvents() [1/2]
◆ freshEvents() [2/2]
◆ freshEventsChanged
void VP1AvailEvents::freshEventsChanged |
( |
| ) |
|
|
signalinherited |
◆ generateHttpsRequest
void VP1AvailEvtsHttps::generateHttpsRequest |
( |
| ) |
|
|
privateslot |
-— For logging std::cout << "VP1AvailEvtsHttps getHead stage -- " << m_d->m_stage << " --" << std::endl;
-— For logging std::cout << "VP1AvailEvtsHttps get stage -- " << m_d->m_stage << " --" << std::endl;
-— For logging std::cout << "VP1AvailEvtsHttps get stage -- " << m_d->m_stage << " --" << std::endl;
-— For logging std::cout << " Event : " << url.toString().toStdString() << std::endl;
Definition at line 153 of file VP1AvailEvtsHttps.cxx.
156 QNetworkRequest netrequest(fileInfoUrl);
174 QString
target = activeRetrievalDir +
"downloadedfileinfo.txt";
177 if (!newEvtsOnServerInfo.isValid()) {
203 QList<VP1EventFile> freshLocalEvents =
freshEvents();
206 if (
evt < evtToGet) {
221 QNetworkRequest netrequestEvt(
url);
◆ inHistory()
bool VP1AvailEvents::inHistory |
( |
int |
run, |
|
|
int |
event |
|
) |
| const |
|
protectedinherited |
◆ init()
void VP1AvailEvtsHttps::init |
( |
| ) |
|
|
virtual |
◆ invalidateDirCache()
void VP1AvailEvents::invalidateDirCache |
( |
const QString & |
dir | ) |
|
|
protectedinherited |
◆ isConsideredFresh()
◆ maxLocalFilesToKeep()
int VP1AvailEvents::maxLocalFilesToKeep |
( |
| ) |
const |
|
inherited |
◆ message
void VP1AvailEvents::message |
( |
const QString & |
| ) |
const |
|
signalinherited |
◆ messageDebug()
void VP1AvailEvents::messageDebug |
( |
const QString & |
s | ) |
const |
|
protectedinherited |
◆ newestEvent()
◆ requireNewestRunNumber()
bool VP1AvailEvents::requireNewestRunNumber |
( |
| ) |
const |
|
inlineprotectedinherited |
◆ setCurrentEvent()
void VP1AvailEvents::setCurrentEvent |
( |
int |
run, |
|
|
int |
event |
|
) |
| |
|
inherited |
◆ sslErrors
void VP1AvailEvtsHttps::sslErrors |
( |
const QList< QSslError > & |
| ) |
|
|
privateslot |
-— For logging std::cout << "VP1AvailEvtsHttps SSL errors" << std::endl; for(int ii=0; ii<errlist.size(); ++ii) std::cout << " SSL * " << (int)errlist.at(ii).error() << ", " << errlist.at(ii).errorString().toStdString() << std::endl;
Definition at line 365 of file VP1AvailEvtsHttps.cxx.
◆ start
void VP1AvailEvtsHttps::start |
( |
QNetworkAccessManager * |
netmanager | ) |
|
|
slot |
◆ timeCutForNew()
int VP1AvailEvents::timeCutForNew |
( |
| ) |
const |
|
protectedinherited |
◆ tmpActiveRetrievalDir()
QString VP1AvailEvents::tmpActiveRetrievalDir |
( |
| ) |
|
|
protectedinherited |
◆ tmpDir()
const QString & VP1AvailEvents::tmpDir |
( |
| ) |
const |
|
protectedinherited |
◆ tmpLocalFileDir()
QString VP1AvailEvents::tmpLocalFileDir |
( |
| ) |
const |
|
protectedinherited |
◆ m_d
Imp* VP1AvailEvtsHttps::m_d |
|
private |
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
QString tmpLocalFileDir() const
void actualCheckForEventListChanges()
QList< VP1EventFile > allLocalEvents() const
void allLocalEventsChanged()
void cleanupAndCheckForEventListChanges()
QString tmpActiveRetrievalDir()
QNetworkReply * m_netreply
void freshEventsChanged()
void message(const QString &) const
bool inHistory(int run, int event) const
QList< VP1EventFile > freshEvents() const
void startTimer(int interval=0)
VP1AvailEvents(int timeCutForNew, const QString &tmpdir, int maxLocalFilesToKeep=-1, QObject *parent=0)
QNetworkAccessManager * m_netmanager
VP1EventFile newestEvent() const
POOL::TEvent event(POOL::TEvent::kClassAccess)
void cleanupTmpLocalFiles()
void connectNetworkSignalsToSlots()
int timeCutForNew() const
const QString & fileName() const
bool requireNewestRunNumber() const
QList< EventID > historyOrdered
QString tmpActiveRetrievalDir
const QString & md5Sum() const
std::set< EventID > historySorted
static bool sumMatches(const QString &filename, const QByteArray &md5sum)
int maxLocalFilesToKeep() const
static const char * prefix_verbose()
static void messageDebug(const QString &)
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
QList< VP1EventFile > lastFresh
QList< VP1EventFile > allEventFilesInDir(const QString &dir) const
QList< VP1EventFile > lastAllLocal
static EventID evtToID(const VP1EventFile &evt)
bool isConsideredFresh(const VP1EventFile &evt, const VP1EventFile &newestEvt) const
QString attemptGenerationOfTmpSubdir(const QString &preferredname, QString &cachevar)
std::map< QString, std::pair< QDateTime, QList< VP1EventFile > > > dircache
void invalidateDirCache(const QString &dir)
bool match(std::string s1, std::string s2)
match the individual directories of two strings
unsigned m_lastChangeTime