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

📄 terminalinfoinvokerimpl.java

📁 打印管理程序,测试完全通过.windows开发环境.
💻 JAVA
字号:
package jp.co.ntl.swing.ext.terminal;

import java.util.Vector;

import jp.co.ntl.Net;
import jp.co.ntl.NetworkException;
import jp.co.ntl.ServerException;
import jp.co.ntl.TimeOutException;
import jp.co.ntl.terminal.TerminalInfo;
import jp.co.ntl.swing.ext.InvokerUtil;

public class TerminalInfoInvokerImpl extends TerminalInfoInvoker {
	InvokerUtil		iu;
	
	TerminalInfoInvokerImpl(Net net) {
		this.iu = new InvokerUtil(net);
	}
	
	public int addTerminal(TerminalInfo terminalInfo) throws NetworkException, ServerException, TimeOutException {
		return iu.serverAccessRetInt(Net.terminalServletName, Net.CMD_AddTerminal, terminalInfo);
	}
	
	public void delTerminal(Vector vcTerminalInfo) throws NetworkException, ServerException, TimeOutException {
		iu.serverAccessRetVoid(Net.terminalServletName, Net.CMD_DeleteTerminal, vcTerminalInfo);
	}
	
	public Vector getTerminalInfo() throws NetworkException, ServerException, TimeOutException {
		return iu.serverAccessRetVector(Net.terminalServletName, Net.CMD_GetTerminalInfo);
	}
	
	// 2007.10.22 lium 暋悢僾儕儞僞懳墳 add start
	public Vector getLocalTerminalInfo() throws NetworkException, ServerException, TimeOutException {
		return iu.serverAccessRetVector(Net.terminalServletName, Net.CMD_GetLocalTerminalInfo);
	}
	// 2007.10.22 lium 暋悢僾儕儞僞懳墳 add end
	
	public void setTerminalInfo(TerminalInfo terminalInfo) throws NetworkException, ServerException, TimeOutException {
		iu.serverAccessRetVoid(Net.terminalServletName, Net.CMD_SetTerminalInfo, terminalInfo);
	}
	
	// 2007.10.26 KAlive add start
	public void setTerminalStatus(TerminalInfo terminalInfo) throws NetworkException, ServerException, TimeOutException {
		iu.serverAccessRetVoid(Net.terminalServletName, Net.CMD_SetTerminalStatus, terminalInfo);
	}
	// 2007.10.26 KAlive add end
	
	public Vector getRelatedPrinterList(TerminalInfo terminalInfo) throws NetworkException, ServerException, TimeOutException {
		return iu.serverAccessRetVector(Net.terminalServletName, Net.CMD_GetRelatedPrinterList, terminalInfo);
	}
/*	
	public void addRelatedPrinter(TerminalInfo terminalInfo, Vector vcPrinterInfo) throws NetworkException, ServerException, TimeOutException {
		ObjectInputStream	is;
		
		try {
			gc.enterConnection();
			Hashtable	h = new Hashtable();
			h.put("TerminalInfo", terminalInfo);
			h.put("PrinterList", vcPrinterInfo);
			is = new ObjectInputStream(net.sendCommand(Net.terminalServletName, "AddRelatedPrinter", h));
		} catch (IOException e) {
			throw new NetworkException(e.getMessage());
		} catch (NoSuchAlgorithmException e) {
			throw new NetworkException(e.getMessage());
		} catch (KeyManagementException e) {
			throw new NetworkException(e.getMessage());
		} finally {
			gc.releaseConnection();
		}
		
		try {
			gc.enterConnection();
			boolean	b;
			try {
				b = is.readBoolean();
			} catch (IOException e) {
				throw new ServerException(e.getMessage());
			}
			
			if (b) {
				;
			} else {
				try {
					String	message = is.readUTF();
					if (message.equals(Net.resultServerError)) {
						throw new ServerException("error");
					} else if (message.equals(Net.resultTimeOut)) {
						throw new TimeOutException();
					} else {
						throw new ServerException(message);
					}
				} catch (IOException e) {
				}
			}
		} finally {
			try {
				is.close();
			} catch (IOException e) {
			}
			gc.releaseConnection();
		}
	}
	
	public void releaseRelatedPrinter(TerminalInfo terminalInfo, Vector vcPrinterInfo) throws NetworkException, ServerException, TimeOutException {
		ObjectInputStream	is;
		
		try {
			gc.enterConnection();
			Hashtable	h = new Hashtable();
			h.put("TerminalInfo", terminalInfo);
			h.put("PrinterList", vcPrinterInfo);
			is = new ObjectInputStream(net.sendCommand(Net.terminalServletName, "ReleaseRelatedPrinter", h));
		} catch (IOException e) {
			throw new NetworkException(e.getMessage());
		} catch (NoSuchAlgorithmException e) {
			throw new NetworkException(e.getMessage());
		} catch (KeyManagementException e) {
			throw new NetworkException(e.getMessage());
		} finally {
			gc.releaseConnection();
		}
		
		try {
			gc.enterConnection();
			boolean	b;
			try {
				b = is.readBoolean();
			} catch (IOException e) {
				throw new ServerException(e.getMessage());
			}
			
			if (b) {
				;
			} else {
				try {
					String	message = is.readUTF();
					if (message.equals(Net.resultServerError)) {
						throw new ServerException("error");
					} else if (message.equals(Net.resultTimeOut)) {
						throw new TimeOutException();
					} else {
						throw new ServerException(message);
					}
				} catch (IOException e) {
				}
			}
		} finally {
			try {
				is.close();
			} catch (IOException e) {
			}
			gc.releaseConnection();
		}
	}*/
}

⌨️ 快捷键说明

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