@Service
public class ZoneService
extends java.lang.Object
Constructor and Description |
---|
ZoneService(ZoneRepository zoneRepository,
ZoneSequenceRepository zoneSequenceRepository,
MonitoredAreaRepository monitoredAreaRepository,
MQTTManager mqttManager) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
createNewZone(java.util.UUID areaID,
ZoneRequest request)
Stores a new zone
|
void |
deleteZone(java.util.UUID areaID,
int zoneNumber)
Deletes the zone belonging to the given monitored area with the given number
|
void |
deleteZone(java.util.UUID areaID,
int zoneNumber,
boolean hard)
Deletes the zone belonging to the given monitored area with the given number
|
<T> java.lang.Iterable<T> |
findByAreaId(java.util.UUID areaID,
boolean activeOnly,
java.lang.Class<T> resultType)
Returns all zones belonging to the given monitored area
|
<T> java.lang.Iterable<T> |
findByAreaId(java.util.UUID areaID,
java.lang.Class<T> resultType)
Returns all zones belonging to the given monitored area
|
<T> T |
findZoneByAreaIDAndNumber(java.util.UUID areaID,
int zoneNumber,
java.lang.Class<T> resultType)
Returns the zone belonging to the given monitored area with the given number
|
ZoneView |
updateZone(java.util.UUID areaID,
int zoneNumber,
ZoneRequest request)
Updates a zone
|
@Autowired public ZoneService(ZoneRepository zoneRepository, ZoneSequenceRepository zoneSequenceRepository, MonitoredAreaRepository monitoredAreaRepository, MQTTManager mqttManager)
public <T> java.lang.Iterable<T> findByAreaId(java.util.UUID areaID, boolean activeOnly, java.lang.Class<T> resultType)
areaID
- the ID of the monitored areaactiveOnly
- if true, only active zones will be returnedresultType
- type of the result (Zone projection)public <T> java.lang.Iterable<T> findByAreaId(java.util.UUID areaID, java.lang.Class<T> resultType)
areaID
- the ID of the monitored arearesultType
- type of the result (Zone projection)public <T> T findZoneByAreaIDAndNumber(java.util.UUID areaID, int zoneNumber, java.lang.Class<T> resultType)
areaID
- the ID of the monitored areazoneNumber
- the zone numberpublic java.lang.String createNewZone(java.util.UUID areaID, ZoneRequest request)
areaID
- the ID of the monitored area to which the zone will belongrequest
- request containing the attributes of the new zone@Transactional public ZoneView updateZone(java.util.UUID areaID, int zoneNumber, ZoneRequest request)
areaID
- the ID of the monitored area to which the zone belongszoneNumber
- the zone numberrequest
- request containing the attributes of the zone@Transactional public void deleteZone(java.util.UUID areaID, int zoneNumber, boolean hard)
hard
- if true, zone is deleted from the database, if false, it is set to inactive.
In either case, it is deleted from the camera deviceareaID
- the ID of the monitored areazoneNumber
- the zone number@Transactional public void deleteZone(java.util.UUID areaID, int zoneNumber)
areaID
- the ID of the monitored areazoneNumber
- the zone number