import dto.LiveNode;
import java.util.List;

public class Client {
    public static void main(String[] args) {

        String ips = "109.231.122.0-100";//"109.231.122.54";
        CommandExecutor commandExecutor = new CommandExecutor();
        String nmapOutput = commandExecutor.execute("nmap --open " + ips + " -p 50070 -oX -");

        XmlToJsonConverter converter = new XmlToJsonConverter();
        PotentialNameNodeDiscoverer pnd = new PotentialNameNodeDiscoverer();
        String jsonString = converter.process(nmapOutput);
        List<String> potentialNameNodes = pnd.getPotentialNameNodes(jsonString);

        for (String ip : potentialNameNodes) {
            String url = "http://" + ip + ":50070/jmx?qry=Hadoop:service=NameNode,name=NameNodeInfo";
            HdfsNodeExtractor hdfsNodeExtractor = new HdfsNodeExtractor(url);
            List<LiveNode> liveDataNodes = hdfsNodeExtractor.getLiveDataNodes();
            //hdfsNodeExtractor.prettyPrint();
            System.out.print(liveDataNodes);
        }

        //"nmap --open 109.231.122.240 109.231.122.54 -p 50070"
    }
}

@@ -124,53 +124,173 @@
 ring
- ips = %22109.231.122.0-100%22;//%22109.231.122.54%22
+Builder ipList = new StringBuilder();%0A        for (String arg : args) %7B%0A            ipList.append(arg + %22 %22);%0A        %7D%0A        String ips = ipList.toString().trim()
 ;%0A  
@@ -1144,73 +1144,8 @@
    %7D
-%0A%0A        //%22nmap --open 109.231.122.240 109.231.122.54 -p 50070%22
 %0A   

Use program arguments to specify ip and ip ranges.