?? bindresponse.java
字號(hào):
/*
* 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 org.smpp.pdu;
import org.smpp.Data;
import org.smpp.util.*;
import org.smpp.pdu.tlv.*;
/**
* @author Logica Mobile Networks SMPP Open Source Team
* @version $Revision: 1.2 $
*/
public abstract class BindResponse extends Response {
// mandatory parameters
private String systemId = Data.DFLT_SYSID;
// optional parameters
private TLVByte scInterfaceVersion = new TLVByte(Data.OPT_PAR_SC_IF_VER);
public BindResponse(int commandId) {
super(commandId);
registerOptional(scInterfaceVersion);
}
public void setBody(ByteBuffer buffer)
throws NotEnoughDataInByteBufferException, TerminatingZeroNotFoundException, PDUException {
if (getCommandStatus() == 0) { // ok => have body
setSystemId(buffer.removeCString());
}
}
public ByteBuffer getBody() {
ByteBuffer buffer = new ByteBuffer();
//if (getCommandStatus() == 0) { // ok => append body
buffer.appendCString(getSystemId());
//}
return buffer;
}
public void setSystemId(String sysId) throws WrongLengthOfStringException {
checkString(sysId, Data.SM_SYSID_LEN);
systemId = sysId;
}
public String getSystemId() {
return systemId;
}
public boolean hasScInterfaceVersion() {
return scInterfaceVersion.hasValue();
}
public void setScInterfaceVersion(byte value) {
scInterfaceVersion.setValue(value);
}
public byte getScInterfaceVersion() throws ValueNotSetException {
return scInterfaceVersion.getValue();
}
public String debugString() {
String dbgs = "(bindresp: ";
dbgs += super.debugString();
dbgs += getSystemId();
if (hasScInterfaceVersion()) {
dbgs += " ";
try {
dbgs += getScInterfaceVersion();
} catch (Exception e) {
// don't want to throw exception in debug code!
}
}
dbgs += ") ";
return dbgs;
}
}
/*
* $Log: BindResponse.java,v $
* Revision 1.2 2004/09/10 23:07:15 sverkera
* Corrected issue that can cause pdu problem
*
* Revision 1.1 2003/07/23 00:28:39 sverkera
* Imported
*
*
* Old changelog:
* 09-10-01 ticp@logica.com ID changed to Id in getSystemID and setSystemID
*/
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -