コード例 #1
0
ファイル: service-qmf.cpp プロジェクト: antoinevg/matahari
int
SrvAgent::setup(qmf::AgentSession session)
{
#ifdef __linux__
    standards.push_back("ocf");
#endif
    standards.push_back("lsb");
#ifndef WIN32
    standards.push_back("windows");
#endif

    _package.configure(session);

    _services = qmf::Data(_package.data_Services);

    _services.setProperty("uuid", mh_uuid());
    _services.setProperty("hostname", mh_hostname());

    session.addData(_services, "Services");

    _resources = qmf::Data(_package.data_Resources);

    _resources.setProperty("uuid", mh_uuid());
    _resources.setProperty("hostname", mh_hostname());

    session.addData(_resources, "Resources");

    return 0;
}
コード例 #2
0
ファイル: mh_agent.cpp プロジェクト: russellb/matahari
void
MatahariAgentImpl::registerAgent(void)
{
    qmf::Schema data_Agent(qmf::SCHEMA_TYPE_DATA,
                           "org.matahariproject", "Agent");
    {
        qmf::SchemaProperty prop("hostname", qmf::SCHEMA_DATA_STRING);
        prop.setAccess(qmf::ACCESS_READ_ONLY);
        prop.setIndex(true);
        prop.setDesc("Hostname");
        data_Agent.addProperty(prop);
    }
    {
        qmf::SchemaProperty prop("uuid", qmf::SCHEMA_DATA_STRING);
        prop.setAccess(qmf::ACCESS_READ_ONLY);
        prop.setIndex(true);
        prop.setDesc("Filesystem Host UUID");
        data_Agent.addProperty(prop);
    }

    _agent_session.registerSchema(data_Agent);

    _agent_instance = qmf::Data(data_Agent);
    _agent_instance.setProperty("uuid", mh_uuid());
    _agent_instance.setProperty("hostname", mh_hostname());
    _agent_session.addData(_agent_instance);
}
コード例 #3
0
ファイル: widgetsessions.cpp プロジェクト: ErnieAllen/XView
void WidgetSessions::showRelated(const qmf::Data& object, const QString &widget_type, ArrowDirection a)
{
    if (!updateAll)
        if (this->hasData() && (arrow() != arrowNone)) {
            //qDebug("showRelated: %s needs an update", this->objectName().toStdString().c_str());
            emit needUpdate();
            return;
        }

    setArrow(a);

    if (widget_type == "widgetConnections") {
        qpid::types::Variant value = object.getProperty("address");
        std::string name = value.asString();
        related->setRelatedData("connectionRef", name);
        related->clearFilter();
        emit needData();
        return;
    }
    // the object is a subscription
    qpid::types::Variant value = object.getProperty("sessionRef");
    QString name(value.asMap()["_object_name"].asString().c_str());
    QString session = name.section(':', -1);

    related->setRelatedData("name", session.toStdString());
    related->clearFilter();
    //qDebug("showRelated: %s needs new data", this->objectName().toStdString().c_str());
    emit needData();

}
コード例 #4
0
int
NetAgent::setup(qmf::AgentSession session)
{
    _package.configure(session);
    _instance = qmf::Data(_package.data_Network);

    _instance.setProperty("hostname", mh_hostname());
    _instance.setProperty("uuid", mh_uuid());

    session.addData(_instance, NETWORK_NAME);
    return 0;
}
コード例 #5
0
ファイル: object-details.cpp プロジェクト: ErnieAllen/XView
void ObjectDetailsModel::showObjectDetail(const qmf::Data& object)
{
    if (!object.isValid())
        return;

    clear();

    const qpid::types::Variant::Map& attrs(object.getProperties());

    beginInsertRows(QModelIndex(), 0, attrs.size() - 2);
    for (qpid::types::Variant::Map::const_iterator iter = attrs.begin();
         iter != attrs.end(); iter++) {
         // We manually added the correlator to the map. Don't display it
         if (iter->first != "correlator") {
            keys << QString(iter->first.c_str());
            values << QString(iter->second.asString().c_str());
         }
    }
    endInsertRows();
    emit detailReady();
}