亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? interface.java

?? 發送短信 接收短信 多種接口com/net/modem 開發庫
?? JAVA
字號:
// SMSLib for Java v3
// A Java API library for sending and receiving SMS via a GSM modem
// or other supported gateways.
// Web Site: http://www.smslib.org
//
// Copyright (C) 2002-2009, Thanasis Delenikas, Athens/GREECE.
// SMSLib is distributed under the terms of the Apache License version 2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package org.smslib.smsserver.interfaces;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import org.smslib.InboundMessage;
import org.smslib.OutboundMessage;
import org.smslib.Service;
import org.smslib.smsserver.SMSServer;

/**
 * The base class of all implemented SMSServer interfaces.
 * <p>
 * An SMSServer interface can be thought of as a message producer or a message
 * consumer.
 * <p>
 * SMSServer comes with a couple of ready-made interfaces. If you wish to extend
 * SMSServer with new interface functionality, create your own interface by
 * implementing the current class.
 */
public class Interface<T>
{
	/**
	 * Class representing SMSServer interface types.
	 */
	public enum InterfaceTypes
	{
		/**
		 * Representing an inbound-only interface.
		 */
		INBOUND,
		/**
		 * Representing an outbound-only interface.
		 */
		OUTBOUND,
		/**
		 * Representing a dual (inbound + outbound) interface.
		 */
		INOUTBOUND
	}

	private String infId;

	private Properties props;

	private SMSServer server;

	private InterfaceTypes type;

	private String description;

	/**
	 * Store to save messageId with interface-specific message identifications
	 * like primary keys or filenames
	 */
	private Map<Long, T> messageIdCache;

	public Interface(String myInfId, Properties myProps, SMSServer myServer, InterfaceTypes myType)
	{
		this.infId = myInfId;
		this.props = myProps;
		this.server = myServer;
		this.type = myType;
		this.messageIdCache = new HashMap<Long, T>();
	}

	public final Service getService()
	{
		return getServer().getService();
	}

	public final SMSServer getServer()
	{
		return this.server;
	}

	public String getId()
	{
		return this.infId;
	}

	/**
	 * This method is called by SMSServer every time an inbound call is
	 * received. SMSServer calls this method for all available/active
	 * interfaces.
	 * <p>
	 * <b>Override this call if you wish to implement your own
	 * functionality</b>.
	 * 
	 * @param gtwId
	 *            The Id of the gateway which received the call.
	 * @param callerId
	 *            The caller id.
	 */
	public void CallReceived(String gtwId, String callerId) throws Exception
	{
		// Should be overridden if necessary.
	}

	/**
	 * Returns the interface description.
	 * 
	 * @return The interface description.
	 */
	public final String getDescription()
	{
		return this.description;
	}

	/**
	 * Sets the interface description.
	 * 
	 * @param myDescription
	 *            The interface description.
	 */
	public final void setDescription(String myDescription)
	{
		this.description = myDescription;
	}

	public final Map<Long, T> getMessageCache()
	{
		return this.messageIdCache;
	}

	/**
	 * SMSServer calls this method in order to query the interface for messages
	 * that need to be send out.
	 * <p>
	 * <b>Override this call if you wish to implement your own
	 * functionality</b>.
	 * 
	 * @return A list of Outbound messages to be sent. Return an empty list if
	 *         the interface has no messages for dispatch.
	 * @throws Exception
	 */
	public Collection<OutboundMessage> getMessagesToSend() throws Exception
	{
		// Should be overridden if necessary.
		return new ArrayList<OutboundMessage>();
	}

	/**
	 * This method returns the number of outbound queued messages identified by
	 * this interface. Should return (-1) if this method is not implemented or
	 * if the number cannot be determined.
	 * 
	 * @return The number of pending messages to be sent via this interface.
	 */
	public int getPendingMessagesToSend()
	{
		return -1;
	}

	/**
	 * Reads the property key of this interface.
	 * 
	 * @param key
	 *            The key of the property to read.
	 * @return The value of the property or null if not set
	 */
	public final String getProperty(String key)
	{
		return getProperty(key, null);
	}

	/**
	 * Reads the property key of this interface. <br /> The defaultValue is
	 * returned if the key is not defined in the properties.
	 * 
	 * @param key
	 *            The key of the property to read.
	 * @param defaultValue
	 *            The defaultValue if key is not defined.
	 * @return The value of the property or defaultValue if not set.
	 */
	public final String getProperty(String key, String defaultValue)
	{
		String value = this.props.getProperty(this.infId + "." + key, defaultValue);
		if ((value == null) || (value.length() == 0)) value = defaultValue;
		return value;
	}

