Search in sources :

Example 1 with SgipEndpointEntity

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

the class SgipSessionLoginManager method doLogin.

@Override
protected void doLogin(Channel ch) {
    // 发送bind请求
    SgipEndpointEntity sgipentity = (SgipEndpointEntity) entity;
    SgipBindRequestMessage bind = createBindRequest(sgipentity);
    ch.writeAndFlush(bind);
}
Also used : SgipBindRequestMessage(com.zx.sms.codec.sgip12.msg.SgipBindRequestMessage) SgipEndpointEntity(com.zx.sms.connect.manager.sgip.SgipEndpointEntity)

Example 2 with SgipEndpointEntity

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

the class SgipSessionLoginManager method validClientMsg.

@Override
protected int validClientMsg(EndpointEntity entity, Object msg) {
    SgipEndpointEntity sgipentity = (SgipEndpointEntity) entity;
    SgipBindRequestMessage message = (SgipBindRequestMessage) msg;
    if (sgipentity.getLoginName().equals(message.getLoginName()) && sgipentity.getLoginPassowrd().equals(message.getLoginPassowrd())) {
        return 0;
    } else {
        return 1;
    }
}
Also used : SgipBindRequestMessage(com.zx.sms.codec.sgip12.msg.SgipBindRequestMessage) SgipEndpointEntity(com.zx.sms.connect.manager.sgip.SgipEndpointEntity)

Example 3 with SgipEndpointEntity

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

the class SgipSessionLoginManager method doLoginSuccess.

@Override
protected void doLoginSuccess(ChannelHandlerContext ctx, EndpointEntity entity, Object message) {
    // 发送bind请求
    SgipEndpointEntity sgipentity = (SgipEndpointEntity) entity;
    SgipBindResponseMessage resp = new SgipBindResponseMessage(((Message) message).getHeader());
    resp.setResult((short) 0);
    resp.setTimestamp(((Message) message).getTimestamp());
    ctx.channel().writeAndFlush(resp);
}
Also used : SgipBindResponseMessage(com.zx.sms.codec.sgip12.msg.SgipBindResponseMessage) SgipEndpointEntity(com.zx.sms.connect.manager.sgip.SgipEndpointEntity)

Aggregations

SgipEndpointEntity (com.zx.sms.connect.manager.sgip.SgipEndpointEntity)3 SgipBindRequestMessage (com.zx.sms.codec.sgip12.msg.SgipBindRequestMessage)2 SgipBindResponseMessage (com.zx.sms.codec.sgip12.msg.SgipBindResponseMessage)1