?? querysm.java
字號:
/*
* Copyright (c) 1996-2001
* Logica Mobile Networks Limited
* All rights reserved.
*
* This software is distributed under Logica Open Source License Version 1.0
* ("Licence Agreement"). You shall use it and distribute only in accordance
* with the terms of the License Agreement.
*
*/
package com.logica.smpp.pdu;
import com.logica.smpp.Data;
import com.logica.smpp.util.*;
/**
* @author Logica Mobile Networks SMPP Open Source Team
* @version 1.0, 11 Jun 2001
*/
public class QuerySM extends Request
{
private String messageId = Data.DFLT_MSGID;
private Address sourceAddr = new Address();
public QuerySM()
{
super(Data.QUERY_SM);
}
protected Response createResponse()
{
return new QuerySMResp();
}
public void setBody(ByteBuffer buffer)
throws NotEnoughDataInByteBufferException,
TerminatingZeroNotFoundException,
PDUException
{
setMessageId(buffer.removeCString());
sourceAddr.setData(buffer); // ?
}
public ByteBuffer getBody()
{
ByteBuffer buffer = new ByteBuffer();
buffer.appendCString(messageId);
buffer.appendBuffer(getSourceAddr().getData());
return buffer;
}
public void setMessageId(String value)
throws WrongLengthOfStringException {
checkString(value, Data.SM_MSGID_LEN);
messageId = value;
}
public void setSourceAddr(Address value) { sourceAddr = value; }
public void setSourceAddr(String address)
throws WrongLengthOfStringException {
setSourceAddr(new Address(address));
}
public void setSourceAddr(byte ton, byte npi, String address)
throws WrongLengthOfStringException {
setSourceAddr(new Address(ton, npi, address));
}
public String getMessageId() { return messageId; }
public Address getSourceAddr() { return sourceAddr; }
public String debugString()
{
String dbgs = "(query: ";
dbgs += super.debugString();
dbgs += getMessageId(); dbgs += " ";
dbgs += getSourceAddr().debugString(); dbgs += " ";
dbgs += debugStringOptional();
dbgs += ") ";
return dbgs;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -