public Set<DiscoveredResourceDetails> discoverResources(ResourceDiscoveryContext<PlatformComponent> discoveryContext)
throws Exception {
Set<DiscoveredResourceDetails> results = new HashSet<DiscoveredResourceDetails>();
SystemInfo sysInfo = discoveryContext.getSystemInformation();
if (!sysInfo.isNative()) {
log.debug("Skipping " + discoveryContext.getResourceType().getName() +
" discovery, since native system info is not available.");
return results;
}
for (NetworkAdapterInfo info : sysInfo.getAllNetworkAdapters()) {
Configuration configuration = discoveryContext.getDefaultPluginConfiguration();
configuration.put(new PropertySimple("macAddress", info.getMacAddressString()));
DiscoveredResourceDetails found = new DiscoveredResourceDetails(discoveryContext.getResourceType(),
info.getName(), info.getDisplayName(), null, info.getMacAddressString(), configuration, null);
results.add(found);