@Override public String getSystemId() { return this.configuration.getSystemId(); }
@Override public String getSystemId() { return this.configuration.getSystemId(); }
@Override public String getSystemId() { return this.configuration.getSystemId(); }
@Override public String getSystemId() { return this.configuration.getSystemId(); }
@SuppressWarnings("rawtypes") @Override public void sessionBindRequested(Long sessionId, SmppSessionConfiguration sessionConfiguration, final BaseBind bindRequest) throws SmppProcessingException { // test name change of sessions // this name actually shows up as thread context.... sessionConfiguration.setName("Application.SMPP." + sessionConfiguration.getSystemId()); }
@Override public SmppSession getUsedSession(SmppSessionManager sessionManager) { String systemId = getSession().getConfiguration().getSystemId(); return sessionManager.getNextServerSession(systemId); }
public synchronized void removeServerSession(SmppServerSession session) { if (session.getBindType() == SmppBindType.TRANSMITTER) { // we ignore transmitters as they can not be used to send delivers return; } String systemId = session.getConfiguration().getSystemId(); SessionList sessionList = applicationSessionMap.get(systemId); boolean removed = false; if (sessionList != null) { removed = sessionList.remove(session); globalSessionList.remove(session); } if (!removed) { logger.warn("Failed to remove session %s, Session not found.", session); } }
public synchronized void addServerSession(SmppServerSession session) { if (session.getBindType() == SmppBindType.TRANSMITTER) { // we ignore transmitters as they can not be used to send delivers return; } String systemId = session.getConfiguration().getSystemId(); SessionList sessionList = applicationSessionMap.get(systemId); if (sessionList == null) { sessionList = new SessionList(); applicationSessionMap.put(systemId, sessionList); } sessionList.add(session); globalSessionList.add(session); }
@Override public void sessionDestroyed(Long sessionId, SmppServerSession session) { this.frm.addMessage("Session destroyed", session.getConfiguration().getSystemId()); this.frm.setSmppSession(null); session.destroy(); }
protected void doBind(DefaultSmppSession session, SmppSessionConfiguration config, SmppSessionHandler sessionHandler) throws SmppTimeoutException, SmppChannelException, SmppBindException, UnrecoverablePduException, InterruptedException { // create the bind request we'll use (may throw an exception) BaseBind bindRequest = createBindRequest(config); BaseBindResp bindResp = null; try { // attempt to bind to the SMSC // session implementation handles error checking, version negotiation, and can be discarded bindResp = session.bind(bindRequest, config.getBindTimeout()); logger.debug("Bound to esme systemId=" + config.getSystemId()); } catch (RecoverablePduException e) { // if a bind fails, there really is no recovery... throw new UnrecoverablePduException(e.getMessage(), e); } }
public void sessionDestroyed(SmppSession session) { synchronized (this) { if (logger.isInfoEnabled()) { logger.info(String.format("Session destroyed: %s", session.getConfiguration().getSystemId())); } // print out final stats if (session.hasCounters()) { logger.info(String.format("final session rx-submitSM: %s", session.getCounters().getRxSubmitSM())); } // remove esmeServer out of enquire list String esmeName = session.getConfiguration().getName(); Esme esmeServer = this.esmeManagement.getEsmeByName(esmeName); esmeServer.setServerBound(false); esmeServer.resetEnquireLinkFail(); this.smppServerOpsThread.removeEnquireList(esmeName); DefaultSmppSession defaultSession = (DefaultSmppSession) session; // firing of onPduRequestTimeout() for sent messages for which we do not have responses Window<Integer, PduRequest, PduResponse> wind = defaultSession.getSendWindow(); Map<Integer, WindowFuture<Integer, PduRequest, PduResponse>> futures = wind.createSortedSnapshot(); for (WindowFuture<Integer, PduRequest, PduResponse> future : futures.values()) { this.logger.warn("Firing of onPduRequestTimeout from DefaultSmppServerHandler.sessionDestroyed(): " + future.getRequest().toString()); defaultSession.expired(future); } // make sure it's really shutdown session.destroy(); } }
logger.info(String.format("Session destroyed: %s", session.getConfiguration().getSystemId()));
@Override public void sessionCreated(Long sessionId, SmppServerSession session, BaseBindResp preparedBindResponse) throws SmppProcessingException { if (this.frm.getSmppSession() != null) { throw new SmppProcessingException(SmppConstants.STATUS_INVBNDSTS); } this.frm.addMessage("Session created", session.getConfiguration().getSystemId()); this.frm.setSmppSession(session); session.serverReady(new ClientSmppSessionHandler(this.frm)); }
if (logger.isInfoEnabled()) { logger.info(String.format("Session created: Name=%s SystemId=%s", session.getConfiguration().getName(), session.getConfiguration().getSystemId())); sessionConfiguration.getSystemId(), sessionConfiguration.getHost(), sessionConfiguration.getPort(), sessionConfiguration.getType())); throw new SmppProcessingException(SmppConstants.STATUS_BINDFAIL);
if (logger.isInfoEnabled()) { logger.info(String.format("Session created: Name=%s SystemId=%s", session.getConfiguration().getName(), session.getConfiguration().getSystemId())); sessionConfiguration.getSystemId(), sessionConfiguration.getHost(), sessionConfiguration.getPort(), sessionConfiguration.getType())); throw new SmppProcessingException(SmppConstants.STATUS_BINDFAIL);
protected DefaultSmppSession createSession(Channel channel, SmppSessionConfiguration config, SmppSessionHandler sessionHandler) throws SmppTimeoutException, SmppChannelException, InterruptedException { DefaultSmppSession session = new DefaultSmppSession(SmppSession.Type.CLIENT, config, channel, sessionHandler, monitorExecutor); logger.debug("Creating session with esme " + config.getSystemId());
protected BaseBind createBindRequest(SmppSessionConfiguration config) throws UnrecoverablePduException { BaseBind bind = null; if (config.getType() == SmppBindType.TRANSCEIVER) { bind = new BindTransceiver(); } else if (config.getType() == SmppBindType.RECEIVER) { bind = new BindReceiver(); } else if (config.getType() == SmppBindType.TRANSMITTER) { bind = new BindTransmitter(); } else { throw new UnrecoverablePduException("Unable to convert SmppSessionConfiguration into a BaseBind request"); } bind.setSystemId(config.getSystemId()); bind.setPassword(config.getPassword()); bind.setSystemType(config.getSystemType()); bind.setInterfaceVersion(config.getInterfaceVersion()); bind.setAddressRange(config.getAddressRange()); return bind; }
protected BaseBind createBindRequest(SmppSessionConfiguration config) throws UnrecoverablePduException { BaseBind bind = null; if (config.getType() == SmppBindType.TRANSCEIVER) { bind = new BindTransceiver(); } else if (config.getType() == SmppBindType.RECEIVER) { bind = new BindReceiver(); } else if (config.getType() == SmppBindType.TRANSMITTER) { bind = new BindTransmitter(); } else { throw new UnrecoverablePduException("Unable to convert SmppSessionConfiguration into a BaseBind request"); } bind.setSystemId(config.getSystemId()); bind.setPassword(config.getPassword()); bind.setSystemType(config.getSystemType()); bind.setInterfaceVersion(config.getInterfaceVersion()); bind.setAddressRange(config.getAddressRange()); return bind; }
protected BaseBind createBindRequest(SmppSessionConfiguration config) throws UnrecoverablePduException { BaseBind bind = null; if (config.getType() == SmppBindType.TRANSCEIVER) { bind = new BindTransceiver(); } else if (config.getType() == SmppBindType.RECEIVER) { bind = new BindReceiver(); } else if (config.getType() == SmppBindType.TRANSMITTER) { bind = new BindTransmitter(); } else { throw new UnrecoverablePduException("Unable to convert SmppSessionConfiguration into a BaseBind request"); } bind.setSystemId(config.getSystemId()); bind.setPassword(config.getPassword()); bind.setSystemType(config.getSystemType()); bind.setInterfaceVersion(config.getInterfaceVersion()); bind.setAddressRange(config.getAddressRange()); return bind; }
protected BaseBind createBindRequest(SmppSessionConfiguration config) throws UnrecoverablePduException { BaseBind bind = null; if (config.getType() == SmppBindType.TRANSCEIVER) { bind = new BindTransceiver(); } else if (config.getType() == SmppBindType.RECEIVER) { bind = new BindReceiver(); } else if (config.getType() == SmppBindType.TRANSMITTER) { bind = new BindTransmitter(); } else { throw new UnrecoverablePduException("Unable to convert SmppSessionConfiguration into a BaseBind request"); } bind.setSystemId(config.getSystemId()); bind.setPassword(config.getPassword()); bind.setSystemType(config.getSystemType()); bind.setInterfaceVersion(config.getInterfaceVersion()); bind.setAddressRange(config.getAddressRange()); return bind; }