Adds immediate migration results in progress

This commit is contained in:
torsten committed 2026-08-19 11:18:24 +02:00
1 parent 8453e104c5
commit 3bb6e89496
2102 files changed
+17482 -15071

No files matched your search

@@ -22,7 +22,7 @@ LicenceHandler::LicenceHandler(const std::shared_ptr<DdsHandler> &ddsHandler, co
, m_ddsHandler(ddsHandler)
, m_xmlFileName(licenceFile)
{
INFO_LOG() << "Start ServiceManagement LicenceHandler. Filename: " << m_xmlFileName;
INFO_LOG(m_logger) << "Start ServiceManagement LicenceHandler. Filename: " << m_xmlFileName;
} // end of ctor()
//-----------------------------------------------------------------------------
@@ -35,12 +35,12 @@ LicenceHandler::~LicenceHandler()
bool LicenceHandler::init()
{
INFO_LOG() << "init() Start ServiceManagement LicenceHandler.";
INFO_LOG(m_logger) << "init() Start ServiceManagement LicenceHandler.";
// read all licences from licencefile
if (!readLicenceFile())
{
ERROR_LOG() << "Error reading data from licencefile!";
ERROR_LOG(m_logger) << "Error reading data from licencefile!";
return false;
}
@@ -64,7 +64,7 @@ bool LicenceHandler::isServiceLicensed(const QString &licenceName) const
void LicenceHandler::onGetLicenceRequest(const rti::core::SampleIdentity &cookie,
const LicenceRequest &request)
{
INFO_LOG() << "Try to getLicence (from DDS) for '" << request.name() << "' ...";
INFO_LOG(m_logger) << "Try to getLicence (from DDS) for '" << request.name() << "' ...";
Core::FunctionReplyObject ret = getLicenceInternal(QString::fromStdString(request.name()));
m_ddsHandler->fts()->getLicenceReply(cookie, ret);
@@ -76,7 +76,7 @@ void LicenceHandler::onGetLicenceRequest(const rti::core::SampleIdentity &cookie
void LicenceHandler::onFreeLicenceRequest(const rti::core::SampleIdentity &cookie,
const LicenceRequest &request)
{
INFO_LOG() << "Try to freeLicence (from DDS) for '" << request.name() << "' ...";
INFO_LOG(m_logger) << "Try to freeLicence (from DDS) for '" << request.name() << "' ...";
Core::FunctionReplyObject ret = freeLicenceInternal(QString::fromStdString(request.name()));
m_ddsHandler->fts()->freeLicenceReply(cookie, ret);
@@ -87,12 +87,12 @@ void LicenceHandler::onFreeLicenceRequest(const rti::core::SampleIdentity &cooki
bool LicenceHandler::getLicence(const QString &licenceName)
{
INFO_LOG() << "Try to getLicence (from SCM) for '" << licenceName << "' ...";
INFO_LOG(m_logger) << "Try to getLicence (from SCM) for '" << licenceName << "' ...";
Core::FunctionReplyObject fro = getLicenceInternal(licenceName);
if (fro.error())
INFO_LOG() << "getLicence() errorText: " << fro.translated();
INFO_LOG(m_logger) << "getLicence() errorText: " << fro.translated();
return !fro.error();
} // end of getLicence()
@@ -100,12 +100,12 @@ bool LicenceHandler::getLicence(const QString &licenceName)
bool LicenceHandler::freeLicence(const QString &licenceName)
{
INFO_LOG() << "Try to freeLicence (from SCM) for '" << licenceName << "' ...";
INFO_LOG(m_logger) << "Try to freeLicence (from SCM) for '" << licenceName << "' ...";
Core::FunctionReplyObject fro = freeLicenceInternal(licenceName);
if (fro.error())
INFO_LOG() << "freeLicence() errorText: " << fro.translated();
INFO_LOG(m_logger) << "freeLicence() errorText: " << fro.translated();
return !fro.error();
} // end of freeLicence()
@@ -116,13 +116,13 @@ bool LicenceHandler::readLicenceFile()
QFile f(m_xmlFileName);
if (!f.exists())
{
ERROR_LOG() << "Error loading licencefile ... file not found. '" << m_xmlFileName << "'";
ERROR_LOG(m_logger) << "Error loading licencefile ... file not found. '" << m_xmlFileName << "'";
return false;
}
if (!f.open(QIODevice::ReadOnly))
{
ERROR_LOG() << "Error loading licencefile ... file open failed.'" << m_xmlFileName << "'";
ERROR_LOG(m_logger) << "Error loading licencefile ... file open failed.'" << m_xmlFileName << "'";
return false;
}
@@ -131,20 +131,20 @@ bool LicenceHandler::readLicenceFile()
if (m_xmlFileName.endsWith(QLatin1String(".crl")))
{
qbaIn = LtsLicence::decryptData(qbaIn);
INFO_LOG() << "ReadAll() from encrypted licencefile ... bytesAvailable:" << qbaIn.size();
INFO_LOG(m_logger) << "ReadAll() from encrypted licencefile ... bytesAvailable:" << qbaIn.size();
}
else if (m_xmlFileName.endsWith(QLatin1String(".lic")))
INFO_LOG() << "ReadAll() from unencrypted licencefile ... bytesAvailable:" << qbaIn.size();
INFO_LOG(m_logger) << "ReadAll() from unencrypted licencefile ... bytesAvailable:" << qbaIn.size();
f.close();
INFO_LOG() << "Try to parse xml file '" << m_xmlFileName << "'";
INFO_LOG(m_logger) << "Try to parse xml file '" << m_xmlFileName << "'";
m_licenceVec = LtsLicence::readLicences(qbaIn);
if (m_licenceVec.isEmpty())
{
ERROR_LOG() << "Parse error reading xml file '" << m_xmlFileName << "'";
ERROR_LOG(m_logger) << "Parse error reading xml file '" << m_xmlFileName << "'";
return false;
}
return true;
@@ -169,7 +169,7 @@ Core::FunctionReplyObject LicenceHandler::getLicenceInternal(const QString &lice
{
if (licence.maxCount <= licence.licenceRefCount)
{
WARNING_LOG() << "getLicence() for '" << licence.name << "' failed. - No more licences available.";
WARNING_LOG(m_logger) << "getLicence() for '" << licence.name << "' failed. - No more licences available.";
return Core::FunctionReplyObject(0, "No more licences available.");
}
else
@@ -183,14 +183,14 @@ Core::FunctionReplyObject LicenceHandler::getLicenceInternal(const QString &lice
if (m_logger.isInfoEnabled())
{
const QString info = dumpLicenceInformation(licence);
INFO_LOG() << "getLicence() for '" << licenceName << "' ok.\n" << info;
INFO_LOG(m_logger) << "getLicence() for '" << licenceName << "' ok.\n" << info;
}
publishData(licence);
return Core::FunctionReplyObject(i + 1); // id im FRO >0 ; - m_licenceVec beginnt bei [0]
}
}
ERROR_LOG() << "getLicence() for '" << licenceName << "' failed. - No licence with this name.";
ERROR_LOG(m_logger) << "getLicence() for '" << licenceName << "' failed. - No licence with this name.";
return Core::FunctionReplyObject(0, "No licence with this name.");
} // end of getLicenceInternal()
//-----------------------------------------------------------------------------
@@ -213,7 +213,7 @@ Core::FunctionReplyObject LicenceHandler::freeLicenceInternal(const QString &lic
{
if (licence.licenceRefCount <= 0)
{
WARNING_LOG() << "freeLicence() for '" << licence.name << "' failed. - Max number of licences are free.";
WARNING_LOG(m_logger) << "freeLicence() for '" << licence.name << "' failed. - Max number of licences are free.";
return Core::FunctionReplyObject(0, "Max number of licences are free.");
}
else
@@ -230,14 +230,14 @@ Core::FunctionReplyObject LicenceHandler::freeLicenceInternal(const QString &lic
if (m_logger.isInfoEnabled())
{
const QString info = dumpLicenceInformation(licence);
INFO_LOG() << "freeLicence() for '" << licenceName << "' ok.\n" << info;
INFO_LOG(m_logger) << "freeLicence() for '" << licenceName << "' ok.\n" << info;
}
publishData(licence);
return Core::FunctionReplyObject(i + 1); // id im FRO >0 ; - m_licenceVec beginnt bei [0]
}
}
ERROR_LOG() << "freeLicence() for '" << licenceName << "' failed. - No licence with this name.";
ERROR_LOG(m_logger) << "freeLicence() for '" << licenceName << "' failed. - No licence with this name.";
return Core::FunctionReplyObject(0, "No licence with this name.");
}// end of freeLicence()
//-----------------------------------------------------------------------------
@@ -251,13 +251,13 @@ bool LicenceHandler::isLicenceValid(const LtsLicence::Licence &licence) const
{
if (!licence.ignoreExpiration)
{
INFO_LOG() << "Licence '" << licence.name << "' is valid for " << now.daysTo(end) << " days."
INFO_LOG(m_logger) << "Licence '" << licence.name << "' is valid for " << now.daysTo(end) << " days."
<< " Expiration: " << licence.expiration.date().toString()
<< " " << licence.expiration.time().toString();
}
return true;
}
WARNING_LOG() << "Licence '" << licence.name << "' is expired since " << end.daysTo(now) << " days."
WARNING_LOG(m_logger) << "Licence '" << licence.name << "' is expired since " << end.daysTo(now) << " days."
<< " Expiration: " << licence.expiration.date().toString()
<< " " << licence.expiration.time().toString();
return false;
@@ -309,10 +309,10 @@ void LicenceHandler::publishAllData()
void LicenceHandler::publishData(const LtsLicence::Licence &data)
{
INFO_LOG() << "Publish '" << data.name << "' Licence-data to dds";
INFO_LOG(m_logger) << "Publish '" << data.name << "' Licence-data to dds";
if (!m_ddsHandler->dts()->publish(toDdsData(data)))
ERROR_LOG() << "Error publishing '" << data.name << "' Licence-data to dds";
ERROR_LOG(m_logger) << "Error publishing '" << data.name << "' Licence-data to dds";
} // end of publishData()
//-----------------------------------------------------------------------------