Adds immediate migration results in progress
This commit is contained in:
2102 files changed
+17482
-15071
No files matched your search
+27
-27
@@ -48,7 +48,7 @@ bool PartyHandling::PartyHandler::init()
|
||||
// read parties from db
|
||||
if (!m_mainHandler->db()->select(partyVec))
|
||||
{
|
||||
ERROR_LOG() << "Error while reading party data from database";
|
||||
ERROR_LOG(m_logger) << "Error while reading party data from database";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ bool PartyHandling::PartyHandler::init()
|
||||
|
||||
if (partyVec.isEmpty())
|
||||
{
|
||||
ERROR_LOG() << "Error while reading party data from database";
|
||||
ERROR_LOG(m_logger) << "Error while reading party data from database";
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ bool PartyHandling::PartyHandler::init()
|
||||
//------------------------------------------------------------------------------------------
|
||||
void PartyHandling::PartyHandler::resetAdlerProperties( QString &properties, const int partyId)
|
||||
{
|
||||
DEBUG_LOG() << "properties: " << properties;
|
||||
DEBUG_LOG(m_logger) << "properties: " << properties;
|
||||
QJsonObject obj = QJsonDocument::fromJson(properties.toUtf8()).object();
|
||||
|
||||
if (!obj.contains(QStringLiteral("Adler")))
|
||||
@@ -87,7 +87,7 @@ void PartyHandling::PartyHandler::resetAdlerProperties( QString &properties, con
|
||||
if (connectState == ParticipantManagement::ConnectState::Undefined)
|
||||
return;
|
||||
|
||||
DEBUG_LOG() << "connectState: " << connectState;
|
||||
DEBUG_LOG(m_logger) << "connectState: " << connectState;
|
||||
|
||||
if (connectState != ParticipantManagement::ConnectState::Disconnected)
|
||||
{
|
||||
@@ -97,7 +97,7 @@ void PartyHandling::PartyHandler::resetAdlerProperties( QString &properties, con
|
||||
const QByteArray propertiesStr = QJsonDocument(obj).toJson(QJsonDocument::Compact);
|
||||
properties = QString::fromStdString(propertiesStr.data());
|
||||
|
||||
INFO_LOG() << "isSaaConnected set to false";
|
||||
INFO_LOG(m_logger) << "isSaaConnected set to false";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ QVector<Database::PpmParty> PartyHandling::PartyHandler::loadDefaultParties(bool
|
||||
QVector<Database::PpmParty> partyVec;
|
||||
|
||||
if (!m_mainHandler->dbEx0()->select(partyVec))
|
||||
ERROR_LOG() << "Error while reading party data from database (ex_0)";
|
||||
ERROR_LOG(m_logger) << "Error while reading party data from database (ex_0)";
|
||||
|
||||
auto cb = [](const Database::PpmParty &p1,const Database::PpmParty &p2) -> bool
|
||||
{
|
||||
@@ -139,7 +139,7 @@ void PartyHandling::PartyHandler::onModifyPartyDataRequest(const rti::core::Samp
|
||||
{
|
||||
auto ret = modifyPartyDataRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
|
||||
m_mainHandler->fts()->modifyPartyDataReply(cookie, ret);
|
||||
}
|
||||
@@ -147,7 +147,7 @@ void PartyHandling::PartyHandler::onModifyPartyDataRequest(const rti::core::Samp
|
||||
//------------------------------------------------------------------------------------------
|
||||
Core::FunctionReplyObject PartyHandling::PartyHandler::modifyPartyDataRequest(const ParticipantManagement::Party &request)
|
||||
{
|
||||
DEBUG_LOG() << "onModifyPartyDataRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "onModifyPartyDataRequest: " << request;
|
||||
Party *partyToPublish = m_parties.value(request.id());
|
||||
|
||||
if (!partyToPublish && request.id() >= 0)
|
||||
@@ -156,7 +156,7 @@ Core::FunctionReplyObject PartyHandling::PartyHandler::modifyPartyDataRequest(co
|
||||
|
||||
if (!partyToPublish) // create new party
|
||||
{
|
||||
DEBUG_LOG() << "Creating new party";
|
||||
DEBUG_LOG(m_logger) << "Creating new party";
|
||||
|
||||
// insert into database
|
||||
Database::PpmParty newDbParty;
|
||||
@@ -172,7 +172,7 @@ Core::FunctionReplyObject PartyHandling::PartyHandler::modifyPartyDataRequest(co
|
||||
if (!m_mainHandler->db()->insert(newDbParty))
|
||||
{
|
||||
QString errText = m_mainHandler->db()->getLastError().databaseText();
|
||||
ERROR_LOG() << "Error inserting Party into database: " << errText;
|
||||
ERROR_LOG(m_logger) << "Error inserting Party into database: " << errText;
|
||||
return Core::FunctionReplyObject(request.id(), tr_lts("dds", "Error inserting new party to database: %1")).arg(errText);
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ Core::FunctionReplyObject PartyHandling::PartyHandler::modifyPartyDataRequest(co
|
||||
}
|
||||
else // modify existing party
|
||||
{
|
||||
DEBUG_LOG() << "Modifying party with id " << partyToPublish->id();
|
||||
DEBUG_LOG(m_logger) << "Modifying party with id " << partyToPublish->id();
|
||||
|
||||
if (!partyToPublish->hasChanges(request, true))
|
||||
partyToPublish = nullptr; // so it will not be published at the end of this method ...
|
||||
@@ -203,10 +203,10 @@ Core::FunctionReplyObject PartyHandling::PartyHandler::modifyPartyDataRequest(co
|
||||
void PartyHandling::PartyHandler::onRemovePartyRequest(const rti::core::SampleIdentity &cookie,
|
||||
const ParticipantManagement::RemovePartyRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "onRemovePartyRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "onRemovePartyRequest: " << request;
|
||||
auto ret = removePartyRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
|
||||
m_mainHandler->fts()->removePartyReply(cookie, ret);
|
||||
}
|
||||
@@ -214,7 +214,7 @@ void PartyHandling::PartyHandler::onRemovePartyRequest(const rti::core::SampleId
|
||||
//------------------------------------------------------------------------------------------
|
||||
Core::FunctionReplyObject PartyHandling::PartyHandler::removePartyRequest(const ParticipantManagement::RemovePartyRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "onRemovePartyRequest " << request;
|
||||
DEBUG_LOG(m_logger) << "onRemovePartyRequest " << request;
|
||||
|
||||
if (request.partyId() < 0)
|
||||
return Core::FunctionReplyObject(tr_lts("dds", "Got request to delete a party, but no valid party id to delete"));
|
||||
@@ -227,7 +227,7 @@ Core::FunctionReplyObject PartyHandling::PartyHandler::removePartyRequest(const
|
||||
if (partyToDelete->isUsedBy() == true)
|
||||
return Core::FunctionReplyObject(tr_lts("dds", "Not possible to delete a party in use"));
|
||||
|
||||
DEBUG_LOG() << "Removing party with ID " << request.partyId();
|
||||
DEBUG_LOG(m_logger) << "Removing party with ID " << request.partyId();
|
||||
|
||||
return removeParty(partyToDelete);
|
||||
}
|
||||
@@ -253,7 +253,7 @@ Core::FunctionReplyObject PartyHandling::PartyHandler::removeParty(Party *partyT
|
||||
void PartyHandling::PartyHandler::onSyncPartiesRequest(const rti::core::SampleIdentity &cookie,
|
||||
const ParticipantManagement::SyncPartiesRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "onSyncPartiesRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "onSyncPartiesRequest: " << request;
|
||||
|
||||
Core::FunctionReplyObject rep;
|
||||
QVector<Database::PpmParty> partyVec = loadDefaultParties(false);
|
||||
@@ -261,7 +261,7 @@ void PartyHandling::PartyHandler::onSyncPartiesRequest(const rti::core::SampleId
|
||||
for (auto it = partyVec.begin(); it != partyVec.end(); ++it)
|
||||
{
|
||||
int partyId = (*it).id;
|
||||
DEBUG_LOG() << "Checking Party Id: " << partyId;
|
||||
DEBUG_LOG(m_logger) << "Checking Party Id: " << partyId;
|
||||
|
||||
Database::PpmParty partyEx0 = (*it);
|
||||
|
||||
@@ -272,12 +272,12 @@ void PartyHandling::PartyHandler::onSyncPartiesRequest(const rti::core::SampleId
|
||||
if (!m_mainHandler->db()->insert(partyEx0))
|
||||
{
|
||||
QString errText = m_mainHandler->db()->getLastError().databaseText();
|
||||
WARNING_LOG() << "Error inserting new party with id " << partyId << " to database: " << errText;
|
||||
WARNING_LOG(m_logger) << "Error inserting new party with id " << partyId << " to database: " << errText;
|
||||
continue;
|
||||
}
|
||||
else
|
||||
{
|
||||
DEBUG_LOG() << "Inserting Party Id: " << partyId;
|
||||
DEBUG_LOG(m_logger) << "Inserting Party Id: " << partyId;
|
||||
PartyHandling::Party *newParty = new PartyHandling::Party(partyEx0);
|
||||
m_parties.insert(partyEx0.id, newParty);
|
||||
m_mainHandler->dts()->publish(newParty->toDdsParty());
|
||||
@@ -293,7 +293,7 @@ void PartyHandling::PartyHandler::onSyncPartiesRequest(const rti::core::SampleId
|
||||
|| partyEx0.hlaForceIdentifier != partyEx->toDbParty().hlaForceIdentifier
|
||||
|| partyEx0.roleId != partyEx->toDbParty().roleId;
|
||||
|
||||
DEBUG_LOG() << "Has changes = " << hasChanges;
|
||||
DEBUG_LOG(m_logger) << "Has changes = " << hasChanges;
|
||||
|
||||
if (hasChanges)
|
||||
{
|
||||
@@ -312,7 +312,7 @@ void PartyHandling::PartyHandler::onSyncPartiesRequest(const rti::core::SampleId
|
||||
|
||||
auto ret = modifyPartyDataRequest(req);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -332,14 +332,14 @@ void PartyHandling::PartyHandler::onSyncPartiesRequest(const rti::core::SampleId
|
||||
}
|
||||
if (!found)
|
||||
{
|
||||
DEBUG_LOG() << "Party id to be deleted = " << curParty->id();
|
||||
DEBUG_LOG(m_logger) << "Party id to be deleted = " << curParty->id();
|
||||
if (curParty->isUsedBy())
|
||||
INFO_LOG() << "Party with id " << curParty->id() << " cannot be deleted, is in use";
|
||||
INFO_LOG(m_logger) << "Party with id " << curParty->id() << " cannot be deleted, is in use";
|
||||
else
|
||||
{
|
||||
auto ret = removeParty(curParty); // removed from map etc
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -352,10 +352,10 @@ void PartyHandling::PartyHandler::onSyncPartiesRequest(const rti::core::SampleId
|
||||
void PartyHandling::PartyHandler::onChangePartyUsedStateRequest(const rti::core::SampleIdentity &cookie,
|
||||
const ParticipantManagement::ChangePartyUsedStateRequest &request)
|
||||
{
|
||||
DEBUG_LOG() << "onChangePartyUsedStateRequest: " << request;
|
||||
DEBUG_LOG(m_logger) << "onChangePartyUsedStateRequest: " << request;
|
||||
auto ret = changePartyUsedStateRequest(request);
|
||||
if (ret.error())
|
||||
WARNING_LOG() << ret();
|
||||
WARNING_LOG(m_logger) << ret();
|
||||
m_mainHandler->fts()->changePartyUsedStateReply(cookie, ret);
|
||||
}
|
||||
|
||||
@@ -374,7 +374,7 @@ Core::FunctionReplyObject PartyHandling::PartyHandler::changePartyUsedStateReque
|
||||
if (!m_mainHandler->db()->update(party->toDbParty()))
|
||||
return Core::FunctionReplyObject(request.partyId(), tr_lts("dds", "Error updating party used state in database"));
|
||||
|
||||
DEBUG_LOG() << "Change used state for party " << party->id() << " to " << party->isUsedBy();
|
||||
DEBUG_LOG(m_logger) << "Change used state for party " << party->id() << " to " << party->isUsedBy();
|
||||
m_mainHandler->dts()->publish(party->toDdsParty());
|
||||
}
|
||||
return Core::FunctionReplyObject(request.partyId());
|
||||
|
||||
Reference in new issue
Block a user