Example #1
0
bool deleteDomain (SDBConnectionPtr aSDB, const std::string &aDomainName) {
  try {
      DeleteDomainResponsePtr lRes = aSDB->deleteDomain (aDomainName);
      std::cout << "delete domain successfully" << std::endl;
    } catch (DeleteDomainException &e) {
      std::cerr << e.what() << std::endl;
      return false;
    }
  return true;
}
Example #2
0
bool deleteAllDomains (SDBConnectionPtr aSDB, std::string aPrefix) {
  try {
      ListDomainsResponsePtr lRes = aSDB->listDomains();
      std::cout << "start deleting" << std::endl;
      lRes->open();
      std::string lDomain;
      while (lRes->next (lDomain)) {
        if(aPrefix.length() == 0 || lDomain.compare(0, aPrefix.length(),aPrefix) == 0){
            std::cout << "   " << lDomain  << std::endl;
            aSDB->deleteDomain (lDomain);
          }
        }
      lRes->close();
    } catch (PutAttributesException &e) {
      std::cerr << e.what() << std::endl;
      return false;
    }
  return true;
}