// Path: cxf/src/main/java/org/opennms/core/wsman/cxf/CXFWSManClientFactory.java
// public class CXFWSManClientFactory implements WSManClientFactory {
// 
//     @Override
//     public CXFWSManClient getClient(WSManEndpoint endpoint) {
//         return new CXFWSManClient(endpoint);
//     }
// }


import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.config.Configuration;
import org.apache.logging.log4j.core.config.LoggerConfig;
import org.apache.logging.log4j.spi.StandardLevel;
import org.kohsuke.args4j.Argument;
import org.kohsuke.args4j.CmdLineException;
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.Option;
import org.kohsuke.args4j.ParserProperties;
import org.kohsuke.args4j.spi.MapOptionHandler;
import org.opennms.core.wsman.cxf.CXFWSManClientFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import com.google.common.collect.Lists;
                    LOG.info("Succesfully pulled {} nodes.", nodes.size());
                }
            }

            // Dump the list of nodes to stdout
            for (Node node : nodes) {
                dumpNodeToStdout(node);
            }
        } else if (operation == WSManOperation.GET) {
            LOG.info("Issuing a GET on '{}' with selectors {}", resourceUri, selectors);
            Node node = client.get(resourceUri, selectors);
            LOG.info("GET successful.");

            // Dump the node to stdout
            dumpNodeToStdout(node);
        } else if (operation == WSManOperation.IDENTIFY) {
            LOG.info("Issuing IDENTIFY");
            Identity identity = client.identify();
            LOG.info("IDENTIFY successful: {}", identity);
        }
    }

    private void setupLogging() {
        Level level = Level.getLevel(logLevel.name());
        LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
        Configuration config = ctx.getConfiguration();
        // Setup the root logger to the requested log level
        LoggerConfig loggerConfig = config.getLoggerConfig(LogManager.ROOT_LOGGER_NAME);
        loggerConfig.setLevel(level);
        // Dump the requests/responses when requested
// Path: cxf/src/main/java/org/opennms/core/wsman/cxf/CXFWSManClientFactory.java
// public class CXFWSManClientFactory implements WSManClientFactory {
// 
//     @Override
//     public CXFWSManClient getClient(WSManEndpoint endpoint) {
//         return new CXFWSManClient(endpoint);
//     }
// }


// Path: cli/src/main/java/org/opennms/core/wsman/WSManCli.java
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.config.Configuration;
import org.apache.logging.log4j.core.config.LoggerConfig;
import org.apache.logging.log4j.spi.StandardLevel;
import org.kohsuke.args4j.Argument;
import org.kohsuke.args4j.CmdLineException;
import org.kohsuke.args4j.CmdLineParser;
import org.kohsuke.args4j.Option;
import org.kohsuke.args4j.ParserProperties;
import org.kohsuke.args4j.spi.MapOptionHandler;
import org.opennms.core.wsman.cxf.CXFWSManClientFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import com.google.common.collect.Lists;

                    LOG.info("Succesfully pulled {} nodes.", nodes.size());
                }
            }

            // Dump the list of nodes to stdout
            for (Node node : nodes) {
                dumpNodeToStdout(node);
            }
        } else if (operation == WSManOperation.GET) {
            LOG.info("Issuing a GET on '{}' with selectors {}", resourceUri, selectors);
            Node node = client.get(resourceUri, selectors);
            LOG.info("GET successful.");

            // Dump the node to stdout
            dumpNodeToStdout(node);
        } else if (operation == WSManOperation.IDENTIFY) {
            LOG.info("Issuing IDENTIFY");
            Identity identity = client.identify();
            LOG.info("IDENTIFY successful: {}", identity);
        }
    }

    private void setupLogging() {
        Level level = Level.getLevel(logLevel.name());
        LoggerContext ctx = (LoggerContext) LogManager.getContext(false);
        Configuration config = ctx.getConfiguration();
        // Setup the root logger to the requested log level
        LoggerConfig loggerConfig = config.getLoggerConfig(LogManager.ROOT_LOGGER_NAME);
        loggerConfig.setLevel(level);
        // Dump the requests/responses when requested
        if (logRequests) {