package com.eactive.eai.rms.onl.manage.serviceinfo.itsm.vo;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;

import com.eactive.eai.common.util.SystemUtil;

@XmlRootElement(name = "adapter")
@XmlAccessorType(XmlAccessType.FIELD)
public class AdapterInfo {

	private String instance;
	private String serverType;
	private String adapterName;
	private String instiName;
	private String bizName;
	private String ioType;
	private Boolean status;
	
	public AdapterInfo() {}
	
	public AdapterInfo(String instance, String adapterName, String instiName, String bizName, Boolean status) {
		
		String serverType = System.getProperty(SystemUtil.EAI_SYSTEMMODE);
		
		this.instance = instance;
		this.serverType = serverType.equals("S")? "T" : serverType;
		this.adapterName = adapterName;
		this.instiName = instiName;
		this.bizName = bizName;
		this.status = status;
		
		if(adapterName != null) {
			switch(adapterName.split("_")[2]) {
			case "IN" : this.ioType = "수신";
				break;
			case "OU" : this.ioType = "송신";
				break;
			case "IO" : this.ioType = "송수신";
				break;
			}
		}
	}
	
	public String getInstance() {
		return instance;
	}

	public String getServerType() {
		return serverType;
	}

	public String getAdapterName() {
		return adapterName;
	}

	public String getInstiName() {
		return instiName;
	}

	public String getBizName() {
		return bizName;
	}

	public String getIoType() {
		return ioType;
	}

	public Boolean getStatus() {
		return status;
	}

}
