// 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 org.apache.commons.cli.ParseException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cisco.pxgrid.samples.ise.model.AccountState;
import com.cisco.pxgrid.samples.ise.model.Service;
package com.cisco.pxgrid.samples.ise;




/**
 * Demonstrates how to query session by IP from ISE Session Directory service
 */
public class SessionQueryByIP {
	private static Logger logger = LoggerFactory.getLogger(SessionQueryByIP.class);

	private static class SessionQueryRequest {
		String ipAddress;
	}
	
	private static void query(SampleConfiguration config, String ip) throws IOException {
		PxgridControl pxgrid = new PxgridControl(config);
		
		// pxGrid ServiceLookup for session service
		Service[] services = pxgrid.serviceLookup("com.cisco.ise.session");
		if (services == null || services.length == 0) {
			System.out.println("Service unavailabe");
			return;
		}
		
		// Use first service
// 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/SessionQueryByIP.java
import java.io.IOException;
import org.apache.commons.cli.ParseException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.cisco.pxgrid.samples.ise.model.AccountState;
import com.cisco.pxgrid.samples.ise.model.Service;

package com.cisco.pxgrid.samples.ise;




/**
 * Demonstrates how to query session by IP from ISE Session Directory service
 */
public class SessionQueryByIP {
	private static Logger logger = LoggerFactory.getLogger(SessionQueryByIP.class);

	private static class SessionQueryRequest {
		String ipAddress;
	}
	
	private static void query(SampleConfiguration config, String ip) throws IOException {
		PxgridControl pxgrid = new PxgridControl(config);
		
		// pxGrid ServiceLookup for session service
		Service[] services = pxgrid.serviceLookup("com.cisco.ise.session");
		if (services == null || services.length == 0) {
			System.out.println("Service unavailabe");
			return;
		}
		
		// Use first service
		Service service = services[0];