@Override public boolean process(SmppSimulatorSessionHandler session, Channel channel, Pdu pdu) throws Exception { // anything other than a bind is super bad! if (!(pdu instanceof BaseBind)) { if (pdu instanceof PduRequest) { session.addPduToWriteOnNextPduReceived(((PduRequest)pdu).createGenericNack(SmppConstants.STATUS_INVBNDSTS)); return true; } else { //logger.error("PDU response received, but not bound"); channel.close(); return true; } } BaseBind bind = (BaseBind)pdu; BaseBindResp bindResp = (BaseBindResp)bind.createResponse(); if (!bind.getSystemId().equals(systemId)) { bindResp.setCommandStatus(SmppConstants.STATUS_INVSYSID); } else if (!bind.getPassword().equals(password)) { bindResp.setCommandStatus(SmppConstants.STATUS_INVPASWD); } session.addPduToWriteOnNextPduReceived(bindResp); return true; }
@Override public boolean process(SmppSimulatorSessionHandler session, Channel channel, Pdu pdu) throws Exception { // anything other than a bind is super bad! if (!(pdu instanceof BaseBind)) { if (pdu instanceof PduRequest) { session.addPduToWriteOnNextPduReceived(((PduRequest)pdu).createGenericNack(SmppConstants.STATUS_INVBNDSTS)); return true; } else { //logger.error("PDU response received, but not bound"); channel.close(); return true; } } BaseBind bind = (BaseBind)pdu; BaseBindResp bindResp = (BaseBindResp)bind.createResponse(); if (!bind.getSystemId().equals(systemId)) { bindResp.setCommandStatus(SmppConstants.STATUS_INVSYSID); } else if (!bind.getPassword().equals(password)) { bindResp.setCommandStatus(SmppConstants.STATUS_INVPASWD); } session.addPduToWriteOnNextPduReceived(bindResp); return true; }
@Override public boolean process(SmppSimulatorSessionHandler session, Channel channel, Pdu pdu) throws Exception { // anything other than a bind is super bad! if (!(pdu instanceof BaseBind)) { if (pdu instanceof PduRequest) { session.addPduToWriteOnNextPduReceived(((PduRequest)pdu).createGenericNack(SmppConstants.STATUS_INVBNDSTS)); return true; } else { //logger.error("PDU response received, but not bound"); channel.close(); return true; } } BaseBind bind = (BaseBind)pdu; BaseBindResp bindResp = (BaseBindResp)bind.createResponse(); if (!bind.getSystemId().equals(systemId)) { bindResp.setCommandStatus(SmppConstants.STATUS_INVSYSID); } else if (!bind.getPassword().equals(password)) { bindResp.setCommandStatus(SmppConstants.STATUS_INVPASWD); } session.addPduToWriteOnNextPduReceived(bindResp); return true; }
@Override public boolean process(SmppSimulatorSessionHandler session, Channel channel, Pdu pdu) throws Exception { // anything other than a bind is super bad! if (!(pdu instanceof BaseBind)) { if (pdu instanceof PduRequest) { session.addPduToWriteOnNextPduReceived(((PduRequest)pdu).createGenericNack(SmppConstants.STATUS_INVBNDSTS)); return true; } else { //logger.error("PDU response received, but not bound"); channel.close(); return true; } } BaseBind bind = (BaseBind)pdu; BaseBindResp bindResp = (BaseBindResp)bind.createResponse(); if (!bind.getSystemId().equals(systemId)) { bindResp.setCommandStatus(SmppConstants.STATUS_INVSYSID); } else if (!bind.getPassword().equals(password)) { bindResp.setCommandStatus(SmppConstants.STATUS_INVPASWD); } session.addPduToWriteOnNextPduReceived(bindResp); return true; }