// Path: http2-client/src/org/iproduct/demo/profiler/client/model/ProcessInfo.java
// public class ProcessInfo implements Serializable {
//     private static final long serialVersionUID = -6705829915457870975L;
// 
//     private long pid;
//     private String command;
// 
//     public ProcessInfo() {
//     }
// 
//     public ProcessInfo(long pid, String command) {
//         this.pid = pid;
//         this.command = command;
//     }
// 
//     public long getPid() {
//         return pid;
//     }
// 
//     public void setPid(long pid) {
//         this.pid = pid;
//     }
// 
//     public String getCommand() {
//         return command;
//     }
// 
//     public void setCommand(String command) {
//         this.command = command;
//     }
//     
//     @Override
// 	public int hashCode() {
// 		final int prime = 31;
// 		int result = 1;
// 		result = prime * result + ((command == null) ? 0 : command.hashCode());
// 		result = prime * result + (int) (pid ^ (pid >>> 32));
// 		return result;
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (this == obj)
// 			return true;
// 		if (obj == null)
// 			return false;
// 		if (getClass() != obj.getClass())
// 			return false;
// 		ProcessInfo other = (ProcessInfo) obj;
// 		if (command == null) {
// 			if (other.command != null)
// 				return false;
// 		} else if (!command.equals(other.command))
// 			return false;
// 		if (pid != other.pid)
// 			return false;
// 		return true;
// 	}
// 
// 	public String toString() { 
//     	return "ProcessInfo[" + pid + ", " + command + "]";
//     }
//     
// }


import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import org.iproduct.demo.profiler.client.model.ProcessInfo;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import jdk.incubator.http.HttpClient;
import jdk.incubator.http.HttpRequest;
import jdk.incubator.http.HttpResponse;

package org.iproduct.demo.profiler.client;


//import javax.ws.rs.core.GenericType;
//import javax.ws.rs.sse.SseEventSource;

//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;




public class ProfilerAppClient {
	public static final String PROFILER_API_URL = "http://localhost:8080/rest/api/";


	public static void main(String[] args) throws URISyntaxException, InterruptedException {
		
		HttpClient client = HttpClient.newHttpClient();

		HttpRequest processesReq = HttpRequest.newBuilder()
			    .uri(new URI(PROFILER_API_URL + "processes"))
			    .GET()
			    .build();


// Path: http2-client/src/org/iproduct/demo/profiler/client/model/ProcessInfo.java
// public class ProcessInfo implements Serializable {
//     private static final long serialVersionUID = -6705829915457870975L;
// 
//     private long pid;
//     private String command;
// 
//     public ProcessInfo() {
//     }
// 
//     public ProcessInfo(long pid, String command) {
//         this.pid = pid;
//         this.command = command;
//     }
// 
//     public long getPid() {
//         return pid;
//     }
// 
//     public void setPid(long pid) {
//         this.pid = pid;
//     }
// 
//     public String getCommand() {
//         return command;
//     }
// 
//     public void setCommand(String command) {
//         this.command = command;
//     }
//     
//     @Override
// 	public int hashCode() {
// 		final int prime = 31;
// 		int result = 1;
// 		result = prime * result + ((command == null) ? 0 : command.hashCode());
// 		result = prime * result + (int) (pid ^ (pid >>> 32));
// 		return result;
// 	}
// 
// 	@Override
// 	public boolean equals(Object obj) {
// 		if (this == obj)
// 			return true;
// 		if (obj == null)
// 			return false;
// 		if (getClass() != obj.getClass())
// 			return false;
// 		ProcessInfo other = (ProcessInfo) obj;
// 		if (command == null) {
// 			if (other.command != null)
// 				return false;
// 		} else if (!command.equals(other.command))
// 			return false;
// 		if (pid != other.pid)
// 			return false;
// 		return true;
// 	}
// 
// 	public String toString() { 
//     	return "ProcessInfo[" + pid + ", " + command + "]";
//     }
//     
// }


// Path: http2-client/src/org/iproduct/demo/profiler/client/ProfilerAppClient.java
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import org.iproduct.demo.profiler.client.model.ProcessInfo;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.reflect.TypeToken;
import jdk.incubator.http.HttpClient;
import jdk.incubator.http.HttpRequest;
import jdk.incubator.http.HttpResponse;

package org.iproduct.demo.profiler.client;


//import javax.ws.rs.core.GenericType;
//import javax.ws.rs.sse.SseEventSource;

//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;




public class ProfilerAppClient {
	public static final String PROFILER_API_URL = "http://localhost:8080/rest/api/";


	public static void main(String[] args) throws URISyntaxException, InterruptedException {
		
		HttpClient client = HttpClient.newHttpClient();

		HttpRequest processesReq = HttpRequest.newBuilder()
			    .uri(new URI(PROFILER_API_URL + "processes"))
			    .GET()
			    .build();


		TypeToken<ArrayList<ProcessInfo>> token = new TypeToken<ArrayList<ProcessInfo>>() {};
