@Service
public class MQTTManager
extends java.lang.Object
Constructor and Description |
---|
MQTTManager(MQTTService mqttService) |
Modifier and Type | Method and Description |
---|---|
SyncToken<java.util.UUID> |
getAreaSyncToken(java.util.UUID areaId)
Returns a synchronization token that can be used to coordinate communication with
the same camera device to prevent conflicts from arising
|
void |
sendConfigurationToCamera(MonitoredArea monitoredArea)
Sends a complete configuration to a camera device
|
void |
sendParameterConfigurationToCamera(java.util.UUID deviceId,
DetectionParameters params)
Sends parameter configuration to a camera device
|
void |
sendZoneConfigurationToCamera(java.util.UUID deviceId,
java.lang.Iterable<Zone> zones)
Sends zone configuration to a camera device (list of zones it should be monitoring and
relevant information about them)
|
@Autowired public MQTTManager(MQTTService mqttService)
public SyncToken<java.util.UUID> getAreaSyncToken(java.util.UUID areaId)
areaId
- the ID of the monitored area where the device is deployedpublic void sendConfigurationToCamera(MonitoredArea monitoredArea) throws com.fasterxml.jackson.core.JsonProcessingException, org.eclipse.paho.client.mqttv3.MqttException
monitoredArea
- the area whose current configuration should be sent to its devicecom.fasterxml.jackson.core.JsonProcessingException
- if something went wrong serializing the configuration to JSONorg.eclipse.paho.client.mqttv3.MqttException
- if something went wrong sending the configurationpublic void sendParameterConfigurationToCamera(java.util.UUID deviceId, DetectionParameters params) throws com.fasterxml.jackson.core.JsonProcessingException, org.eclipse.paho.client.mqttv3.MqttException
deviceId
- the ID of the device to receive the updated parametersparams
- the parameters to be sent to the devicecom.fasterxml.jackson.core.JsonProcessingException
- if something went wrong serializing the configuration to JSONorg.eclipse.paho.client.mqttv3.MqttException
- if something went wrong sending the configurationpublic void sendZoneConfigurationToCamera(java.util.UUID deviceId, java.lang.Iterable<Zone> zones) throws com.fasterxml.jackson.core.JsonProcessingException, org.eclipse.paho.client.mqttv3.MqttException
deviceId
- the ID of the device to receive the updated parameterszones
- the zones to be sent to the devicecom.fasterxml.jackson.core.JsonProcessingException
- if something went wrong serializing the configuration to JSONorg.eclipse.paho.client.mqttv3.MqttException
- if something went wrong sending the configuration