private boolean sendSubmitSM(BaseMTInfo info) {
boolean ret = false;
if(this.bind == true && this.session != null) {
SubmitSMResp response = null;
SubmitSM request = info.getRequest();
try {
logger.info("MT to send for src: " +
request.getSourceAddr().getAddress() +
" dstn: " + request.getDestAddr().getAddress() +
" seqNum: " + request.getSequenceNumber());
long start = System.currentTimeMillis();
response = this.session.submit(request);
if(response != null) {
long stop = System.currentTimeMillis();
info.setTransactionTime(stop - start);
logger.info("MT response " + response.debugString() +
" for src: " + request.getSourceAddr().getAddress() +
" dstn: " + request.getDestAddr().getAddress() +
" seqNum: " + request.getSequenceNumber());
callMTListeners(info, response);
ret = true;
} else {
if(synchronous == false) {
logger.fatal("No response going out....");
addMTToSend(info);
} else {
logger.fatal("No response...");
}
}
} catch (ValueNotSetException e) {
logger.fatal("no way to manage this exception " + e.getMessage());
} catch (TimeoutException e) {
logger.error(e.getMessage());
if(synchronous == false) {
logger.error(" re-adding in queue " +
request.debugString());
addMTToSend(info);
}
} catch (PDUException e) {
logger.fatal("no way to manage this exception " + e.getMessage());
} catch (WrongSessionStateException e) {
logger.fatal("no way to manage this exception " + e.getMessage());
} catch (IOException e) {
logger.error(e.getMessage());
if(synchronous == false) {
logger.error(" re-adding in queue " +
request.debugString());
addMTToSend(info);
}
} catch (NullPointerException e) {
logger.error(e.getMessage());
if(synchronous == false) {
logger.error(" re-adding in queue " +
request.debugString());
addMTToSend(info);
}
}
} else {
logger.error("unbind session");