// Path: src/main/java/org/erc/qmm/mq/MQUtils.java
// public abstract class MQUtils {
// 	
// 	/**
// 	 * Builds the manager.
// 	 *
// 	 * @param config the config
// 	 * @return the MQ queue manager
// 	 * @throws MQException the MQ exception
// 	 */
// 	public static MQQueueManager buildManager(QueueConfig config) throws MQException{
// 		return buildManager(config.getHost(),config.getPort(),config.getChannel(), config.getManager());
// 	}
// 	
// 	/**
// 	 * Builds the manager.
// 	 *
// 	 * @param host the host
// 	 * @param port the port
// 	 * @param channel the channel
// 	 * @param manager the manager
// 	 * @return the MQ queue manager
// 	 * @throws MQException the MQ exception
// 	 */
// 	public static MQQueueManager buildManager(String host,int port,String channel,String manager) throws MQException{
// 		Hashtable<String,Object> mqProps = new Hashtable<String,Object>();
// 
// 		if(host != null){
// 			mqProps.put("hostname", host);
// 		}
// 		if(port >0 ){
// 			mqProps.put("port",port);
// 		}
// 		if(channel != null){
// 			mqProps.put("channel", channel);
// 		}
// 		return new MQQueueManager(manager,mqProps);
// 	}
// }


import java.io.IOException;
import java.util.List;
import java.util.Vector;
import org.erc.qmm.mq.MQUtils;
import com.ibm.mq.MQException;
import com.ibm.mq.MQGetMessageOptions;
import com.ibm.mq.MQMessage;
import com.ibm.mq.MQPutMessageOptions;
import com.ibm.mq.MQQueue;
import com.ibm.mq.MQQueueManager;
package org.erc.qmm.mq.agent;




/**
 * The Class Agent.
 */
public class Agent {

	/** The pmo. */
	private final MQPutMessageOptions pmo = new MQPutMessageOptions();
	
	/** The gmo. */
	private final MQGetMessageOptions gmo = new MQGetMessageOptions();

	/** The Constant modelQueueName. */
	private static final String modelQueueName = "SYSTEM.DEFAULT.MODEL.QUEUE";
	
	/** The Constant expiryTime. */
	private static final int expiryTime = 300;
	
	/** The Constant encoding. */
	private static final int encoding = 273;
	
	/** The qmanager. */
	private MQQueueManager qmanager;
	
	/** The admin queue. */
	private MQQueue adminQueue;
	
	/** The reply queue. */
	private MQQueue replyQueue;

	/** The qmanager_level. */
	private int qmanager_level;
	
	/** The qmanager_platform. */
	private int qmanager_platform;

	/**
	 * Instantiates a new agent.
	 *
	 * @param host the host
	 * @param port the port
	 * @param channel the channel
	 * @param manager the manager
	 * @throws MQException the MQ exception
	 */
	public Agent(String host, int port, String channel,String manager) throws MQException {
		pmo.options = 128;
		gmo.options = 24577;
		gmo.waitInterval = 30000;
// Path: src/main/java/org/erc/qmm/mq/MQUtils.java
// public abstract class MQUtils {
// 	
// 	/**
// 	 * Builds the manager.
// 	 *
// 	 * @param config the config
// 	 * @return the MQ queue manager
// 	 * @throws MQException the MQ exception
// 	 */
// 	public static MQQueueManager buildManager(QueueConfig config) throws MQException{
// 		return buildManager(config.getHost(),config.getPort(),config.getChannel(), config.getManager());
// 	}
// 	
// 	/**
// 	 * Builds the manager.
// 	 *
// 	 * @param host the host
// 	 * @param port the port
// 	 * @param channel the channel
// 	 * @param manager the manager
// 	 * @return the MQ queue manager
// 	 * @throws MQException the MQ exception
// 	 */
// 	public static MQQueueManager buildManager(String host,int port,String channel,String manager) throws MQException{
// 		Hashtable<String,Object> mqProps = new Hashtable<String,Object>();
// 
// 		if(host != null){
// 			mqProps.put("hostname", host);
// 		}
// 		if(port >0 ){
// 			mqProps.put("port",port);
// 		}
// 		if(channel != null){
// 			mqProps.put("channel", channel);
// 		}
// 		return new MQQueueManager(manager,mqProps);
// 	}
// }


// Path: src/main/java/org/erc/qmm/mq/agent/Agent.java
import java.io.IOException;
import java.util.List;
import java.util.Vector;
import org.erc.qmm.mq.MQUtils;
import com.ibm.mq.MQException;
import com.ibm.mq.MQGetMessageOptions;
import com.ibm.mq.MQMessage;
import com.ibm.mq.MQPutMessageOptions;
import com.ibm.mq.MQQueue;
import com.ibm.mq.MQQueueManager;

package org.erc.qmm.mq.agent;




/**
 * The Class Agent.
 */
public class Agent {

	/** The pmo. */
	private final MQPutMessageOptions pmo = new MQPutMessageOptions();
	
	/** The gmo. */
	private final MQGetMessageOptions gmo = new MQGetMessageOptions();

	/** The Constant modelQueueName. */
	private static final String modelQueueName = "SYSTEM.DEFAULT.MODEL.QUEUE";
	
	/** The Constant expiryTime. */
	private static final int expiryTime = 300;
	
	/** The Constant encoding. */
	private static final int encoding = 273;
	
	/** The qmanager. */
	private MQQueueManager qmanager;
	
	/** The admin queue. */
	private MQQueue adminQueue;
	
	/** The reply queue. */
	private MQQueue replyQueue;

	/** The qmanager_level. */
	private int qmanager_level;
	
	/** The qmanager_platform. */
	private int qmanager_platform;

	/**
	 * Instantiates a new agent.
	 *
	 * @param host the host
	 * @param port the port
	 * @param channel the channel
	 * @param manager the manager
	 * @throws MQException the MQ exception
	 */
	public Agent(String host, int port, String channel,String manager) throws MQException {
		pmo.options = 128;
		gmo.options = 24577;
		gmo.waitInterval = 30000;
		qmanager = MQUtils.buildManager(host,port,channel,manager);