ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
VP1Authenticator::Imp Class Reference
Collaboration diagram for VP1Authenticator::Imp:

Public Member Functions

 Imp (VP1Authenticator *, QString)
 
 ~Imp ()
 
 Imp (const Imp &)=delete
 
Impoperator= (const Imp &)=delete
 
QString getTagAttributeVal (const QString &tag, const QString &attribute)
 
void connectToAuthenticator (VP1Authenticator *authenticator)
 
void displayError (QString)
 

Public Attributes

VP1Authenticatorm_theClass
 
QNetworkAccessManager * m_netmanager
 
QNetworkReply * m_netreply
 
QFile * m_log
 
int stage
 
QString m_fileInfoUrl
 
QString m_loginServer
 

Detailed Description

Definition at line 21 of file VP1Authenticator.cxx.

Constructor & Destructor Documentation

◆ Imp() [1/2]

VP1Authenticator::Imp::Imp ( VP1Authenticator theClass,
QString  fileInfoUrl 
)

Definition at line 49 of file VP1Authenticator.cxx.

51  : m_theClass(theClass)
52  , m_netmanager(new QNetworkAccessManager())
53  , m_netreply(0)
54  , m_log(0)
55  , stage(1)
56  , m_fileInfoUrl(fileInfoUrl)
57  , m_loginServer("login.cern.ch")
58 {
59  #if defined BUILDVP1LIGHT
60  bool checkAuthEnabled = VP1QtUtils::expertSettingIsOn("expert","ExpertSettings/VP1_AUTH_ENABLELOG");
61  #else
62  bool checkAuthEnabled = VP1QtUtils::environmentVariableIsOn("VP1_AUTH_ENABLELOG");
63  #endif
64 
65  if(checkAuthEnabled) {
66  QString logname("vp1live-auth.log");
67  if(QFileInfo(logname).exists() && !QFile(logname).remove())
68  std::cerr << "VP1Authenticator ERROR: Unable to remove old logfile" << std::endl;
69  else {
70  m_log = new QFile(logname);
71  if(!m_log->open(QIODevice::WriteOnly)) {
72  std::cerr << "VP1Authenticator ERROR: Unable to open new logfile for writing" << std::endl;
73  delete m_log;
74  m_log = 0;
75  }
76  }
77  }
78 }

◆ ~Imp()

VP1Authenticator::Imp::~Imp ( )

Definition at line 80 of file VP1Authenticator.cxx.

81 {
82  // deleting m_netmanager is not my responsibility :)
83  delete m_netreply;
84 
85  if(m_log) {
86  m_log->close();
87  delete m_log;
88  }
89 }

◆ Imp() [2/2]

VP1Authenticator::Imp::Imp ( const Imp )
delete

Member Function Documentation

◆ connectToAuthenticator()

void VP1Authenticator::Imp::connectToAuthenticator ( VP1Authenticator authenticator)

Definition at line 108 of file VP1Authenticator.cxx.

109 {
110  connect(m_netreply, SIGNAL(finished()),
111  authenticator, SLOT(finished()));
112  connect(m_netreply, SIGNAL(error(QNetworkReply::NetworkError)),
113  authenticator, SLOT(error(QNetworkReply::NetworkError)));
114 #ifndef QT_NO_SSL
115  connect(m_netreply, SIGNAL(sslErrors(const QList<QSslError>&)),
116  authenticator, SLOT(sslErrors(const QList<QSslError>&)));
117 #endif
118 }

◆ displayError()

void VP1Authenticator::Imp::displayError ( QString  message)

Definition at line 120 of file VP1Authenticator.cxx.

121 {
122  m_theClass->teditError->setVisible(true);
123  m_theClass->setFixedSize(400,350);
124  m_theClass->teditError->append(message);
125  m_theClass->inpPhr->clear();
126  m_theClass->inpPers->setEnabled(true);
127  m_theClass->inpPhr->setEnabled(true);
128  m_theClass->inpPhr->setFocus();
129  if(m_log) {
130  QByteArray logBa(QString(message+"\n").toStdString().c_str());
131  m_log->write(logBa);
132  }
133 }

