📄 simulaterouter.java
字号:
String FeeCode;
FeeCode = configuration.getString("MT.sgip.FeeCode");
mt.setFeeCode(FeeCode); //6
String FeeType;
FeeType = configuration.getString("MT.sgip.FeeType");
mt.setFeeType(FeeType); //7
String FeeUserType;
FeeUserType = configuration.getString("MT.sgip.FeeUserType");
mt.setFeeUserType(FeeUserType); //8
String MtType;
MtType = configuration.getString("MT.sgip.MtType");
mt.setMtType(MtType); //9
String Spnumber;
Spnumber = configuration.getString("MT.sgip.Spnumber");
mt.setSpnumber(Spnumber); //10
int SubType;
SubType = configuration.getInt("MT.sgip.SubType");
mt.setSubType(SubType); //11
String MsgContent;
MsgContent = configuration.getString("MT.sgip.MsgContent");
mt.setMsgContent(MsgContent); //12
mt.setMsgLen("" + MsgContent.length()); //13
String MsgFormat;
MsgFormat = configuration.getString("MT.sgip.MsgFormat");
mt.setMsgFormat(MsgFormat); //14
String ServiceCode;
ServiceCode = configuration.getString("MT.sgip.ServiceCode");
mt.setServiceCode(ServiceCode); //15
String NeedReply;
NeedReply = configuration.getString("MT.sgip.NeedReply");
mt.setNeedReply(NeedReply); //16
String sendTime;
sendTime = configuration.getString("MT.sgip.sendTime");
mt.setMsgLevel(sendTime); //17
String MsgLevel;
MsgLevel = configuration.getString("MT.sgip.MsgLevel");
mt.setMsgLevel(MsgLevel); //18
String IsImBalance;
IsImBalance = configuration.getString("MT.sgip.IsImBalance");
mt.setIsImBalance(IsImBalance); //19
String LinkId;
LinkId = configuration.getString("MT.sgip.LinkId");
mt.setLinkID(LinkId); //20
String MoreLateToMTFlag;
MoreLateToMTFlag = configuration.getString("MT.sgip.MoreLateToMTFlag");
mt.setMoreLateToMTFlag(MoreLateToMTFlag); //21
String moID;
moID = configuration.getString("MT.sgip.MoreLateToMTFlag");
mt.setMoID(moID);
int sendNum;
sendNum = configuration.getInt("MT.sgip.sendNum");
mt.setSendNum(sendNum); //22
// System.out.println("" + mt.toString());
return mt;
}
public MT getct_submit() {
mt = new MT();
String msgID;
msgID = configuration.getString("MT.smgp.msgID");
mt.setMsgID(msgID); //1
String GateWayID;
GateWayID = configuration.getString("MT.smgp.GateWayID");
mt.setGatewayID(GateWayID); //2
String SrcTermID;
SrcTermID = configuration.getString("MT.smgp.SrcTermID");
mt.setSrcTermID(SrcTermID); //3
String DestTermID;
DestTermID = configuration.getString("MT.smgp.DestTermID");
mt.setDestTermID(DestTermID); //4
String FeeTermID;
FeeTermID = configuration.getString("MT.smgp.FeeTermID");
mt.setFeeTermID(FeeTermID); //5
String FeeCode;
FeeCode = configuration.getString("MT.smgp.FeeCode");
mt.setFeeCode(FeeCode); //6
String FeeType;
FeeType = configuration.getString("MT.smgp.FeeType");
mt.setFeeType(FeeType); //7
String FeeUserType;
FeeUserType = configuration.getString("MT.smgp.FeeUserType");
mt.setFeeUserType(FeeUserType); //8
String MtType;
MtType = configuration.getString("MT.smgp.MtType");
mt.setMtType(MtType); //9
String Spnumber;
Spnumber = configuration.getString("MT.smgp.Spnumber");
mt.setSpnumber(Spnumber); //10
int SubType;
SubType = configuration.getInt("MT.smgp.SubType");
mt.setSubType(SubType); //11
String MsgContent;
MsgContent = configuration.getString("MT.smgp.MsgContent");
mt.setMsgContent(MsgContent); //12
mt.setMsgLen("" + MsgContent.length()); //13
String MsgFormat;
MsgFormat = configuration.getString("MT.smgp.MsgFormat");
mt.setMsgFormat(MsgFormat); //14
String ServiceCode;
ServiceCode = configuration.getString("MT.smgp.ServiceCode");
mt.setServiceCode(ServiceCode); //15
String NeedReply;
NeedReply = configuration.getString("MT.smgp.NeedReply");
mt.setNeedReply(NeedReply); //16
String sendTime;
sendTime = configuration.getString("MT.smgp.sendTime");
mt.setMsgLevel(sendTime); //17
String MsgLevel;
MsgLevel = configuration.getString("MT.smgp.MsgLevel");
mt.setMsgLevel(MsgLevel); //18
String IsImBalance;
IsImBalance = configuration.getString("MT.smgp.IsImBalance");
mt.setIsImBalance(IsImBalance); //19
String LinkId;
LinkId = configuration.getString("MT.smgp.LinkId");
mt.setLinkID(LinkId); //20
int sendNum;
sendNum = configuration.getInt("MT.smgp.sendNum");
mt.setSendNum(sendNum); //21
// System.out.println("" + mt.toString());
return mt;
}
public MT getcn_submit() {
mt = new MT();
String msgID;
msgID = configuration.getString("MT.cngp.msgID");
mt.setMsgID(msgID); //1
String GateWayID;
GateWayID = configuration.getString("MT.cngp.GateWayID");
mt.setGatewayID(GateWayID); //2
String SrcTermID;
SrcTermID = configuration.getString("MT.cngp.SrcTermID");
mt.setSrcTermID(SrcTermID); //3
String DestTermID;
DestTermID = configuration.getString("MT.cngp.DestTermID");
mt.setDestTermID(DestTermID); //4
String FeeTermID;
FeeTermID = configuration.getString("MT.cngp.FeeTermID");
mt.setFeeTermID(FeeTermID); //5
String FeeCode;
FeeCode = configuration.getString("MT.cngp.FeeCode");
mt.setFeeCode(FeeCode); //6
String FeeType;
FeeType = configuration.getString("MT.cngp.FeeType");
mt.setFeeType(FeeType); //7
String FeeUserType;
FeeUserType = configuration.getString("MT.cngp.FeeUserType");
mt.setFeeUserType(FeeUserType); //8
String MtType;
MtType = configuration.getString("MT.cngp.MtType");
mt.setMtType(MtType); //9
String Spnumber;
Spnumber = configuration.getString("MT.cngp.Spnumber");
mt.setSpnumber(Spnumber); //10
int SubType;
SubType = configuration.getInt("MT.cngp.SubType");
mt.setSubType(SubType); //11
String MsgContent;
MsgContent = configuration.getString("MT.cngp.MsgContent");
mt.setMsgContent(MsgContent); //12
mt.setMsgLen("" + MsgContent.length()); //13
String MsgFormat;
MsgFormat = configuration.getString("MT.cngp.MsgFormat");
mt.setMsgFormat(MsgFormat); //14
String ServiceCode;
ServiceCode = configuration.getString("MT.cngp.ServiceCode");
mt.setServiceCode(ServiceCode); //15
String NeedReply;
NeedReply = configuration.getString("MT.cngp.NeedReply");
mt.setNeedReply(NeedReply); //16
String sendTime;
sendTime = configuration.getString("MT.cngp.sendTime");
mt.setMsgLevel(sendTime); //17
String MsgLevel;
MsgLevel = configuration.getString("MT.cngp.MsgLevel");
mt.setMsgLevel(MsgLevel); //18
String IsImBalance;
IsImBalance = configuration.getString("MT.cngp.IsImBalance");
mt.setIsImBalance(IsImBalance); //19
String LinkId;
LinkId = configuration.getString("MT.cngp.LinkId");
mt.setLinkID(LinkId); //20
int sendNum;
sendNum = configuration.getInt("MT.cngp.sendNum");
mt.setSendNum(sendNum); //21
// System.out.println("" + mt.toString());
return mt;
}
class Sender extends ClientDefaultSendTemplet{
/**
* processException
*
* @param cause Throwable
*/
public void processException(Throwable cause) {
if (cause instanceof java.net.ConnectException || cause instanceof java.net.SocketException || cause instanceof java.io.IOException) {
// SmsGWIFGlobal.sendMonitor("R000101");
txt.setText( txt.getText() + "\n------------------ 路由未启动,报警包被屏蔽 -------------------");
}
}
public void processSend() {
MT mt = (MT)mtqueue.removeNoWait();
if (mt != null) {
if( !this.write(mt.toString().getBytes()) ){
txt.setText( txt.getText() + "\n--- 发送 mt 失败 ---");
//与路由连接不通,发送失败,保存信息
mtqueue.add(mt);
try {
Thread.sleep(10000);
} catch (Exception e) {
}
}
else{
txt.setText( txt.getText() + "\n--- 发送 mt 成功 ---" + mt.toString() + " ----------- ");
}
}
else{
try{
Thread.sleep(100);
}catch(Exception e){
}
}
}
public void processClosed(){
if( this.idleFlag ){
txt.setText( txt.getText() + "\n--- Connection Closed ----------- ");
}
}
}
public static void main(String args[]) {
// SimulateRouter frame = new SimulateRouter();
new SimulateRouter();
}
public synchronized int getCyclecount() {
return cyclecount;
}
public synchronized void setCyclecount(int cyclecount) {
this.cyclecount = cyclecount;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -