Map<String, IISMetaBase> websites = IISMetaBase.getWebSites();
for (String siteName : vhosts) {
IISMetaBase info = websites.get(siteName);
if (info == null) {
continue;
}
Configuration config = resourceDiscoveryContext.getDefaultPluginConfiguration();
config.put(new PropertySimple("siteName", siteName));
config.put(new PropertySimple("port", info.getPort()));
config.put(new PropertySimple("ipAddress", info.getIp()));
config.put(new PropertySimple("docRoot", info.getPath()));
config.put(new PropertySimple("hostname", info.getHostname()));
config.put(new PropertySimple("ssl", info.isRequireSSL()));
// Auto-configure response-time properties. IIS 5.x and 6.x put
// logs by default in system32. (Even though IIS 5.x installs
// into C:\Windows\System32\inetsrv). Should try to get this
// info from either metabase or the registry, though this will
// cover most cases.
config.put(new PropertySimple("logDirectory", "C:\\Windows\\System32\\LogFiles\\W3SVC" + info.getId()));
DiscoveredResourceDetails details = new DiscoveredResourceDetails(resourceDiscoveryContext
.getResourceType(), siteName, siteName, "1.0", siteName + " Virtual Host", config, null);
hostDetails.add(details);