public String debugString() { String dbgs = "(addr: "; dbgs += super.debugString(); dbgs += Integer.toString(getTon()); dbgs += " "; dbgs += Integer.toString(getNpi()); dbgs += " "; dbgs += getAddress(); dbgs += ") "; return dbgs; }
/** * Constructor for building the object from <code>SubmitSM</code> * PDU. * * @param systemId system id of the client * @param submit the PDU send from the client */ ShortMessageValue(String systemId, SubmitSM submit) throws UnsupportedEncodingException { this.systemId = systemId; serviceType = submit.getServiceType(); sourceAddr = submit.getSourceAddr().getAddress(); destinationAddr = submit.getDestAddr().getAddress(); String encoding = DataCodingCharsetHandler.getCharsetName(submit.getDataCoding()); shortMessage = submit.getShortMessage(encoding); } }
addr = properties.getProperty("source-address", sourceAddress.getAddress()); setAddressParameter("source-address", sourceAddress, ton, npi, addr); addr = properties.getProperty("destination-address", destAddress.getAddress()); setAddressParameter("destination-address", destAddress, ton, npi, addr);
addr = properties.getProperty("source-address", sourceAddress.getAddress()); setAddressParameter("source-address", sourceAddress, ton, npi, addr); addr = properties.getProperty("destination-address", destAddress.getAddress()); setAddressParameter("destination-address", destAddress, ton, npi, addr);
public ByteBuffer getData() { ByteBuffer addressBuf = new ByteBuffer(); addressBuf.appendByte(getTon()); addressBuf.appendByte(getNpi()); try { addressBuf.appendCString(getAddress(), Data.ENC_ASCII); } catch(UnsupportedEncodingException e) { // can't happen, ascii is always supported } return addressBuf; }
/** * Prompts the user to enter an address value with specified max length. */ private Address getAddress(String type, Address address, int maxAddressLength) throws WrongLengthOfStringException { byte ton = getParam(type + " address TON", address.getTon()); byte npi = getParam(type + " address NPI", address.getNpi()); String addr = getParam(type + " address", address.getAddress()); address.setTon(ton); address.setNpi(npi); address.setAddress(addr, maxAddressLength); return address; }