Commit e8c9f5de authored by 赵啸非's avatar 赵啸非

短信界面修改

parent faf4dc14
No related merge requests found
package com.mortals.xhx.common.utils;
import com.mortals.xhx.module.alarm.model.AlarmSmsSendEntity;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicInteger;
@Slf4j
@Data
public class SmsQueueManager {
/**
* 响应队列
*/
public static Queue<AlarmSmsSendEntity> respQueue = new ConcurrentLinkedQueue<>();
/**
* 待提交短信网关队列大小 加入队列时增加,取出队列时减少
*/
public static AtomicInteger sendQueueSize = new AtomicInteger(0);
/**
* 状态报告队列
*/
public static Queue<AlarmSmsSendEntity> rptQueue = new ConcurrentLinkedQueue<>();
/**
* 状态报告更新队列
*/
public static Queue<AlarmSmsSendEntity> rptUpdateQueue = new ConcurrentLinkedQueue<>();
/**
* 获取发送队列大小
*
* @return
*/
public static int getSendQueueSize() {
return sendQueueSize.get();
}
/**
* 取响应队列大小
*
* @return
*/
public static int getRespQueueSize() {
return respQueue.size();
}
/**
* 取出 响应
*
* @return
*/
public static AlarmSmsSendEntity pollRespQueue() {
return respQueue.poll();
}
/**
* 放入响应
*
* @param SmsGateRespQueueEntity
*/
public static void offerRespQueue(AlarmSmsSendEntity SmsGateRespQueueEntity) {
if (null == SmsGateRespQueueEntity) {
return;
}
respQueue.offer(SmsGateRespQueueEntity);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment