@Override public void destroyObject( PooledObject<SMPPSession> pooledObject ) throws Exception { final SMPPSession session = pooledObject.getObject(); Log.debug( "Destroying a pooled session with ID '{}'.", session.getSessionId() ); session.unbindAndClose(); }
@Override public boolean validateObject( PooledObject<SMPPSession> pooledObject ) { final SMPPSession session = pooledObject.getObject(); final boolean isValid = session.getSessionState().isTransmittable(); // updated by the SMPPSession internal enquireLink timer. Log.debug( "Ran a check to see if session with ID '{}' is valid. Outcome: {}", session.getSessionId(), isValid ); return isValid; }
@Override public SMPPSession create() throws Exception { // SMSC connection settings final String host = JiveGlobals.getProperty( "sms.smpp.host", "localhost" ); final int port = JiveGlobals.getIntProperty( "sms.smpp.port", 2775 ); final String systemId = JiveGlobals.getProperty( "sms.smpp.systemId" ); final String password = JiveGlobals.getProperty( "sms.smpp.password" ); final String systemType = JiveGlobals.getProperty( "sms.smpp.systemType" ); // Settings that apply to 'receiving' SMS. Should not apply to this implementation, as we're not receiving anything.. final TypeOfNumber receiveTon = JiveGlobals.getEnumProperty( "sms.smpp.receive.ton", TypeOfNumber.class, TypeOfNumber.UNKNOWN ); final NumberingPlanIndicator receiveNpi = JiveGlobals.getEnumProperty( "sms.smpp.receive.npi", NumberingPlanIndicator.class, NumberingPlanIndicator.UNKNOWN ); Log.debug( "Creating a new sesssion (host: '{}', port: '{}', systemId: '{}'.", host, port, systemId ); final SMPPSession session = new SMPPSession(); session.connectAndBind( host, port, new BindParameter( BindType.BIND_TX, systemId, password, systemType, receiveTon, receiveNpi, null ) ); Log.debug( "Created a new session with ID '{}'.", session.getSessionId() ); return session; }
@Override public void destroyObject( PooledObject<SMPPSession> pooledObject ) throws Exception { final SMPPSession session = pooledObject.getObject(); Log.debug( "Destroying a pooled session with ID '{}'.", session.getSessionId() ); session.unbindAndClose(); }
@Override public boolean validateObject( PooledObject<SMPPSession> pooledObject ) { final SMPPSession session = pooledObject.getObject(); final boolean isValid = session.getSessionState().isTransmittable(); // updated by the SMPPSession internal enquireLink timer. Log.debug( "Ran a check to see if session with ID '{}' is valid. Outcome: {}", session.getSessionId(), isValid ); return isValid; }
notifyNoActivity(); } catch (IOException e) { logger.info("Reading PDU session {} in state {}: {}", getSessionId(), getSessionState(), e.getMessage()); close(); } catch (RuntimeException e) {
@Override public SMPPSession create() throws Exception { // SMSC connection settings final String host = JiveGlobals.getProperty( "sms.smpp.host", "localhost" ); final int port = JiveGlobals.getIntProperty( "sms.smpp.port", 2775 ); final String systemId = JiveGlobals.getProperty( "sms.smpp.systemId" ); final String password = JiveGlobals.getProperty( "sms.smpp.password" ); final String systemType = JiveGlobals.getProperty( "sms.smpp.systemType" ); // Settings that apply to 'receiving' SMS. Should not apply to this implementation, as we're not receiving anything.. final TypeOfNumber receiveTon = JiveGlobals.getEnumProperty( "sms.smpp.receive.ton", TypeOfNumber.class, TypeOfNumber.UNKNOWN ); final NumberingPlanIndicator receiveNpi = JiveGlobals.getEnumProperty( "sms.smpp.receive.npi", NumberingPlanIndicator.class, NumberingPlanIndicator.UNKNOWN ); Log.debug( "Creating a new sesssion (host: '{}', port: '{}', systemId: '{}'.", host, port, systemId ); final SMPPSession session = new SMPPSession(); session.connectAndBind( host, port, new BindParameter( BindType.BIND_TX, systemId, password, systemType, receiveTon, receiveNpi, null ) ); Log.debug( "Created a new session with ID '{}'.", session.getSessionId() ); return session; }