Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
device-new-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
device-new-platform
Commits
e8c9f5de
Commit
e8c9f5de
authored
2 years ago
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
短信界面修改
parent
faf4dc14
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
0 deletions
+79
-0
device-manager/src/main/java/com/mortals/xhx/common/utils/SmsQueueManager.java
...in/java/com/mortals/xhx/common/utils/SmsQueueManager.java
+79
-0
No files found.
device-manager/src/main/java/com/mortals/xhx/common/utils/SmsQueueManager.java
0 → 100644
View file @
e8c9f5de
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
);
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment