📄 cbspay.java
字号:
package simulator.wap.message;
import net.smpp.message.SMPPRequest;
import net.smpp.message.SMPPProtocolException;
import net.smpp.util.SMPPIO;
import java.io.OutputStream;
/**
*
* Author: zhouzh
* Create Time: 2004-7-28 0:55:38
*
*/
public class CBSPay extends SMPPRequest
{
public CBSPay()
{
super(CBS_PAY);
}
public CBSPay(int seqNum)
{
super(CBS_PAY,seqNum);
}
String spCode; //5
String spServiceType; //14
int priority;
String callTime; //14
String payMsisdn; //21
int feeType;
int fee;
int svcType;
int givenFee;
String ipAddress;
int dtOctetCount;
int doOctetCount;
int duration;
public int getBodyLength()
{
int len = ((spCode != null) ? spCode.length()+1 : 1)
+ ((spServiceType != null) ? spServiceType.length()+1 : 1)
+ ((callTime != null) ? callTime.length()+1 : 1)
+ ((payMsisdn != null) ? payMsisdn.length()+1 : 1)
+ ((ipAddress != null) ? ipAddress.length()+1 : 1);
return (len+1+1+4+1+4+4+4+4);
}
protected void encodeBody(OutputStream out) throws java.io.IOException
{
SMPPIO.writeCString(spCode, out);
SMPPIO.writeCString(spServiceType, out);
SMPPIO.writeInt(priority, 1, out);
SMPPIO.writeCString(callTime, out);
SMPPIO.writeCString(payMsisdn, out);
SMPPIO.writeInt(feeType, 1, out);
SMPPIO.writeInt(fee, 4, out);
SMPPIO.writeInt(svcType, 1, out);
SMPPIO.writeInt(givenFee, 4, out);
SMPPIO.writeCString(ipAddress, out);
SMPPIO.writeInt(dtOctetCount, 4, out );
SMPPIO.writeInt(doOctetCount, 4, out);
SMPPIO.writeInt(duration, 4, out);
}
public void readBodyFrom(byte[] body, int offset) throws SMPPProtocolException
{
spCode = SMPPIO.readCString(body, offset);
offset += spCode.length()+1;
spServiceType = SMPPIO.readCString(body, offset);
offset += spServiceType.length()+1;
priority = SMPPIO.bytesToInt(body, offset, 1);
offset+= 1;
callTime = SMPPIO.readCString(body, offset);
offset += callTime.length()+1;
payMsisdn = SMPPIO.readCString(body, offset);
offset += payMsisdn.length()+1;
feeType = SMPPIO.bytesToInt(body, offset, 1);
offset+=1;
fee = SMPPIO.bytesToInt(body, offset, 4);
offset+=4;
svcType = SMPPIO.bytesToInt(body, offset, 1);
offset+=1;
givenFee = SMPPIO.bytesToInt(body, offset, 4);
offset+=4;
ipAddress = SMPPIO.readCString(body, offset);
offset += ipAddress.length()+1;
dtOctetCount = SMPPIO.bytesToInt(body, offset, 4);
offset+=4;
doOctetCount = SMPPIO.bytesToInt(body, offset, 4);
offset+=4;
duration = SMPPIO.bytesToInt(body, offset, 4);
offset+=4;
}
public String getSpCode()
{
return spCode;
}
public void setSpCode(String spCode)
{
this.spCode = spCode;
}
public String getSpServiceType()
{
return spServiceType;
}
public void setSpServiceType(String spServiceType)
{
this.spServiceType = spServiceType;
}
public int getPriority()
{
return priority;
}
public void setPriority(int priority)
{
this.priority = priority;
}
public String getCallTime()
{
return callTime;
}
public void setCallTime(String callTime)
{
this.callTime = callTime;
}
public String getPayMsisdn()
{
return payMsisdn;
}
public void setPayMsisdn(String payMsisdn)
{
this.payMsisdn = payMsisdn;
}
public int getFeeType()
{
return feeType;
}
public void setFeeType(int feeType)
{
this.feeType = feeType;
}
public int getFee()
{
return fee;
}
public void setFee(int fee)
{
this.fee = fee;
}
public int getSvcType()
{
return svcType;
}
public void setSvcType(int svcType)
{
this.svcType = svcType;
}
public int getGivenFee()
{
return givenFee;
}
public void setGivenFee(int givenFee)
{
this.givenFee = givenFee;
}
public String getIpAddress()
{
return ipAddress;
}
public void setIpAddress(String ipAddress)
{
this.ipAddress = ipAddress;
}
public int getDtOctetCount()
{
return dtOctetCount;
}
public void setDtOctetCount(int dtOctetCount)
{
this.dtOctetCount = dtOctetCount;
}
public int getDoOctetCount()
{
return doOctetCount;
}
public void setDoOctetCount(int doOctetCount)
{
this.doOctetCount = doOctetCount;
}
public int getDuration()
{
return duration;
}
public void setDuration(int duration)
{
this.duration = duration;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -