mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
Merge pull request #816 from dunithd/master
Checking whether the geo location service has been enabled before reading stats from analytics server
This commit is contained in:
commit
031c648a2e
@ -37,6 +37,8 @@ import org.wso2.carbon.device.mgt.common.geo.service.Event;
|
|||||||
import org.wso2.carbon.device.mgt.common.geo.service.GeoFence;
|
import org.wso2.carbon.device.mgt.common.geo.service.GeoFence;
|
||||||
import org.wso2.carbon.device.mgt.common.geo.service.GeoServiceException;
|
import org.wso2.carbon.device.mgt.common.geo.service.GeoServiceException;
|
||||||
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroupConstants;
|
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroupConstants;
|
||||||
|
import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager;
|
||||||
|
import org.wso2.carbon.device.mgt.core.config.DeviceManagementConfig;
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.service.api.GeoService;
|
import org.wso2.carbon.device.mgt.jaxrs.service.api.GeoService;
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.util.Constants;
|
import org.wso2.carbon.device.mgt.jaxrs.util.Constants;
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils;
|
import org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils;
|
||||||
@ -73,6 +75,14 @@ public class GeoServiceImpl implements GeoService {
|
|||||||
public Response getGeoDeviceStats(@PathParam("deviceId") String deviceId,
|
public Response getGeoDeviceStats(@PathParam("deviceId") String deviceId,
|
||||||
@PathParam("deviceType") String deviceType,
|
@PathParam("deviceType") String deviceType,
|
||||||
@QueryParam("from") long from, @QueryParam("to") long to) {
|
@QueryParam("from") long from, @QueryParam("to") long to) {
|
||||||
|
//First, check whether the Geo Location service has been enabled in the cdmf-config.xml file
|
||||||
|
DeviceManagementConfig deviceManagementConfig = DeviceConfigurationManager.getInstance()
|
||||||
|
.getDeviceManagementConfig();
|
||||||
|
if (deviceManagementConfig != null) {
|
||||||
|
if(!deviceManagementConfig.getGeoLocationConfiguration().getPublishLocationOperationResponse()){
|
||||||
|
return Response.status(Response.Status.BAD_REQUEST.getStatusCode()).build();
|
||||||
|
}
|
||||||
|
}
|
||||||
String tableName = "IOT_PER_DEVICE_STREAM_GEO_FUSEDSPATIALEVENT";
|
String tableName = "IOT_PER_DEVICE_STREAM_GEO_FUSEDSPATIALEVENT";
|
||||||
String fromDate = String.valueOf(from);
|
String fromDate = String.valueOf(from);
|
||||||
String toDate = String.valueOf(to);
|
String toDate = String.valueOf(to);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user