public class StandaloneDeviceMessageBroker extends Object implements DeviceOperationBroker, MessageHandler
| 构造器和说明 |
|---|
StandaloneDeviceMessageBroker() |
StandaloneDeviceMessageBroker(reactor.core.publisher.FluxProcessor<Message,Message> processor) |
| 限定符和类型 | 方法和说明 |
|---|---|
reactor.core.publisher.Flux<DeviceStateInfo> |
getDeviceState(String serviceId,
Collection<String> deviceIdList)
获取指定服务里设备状态
|
reactor.core.Disposable |
handleGetDeviceState(String serverId,
java.util.function.Function<org.reactivestreams.Publisher<String>,reactor.core.publisher.Flux<DeviceStateInfo>> stateMapper)
监听获取设备真实状态请求,并响应状态结果
|
reactor.core.publisher.Flux<DeviceMessageReply> |
handleReply(String deviceId,
String messageId,
java.time.Duration timeout)
根据消息ID监听响应
|
reactor.core.publisher.Flux<Message> |
handleSendToDeviceMessage(String serverId)
监听发往设备的指令
|
reactor.core.publisher.Mono<Boolean> |
reply(DeviceMessageReply message)
回复平台下发的指令
|
reactor.core.publisher.Mono<Integer> |
send(org.reactivestreams.Publisher<? extends BroadcastMessage> message)
发送广播消息
|
reactor.core.publisher.Mono<Integer> |
send(String serverId,
org.reactivestreams.Publisher<? extends Message> message)
发送设备消息到指定到服务
|
public reactor.core.publisher.Flux<Message> handleSendToDeviceMessage(String serverId)
MessageHandlerhandleSendToDeviceMessage 在接口中 MessageHandlerserverId - 服务ID,在集群时,不同的节点serverId不同 ServerNode#getId()public reactor.core.Disposable handleGetDeviceState(String serverId, java.util.function.Function<org.reactivestreams.Publisher<String>,reactor.core.publisher.Flux<DeviceStateInfo>> stateMapper)
MessageHandlerhandleGetDeviceState 在接口中 MessageHandlerserverId - 服务ID,在集群时,不同的节点serverId不同stateMapper - 状态检查器public reactor.core.publisher.Flux<DeviceStateInfo> getDeviceState(String serviceId, Collection<String> deviceIdList)
DeviceOperationBrokergetDeviceState 在接口中 DeviceOperationBrokerserviceId - 设备所在服务ID ServerNode#getId()deviceIdList - 设备列表DeviceOperator.getConnectionServerId()public reactor.core.publisher.Mono<Boolean> reply(DeviceMessageReply message)
MessageHandlerreply 在接口中 MessageHandlermessage - 回复指令public reactor.core.publisher.Flux<DeviceMessageReply> handleReply(String deviceId, String messageId, java.time.Duration timeout)
DeviceOperationBrokerhandleReply 在接口中 DeviceOperationBrokerdeviceId - 设备IDmessageId - 消息IDtimeout - 超时时间public reactor.core.publisher.Mono<Integer> send(String serverId, org.reactivestreams.Publisher<? extends Message> message)
DeviceOperationBrokersend 在接口中 DeviceOperationBrokerserverId - 设备所在服务ID ServerNode#getId()DeviceOperator.getConnectionServerId()public reactor.core.publisher.Mono<Integer> send(org.reactivestreams.Publisher<? extends BroadcastMessage> message)
DeviceOperationBrokersend 在接口中 DeviceOperationBrokermessage - 广播消息Copyright © 2019–2022. All rights reserved.