	/**
	 * Returns the interface type.
	 * 
	 * @return The interface type.
	 * @see InterfaceTypes
	 */
	public final InterfaceTypes getType()
	{
		return this.type;
	}

	/**
	 * Returns true if the interface is for inbound messaging.
	 * 
	 * @return True if the interface is for inbound messaging.
	 */
	public final boolean isInbound()
	{
		if (InterfaceTypes.INBOUND == this.type || InterfaceTypes.INOUTBOUND == this.type) return true;
		return false;
	}

	/**
	 * Returns true if the interface is for outbound messaging.
	 * 
	 * @return True if the interface is for outbound messaging.
	 */
	public final boolean isOutbound()
	{
		if (InterfaceTypes.OUTBOUND == this.type || InterfaceTypes.INOUTBOUND == this.type) return true;
		return false;
	}

	/**
	 * After a successful or unsuccessful attempt to send a message, SMSServer
	 * calls this method. The interface can then decide what to do with the
	 * message. Note that the message status and errors member fields are
	 * updated, so you should examine them in order to determine whether the
	 * message has been sent out, etc.
	 * <p>
	 * <b>Override this call if you wish to implement your own
	 * functionality</b>.
	 * 
	 * @param msg
	 *            The Outbound message.
	 * @throws Exception
	 */
	public void markMessage(OutboundMessage msg) throws Exception
	{
		// Should be overridden if necessary.
	}

	public void markMessages(Collection<OutboundMessage> msgList) throws Exception
	{
		for (OutboundMessage msg : msgList)
			markMessage(msg);
	}

	/**
	 * This method is called by SMSServer every time a message (or more
	 * messages) is received. SMSServer calls this method for all
	 * available/active interfaces.
	 * <p>
	 * <b>Override this call if you wish to implement your own
	 * functionality</b>.
	 * 
	 * @param msgList
	 *            A message list of all received messages.
	 * @throws Exception
	 */
	public void MessagesReceived(Collection<InboundMessage> msgList) throws Exception
	{
		// Should be overridden if necessary.
	}

	/**
	 * Called once before SMSServer starts its operation. Use this method for
	 * initialization.
	 * <p>
	 * <b>Override this call if you wish to implement your own
	 * functionality</b>.
	 * 
	 * @throws Exception
	 *             An exception thrown will stop SMSServer from starting its
	 *             processing.
	 */
	public void start() throws Exception
	{
		getService().getLogger().logInfo("SMSServer: interface: " + this.getClass().getName() + " started.", null, null);
	}

