|
1 | 1 | /*
|
2 |
| - * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 2 | + * Copyright 2010-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License").
|
5 | 5 | * You may not use this file except in compliance with the License.
|
@@ -2088,6 +2088,75 @@ public DisassociateTrackerConsumerResult disassociateTrackerConsumer(
|
2088 | 2088 | }
|
2089 | 2089 | }
|
2090 | 2090 |
|
| 2091 | + /** |
| 2092 | + * <p> |
| 2093 | + * Evaluates device positions against geofence geometries from a given |
| 2094 | + * geofence collection. The event forecasts three states for which a device |
| 2095 | + * can be in relative to a geofence: |
| 2096 | + * </p> |
| 2097 | + * <p> |
| 2098 | + * <code>ENTER</code>: If a device is outside of a geofence, but would |
| 2099 | + * breach the fence if the device is moving at its current speed within time |
| 2100 | + * horizon window. |
| 2101 | + * </p> |
| 2102 | + * <p> |
| 2103 | + * <code>EXIT</code>: If a device is inside of a geofence, but would breach |
| 2104 | + * the fence if the device is moving at its current speed within time |
| 2105 | + * horizon window. |
| 2106 | + * </p> |
| 2107 | + * <p> |
| 2108 | + * <code>IDLE</code>: If a device is inside of a geofence, and the device is |
| 2109 | + * not moving. |
| 2110 | + * </p> |
| 2111 | + * |
| 2112 | + * @param forecastGeofenceEventsRequest |
| 2113 | + * @return forecastGeofenceEventsResult The response from the |
| 2114 | + * ForecastGeofenceEvents service method, as returned by AWS |
| 2115 | + * Location service. |
| 2116 | + * @throws InternalServerException |
| 2117 | + * @throws ResourceNotFoundException |
| 2118 | + * @throws AccessDeniedException |
| 2119 | + * @throws ValidationException |
| 2120 | + * @throws ThrottlingException |
| 2121 | + * @throws AmazonClientException If any internal errors are encountered |
| 2122 | + * inside the client while attempting to make the request or |
| 2123 | + * handle the response. For example if a network connection is |
| 2124 | + * not available. |
| 2125 | + * @throws AmazonServiceException If an error response is returned by AWS |
| 2126 | + * Location service indicating either a problem with the data in |
| 2127 | + * the request, or a server side issue. |
| 2128 | + */ |
| 2129 | + public ForecastGeofenceEventsResult forecastGeofenceEvents( |
| 2130 | + ForecastGeofenceEventsRequest forecastGeofenceEventsRequest) |
| 2131 | + throws AmazonServiceException, AmazonClientException { |
| 2132 | + ExecutionContext executionContext = createExecutionContext(forecastGeofenceEventsRequest); |
| 2133 | + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
| 2134 | + awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
| 2135 | + Request<ForecastGeofenceEventsRequest> request = null; |
| 2136 | + Response<ForecastGeofenceEventsResult> response = null; |
| 2137 | + try { |
| 2138 | + awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
| 2139 | + try { |
| 2140 | + request = new ForecastGeofenceEventsRequestMarshaller() |
| 2141 | + .marshall(forecastGeofenceEventsRequest); |
| 2142 | + // Binds the request metrics to the current request. |
| 2143 | + request.setAWSRequestMetrics(awsRequestMetrics); |
| 2144 | + } finally { |
| 2145 | + awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
| 2146 | + } |
| 2147 | + Unmarshaller<ForecastGeofenceEventsResult, JsonUnmarshallerContext> unmarshaller = new ForecastGeofenceEventsResultJsonUnmarshaller(); |
| 2148 | + JsonResponseHandler<ForecastGeofenceEventsResult> responseHandler = new JsonResponseHandler<ForecastGeofenceEventsResult>( |
| 2149 | + unmarshaller); |
| 2150 | + |
| 2151 | + response = invoke(request, responseHandler, executionContext); |
| 2152 | + |
| 2153 | + return response.getAwsResponse(); |
| 2154 | + } finally { |
| 2155 | + awsRequestMetrics.endEvent(Field.ClientExecuteTime); |
| 2156 | + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); |
| 2157 | + } |
| 2158 | + } |
| 2159 | + |
2091 | 2160 | /**
|
2092 | 2161 | * <p>
|
2093 | 2162 | * Retrieves a device's most recent position according to its sample time.
|
@@ -2208,6 +2277,12 @@ public GetDevicePositionHistoryResult getDevicePositionHistory(
|
2208 | 2277 | * <p>
|
2209 | 2278 | * Retrieves the geofence details from a geofence collection.
|
2210 | 2279 | * </p>
|
| 2280 | + * <note> |
| 2281 | + * <p> |
| 2282 | + * The returned geometry will always match the geometry format used when the |
| 2283 | + * geofence was created. |
| 2284 | + * </p> |
| 2285 | + * </note> |
2211 | 2286 | *
|
2212 | 2287 | * @param getGeofenceRequest
|
2213 | 2288 | * @return getGeofenceResult The response from the GetGeofence service
|
@@ -3724,6 +3799,61 @@ public UpdateTrackerResult updateTracker(UpdateTrackerRequest updateTrackerReque
|
3724 | 3799 | }
|
3725 | 3800 | }
|
3726 | 3801 |
|
| 3802 | + /** |
| 3803 | + * <p> |
| 3804 | + * Verifies the integrity of the device's position by determining if it was |
| 3805 | + * reported behind a proxy, and by comparing it to an inferred position |
| 3806 | + * estimated based on the device's state. |
| 3807 | + * </p> |
| 3808 | + * |
| 3809 | + * @param verifyDevicePositionRequest |
| 3810 | + * @return verifyDevicePositionResult The response from the |
| 3811 | + * VerifyDevicePosition service method, as returned by AWS Location |
| 3812 | + * service. |
| 3813 | + * @throws InternalServerException |
| 3814 | + * @throws ResourceNotFoundException |
| 3815 | + * @throws AccessDeniedException |
| 3816 | + * @throws ValidationException |
| 3817 | + * @throws ThrottlingException |
| 3818 | + * @throws AmazonClientException If any internal errors are encountered |
| 3819 | + * inside the client while attempting to make the request or |
| 3820 | + * handle the response. For example if a network connection is |
| 3821 | + * not available. |
| 3822 | + * @throws AmazonServiceException If an error response is returned by AWS |
| 3823 | + * Location service indicating either a problem with the data in |
| 3824 | + * the request, or a server side issue. |
| 3825 | + */ |
| 3826 | + public VerifyDevicePositionResult verifyDevicePosition( |
| 3827 | + VerifyDevicePositionRequest verifyDevicePositionRequest) |
| 3828 | + throws AmazonServiceException, AmazonClientException { |
| 3829 | + ExecutionContext executionContext = createExecutionContext(verifyDevicePositionRequest); |
| 3830 | + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
| 3831 | + awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
| 3832 | + Request<VerifyDevicePositionRequest> request = null; |
| 3833 | + Response<VerifyDevicePositionResult> response = null; |
| 3834 | + try { |
| 3835 | + awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
| 3836 | + try { |
| 3837 | + request = new VerifyDevicePositionRequestMarshaller() |
| 3838 | + .marshall(verifyDevicePositionRequest); |
| 3839 | + // Binds the request metrics to the current request. |
| 3840 | + request.setAWSRequestMetrics(awsRequestMetrics); |
| 3841 | + } finally { |
| 3842 | + awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
| 3843 | + } |
| 3844 | + Unmarshaller<VerifyDevicePositionResult, JsonUnmarshallerContext> unmarshaller = new VerifyDevicePositionResultJsonUnmarshaller(); |
| 3845 | + JsonResponseHandler<VerifyDevicePositionResult> responseHandler = new JsonResponseHandler<VerifyDevicePositionResult>( |
| 3846 | + unmarshaller); |
| 3847 | + |
| 3848 | + response = invoke(request, responseHandler, executionContext); |
| 3849 | + |
| 3850 | + return response.getAwsResponse(); |
| 3851 | + } finally { |
| 3852 | + awsRequestMetrics.endEvent(Field.ClientExecuteTime); |
| 3853 | + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); |
| 3854 | + } |
| 3855 | + } |
| 3856 | + |
3727 | 3857 | /**
|
3728 | 3858 | * Returns additional metadata for a previously executed successful,
|
3729 | 3859 | * request, typically used for debugging issues where a service isn't acting
|
|
0 commit comments