package com.eactive.eai.adapter.http.dynamic;

public class HttpDynamicInAdapterUri {
	
	public String adptGrpName = null;
	public String adptName = null;
	public String uri = null;
	public String adptType = null;
	public Integer listenPort = 0;
	
	public HttpDynamicInAdapterUri(String adptGrpName, String adptName, Integer port, String uri, String adptType) {
		this.adptGrpName = adptGrpName;
		this.adptName    = adptName;
		this.uri         = uri;
		this.adptType    = adptType;
		this.listenPort	 = port;
	}
	
	public HttpDynamicInAdapterUri(String adptGrpName, String adptName, String uri, String adptType) {
		this.adptGrpName = adptGrpName;
		this.adptName    = adptName;
		this.uri         = uri;
		this.adptType    = adptType;
		this.listenPort	 = 0;
	}
	
	public boolean isEqualsAdpt(HttpDynamicInAdapterUri other) {	
		return isEqualsAdpt(other.getAdptGrpName(), other.getAdptName());
	}
	
	public boolean isEqualsAdpt(String adptGrpName, String adptName) {	
		if ( adptGrpName != null && adptGrpName.equals(this.adptGrpName)
				&& adptName != null && adptName.equals(this.adptName) ) {
			return true;
		} else {
			return false;
		}				
	}
	
	public boolean isEqualsAdpt(String adptGrpName) {	
		if ( adptGrpName != null && adptGrpName.equals(this.adptGrpName)) {
			return true;
		} else {
			return false;
		}				
	}
	
	public String getAdptGrpName() {
		return adptGrpName;
	}

	public void setAdptGrpName(String adptGrpName) {
		this.adptGrpName = adptGrpName;
	}

	public String getAdptName() {
		return adptName;
	}

	public void setAdptName(String adptName) {
		this.adptName = adptName;
	}

	public String getUri() {
		return uri;
	}

	public void setUri(String uri) {
		this.uri = uri;
	}
	
	public String getAdptType() {
		return adptType;
	}

	public void setAdptType(String adptType) {
		this.adptType = adptType;
	}

	public Integer getListenPort() {
		return listenPort;
	}

	public void setListenPort(Integer listenPort) {
		this.listenPort = listenPort;
	}

	public String toString() {
        StringBuffer sb = new StringBuffer();
        sb.append("HttpDynamicInAdapterUri[ adptGrpName=").append(adptGrpName);
        sb.append(", adptName=").append(adptName);
        sb.append(", port=").append(listenPort);
        sb.append(", uri=").append(uri);
        sb.append(", adptType=").append(adptType);
        sb.append(" ]");
        
        return sb.toString();   
	}
}
