📄 smmessage.java
字号:
this.destAddr = theDestAddr;
this.submitMulti = MULTI_SMS_SEND;
}
/**
* 设置短消息的类型
* @param multiMsgFlag 短消息的类型
*/
public void setMultiMsgFlag(boolean multiMsgFlag)
throws SMQueueAccessException {
int flag = multiMsgFlag ? MULTI_SMS_SEND : SINGLE_SMS_SEND;
this.submitMulti = flag;
}
/**
* 反转短消息的状态,已发送设置为未发送,未发送设置为已发送
* @return 反转前短消息的状态
*/
public boolean resetSendStat() throws SMQueueAccessException {
int stat;
stat = this.sendStat == IN_PROCESSING ? NOT_IN_PROCESSING : IN_PROCESSING;
this.sendStat = stat;
return this.sendStat == NOT_IN_PROCESSING;
}
/**
* For SMMessage constructor.
* Private method .
* Creation date: (2000-12-20 9:52:48)
*/
private void smInit(
String sourceAddr,
String[] destAddr,
int priorityFlag,
Date scheduleTime,
Date validatyPeriod,
String content)
throws SMParameterException {
//try to init a multi-addr example
try {
setContent(content);
setSourceAddr(sourceAddr);
setDestAddr(destAddr);
setPriorityFlag(priorityFlag);
setScheduleTime(scheduleTime);
setValidatyPeriod(validatyPeriod);
this.sendCount = 0;
this.queueID = 0;
this.sendStat = NOT_IN_PROCESSING;
this.submitMulti = MULTI_SMS_SEND;
}
catch (SMQueueAccessException qae) {
throw new SMParameterException();
}
}
/**
* For SMMessage constructor.
* Private method .
* Creation date: (2000-12-20 9:52:48)
*/
private void smInit(
String sourceAddr,
String destAddr,
int priorityFlag,
Date scheduleTime,
Date validatyPeriod,
String content)
throws SMParameterException {
//try to init an single-addr example
try {
setContent(content);
setSourceAddr(sourceAddr);
setDestinationAddr(destAddr);
setPriorityFlag(priorityFlag);
setScheduleTime(scheduleTime);
setValidatyPeriod(validatyPeriod);
this.sendCount = 0;
this.queueID = 0;
this.sendStat = NOT_IN_PROCESSING;
this.submitMulti = SINGLE_SMS_SEND;
}
catch (SMQueueAccessException qae) {
throw new SMParameterException();
}
}
/**
* Verify address format, an address >= 11 and address <= 20 is available.
* null address is available,too
* Creation date: (2000-12-22 8:55:27)
* @return boolean
* @param addr java.lang.String[]
*/
private boolean verifyAddr(String addr) {
if ((addr != null) && (addr.length() > 21))
return false;
return true;
}
/**
* verify message body.It will return false when msg length>140.
* null message is available,too
* Creation date: (2000-12-20 10:18:29)
* @return boolean
* @param msg java.lang.String
*/
private boolean verifyMsg(String content) {
if (content != null && content.length() > 140)
return false;
return true;
}
private boolean verifyMsg(byte[] binaryContent) {
if (binaryContent != null && binaryContent.length > 140)
return false;
return true;
}
/**
* Verify address format, an address >= 11 and address <= 20 is available.
* null address is available,too
* Creation date: (2000-12-22 8:55:27)
* @return boolean
* @param addr java.lang.String[]
*/
private boolean verifyAddr(String[] addr) {
if ((addr != null && addr.length > 0))
for (int i = 0; i < addr.length; i++)
if (!verifyAddr(addr[i]))
return false;
return true;
}
/** 短消息应用模块ID和模块信息 */
// protected String funcID;
/* 短消息应用信息 */
// protected String funcRemark;
/** 短消息应用使用者ID */
protected long userID;
/**
* Insert the method's description here.
* Creation date: (2001-2-7 12:48:25)
* @return java.lang.String
*/
// public String getFuncID() {
// return funcID;
// }
/**
* Insert the method's description here.
* Creation date: (2001-2-7 12:49:16)
* @return java.lang.String
*/
// public String getFuncRemark() {
// return funcRemark;
// }
/**
* 获取短消息的消息内容
* Creation date: (2000-12-22 15:47:44)
* @return java.lang.String
*/
public String getContent() {
return this.content;
}
public String[] getContentMulti() {
return this.contentMulti;
}
public byte[] getBinaryContent() {
return this.binaryContent;
}
public byte[][] getBinaryContentMulti() {
return this.binaryContentMulti;
}
/**
* Insert the method's description here.
* Creation date: (2001-2-7 12:47:43)
* @return long
*/
public long getUserID() {
return this.userID;
}
public int getFileNum() {
return this.fileNum;
}
public String getSpNumber() {
return this.spNumber;
}
public String getCorpID() {
return this.corpID;
}
public String getServiceType() {
return this.serviceType;
}
public int getFeeType() {
return this.feeType;
}
public String getFeeValue() {
return this.feeValue;
}
public String getGivenValue() {
return this.givenValue;
}
public int getMorelatetoMTFlag(){
return this.morelatetoMTFlag;
}
public int getReportFlag(){
return this.reportFlag;
}
/**
* Insert the method's description here.
* Creation date: (2001-2-7 12:50:19)
* @param uid long
*/
// public void setFuncID(String fid) {
// funcID = fid;
// }
/**
* Insert the method's description here.
* Creation date: (2001-2-7 12:50:19)
* @param uid long
*/
// public void setFuncRemark(String fRemark) {
// funcRemark = fRemark;
// }
/**
* 设置短消息的消息内容
* Creation date: (2000-12-22 15:48:15)
* @param msg java.lang.String
*/
public void setContent(String theContent)
throws SMParameterException, SMQueueAccessException {
//verify message body
if (!verifyMsg(theContent))
throw new SMParameterException("Message Body Length Error!");
//set this message body
this.content = theContent;
}
public void setContentMulti(String[] theContentMulti)
throws SMParameterException, SMQueueAccessException {
this.contentMulti = theContentMulti;
}
public void setBinaryContent(byte[] theBinaryContent) throws SMParameterException, SMQueueAccessException {
if (!verifyMsg(theBinaryContent))
throw new SMParameterException("Message Body Length Error!");
this.binaryContent = theBinaryContent;
}
public void setBinaryContentMulti(byte[][] theBinaryContentMulti) throws SMParameterException, SMQueueAccessException {
this.binaryContentMulti = theBinaryContentMulti;
}
/**
* Insert the method's description here.
* Creation date: (2001-2-7 12:50:19)
* @param uid long
*/
public void setUserID(long uid) {
this.userID = uid;
}
public void setFileNum(int fNum) {
this.fileNum = fNum;
}
/**
* For SMMessage constructor.
* Private method .
* Creation date: (2000-12-20 9:52:48)
*/
private void smInit(
String sourceAddr,
String destinationAddr,
int priorityFlag,
Date scheduleTime,
Date validatyPeriod,
String content,
long uid)
throws SMParameterException {
//try to init an single-addr example
try {
setSourceAddr(sourceAddr);
setDestinationAddr(destinationAddr);
setPriorityFlag(priorityFlag);
setScheduleTime(scheduleTime);
setValidatyPeriod(validatyPeriod);
setContent(content);
this.sendCount = 0;
this.queueID = 0;
this.sendStat = NOT_IN_PROCESSING;
this.submitMulti = SINGLE_SMS_SEND;
this.userID = uid;
}
catch (SMQueueAccessException qae) {
throw new SMParameterException();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -