⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 builder_emereq.java

📁 中移动lbs系统服务器端源码
💻 JAVA
字号:
package cn.netjava.lbs.le;

/**
 * 
 * <p>Title:中国移动手机定位系统(LBS) le接口库</p>
 * <p>Description: 紧急状态的定位请求打包</p>
 * <p>Company:蓝杰实训 </p>
 * @author www.NetJava.cn 
 * @version 0.1
 */

class Builder_EmeReq extends Builder_req {
	/**
	 * 紧急定位自己
	 */
	void L_EmeSelf() {
		buildHead();
		buildBody();
		addTail();
	}

	/**
	 * 紧急定位别人
	 */
	void L_EmeOther() {
		buildHead();
		addReqOther();
		buildBody();
		addTail();
	}

	/**
	 * 加入消息头
	 */
	private void buildHead() {
		sb.append("<svc_init ver=\"1.0.0\" >\n");
		sb.append("<hdr ver=\"1.0.0\">\n");
		sb.append("<client> \n");
		sb.append("<id>" + this.getValue(AttributeDesc.client_id) + "</id>\n");
		sb.append("<pwd>" + this.getValue(AttributeDesc.client_pwd)
				+ "</pwd>\n");
		sb.append("<serviceid>" + this.getValue(AttributeDesc.client_serviceid)
				+ "</serviceid>\n");
		// sb.append("<requestmode
		// type=\""+this.getValue(AttributeDesc.requestmode_type)+"\"/>");
		sb.append("</client>\n");
	}

	/**
	 * 如果有行业用户的话 ???
	 */
	private void addSubClient() {
		sb.append("<subclient>\n");
		sb.append("<id>" + this.getValue(AttributeDesc.subclient_id)
				+ "</id>\n");// <!—如果moto 是行业用户,ABC 就是行业用户下的某公司名à
		sb.append("</subclient>\n");
	}

	/**
	 * 加入共有的消息体 slir_res_type
	 * 
	 * <msids><!—被查号段--> <msid type="EME_MSID">am3RH7ikuZN</msid> </msids>
	 * 是否设定被定位用户wie码呢?
	 */
	private void buildBody() {
		sb.append("</hdr>\n");
		sb.append("<eme_lir ver=\"1.0.0\">\n");
		sb.append("<msids>\n"); // <!—被查号段-->
		sb.append("<msid enc=\"ASC\" type=\"MSISDN\" >"
				+ getValue(AttributeDesc.msids_msid) + "</msid>\n");
		sb.append("</msids>\n");
		/** 这一段例子上是不要的 */
		// sb.append("<eqop>");
		// sb.append("<resp_req
		// type=\""+getValue(AttributeDesc.resp_req_type)+"\" />");
		// sb.append("<hor_acc>"+getValue(AttributeDesc.eqop_hor_acc)+"</hor_acc>");
		// sb.append("</eqop>");
		sb.append("<geo_info>\n");
		sb.append("<CoordinateReferenceSystem>\n");
		sb.append("<Identifier>\n");
		sb.append("<code>4326</code>\n");
		sb.append("<codeSpace>EPSG</codeSpace>\n");
		sb.append("<edition>6.1</edition>\n");
		sb.append("</Identifier>\n");
		sb.append("</CoordinateReferenceSystem>\n");
		sb.append("</geo_info>\n");
		sb.append("<loc_type type=\"" + getValue(AttributeDesc.loc_type_type)
				+ "\" />\n");
		sb.append("<prio type = \"" + getValue(AttributeDesc.prio_type)
				+ "\" />\n");

	}

	/**
	 * 加上公用的尾部XML
	 */
	private void addTail() {
		sb.append("</eme_lir>\n");
		sb.append("</svc_init>\n");
	}

	/**
	 * 发起请求者的号码,当需要确认是发出。
	 * 
	 */
	private void addReqOther() {
		sb.append("<requestor>\n");
		sb.append("<id>" + this.getValue(AttributeDesc.requestor_id)
				+ "</id>\n");
		sb.append("</requestor>\n");
	}

	Builder_EmeReq() {
		super();
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -