return getHypervisorType() + " - " + getHypervisorHost();
}
public synchronized Map<String, IDomain> getDomains() throws VirtException {
Map<String, IDomain> domains = new HashMap<String, IDomain>();
IConnect con = getOrCreateConnection();
LogRecord info = new LogRecord(Level.FINE, "Getting hypervisor domains.");
LOGGER.log(info);
if (con != null) {
for (String c : con.listDefinedDomains()) {
if (c != null && !c.equals("")) {
IDomain domain = null;
try {
domain = con.domainLookupByName(c);
domains.put(domain.getName(), domain);
} catch (Exception e) {
LogRecord rec = new LogRecord(Level.WARNING, "Error retrieving information for domain with name: {0}.");
rec.setParameters(new Object[]{c});
rec.setThrown(e);
LOGGER.log(rec);
}
}
}
for (int c : con.listDomains()) {
IDomain domain = null;
try {
domain = con.domainLookupByID(c);
domains.put(domain.getName(), domain);
} catch (Exception e) {
LogRecord rec = new LogRecord(Level.WARNING, "Error retrieving information for domain with id: {0}.");
rec.setParameters(new Object[]{c});
rec.setThrown(e);