use of com.zx.sms.connect.manager.EndpointEntity in project SMSGate by Lihuanghe.
the class ChannelUtil method asyncWriteToEntity.
public static ChannelFuture asyncWriteToEntity(final String entity, final Object msg, GenericFutureListener listner) {
EndpointEntity e = EndpointManager.INS.getEndpointEntity(entity);
EndpointConnector connector = e.getSingletonConnector();
return asyncWriteToEntity(connector, msg, listner);
}
use of com.zx.sms.connect.manager.EndpointEntity in project SMSGate by Lihuanghe.
the class ChannelUtil method syncWriteBinaryMsgToEntity.
/**
* 同步发送消息类型 <br/>
* 注意:该方法将直接发送至编码器,不会再调用BusinessHandler里的write方法了。
* 因此对于Deliver和Submit消息必须自己进行长短信拆分,设置PDU等相关字段
*一般此方法用来发送二进制短信等特殊短信,需要自己生成短信的二进制内容。
*正常短信下发要使用 syncWriteLongMsgToEntity 方法
*/
public static <T extends BaseMessage> Promise<T> syncWriteBinaryMsgToEntity(String entity, BaseMessage msg) throws Exception {
EndpointEntity e = EndpointManager.INS.getEndpointEntity(entity);
EndpointConnector connector = e.getSingletonConnector();
Promise<T> promise = connector.synwrite(msg);
if (promise == null) {
// 为空,可能是连接断了,直接返回
return null;
}
return promise;
}
use of com.zx.sms.connect.manager.EndpointEntity in project SMSGate by Lihuanghe.
the class CMPPClientEndpointConnector method doinitPipeLine.
@Override
protected void doinitPipeLine(ChannelPipeline pipeline) {
CMPPCodecChannelInitializer codec = null;
EndpointEntity entity = getEndpointEntity();
if (entity instanceof CMPPEndpointEntity) {
pipeline.addLast(GlobalConstance.IdleCheckerHandlerName, new IdleStateHandler(0, 0, ((CMPPEndpointEntity) getEndpointEntity()).getIdleTimeSec(), TimeUnit.SECONDS));
codec = new CMPPCodecChannelInitializer(((CMPPEndpointEntity) getEndpointEntity()).getVersion());
} else {
pipeline.addLast(GlobalConstance.IdleCheckerHandlerName, new IdleStateHandler(0, 0, 30, TimeUnit.SECONDS));
codec = new CMPPCodecChannelInitializer();
}
pipeline.addLast("CmppServerIdleStateHandler", GlobalConstance.idleHandler);
pipeline.addLast(codec.pipeName(), codec);
pipeline.addLast("sessionLoginManager", new SessionLoginManager(getEndpointEntity()));
}
Aggregations