📄 submitblacksupport.java
字号:
package com.sms.platform.switchcenter.support;
import org.apache.log4j.Logger;
import com.pub.backserver.net.ClientNet;
import com.sms.platform.switchcenter.parameter.SenderParameter;
import com.sms.platform.switchcenter.parameter.SwitchParameter;
import com.sms.protocol.standard12.Standard_Head;
import com.sms.protocol.standard12.Standard_Inner_Response;
import com.sms.protocol.standard12.Standard_Inner_Submit;
public class SubmitBlackSupport extends Support{
public static Logger log = Logger.getLogger(SubmitBlackSupport.class);
public SubmitBlackSupport(){
}
protected boolean resolve() {
SenderParameter sp = SenderParameter.getInstance();
Standard_Inner_Submit sis = (Standard_Inner_Submit) super.inner;
ClientNet cnb = null;
try {
// 检测黑名单
if (log.isDebugEnabled())
log.debug("checkblacklist mobile :"
+ sis.getDestMobileAll() + " SeqID : "
+ sis.getSequenceId());
cnb = (ClientNet) SwitchParameter.getInstance().getObjPool().borrowObject();
int blacktype = cnb.queryBlackList(sis
.getDestMobileOne());
if (log.isDebugEnabled())
log.debug("blacktype is " + blacktype
+ " SeqID : " + sis.getSequenceId());
/**
* duxu add 20070823 16:59
*/
int type = 1;
try {
if (sis.getReserve().equals("")) {
type = 1;
} else {
type = Integer.parseInt(sis.getReserve());
}
} catch (Exception e) {
type = 1;
}
/**
* end
*/
if (blacktype <= type && blacktype > 0) {
ObjectLog.log.debug(sis.toDataString());
Standard_Inner_Response sr = new Standard_Inner_Response(
sis); // 设置返回信息
sr.setState(Standard_Head.ERR_BLACKLIST); // 设置状态
// ObjectQueue.getInstanceResponse().add(sr);//
// 黑名单用户
return false;
} else if (blacktype != ClientNet.ERR_NOTFOUND
&& blacktype < 0) {// 发生其他错误重新发送
// 发生其他错误压回重新发送
sis.setDesClientID(0);
// int stat = global.getSubmitQueue().put(sis);
// if (log.isDebugEnabled())
// log.debug(" blackcheck has other error : "
// + sis.getDestMobileAll() + " type : "
// + blacktype + " SeqID : "
// + sis.getSequenceId());
return false;
} else {
}
} catch (Exception e) {
return false;
} finally {
// if (cnb != null)
// global.getObjPool().returnObject(cnb);
}
return true;
}
protected void fail(){
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -