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(); }
synchronized (this) { if (logger.isInfoEnabled()) { logger.info(String.format("Session created: Name=%s SystemId=%s", session.getConfiguration().getName(), session.getConfiguration().getSystemId())); SmppSessionConfiguration sessionConfiguration = session.getConfiguration(); session.getConfiguration().getLoggingOptions().setLogBytes(false); session.getConfiguration().getLoggingOptions().setLogPdu(false);
logger.info(String.format("Session created: Name=%s SystemId=%s", session.getConfiguration().getName(), session.getConfiguration().getSystemId())); SmppSessionConfiguration sessionConfiguration = session.getConfiguration(); session.getConfiguration().getLoggingOptions().setLogBytes(false); session.getConfiguration().getLoggingOptions().setLogPdu(false);
@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)); }