◆ getTagAttributeVal()

QString VP1Authenticator::Imp::getTagAttributeVal ( const QString &  tag,
const QString &  attribute 
)

Definition at line 91 of file VP1Authenticator.cxx.

92 {
93  QStringMatcher startMatcher(attribute + "=\"",Qt::CaseInsensitive);
94  QStringMatcher endMatcher("\"");
95 
96  int startPos = startMatcher.indexIn(tag);
97  if(startPos==-1)
98  return QString("");
99  else {
100  int endPos = endMatcher.indexIn(tag,startPos+startMatcher.pattern().size());
101  if(endPos==-1) // something is wrong with this tag
102  return QString("");
103  else
104  return tag.mid(startPos+startMatcher.pattern().size(),endPos-startPos-startMatcher.pattern().size());
105  }
106 }

◆ operator=()

Imp& VP1Authenticator::Imp::operator= ( const Imp )
delete

Member Data Documentation

◆ m_fileInfoUrl

QString VP1Authenticator::Imp::m_fileInfoUrl

Definition at line 45 of file VP1Authenticator.cxx.

◆ m_log

QFile* VP1Authenticator::Imp::m_log

Definition at line 42 of file VP1Authenticator.cxx.

◆ m_loginServer

QString VP1Authenticator::Imp::m_loginServer

Definition at line 46 of file VP1Authenticator.cxx.

◆ m_netmanager

QNetworkAccessManager* VP1Authenticator::Imp::m_netmanager

Definition at line 40 of file VP1Authenticator.cxx.

◆ m_netreply

QNetworkReply* VP1Authenticator::Imp::m_netreply

Definition at line 41 of file VP1Authenticator.cxx.

◆ m_theClass

VP1Authenticator* VP1Authenticator::Imp::m_theClass

Definition at line 39 of file VP1Authenticator.cxx.

◆ stage

int VP1Authenticator::Imp::stage

Definition at line 44 of file VP1Authenticator.cxx.


The documentation for this class was generated from the following file:
VP1Authenticator::Imp::m_fileInfoUrl
QString m_fileInfoUrl
Definition: VP1Authenticator.cxx:45
VP1Authenticator::Imp::m_netmanager
QNetworkAccessManager * m_netmanager
Definition: VP1Authenticator.cxx:40
fillPileUpNoiseLumi.connect
string connect
Definition: fillPileUpNoiseLumi.py:70
VP1Authenticator::Imp::m_netreply
QNetworkReply * m_netreply
Definition: VP1Authenticator.cxx:41
VP1Authenticator::Imp::stage
int stage
Definition: VP1Authenticator.cxx:44
ReweightUtils.message
message
Definition: ReweightUtils.py:15
PixelModuleFeMask_create_db.remove
string remove
Definition: PixelModuleFeMask_create_db.py:83
VP1QtUtils::environmentVariableIsOn
static bool environmentVariableIsOn(const QString &name)
Definition: VP1QtUtils.cxx:127
VP1Authenticator::finished
void finished()
Definition: VP1Authenticator.cxx:174
VP1Authenticator::Imp::m_loginServer
QString m_loginServer
Definition: VP1Authenticator.cxx:46
VP1QtUtils::expertSettingIsOn
static bool expertSettingIsOn(const QString &type, const QString &name)
Definition: VP1QtUtils.cxx:60
VP1Authenticator::Imp::m_theClass
VP1Authenticator * m_theClass
Definition: VP1Authenticator.cxx:39
VP1Authenticator::Imp::m_log
QFile * m_log
Definition: VP1Authenticator.cxx:42
VP1Authenticator::sslErrors
void sslErrors(const QList< QSslError > &)
Definition: VP1Authenticator.cxx:553
VP1Authenticator::error
void error(QNetworkReply::NetworkError)
Definition: VP1Authenticator.cxx:543
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
python.dummyaccess.exists
def exists(filename)
Definition: dummyaccess.py:9
MakeSliceSet.logname
logname
Definition: MakeSliceSet.py:34