示例#1
0
void Dispatcher::handleSubscriptionStopReceived(const JoynrMessage& message)
{
    LOG_DEBUG(logger, "handleSubscriptionStopReceived");
    QByteArray jsonSubscriptionStop = message.getPayload();

    SubscriptionStop* subscriptionStop =
            JsonSerializer::deserialize<SubscriptionStop>(jsonSubscriptionStop);
    if (subscriptionStop == Q_NULLPTR) {
        LOG_ERROR(logger,
                  QString("Unable to deserialize subscription stop object from: %1")
                          .arg(QString::fromUtf8(jsonSubscriptionStop)));
        return;
    }
    QString subscriptionId = subscriptionStop->getSubscriptionId();
    assert(publicationManager != NULL);
    publicationManager->stopPublication(subscriptionId);
}
示例#2
0
void Dispatcher::handleSubscriptionStopReceived(const JoynrMessage& message)
{
    JOYNR_LOG_DEBUG(logger, "handleSubscriptionStopReceived");
    std::string jsonSubscriptionStop = message.getPayload();

    std::string subscriptionId;
    try {
        SubscriptionStop subscriptionStop =
                JsonSerializer::deserialize<SubscriptionStop>(jsonSubscriptionStop);

        subscriptionId = subscriptionStop.getSubscriptionId();
    } catch (const std::invalid_argument& e) {
        JOYNR_LOG_ERROR(logger,
                        "Unable to deserialize subscription stop object from: {} - error: {}",
                        jsonSubscriptionStop,
                        e.what());
        return;
    }
    assert(publicationManager != nullptr);
    publicationManager->stopPublication(subscriptionId);
}
示例#3
0
bool SubscriptionStop::operator==(const SubscriptionStop& other) const
{
    return subscriptionId == other.getSubscriptionId();
}