Search in sources :

Example 6 with BaseBind

use of com.zx.sms.codec.smpp.msg.BaseBind in project SMSGate by Lihuanghe.

the class SMPPSessionLoginManager method queryEndpointEntityByMsg.

@Override
protected EndpointEntity queryEndpointEntityByMsg(Object msg) {
    if (msg instanceof BaseBind) {
        BaseBind message = (BaseBind) msg;
        String username = message.getSystemId();
        if (entity instanceof SMPPServerEndpointEntity) {
            SMPPServerEndpointEntity serverEntity = (SMPPServerEndpointEntity) entity;
            if (msg instanceof BindTransmitter) {
                EndpointEntity end = serverEntity.getChild(username.trim(), ChannelType.DOWN);
                return end;
            } else if (msg instanceof BindReceiver) {
                EndpointEntity end = serverEntity.getChild(username.trim(), ChannelType.UP);
                return end;
            } else if (msg instanceof BindTransceiver) {
                EndpointEntity end = serverEntity.getChild(username.trim(), ChannelType.DUPLEX);
                return end;
            }
        }
    }
    return null;
}
Also used : BindTransceiver(com.zx.sms.codec.smpp.msg.BindTransceiver) SMPPServerEndpointEntity(com.zx.sms.connect.manager.smpp.SMPPServerEndpointEntity) BindReceiver(com.zx.sms.codec.smpp.msg.BindReceiver) BindTransmitter(com.zx.sms.codec.smpp.msg.BindTransmitter) BaseBind(com.zx.sms.codec.smpp.msg.BaseBind) EndpointEntity(com.zx.sms.connect.manager.EndpointEntity) SMPPEndpointEntity(com.zx.sms.connect.manager.smpp.SMPPEndpointEntity) SMPPServerEndpointEntity(com.zx.sms.connect.manager.smpp.SMPPServerEndpointEntity)

Aggregations

BaseBind (com.zx.sms.codec.smpp.msg.BaseBind)6 SMPPEndpointEntity (com.zx.sms.connect.manager.smpp.SMPPEndpointEntity)4 BindReceiver (com.zx.sms.codec.smpp.msg.BindReceiver)2 BindTransceiver (com.zx.sms.codec.smpp.msg.BindTransceiver)2 BindTransmitter (com.zx.sms.codec.smpp.msg.BindTransmitter)2 TlvConvertException (com.zx.sms.codec.smpp.TlvConvertException)1 BaseBindResp (com.zx.sms.codec.smpp.msg.BaseBindResp)1 PduResponse (com.zx.sms.codec.smpp.msg.PduResponse)1 EndpointEntity (com.zx.sms.connect.manager.EndpointEntity)1 SMPPServerEndpointEntity (com.zx.sms.connect.manager.smpp.SMPPServerEndpointEntity)1 ChannelFuture (io.netty.channel.ChannelFuture)1 ChannelHandlerContext (io.netty.channel.ChannelHandlerContext)1 Future (io.netty.util.concurrent.Future)1 GenericFutureListener (io.netty.util.concurrent.GenericFutureListener)1