Search in sources :

Example 11 with EndpointEntity

use of com.zx.sms.connect.manager.EndpointEntity 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)

Example 12 with EndpointEntity

use of com.zx.sms.connect.manager.EndpointEntity in project SMSGate by Lihuanghe.

the class SgipServerEndpointConnector method doinitPipeLine.

@Override
protected void doinitPipeLine(ChannelPipeline pipeline) {
    super.doinitPipeLine(pipeline);
    EndpointEntity entity = getEndpointEntity();
    pipeline.addLast(GlobalConstance.IdleCheckerHandlerName, new IdleStateHandler(0, 0, entity.getIdleTimeSec(), TimeUnit.SECONDS));
    pipeline.addLast("SgipServerIdleStateHandler", GlobalConstance.sgipidleHandler);
    pipeline.addLast(SgipCodecChannelInitializer.pipeName(), new SgipCodecChannelInitializer());
    pipeline.addLast("sessionLoginManager", new SgipSessionLoginManager(getEndpointEntity()));
}
Also used : SgipSessionLoginManager(com.zx.sms.session.sgip.SgipSessionLoginManager) IdleStateHandler(io.netty.handler.timeout.IdleStateHandler) EndpointEntity(com.zx.sms.connect.manager.EndpointEntity)

Example 13 with EndpointEntity

use of com.zx.sms.connect.manager.EndpointEntity in project SMSGate by Lihuanghe.

the class SMGPServerEndpointConnector method doinitPipeLine.

@Override
protected void doinitPipeLine(ChannelPipeline pipeline) {
    super.doinitPipeLine(pipeline);
    EndpointEntity entity = getEndpointEntity();
    pipeline.addLast(GlobalConstance.IdleCheckerHandlerName, new IdleStateHandler(0, 0, entity.getIdleTimeSec(), TimeUnit.SECONDS));
    pipeline.addLast("SmgpServerIdleStateHandler", GlobalConstance.smgpidleHandler);
    // 默认使用3.0协议,用户登陆后再更换为正确的协议
    pipeline.addLast(SMGPCodecChannelInitializer.pipeName(), new SMGPCodecChannelInitializer(0x30));
    pipeline.addLast("sessionLoginManager", new SMGPSessionLoginManager(getEndpointEntity()));
}
Also used : IdleStateHandler(io.netty.handler.timeout.IdleStateHandler) SMGPSessionLoginManager(com.zx.sms.session.smgp.SMGPSessionLoginManager) EndpointEntity(com.zx.sms.connect.manager.EndpointEntity)

Example 14 with EndpointEntity

use of com.zx.sms.connect.manager.EndpointEntity in project SMSGate by Lihuanghe.

the class SMPPClientEndpointConnector method doinitPipeLine.

@Override
protected void doinitPipeLine(ChannelPipeline pipeline) {
    EndpointEntity entity = getEndpointEntity();
    pipeline.addLast(GlobalConstance.IdleCheckerHandlerName, new IdleStateHandler(0, 0, entity.getIdleTimeSec(), TimeUnit.SECONDS));
    pipeline.addLast("SmppServerIdleStateHandler", GlobalConstance.smppidleHandler);
    pipeline.addLast(SMPPCodecChannelInitializer.pipeName(), new SMPPCodecChannelInitializer());
    pipeline.addLast("sessionLoginManager", new SMPPSessionLoginManager(getEndpointEntity()));
}
Also used : IdleStateHandler(io.netty.handler.timeout.IdleStateHandler) SMPPSessionLoginManager(com.zx.sms.session.smpp.SMPPSessionLoginManager) EndpointEntity(com.zx.sms.connect.manager.EndpointEntity)

Example 15 with EndpointEntity

use of com.zx.sms.connect.manager.EndpointEntity in project SMSGate by Lihuanghe.

the class SMPPServerEndpointConnector method doinitPipeLine.

@Override
protected void doinitPipeLine(ChannelPipeline pipeline) {
    super.doinitPipeLine(pipeline);
    EndpointEntity entity = getEndpointEntity();
    pipeline.addLast(GlobalConstance.IdleCheckerHandlerName, new IdleStateHandler(0, 0, entity.getIdleTimeSec(), TimeUnit.SECONDS));
    pipeline.addLast("SmppServerIdleStateHandler", GlobalConstance.smppidleHandler);
    pipeline.addLast(SMPPCodecChannelInitializer.pipeName(), new SMPPCodecChannelInitializer());
    pipeline.addLast("sessionLoginManager", new SMPPSessionLoginManager(getEndpointEntity()));
}
Also used : IdleStateHandler(io.netty.handler.timeout.IdleStateHandler) SMPPSessionLoginManager(com.zx.sms.session.smpp.SMPPSessionLoginManager) EndpointEntity(com.zx.sms.connect.manager.EndpointEntity)

Aggregations

EndpointEntity (com.zx.sms.connect.manager.EndpointEntity)18 IdleStateHandler (io.netty.handler.timeout.IdleStateHandler)8 EndpointConnector (com.zx.sms.connect.manager.EndpointConnector)4 ServerEndpoint (com.zx.sms.connect.manager.ServerEndpoint)3 EndpointManager (com.zx.sms.connect.manager.EndpointManager)2 SgipSessionLoginManager (com.zx.sms.session.sgip.SgipSessionLoginManager)2 SMGPSessionLoginManager (com.zx.sms.session.smgp.SMGPSessionLoginManager)2 SMPPSessionLoginManager (com.zx.sms.session.smpp.SMPPSessionLoginManager)2 CmppDeliverRequestMessage (com.zx.sms.codec.cmpp.msg.CmppDeliverRequestMessage)1 CmppSubmitRequestMessage (com.zx.sms.codec.cmpp.msg.CmppSubmitRequestMessage)1 SMGPDeliverMessage (com.zx.sms.codec.smgp.msg.SMGPDeliverMessage)1 SMGPLoginMessage (com.zx.sms.codec.smgp.msg.SMGPLoginMessage)1 SMGPSubmitMessage (com.zx.sms.codec.smgp.msg.SMGPSubmitMessage)1 Address (com.zx.sms.codec.smpp.Address)1 BaseBind (com.zx.sms.codec.smpp.msg.BaseBind)1 BindReceiver (com.zx.sms.codec.smpp.msg.BindReceiver)1 BindTransceiver (com.zx.sms.codec.smpp.msg.BindTransceiver)1 BindTransmitter (com.zx.sms.codec.smpp.msg.BindTransmitter)1 DeliverSm (com.zx.sms.codec.smpp.msg.DeliverSm)1 SubmitSm (com.zx.sms.codec.smpp.msg.SubmitSm)1