Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+28
-28
@@ -53,7 +53,7 @@ bool HandlerOperator::init()
|
||||
// read all Operators from database
|
||||
if (!m_mainHandler->db()->select(dataVec))
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -61,17 +61,17 @@ bool HandlerOperator::init()
|
||||
// read all Operators from database
|
||||
if (!m_mainHandler->db()->select(partyExerciseVec))
|
||||
{
|
||||
ERROR_LOG() << "Error reading data from database!";
|
||||
ERROR_LOG(m_logger) << "Error reading data from database!";
|
||||
return true;
|
||||
}
|
||||
QMap<int, QVector<Database::OpmOperatorExercise> > opMap;
|
||||
for (const auto &elem : partyExerciseVec)
|
||||
{
|
||||
INFO_LOG() << "---------- elem.operatorId:" << elem.operatorId
|
||||
INFO_LOG(m_logger) << "---------- elem.operatorId:" << elem.operatorId
|
||||
<< ", elem size " << elem.visibleParties().size();
|
||||
opMap[elem.operatorId] << elem;
|
||||
}
|
||||
INFO_LOG() << "------- opMap size" << opMap.size();
|
||||
INFO_LOG(m_logger) << "------- opMap size" << opMap.size();
|
||||
|
||||
OperatorManagement::OperatorWorkstationAlive alive;
|
||||
alive.lastAlive(QDateTime::currentMSecsSinceEpoch());
|
||||
@@ -82,7 +82,7 @@ bool HandlerOperator::init()
|
||||
if (ret.error())
|
||||
{
|
||||
delete ifs;
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
return false;
|
||||
}
|
||||
if (m_logger.isDebugEnabled())
|
||||
@@ -92,7 +92,7 @@ bool HandlerOperator::init()
|
||||
stringList.reserve(acls.size());
|
||||
for (int acl : acls)
|
||||
stringList << QString::number(acl);
|
||||
DEBUG_LOG() << "Effective ACLs for Operator " << op.name << "(id: " << op.id << "): "
|
||||
DEBUG_LOG(m_logger) << "Effective ACLs for Operator " << op.name << "(id: " << op.id << "): "
|
||||
<< stringList.join(QLatin1String(", "));
|
||||
}
|
||||
ifs->updateExercises(getExercisesForOperator(exMappingVec, op.id), true);
|
||||
@@ -110,7 +110,7 @@ bool HandlerOperator::init()
|
||||
this, &HandlerOperator::onOperatorWorkstationAliveChanged);
|
||||
dtc->enableOperatorWorkstationAlive();
|
||||
|
||||
DEBUG_LOG() << "m_exeObjMap.size() = " << m_operatorObjMap.size();
|
||||
DEBUG_LOG(m_logger) << "m_exeObjMap.size() = " << m_operatorObjMap.size();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -138,7 +138,7 @@ std::vector<int> HandlerOperator::getExercisesForOperator(const QVector<Database
|
||||
void HandlerOperator::onOperatorChangePasswordRequest(const rti::core::SampleIdentity &cookie,
|
||||
const OperatorChangePasswordRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "onOperatorChangePasswordRequest()";
|
||||
DEBUG_LOG(m_logger) << "onOperatorChangePasswordRequest()";
|
||||
ObjectOperator *ifs = m_operatorObjMap.value(request.id());
|
||||
if (!ifs)
|
||||
{
|
||||
@@ -184,14 +184,14 @@ void HandlerOperator::onOperatorCreateModifyRequest(const rti::core::SampleIdent
|
||||
const OperatorCreateModifyRequest &request)
|
||||
{
|
||||
Core::FunctionReplyObject ret;
|
||||
DEBUG_LOG() << "onOperatorCreateModifyRequest()";
|
||||
DEBUG_LOG(m_logger) << "onOperatorCreateModifyRequest()";
|
||||
if (!request.id().is_set())
|
||||
ret = operatorCreateRequest(request);
|
||||
else
|
||||
ret = operatorModifyRequest(request);
|
||||
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_mainHandler->fts()->operatorCreateModifyReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -268,13 +268,13 @@ Core::FunctionReplyObject HandlerOperator::operatorCreateRequest(const OperatorC
|
||||
|
||||
void HandlerOperator::operatorModifyRolePresetId( int operatorId, int rolePresetId)
|
||||
{
|
||||
DEBUG_LOG()<< "HandlerOperator::operatorModifyRolePresetId"
|
||||
DEBUG_LOG(m_logger)<< "HandlerOperator::operatorModifyRolePresetId"
|
||||
<< " operatorId=" << operatorId
|
||||
<< " rolePresetId=" << rolePresetId;
|
||||
ObjectOperator *ifs = m_operatorObjMap.value(operatorId);
|
||||
if (!ifs)
|
||||
{
|
||||
ERROR_LOG()<< "No valid operator id given: "<< operatorId;
|
||||
ERROR_LOG(m_logger)<< "No valid operator id given: "<< operatorId;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ Core::FunctionReplyObject HandlerOperator::operatorModifyRequest(const OperatorC
|
||||
void HandlerOperator::onOperatorRemoveRequest(const rti::core::SampleIdentity &cookie,
|
||||
const Core::RemoveElementRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "onOperatorRemoveRequest()" << request;
|
||||
DEBUG_LOG(m_logger) << "onOperatorRemoveRequest()" << request;
|
||||
|
||||
ObjectOperator *ifs = m_operatorObjMap.value(request.id());
|
||||
if (!ifs)
|
||||
@@ -372,7 +372,7 @@ void HandlerOperator::onOperatorRemoveRequest(const rti::core::SampleIdentity &c
|
||||
Core::FunctionReplyObject ret = m_mainHandler->getHandlerGroup()->remove(groupRemoveRequest);
|
||||
if (ret.error())
|
||||
{
|
||||
ERROR_LOG() << ret();
|
||||
ERROR_LOG(m_logger) << ret();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -389,7 +389,7 @@ void HandlerOperator::onOperatorRemoveRequest(const rti::core::SampleIdentity &c
|
||||
void HandlerOperator::onOperatorLoginRequest(const rti::core::SampleIdentity &cookie,
|
||||
const OperatorLoginRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "OperatorLoginRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "OperatorLoginRequest: " << request;
|
||||
|
||||
ObjectOperator *ifs = m_operatorObjMap.value(request.id());
|
||||
if (!ifs)
|
||||
@@ -460,7 +460,7 @@ void HandlerOperator::onOperatorLoginRequest(const rti::core::SampleIdentity &co
|
||||
OperatorLogoutRequest req;
|
||||
req.id(otherOperatorId);
|
||||
onOperatorLogoutRequest(cookie, req);
|
||||
WARNING_LOG() << "Logged out operator " << otherOperatorId << " on workstation id " << request.workstationId();
|
||||
WARNING_LOG(m_logger) << "Logged out operator " << otherOperatorId << " on workstation id " << request.workstationId();
|
||||
}
|
||||
}
|
||||
// Claim WS:
|
||||
@@ -471,7 +471,7 @@ void HandlerOperator::onOperatorLoginRequest(const rti::core::SampleIdentity &co
|
||||
}
|
||||
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
else
|
||||
{
|
||||
m_mainHandler->getHandlerLockedTopics()->operatorLoggedIn(request.id(), request.workstationId());
|
||||
@@ -491,7 +491,7 @@ int HandlerOperator::getLoggedOperatorId(int workstationId) const
|
||||
void HandlerOperator::onOperatorLogoutRequest(const rti::core::SampleIdentity &cookie,
|
||||
const OperatorLogoutRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "OperatorLogoutRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "OperatorLogoutRequest: " << request;
|
||||
|
||||
ObjectOperator *ifs = m_operatorObjMap.value(request.id());
|
||||
if (!ifs)
|
||||
@@ -566,10 +566,10 @@ void HandlerOperator::onOperatorGetSetSettingsRequest(const rti::core::SampleIde
|
||||
|
||||
void HandlerOperator::onOperatorApplyForeignAclsRequest(const rti::core::SampleIdentity &cookie, const OperatorApplyForeignAclsRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "peratorApplyForeignAclsRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "peratorApplyForeignAclsRequest: " << request;
|
||||
auto reply = operatorApplyForeignAclsRequest(request);
|
||||
if (reply.error())
|
||||
WARNING_LOG() << reply();
|
||||
WARNING_LOG(m_logger) << reply();
|
||||
m_mainHandler->fts()->operatorApplyForeignAclsReply(cookie, reply);
|
||||
}
|
||||
|
||||
@@ -589,11 +589,11 @@ Core::FunctionReplyObject HandlerOperator::operatorApplyForeignAclsRequest(const
|
||||
void HandlerOperator::onOperatorUpdateVisiblePartiesByExerciseRequest(const rti::core::SampleIdentity &cookie,
|
||||
const OperatorUpdateVisiblePartiesByExerciseRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << Q_FUNC_INFO << request;
|
||||
// DEBUG_LOG() << "onOperatorUpdateVisiblePartiesByExerciseRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << Q_FUNC_INFO << request;
|
||||
// DEBUG_LOG(m_logger) << "onOperatorUpdateVisiblePartiesByExerciseRequest: " << request;
|
||||
Core::FunctionReplyObject reply = operatorUpdateVisiblePartiesByExerciseRequest(request);
|
||||
if (reply.error())
|
||||
WARNING_LOG() << reply();
|
||||
WARNING_LOG(m_logger) << reply();
|
||||
m_mainHandler->fts()->operatorUpdateVisiblePartiesByExerciseReply(cookie, reply);
|
||||
}
|
||||
|
||||
@@ -625,7 +625,7 @@ void HandlerOperator::reloadAcls()
|
||||
|
||||
void HandlerOperator::onOperatorWorkstationAliveChanged(const OperatorManagement::OperatorWorkstationAlive &data, DataModification modType)
|
||||
{
|
||||
INFO_LOG() << "onOperatorWorkstationAliveChanged: " << data << ", " << modType;
|
||||
INFO_LOG(m_logger) << "onOperatorWorkstationAliveChanged: " << data << ", " << modType;
|
||||
if (data.operatorId() < 0)
|
||||
{
|
||||
m_aliveData.remove(data.workstationId());
|
||||
@@ -645,11 +645,11 @@ void HandlerOperator::onCheckAliveTimeout()
|
||||
return;
|
||||
|
||||
const qint64 tTimeoutTime = QDateTime::currentMSecsSinceEpoch() - 90 * 1000; // 90s
|
||||
DEBUG_LOG() << "onCheckAliveTimeout, timeoutTime: " << tTimeoutTime;
|
||||
DEBUG_LOG(m_logger) << "onCheckAliveTimeout, timeoutTime: " << tTimeoutTime;
|
||||
auto it = m_aliveData.begin();
|
||||
while (it != m_aliveData.end())
|
||||
{
|
||||
DEBUG_LOG() << "Checking alive for workstation " << it.key();
|
||||
DEBUG_LOG(m_logger) << "Checking alive for workstation " << it.key();
|
||||
auto &events = it.value();
|
||||
if (events.isEmpty() || events.last().lastAlive() >= tTimeoutTime)
|
||||
{
|
||||
@@ -659,12 +659,12 @@ void HandlerOperator::onCheckAliveTimeout()
|
||||
// no reference, will be a dangling one after m_aliveData.erase(it) !
|
||||
const OperatorWorkstationAlive owa = events.last();
|
||||
|
||||
WARNING_LOG() << "Timeout for workstation " << owa.workstationId()
|
||||
WARNING_LOG(m_logger) << "Timeout for workstation " << owa.workstationId()
|
||||
<< " and operator " << owa.operatorId() << " - logging out";
|
||||
if (m_logger.isDebugEnabled())
|
||||
{
|
||||
for (const auto &event : events)
|
||||
DEBUG_LOG() << "Alive history: " << event;
|
||||
DEBUG_LOG(m_logger) << "Alive history: " << event;
|
||||
}
|
||||
ObjectOperator *ifs = m_operatorObjMap.value(owa.operatorId());
|
||||
it = m_aliveData.erase(it);
|
||||
|
||||
Reference in new issue
Block a user