	/**
	 * Called once after SMSServer has finished. Use this method for cleaning up
	 * your interface.
	 * <p>
	 * <b>Override this call if you wish to implement your own
	 * functionality</b>.
	 * 
	 * @throws Exception
	 */
	public void stop() throws Exception
	{
		getService().getLogger().logInfo("SMSServer: interface: " + this.getClass().getName() + " stopped.", null, null);
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人网在线免费视频| 欧美另类videos死尸| 色综合 综合色| 欧美日韩一卡二卡三卡| 国产精品免费观看视频| 国产精品久久久久影院老司| 樱桃视频在线观看一区| 五月天婷婷综合| 狠狠色狠狠色合久久伊人| av电影天堂一区二区在线观看| 欧美日韩精品三区| 久久在线观看免费| 亚洲国产另类精品专区| 国产成人在线观看| 欧美人牲a欧美精品| 国产日韩欧美综合一区| 五月开心婷婷久久| 国产传媒久久文化传媒| 欧美酷刑日本凌虐凌虐| 亚洲欧美日韩国产手机在线 | 日韩欧美国产精品| 亚洲欧美日韩中文播放| 国产九色sp调教91| 欧美一区二区播放| 亚洲老司机在线| 国产成人午夜精品5599| 欧美一激情一区二区三区| 一区二区不卡在线播放 | 91久久久免费一区二区| 国产欧美一区二区三区沐欲| 免费日韩伦理电影| 欧美精品18+| 天天av天天翘天天综合网色鬼国产 | 精品国产污网站| 91视频免费观看| 国产精品久久久久影院亚瑟| 国产精品一区二区果冻传媒| 欧美一区欧美二区| 丝袜亚洲另类欧美| 91精品在线观看入口| 亚洲成人福利片| 欧美精品黑人性xxxx| 亚洲一区二区精品久久av| jvid福利写真一区二区三区| 久久影院视频免费| 国产一区二区不卡在线| 精品国产99国产精品| 国产一区二区三区| 国产欧美一区二区在线观看| 成人午夜短视频| 亚洲裸体在线观看| 欧美怡红院视频| 奇米影视7777精品一区二区| 精品日韩一区二区| 国产a级毛片一区| 一区二区理论电影在线观看| 欧美精三区欧美精三区| 国内精品国产三级国产a久久| 日本一区二区动态图| 91国产成人在线| 男女激情视频一区| 国产精品成人午夜| 欧美一区永久视频免费观看| 国产成人av福利| 亚洲国产日韩av| 国产亚洲欧美日韩日本| 91福利视频久久久久| 国产美女一区二区三区| 一区二区三区在线视频观看58| 91精品综合久久久久久| 91丨porny丨最新| 韩国一区二区三区| 视频一区视频二区在线观看| 国产精品久久久久影院色老大| 成人黄色一级视频| 《视频一区视频二区| 精品播放一区二区| 欧美猛男男办公室激情| 91在线播放网址| 成人小视频在线| 国产精品香蕉一区二区三区| 日韩国产精品久久久| 樱桃视频在线观看一区| 日韩一区中文字幕| 中文一区二区完整视频在线观看| 日韩欧美精品三级| 日韩欧美123| 777亚洲妇女| 在线电影一区二区三区| 欧美欧美欧美欧美首页| 欧美日韩在线一区二区| 欧美日韩一卡二卡| 欧美私人免费视频| 欧美久久高跟鞋激| 欧美一区日本一区韩国一区| 欧美一区二区啪啪| 精品人在线二区三区| 日韩免费电影一区| 国产亚洲欧美色| 成人欧美一区二区三区| 亚洲男人天堂av网| 性欧美大战久久久久久久久| 丝袜亚洲另类丝袜在线| 九九九久久久精品| 成人一区二区在线观看| 91在线porny国产在线看| 欧美三级欧美一级| 精品少妇一区二区三区在线播放| 337p亚洲精品色噜噜噜| 国产亚洲精品7777| 一区二区三区日韩欧美| 日本伊人色综合网| 粗大黑人巨茎大战欧美成人| 在线视频你懂得一区| 精品久久一区二区| 亚洲三级在线免费| 久久精品国产99久久6| 久久亚洲精品小早川怜子| 久久精品欧美一区二区三区不卡 | 91视视频在线观看入口直接观看www| 欧美性猛交xxxx黑人交| 久久久国产一区二区三区四区小说| 国产精品久久久久婷婷二区次| 午夜日韩在线电影| jizzjizzjizz欧美| 日韩欧美一级精品久久| 一区二区三区欧美在线观看| 蜜臀av性久久久久蜜臀aⅴ| 波多野结衣中文一区| 精品国产乱码久久久久久浪潮 | 亚洲三级在线观看| 国产美女av一区二区三区| 91精品国产福利在线观看 | 国产一区二区精品在线观看| 欧美日韩一级视频| 一区二区三区不卡视频| 成人看片黄a免费看在线| 久久久久久久久免费| 日本成人超碰在线观看| 99国产欧美久久久精品| 精品入口麻豆88视频| 成人免费小视频| 成人精品视频一区二区三区尤物| 欧美一级片在线看| 秋霞影院一区二区| 日韩一区二区三区免费观看| 婷婷久久综合九色国产成人| 欧美日韩亚洲综合| 婷婷中文字幕一区三区| 欧美日韩成人在线| 久久精品国产色蜜蜜麻豆| 日韩精品在线一区| 国产一区二区三区四区五区美女| 亚洲精品在线电影| 国产成人精品一区二区三区网站观看| 精品国产乱码久久久久久久| 日本午夜一本久久久综合| 欧美一二三区精品| 国产麻豆精品95视频| 亚洲视频你懂的| 在线一区二区视频| 日韩电影在线看| 国产午夜精品福利| 色激情天天射综合网| 日日夜夜免费精品| 2023国产精品| 91免费在线看| 蜜桃视频第一区免费观看| 国产欧美日韩久久| 欧美日韩国产一级片| 国内成人免费视频| 亚洲一本大道在线| 国产蜜臀av在线一区二区三区| 日本福利一区二区| 韩国女主播一区二区三区| 亚洲视频图片小说| 2023国产精品| 91麻豆精品国产自产在线| 99在线精品免费| 久久99精品久久久久婷婷| 亚洲成人av中文| 久久99国产精品久久| 亚洲一区二区三区四区在线观看 | 亚洲另类色综合网站| 久久综合色鬼综合色| 91精品久久久久久蜜臀| 色香蕉成人二区免费| 成人精品小蝌蚪| 国产精品一区二区在线观看不卡 | 国产色一区二区| 欧美不卡一区二区三区四区| 欧美在线综合视频| 国产高清在线精品| 免费精品视频最新在线| 一区二区成人在线观看| 亚洲精品国产成人久久av盗摄| 国产欧美日韩卡一| 中文字幕不卡三区| 国产日韩欧美a| 国产农村妇女精品|