예제 #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
파일: Dispatcher.cpp 프로젝트: zabela/joynr
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();
}