@Service
public class DetectedObjectMovementService
extends java.lang.Object
Constructor and Description |
---|
DetectedObjectMovementService(DetectedObjectMovementRepository detectedObjectMovementRepository,
AggregatedMovementRepository aggregatedMovementRepository,
AggregatedTrajectoryRepository aggregatedTrajectoryRepository) |
Modifier and Type | Method and Description |
---|---|
long |
getMovementCountByAreaId(java.util.UUID monitoredAreaID,
java.time.Instant since,
java.time.Instant until,
@Min(value=0L) double minVelocity,
@Min(value=-1L) double maxVelocity)
Returns the number of movements that would be returned by a call to
getMovementsByAreaId
with the same arguments |
java.lang.Iterable<MovementView> |
getMovementsByAreaId(java.util.UUID monitoredAreaID,
java.time.Instant since,
java.time.Instant until,
@Min(value=0L) double minVelocity,
@Min(value=-1L) double maxVelocity)
Returns movements filtered by the given criteria
|
java.lang.Iterable<MovementWithTransitView> |
getMovementsWithTransitsByAreaId(java.util.UUID monitoredAreaID,
java.time.Instant since,
java.time.Instant until,
@Min(value=0L) double minVelocity,
@Min(value=-1L) double maxVelocity)
Returns movements along with their transit IDs filtered by the given criteria.
|
MinMax |
getVelocityRangeByArea(java.util.UUID monitoredAreaID,
java.time.Instant since,
java.time.Instant until)
Returns the smallest and larges velocity recorded in the given area.
|
void |
saveAllDetectedObjectMovements(java.lang.Iterable<CreateMovementRequest> requests,
Transit transit)
Saves a list of detected object movements in the database
|
AggregatedMovement |
saveDetectedObjectMovement(CreateMovementRequest request,
Transit transit)
Saves a detected object movement in the database
|
@Autowired public DetectedObjectMovementService(DetectedObjectMovementRepository detectedObjectMovementRepository, AggregatedMovementRepository aggregatedMovementRepository, AggregatedTrajectoryRepository aggregatedTrajectoryRepository)
@Transactional public AggregatedMovement saveDetectedObjectMovement(CreateMovementRequest request, Transit transit)
request
- request containing properties of the movementtransit
- transit the movement belongs to@Transactional public void saveAllDetectedObjectMovements(java.lang.Iterable<CreateMovementRequest> requests, Transit transit)
requests
- requests containing properties of the movementtransit
- transit the movements belong topublic java.lang.Iterable<MovementView> getMovementsByAreaId(java.util.UUID monitoredAreaID, java.time.Instant since, java.time.Instant until, @Min(value=0L) @Min(value=0L) double minVelocity, @Min(value=-1L) @Min(value=-1L) double maxVelocity)
monitoredAreaID
- the ID of the monitored are who movements should be returnedsince
- the time since when movements should be returneduntil
- the time until when movements should be returnedminVelocity
- minimum speed in pixels per second, points at which the speed was
lower will not be returnedmaxVelocity
- maximum speed in pixels per second (-1 for unlimited), points at
which the speed was higher will not be returnedpublic java.lang.Iterable<MovementWithTransitView> getMovementsWithTransitsByAreaId(java.util.UUID monitoredAreaID, java.time.Instant since, java.time.Instant until, @Min(value=0L) @Min(value=0L) double minVelocity, @Min(value=-1L) @Min(value=-1L) double maxVelocity)
monitoredAreaID
- the ID of the monitored are who movements should be returnedsince
- the time since when movements should be returneduntil
- the time until when movements should be returnedminVelocity
- minimum speed in pixels per second, points at which the speed was
lower will not be returnedmaxVelocity
- maximum speed in pixels per second (-1 for unlimited), points at
which the speed was higher will not be returnedpublic long getMovementCountByAreaId(java.util.UUID monitoredAreaID, java.time.Instant since, java.time.Instant until, @Min(value=0L) @Min(value=0L) double minVelocity, @Min(value=-1L) @Min(value=-1L) double maxVelocity)
getMovementsByAreaId
with the same argumentsmonitoredAreaID
- the ID of the monitored are who movements should be returnedsince
- the time since when movements should be returneduntil
- the time until when movements should be returnedminVelocity
- minimum speed in pixels per second, points at which the speed was
lower will not be returnedmaxVelocity
- maximum speed in pixels per second (-1 for unlimited), points at
which the speed was higher will not be returned
recorded speed; points at which the speed was higher will not be returnedpublic MinMax getVelocityRangeByArea(java.util.UUID monitoredAreaID, java.time.Instant since, java.time.Instant until)
monitoredAreaID
- the id of the monitored areasince
- the time since when movements should be returneduntil
- the time until when movements should be returned