public DetectResults isServiceDetected(InetAddress address, WSManEndpoint endpoint) { // Issue the query! List<Node> nodes = Lists.newLinkedList(); final WSManClient client = m_factory.getClient(endpoint); try { LOG.debug("Issuing an ENUM on '{}' with query '{}'", resourceUri, wql); client.enumerateAndPullUsingFilter(resourceUri, WSManConstants.XML_NS_WQL_DIALECT, wql, nodes, true); } catch (WSManException e) { LOG.debug("ENUM failed for address '{}' with endpoint '{}', resourceUri '{}', query '{}'", address, endpoint, resourceUri, wql, e); } return new DetectResultsImpl(nodes.size() > 0); }
public DetectResults isServiceDetected(InetAddress address, WSManEndpoint endpoint) { // Issue the "Identify" request final WSManClient client = m_factory.getClient(endpoint); Identity identity = null; final Map<String, String> attributes = new HashMap<>(); try { identity = client.identify(); LOG.info("Identify succeeded for address {} with product vendor '{}' and product version '{}'.", address, identity.getProductVendor(), identity.getProductVersion()); attributes.put(UPDATE_ASSETS, Boolean.toString(m_updateAssets)); attributes.put(PRODUCT_VENDOR, identity.getProductVendor()); attributes.put(PRODUCT_VERSION, identity.getProductVersion()); } catch (WSManException e) { LOG.info("Identify failed for address {} with endpoint {}.", address, endpoint, e); } return new DetectResultsImpl(identity != null, attributes); }
if (group.getFilter() == null) { LOG.debug("Enumerating and pulling {} on {}.", group.getResourceUri(), client); client.enumerateAndPull(group.getResourceUri(), nodes, true); } else { LOG.debug("Enumerating and pulling {} with dialect {} and filter {} on {}.", group.getResourceUri(), group.getDialect(), group.getFilter(), client); client.enumerateAndPullUsingFilter(group.getResourceUri(), group.getDialect(), group.getFilter(), nodes, true);
while (retryLoop.shouldContinue()) { try { node = client.get(resourceUri, selectors); break; } catch (WSManException e) {
if (group.getFilter() == null) { LOG.debug("Enumerating and pulling {} on {}.", group.getResourceUri(), client); client.enumerateAndPull(group.getResourceUri(), nodes, true); } else { LOG.debug("Enumerating and pulling {} with dialect {} and filter {} on {}.", group.getResourceUri(), group.getDialect(), group.getFilter(), client); client.enumerateAndPullUsingFilter(group.getResourceUri(), group.getDialect(), group.getFilter(), nodes, true);
while (retryLoop.shouldContinue()) { try { node = client.get(resourceUri, selectors); break; } catch (WSManException e) {
public DetectResults isServiceDetected(InetAddress address, WSManEndpoint endpoint) { // Issue the query! List<Node> nodes = Lists.newLinkedList(); final WSManClient client = m_factory.getClient(endpoint); try { LOG.debug("Issuing an ENUM on '{}' with query '{}'", resourceUri, wql); client.enumerateAndPullUsingFilter(resourceUri, WSManConstants.XML_NS_WQL_DIALECT, wql, nodes, true); } catch (WSManException e) { LOG.debug("ENUM failed for address '{}' with endpoint '{}', resourceUri '{}', query '{}'", address, endpoint, resourceUri, wql, e); } return new DetectResultsImpl(nodes.size() > 0); }
public DetectResults isServiceDetected(InetAddress address, WSManEndpoint endpoint) { // Issue the "Identify" request final WSManClient client = m_factory.getClient(endpoint); Identity identity = null; final Map<String, String> attributes = new HashMap<>(); try { identity = client.identify(); LOG.info("Identify succeeded for address {} with product vendor '{}' and product version '{}'.", address, identity.getProductVendor(), identity.getProductVersion()); attributes.put(UPDATE_ASSETS, Boolean.toString(m_updateAssets)); attributes.put(PRODUCT_VENDOR, identity.getProductVendor()); attributes.put(PRODUCT_VERSION, identity.getProductVersion()); } catch (WSManException e) { LOG.info("Identify failed for address {} with endpoint {}.", address, endpoint, e); } return new DetectResultsImpl(identity != null, attributes); }
wqls.add(wqlobj.getWql()); resourceUris.add(wqlobj.getResourceUri()); client.enumerateAndPullUsingFilter(wqlobj.getResourceUri(), WSManConstants.XML_NS_WQL_DIALECT, wqlobj.getWql(), nodes, true); if (!nodes.isEmpty()) { values.add(nodes.get(0).getTextContent());