本文整理汇总了C++中NodeType::getState方法的典型用法代码示例。如果您正苦于以下问题:C++ NodeType::getState方法的具体用法?C++ NodeType::getState怎么用?C++ NodeType::getState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NodeType
的用法示例。
在下文中一共展示了NodeType::getState方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readNode
Node* LdapTools::readNode(const string nodeName) {
Node* retval = NULL;
string base("sstNode=");
base.append(nodeName).append(",ou=nodes,ou=virtualization,ou=services,").append(
Config::getInstance()->getLdapBaseDn());
SYSLOGLOGGER(logDEBUG) << "readNode " << base;
LDAPSearchResults* entries = lc->search(base, LDAPConnection::SEARCH_SUB);
if (entries != 0) {
LDAPEntry* entry = entries->getNext();
if (entry != 0) {
retval = new Node(entry->getDN(), this);
}
while (entry != 0) {
// SYSLOGLOGGER(logINFO) << "dn: " << entry->getDN();
const LDAPAttributeList* attrs = entry->getAttributes();
LDAPAttributeList::const_iterator it = attrs->begin();
for (; it != attrs->end(); it++) {
LDAPAttribute attr = *it;
// SYSLOGLOGGER(logINFO) << attr.getName() << "(";
// SYSLOGLOGGER(logINFO) << attr.getNumValues() << "): ";
StringList values = attr.getValues();
StringList::const_iterator it2 = values.begin();
string value = *it2;
// for (; it2 != values.end(); it2++) {
//
// SYSLOGLOGGER(logINFO) << *it2 << "; ";
// }
// SYSLOGLOGGER(logINFO) << std::endl;
retval->addAttribute(entry->getDN(), attr.getName(), value);
}
delete entry;
entry = entries->getNext();
}
if (NULL != retval) {
NodeType* type = retval->getType(string("VM-Node"));
string nodestate = type->getState();
retval->setMaintenance(0 == nodestate.compare("maintenance"));
}
}
return retval;
}