// Path: java/src/main/java/com/cisco/pxgrid/samples/ise/SampleHelper.java
// public static class OffsetDateTimeAdapter extends TypeAdapter<OffsetDateTime> {
// 	DateTimeFormatter formatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
// 
// 	@Override
// 	public void write(JsonWriter out, OffsetDateTime value) throws IOException {
// 		if (value == null) {
// 			out.nullValue();
// 			return;
// 		}
// 		out.value(formatter.format(value));
// 	}
// 
// 	@Override
// 	public OffsetDateTime read(JsonReader in) throws IOException {
// 		if (in.peek() == JsonToken.NULL) {
// 			in.nextNull();
// 			return null;
// 		}
// 		return formatter.parse(in.nextString(), OffsetDateTime::from);
// 	}
// }
// 
// Path: java/src/main/java/com/cisco/pxgrid/samples/ise/model/AccountState.java
// public enum AccountState {
// 	/**
// 	 * The internal state when the account is created, but never connected. 
// 	 */
// 	INIT,
// 	
// 	/**
// 	 * The state when the account is pending for approval from administrator
// 	 */
// 	PENDING,
// 	
// 	/**
// 	 * The state where all pxGrid control functionalities are available.
// 	 */
// 	ENABLED,
// 	
// 	/**
// 	 * A disabled account. Administrator can disable or enable the account.
// 	 */
// 	DISABLED;
// }
// 
// Path: java/src/main/java/com/cisco/pxgrid/samples/ise/model/Service.java
// public class Service {
// 	private String name;
// 	private String nodeName;
// 	private Map<String, String> properties;
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// 	public String getNodeName() {
// 		return nodeName;
// 	}
// 
// 	public void setNodeName(String nodeName) {
// 		this.nodeName = nodeName;
// 	}
// 
// 	public Map<String, String> getProperties() {
// 		return properties;
// 	}
// 
// 	public void setProperties(Map<String, String> properties) {
// 		this.properties = properties;
// 	}
// }


import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.nio.charset.StandardCharsets;
import java.time.OffsetDateTime;
import javax.net.ssl.HttpsURLConnection;
import org.apache.commons.cli.ParseException;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cisco.pxgrid.samples.ise.SampleHelper.OffsetDateTimeAdapter;
import com.cisco.pxgrid.samples.ise.model.AccountState;
import com.cisco.pxgrid.samples.ise.model.Service;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.stream.JsonReader;
					int count = 0;
					jreader.beginArray();
					while (jreader.hasNext()) {
						Session session = gson.fromJson(jreader, Session.class);
						System.out.println("session=" + session);
						count++;
					}
					System.out.println("count=" + count);
				}
			}
		} else {
			try (InputStream in = httpsConn.getErrorStream()) {
				String content = IOUtils.toString(in, StandardCharsets.UTF_8);
				System.out.println("Content: " + content);
			}
		}
	}

	public static void main(String [] args) throws Exception {
		// Parse arguments
		SampleConfiguration config = new SampleConfiguration();
		try {
			config.parse(args);
		} catch (ParseException e) {
			config.printHelp("SessionQueryAll");
			System.exit(1);
		}

		// AccountActivate
		PxgridControl control = new PxgridControl(config);
// Path: java/src/main/java/com/cisco/pxgrid/samples/ise/SampleHelper.java
// public static class OffsetDateTimeAdapter extends TypeAdapter<OffsetDateTime> {
// 	DateTimeFormatter formatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME;
// 
// 	@Override
// 	public void write(JsonWriter out, OffsetDateTime value) throws IOException {
// 		if (value == null) {
// 			out.nullValue();
// 			return;
// 		}
// 		out.value(formatter.format(value));
// 	}
// 
// 	@Override
// 	public OffsetDateTime read(JsonReader in) throws IOException {
// 		if (in.peek() == JsonToken.NULL) {
// 			in.nextNull();
// 			return null;
// 		}
// 		return formatter.parse(in.nextString(), OffsetDateTime::from);
// 	}
// }
// 
// Path: java/src/main/java/com/cisco/pxgrid/samples/ise/model/AccountState.java
// public enum AccountState {
// 	/**
// 	 * The internal state when the account is created, but never connected. 
// 	 */
// 	INIT,
// 	
// 	/**
// 	 * The state when the account is pending for approval from administrator
// 	 */
// 	PENDING,
// 	
// 	/**
// 	 * The state where all pxGrid control functionalities are available.
// 	 */
// 	ENABLED,
// 	
// 	/**
// 	 * A disabled account. Administrator can disable or enable the account.
// 	 */
// 	DISABLED;
// }
// 
// Path: java/src/main/java/com/cisco/pxgrid/samples/ise/model/Service.java
// public class Service {
// 	private String name;
// 	private String nodeName;
// 	private Map<String, String> properties;
// 
// 	public String getName() {
// 		return name;
// 	}
// 
// 	public void setName(String name) {
// 		this.name = name;
// 	}
// 
// 	public String getNodeName() {
// 		return nodeName;
// 	}
// 
// 	public void setNodeName(String nodeName) {
// 		this.nodeName = nodeName;
// 	}
// 
// 	public Map<String, String> getProperties() {
// 		return properties;
// 	}
// 
// 	public void setProperties(Map<String, String> properties) {
// 		this.properties = properties;
// 	}
// }


// Path: java/src/main/java/com/cisco/pxgrid/samples/ise/SessionQueryAll.java
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.nio.charset.StandardCharsets;
import java.time.OffsetDateTime;
import javax.net.ssl.HttpsURLConnection;
import org.apache.commons.cli.ParseException;
import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cisco.pxgrid.samples.ise.SampleHelper.OffsetDateTimeAdapter;
import com.cisco.pxgrid.samples.ise.model.AccountState;
import com.cisco.pxgrid.samples.ise.model.Service;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.stream.JsonReader;

					int count = 0;
					jreader.beginArray();
					while (jreader.hasNext()) {
						Session session = gson.fromJson(jreader, Session.class);
						System.out.println("session=" + session);
						count++;
					}
					System.out.println("count=" + count);
				}
			}
		} else {
			try (InputStream in = httpsConn.getErrorStream()) {
				String content = IOUtils.toString(in, StandardCharsets.UTF_8);
				System.out.println("Content: " + content);
			}
		}
	}

	public static void main(String [] args) throws Exception {
		// Parse arguments
		SampleConfiguration config = new SampleConfiguration();
		try {
			config.parse(args);
		} catch (ParseException e) {
			config.printHelp("SessionQueryAll");
			System.exit(1);
		}

		// AccountActivate
		PxgridControl control = new PxgridControl(config);
		while (control.accountActivate() != AccountState.ENABLED)