mirror of
https://repository.entgra.net/community/device-mgt-core.git
synced 2025-10-06 02:01:45 +00:00
cleaned up components/device-mgt
This commit is contained in:
parent
584dbd7894
commit
056987141b
@ -155,17 +155,6 @@
|
|||||||
<artifactId>cxf-bundle-jaxrs</artifactId>
|
<artifactId>cxf-bundle-jaxrs</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!---->
|
|
||||||
<!--<dependency>-->
|
|
||||||
<!--<groupId>org.apache.cxf</groupId>-->
|
|
||||||
<!--<artifactId>cxf-rt-frontend-jaxrs</artifactId>-->
|
|
||||||
<!--<scope>provided</scope>-->
|
|
||||||
<!--</dependency>-->
|
|
||||||
<!--<dependency>-->
|
|
||||||
<!--<groupId>org.apache.cxf</groupId>-->
|
|
||||||
<!--<artifactId>cxf-rt-transports-http</artifactId>-->
|
|
||||||
<!--<scope>provided</scope>-->
|
|
||||||
<!--</dependency>-->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.ws.rs</groupId>
|
<groupId>javax.ws.rs</groupId>
|
||||||
<artifactId>jsr311-api</artifactId>
|
<artifactId>jsr311-api</artifactId>
|
||||||
|
|||||||
@ -200,8 +200,8 @@ public class DeviceManagementConfigServiceImpl implements DeviceManagementConfig
|
|||||||
DeviceManagementConfig deviceManagementConfig = DeviceConfigurationManager.getInstance().getDeviceManagementConfig();
|
DeviceManagementConfig deviceManagementConfig = DeviceConfigurationManager.getInstance().getDeviceManagementConfig();
|
||||||
KeyManagerConfigurations kmConfig = deviceManagementConfig.getKeyManagerConfigurations();
|
KeyManagerConfigurations kmConfig = deviceManagementConfig.getKeyManagerConfigurations();
|
||||||
AppRegistrationCredentials credentials = DeviceManagerUtil.getApplicationRegistrationCredentials(
|
AppRegistrationCredentials credentials = DeviceManagerUtil.getApplicationRegistrationCredentials(
|
||||||
System.getProperty(DeviceManagementConstants.ConfigurationManagement.IOT_CORE_HOST),
|
System.getProperty(DeviceManagementConstants.ConfigurationManagement.IOT_GATEWAY_HOST),
|
||||||
System.getProperty(DeviceManagementConstants.ConfigurationManagement.IOT_CORE_HTTPS_PORT),
|
System.getProperty(DeviceManagementConstants.ConfigurationManagement.IOT_GATEWAY_HTTPS_PORT),
|
||||||
kmConfig.getAdminUsername(),
|
kmConfig.getAdminUsername(),
|
||||||
kmConfig.getAdminPassword());
|
kmConfig.getAdminPassword());
|
||||||
AccessTokenInfo accessTokenForAdmin = DeviceManagerUtil.getAccessTokenForDeviceOwner(
|
AccessTokenInfo accessTokenForAdmin = DeviceManagerUtil.getAccessTokenForDeviceOwner(
|
||||||
|
|||||||
@ -155,32 +155,11 @@
|
|||||||
<artifactId>cxf-bundle-jaxrs</artifactId>
|
<artifactId>cxf-bundle-jaxrs</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!---->
|
|
||||||
<!--<dependency>-->
|
|
||||||
<!--<groupId>org.apache.cxf</groupId>-->
|
|
||||||
<!--<artifactId>cxf-rt-frontend-jaxws</artifactId>-->
|
|
||||||
<!--<scope>provided</scope>-->
|
|
||||||
<!--</dependency>-->
|
|
||||||
<!--<dependency>-->
|
|
||||||
<!--<groupId>org.apache.cxf</groupId>-->
|
|
||||||
<!--<artifactId>cxf-rt-frontend-jaxrs</artifactId>-->
|
|
||||||
<!--<scope>provided</scope>-->
|
|
||||||
<!--</dependency>-->
|
|
||||||
<!--<dependency>-->
|
|
||||||
<!--<groupId>org.apache.cxf</groupId>-->
|
|
||||||
<!--<artifactId>cxf-rt-transports-http</artifactId>-->
|
|
||||||
<!--<scope>provided</scope>-->
|
|
||||||
<!--</dependency>-->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>commons-httpclient.wso2</groupId>
|
<groupId>commons-httpclient.wso2</groupId>
|
||||||
<artifactId>commons-httpclient</artifactId>
|
<artifactId>commons-httpclient</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--<dependency>-->
|
|
||||||
<!--<groupId>javax.ws.rs</groupId>-->
|
|
||||||
<!--<artifactId>jsr311-api</artifactId>-->
|
|
||||||
<!--<scope>provided</scope>-->
|
|
||||||
<!--</dependency>-->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon</groupId>
|
<groupId>org.wso2.carbon</groupId>
|
||||||
<artifactId>org.wso2.carbon.utils</artifactId>
|
<artifactId>org.wso2.carbon.utils</artifactId>
|
||||||
@ -211,11 +190,6 @@
|
|||||||
<artifactId>org.wso2.carbon.device.mgt.common</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.common</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--<dependency>-->
|
|
||||||
<!--<groupId>org.wso2.carbon.devicemgt</groupId>-->
|
|
||||||
<!--<artifactId>org.wso2.carbon.device.mgt.analytics.data.publisher</artifactId>-->
|
|
||||||
<!--<scope>provided</scope>-->
|
|
||||||
<!--</dependency>-->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||||
<artifactId>org.wso2.carbon.device.mgt.extensions</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.extensions</artifactId>
|
||||||
@ -362,11 +336,6 @@
|
|||||||
<artifactId>org.wso2.carbon.analytics.api</artifactId>
|
<artifactId>org.wso2.carbon.analytics.api</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--<dependency>-->
|
|
||||||
<!--<groupId>org.wso2.carbon.analytics</groupId>-->
|
|
||||||
<!--<artifactId>org.wso2.carbon.analytics.datasource.commons</artifactId>-->
|
|
||||||
<!--<scope>provided</scope>-->
|
|
||||||
<!--</dependency>-->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||||
<artifactId>org.wso2.carbon.identity.jwt.client.extension</artifactId>
|
<artifactId>org.wso2.carbon.identity.jwt.client.extension</artifactId>
|
||||||
@ -413,11 +382,6 @@
|
|||||||
<artifactId>org.wso2.carbon.event.stream.persistence.stub</artifactId>
|
<artifactId>org.wso2.carbon.event.stream.persistence.stub</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--<dependency>-->
|
|
||||||
<!--<groupId>org.wso2.carbon.devicemgt</groupId>-->
|
|
||||||
<!--<artifactId>org.wso2.carbon.apimgt.integration.client</artifactId>-->
|
|
||||||
<!--<scope>provided</scope>-->
|
|
||||||
<!--</dependency>-->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.powermock</groupId>
|
<groupId>org.powermock</groupId>
|
||||||
<artifactId>powermock-module-testng</artifactId>
|
<artifactId>powermock-module-testng</artifactId>
|
||||||
|
|||||||
@ -67,6 +67,7 @@ import javax.ws.rs.core.Response;
|
|||||||
@Consumes(MediaType.APPLICATION_JSON)
|
@Consumes(MediaType.APPLICATION_JSON)
|
||||||
public interface DeviceEventManagementService {
|
public interface DeviceEventManagementService {
|
||||||
|
|
||||||
|
//todo:amalka
|
||||||
// @POST
|
// @POST
|
||||||
// @Path("/{type}")
|
// @Path("/{type}")
|
||||||
// @ApiOperation(
|
// @ApiOperation(
|
||||||
@ -178,6 +179,7 @@ public interface DeviceEventManagementService {
|
|||||||
"ios, and windows.", required = false)
|
"ios, and windows.", required = false)
|
||||||
@PathParam("type")String deviceType);
|
@PathParam("type")String deviceType);
|
||||||
|
|
||||||
|
//todo:amalka
|
||||||
// @GET
|
// @GET
|
||||||
// @Path("/{type}/{deviceId}")
|
// @Path("/{type}/{deviceId}")
|
||||||
// @ApiOperation(
|
// @ApiOperation(
|
||||||
@ -240,6 +242,7 @@ public interface DeviceEventManagementService {
|
|||||||
// @ApiParam(name = "limit", value = "limit of the records that needs to be picked up", required = false)
|
// @ApiParam(name = "limit", value = "limit of the records that needs to be picked up", required = false)
|
||||||
// @QueryParam("limit") int limit);
|
// @QueryParam("limit") int limit);
|
||||||
|
|
||||||
|
//todo:amalka
|
||||||
// @GET
|
// @GET
|
||||||
// @Path("last-known/{type}/{deviceId}")
|
// @Path("last-known/{type}/{deviceId}")
|
||||||
// @ApiOperation(
|
// @ApiOperation(
|
||||||
@ -296,6 +299,7 @@ public interface DeviceEventManagementService {
|
|||||||
// @ApiParam(name = "limit", value = "limit of the records that needs to be picked up", required = false)
|
// @ApiParam(name = "limit", value = "limit of the records that needs to be picked up", required = false)
|
||||||
// @QueryParam("limit") int limit);
|
// @QueryParam("limit") int limit);
|
||||||
|
|
||||||
|
//todo:amalka
|
||||||
// @GET
|
// @GET
|
||||||
// @Path("filter/{type}/{parameter}")
|
// @Path("filter/{type}/{parameter}")
|
||||||
// @ApiOperation(
|
// @ApiOperation(
|
||||||
|
|||||||
@ -97,6 +97,7 @@ public interface GeoLocationBasedService {
|
|||||||
/**
|
/**
|
||||||
* Retrieve Analytics for the device type
|
* Retrieve Analytics for the device type
|
||||||
*/
|
*/
|
||||||
|
//todo:amalka
|
||||||
// @GET
|
// @GET
|
||||||
// @Path("stats/{deviceType}/{deviceId}")
|
// @Path("stats/{deviceType}/{deviceId}")
|
||||||
// @ApiOperation(
|
// @ApiOperation(
|
||||||
@ -602,6 +603,7 @@ public interface GeoLocationBasedService {
|
|||||||
/**
|
/**
|
||||||
* Retrieve Geo alerts history
|
* Retrieve Geo alerts history
|
||||||
*/
|
*/
|
||||||
|
//todo:amalka
|
||||||
// @GET
|
// @GET
|
||||||
// @Path("alerts/history/{deviceType}/{deviceId}")
|
// @Path("alerts/history/{deviceType}/{deviceId}")
|
||||||
// @ApiOperation(
|
// @ApiOperation(
|
||||||
@ -671,6 +673,7 @@ public interface GeoLocationBasedService {
|
|||||||
/**
|
/**
|
||||||
* Retrieve Geo alerts history for geo clusters
|
* Retrieve Geo alerts history for geo clusters
|
||||||
*/
|
*/
|
||||||
|
//todo:amalka
|
||||||
// @GET
|
// @GET
|
||||||
// @Path("alerts/history")
|
// @Path("alerts/history")
|
||||||
// @ApiOperation(
|
// @ApiOperation(
|
||||||
|
|||||||
@ -26,7 +26,6 @@ import org.apache.axis2.AxisFault;
|
|||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
||||||
//import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException;
|
|
||||||
import org.wso2.carbon.device.mgt.common.Device;
|
import org.wso2.carbon.device.mgt.common.Device;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
||||||
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
|
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
|
||||||
@ -36,7 +35,6 @@ import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
|
|||||||
import org.wso2.carbon.device.mgt.common.exceptions.InvalidConfigurationException;
|
import org.wso2.carbon.device.mgt.common.exceptions.InvalidConfigurationException;
|
||||||
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
|
import org.wso2.carbon.device.mgt.common.operation.mgt.Operation;
|
||||||
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
|
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.policy.mgt.Policy;
|
|
||||||
import org.wso2.carbon.device.mgt.common.policy.mgt.monitor.ComplianceFeature;
|
import org.wso2.carbon.device.mgt.common.policy.mgt.monitor.ComplianceFeature;
|
||||||
import org.wso2.carbon.device.mgt.common.policy.mgt.monitor.PolicyComplianceException;
|
import org.wso2.carbon.device.mgt.common.policy.mgt.monitor.PolicyComplianceException;
|
||||||
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
|
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
|
||||||
@ -52,7 +50,6 @@ import org.wso2.carbon.event.stream.stub.types.EventStreamAttributeDto;
|
|||||||
import org.wso2.carbon.event.stream.stub.types.EventStreamDefinitionDto;
|
import org.wso2.carbon.event.stream.stub.types.EventStreamDefinitionDto;
|
||||||
import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException;
|
import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException;
|
||||||
import org.wso2.carbon.policy.mgt.common.PolicyAdministratorPoint;
|
import org.wso2.carbon.policy.mgt.common.PolicyAdministratorPoint;
|
||||||
import org.wso2.carbon.policy.mgt.common.PolicyEvaluationException;
|
|
||||||
import org.wso2.carbon.policy.mgt.common.PolicyManagementException;
|
import org.wso2.carbon.policy.mgt.common.PolicyManagementException;
|
||||||
import org.wso2.carbon.user.api.UserStoreException;
|
import org.wso2.carbon.user.api.UserStoreException;
|
||||||
|
|
||||||
|
|||||||
@ -4,29 +4,13 @@ import org.apache.axis2.AxisFault;
|
|||||||
import org.apache.axis2.client.Stub;
|
import org.apache.axis2.client.Stub;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
//import org.wso2.carbon.analytics.api.AnalyticsDataAPI;
|
|
||||||
//import org.wso2.carbon.analytics.api.AnalyticsDataAPIUtil;
|
|
||||||
//import org.wso2.carbon.analytics.dataservice.commons.AnalyticsDataResponse;
|
|
||||||
//import org.wso2.carbon.analytics.dataservice.commons.SearchResultEntry;
|
|
||||||
//import org.wso2.carbon.analytics.dataservice.commons.SortByField;
|
|
||||||
//import org.wso2.carbon.analytics.dataservice.commons.SortType;
|
|
||||||
//import org.wso2.carbon.analytics.datasource.commons.Record;
|
|
||||||
//import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException;
|
|
||||||
//import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceEventStreamPersistenceAdminServiceExceptionException;
|
|
||||||
//import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceStub;
|
|
||||||
//import org.wso2.carbon.analytics.stream.persistence.stub.dto.AnalyticsTable;
|
|
||||||
//import org.wso2.carbon.analytics.stream.persistence.stub.dto.AnalyticsTableRecord;
|
|
||||||
import org.wso2.carbon.base.MultitenantConstants;
|
import org.wso2.carbon.base.MultitenantConstants;
|
||||||
import org.wso2.carbon.context.CarbonContext;
|
|
||||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
|
||||||
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
|
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException;
|
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.Attribute;
|
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.Attribute;
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.AttributeType;
|
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.AttributeType;
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.DeviceTypeEvent;
|
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.DeviceTypeEvent;
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.EventAttributeList;
|
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.EventAttributeList;
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.EventRecords;
|
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.TransportType;
|
import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.TransportType;
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.service.api.DeviceEventManagementService;
|
import org.wso2.carbon.device.mgt.jaxrs.service.api.DeviceEventManagementService;
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.util.Constants;
|
import org.wso2.carbon.device.mgt.jaxrs.util.Constants;
|
||||||
@ -43,21 +27,14 @@ import org.wso2.carbon.event.stream.stub.types.EventStreamDefinitionDto;
|
|||||||
import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException;
|
import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException;
|
||||||
import org.wso2.carbon.user.api.UserStoreException;
|
import org.wso2.carbon.user.api.UserStoreException;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
|
||||||
import javax.ws.rs.DELETE;
|
import javax.ws.rs.DELETE;
|
||||||
import javax.ws.rs.GET;
|
import javax.ws.rs.GET;
|
||||||
import javax.ws.rs.POST;
|
|
||||||
import javax.ws.rs.Path;
|
import javax.ws.rs.Path;
|
||||||
import javax.ws.rs.PathParam;
|
import javax.ws.rs.PathParam;
|
||||||
import javax.ws.rs.QueryParam;
|
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
import java.rmi.RemoteException;
|
import java.rmi.RemoteException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Calendar;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -81,6 +58,7 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe
|
|||||||
private static final String MQTT_CONTENT_VALIDATOR = "default";
|
private static final String MQTT_CONTENT_VALIDATOR = "default";
|
||||||
private static final String TIMESTAMP_FIELD_NAME = "_timestamp";
|
private static final String TIMESTAMP_FIELD_NAME = "_timestamp";
|
||||||
|
|
||||||
|
//todo:amalka
|
||||||
// private static AnalyticsDataAPI getAnalyticsDataAPI() {
|
// private static AnalyticsDataAPI getAnalyticsDataAPI() {
|
||||||
// PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
|
// PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
|
||||||
// AnalyticsDataAPI analyticsDataAPI =
|
// AnalyticsDataAPI analyticsDataAPI =
|
||||||
@ -195,6 +173,7 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe
|
|||||||
/**
|
/**
|
||||||
* Deploy Event Stream, Receiver, Publisher and Store Configuration.
|
* Deploy Event Stream, Receiver, Publisher and Store Configuration.
|
||||||
*/
|
*/
|
||||||
|
//todo:amalka
|
||||||
// @POST
|
// @POST
|
||||||
// @Path("/{type}")
|
// @Path("/{type}")
|
||||||
// @Override
|
// @Override
|
||||||
@ -349,6 +328,7 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe
|
|||||||
/**
|
/**
|
||||||
* Returns device specific data for the give period of time.
|
* Returns device specific data for the give period of time.
|
||||||
*/
|
*/
|
||||||
|
//todo:amalka
|
||||||
// @GET
|
// @GET
|
||||||
// @Path("/{type}/{deviceId}")
|
// @Path("/{type}/{deviceId}")
|
||||||
// @Override
|
// @Override
|
||||||
@ -403,6 +383,7 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe
|
|||||||
* Returns last known data points up to the limit if limit is specified. Otherwise returns last known data point.
|
* Returns last known data points up to the limit if limit is specified. Otherwise returns last known data point.
|
||||||
* Limit parameter needs to be zero or positive.
|
* Limit parameter needs to be zero or positive.
|
||||||
*/
|
*/
|
||||||
|
//todo:amalka
|
||||||
// @GET
|
// @GET
|
||||||
// @Path("/last-known/{type}/{deviceId}")
|
// @Path("/last-known/{type}/{deviceId}")
|
||||||
// @Override
|
// @Override
|
||||||
@ -453,6 +434,7 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe
|
|||||||
* Returns the filterd device list. Devices are filterd using the paramter given and the timestamp of the record.
|
* Returns the filterd device list. Devices are filterd using the paramter given and the timestamp of the record.
|
||||||
* parameter should given as a range.
|
* parameter should given as a range.
|
||||||
*/
|
*/
|
||||||
|
//todo:amalka
|
||||||
// @GET
|
// @GET
|
||||||
// @Path("filter/{type}/{parameter}")
|
// @Path("filter/{type}/{parameter}")
|
||||||
// @Override
|
// @Override
|
||||||
@ -613,6 +595,7 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo:amalka
|
||||||
// private void publishEventStore(String streamName, String version, EventAttributeList eventAttributes)
|
// private void publishEventStore(String streamName, String version, EventAttributeList eventAttributes)
|
||||||
// throws RemoteException, UserStoreException, JWTClientException,
|
// throws RemoteException, UserStoreException, JWTClientException,
|
||||||
// EventStreamPersistenceAdminServiceEventStreamPersistenceAdminServiceExceptionException {
|
// EventStreamPersistenceAdminServiceEventStreamPersistenceAdminServiceExceptionException {
|
||||||
|
|||||||
@ -25,15 +25,6 @@ import com.google.gson.Gson;
|
|||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.apache.http.HttpStatus;
|
import org.apache.http.HttpStatus;
|
||||||
//import org.wso2.carbon.analytics.api.AnalyticsDataAPI;
|
|
||||||
//import org.wso2.carbon.analytics.api.AnalyticsDataAPIUtil;
|
|
||||||
//import org.wso2.carbon.analytics.dataservice.commons.AnalyticsDataResponse;
|
|
||||||
//import org.wso2.carbon.analytics.dataservice.commons.SearchResultEntry;
|
|
||||||
//import org.wso2.carbon.analytics.dataservice.commons.SortByField;
|
|
||||||
//import org.wso2.carbon.analytics.dataservice.commons.SortType;
|
|
||||||
//import org.wso2.carbon.analytics.datasource.commons.Record;
|
|
||||||
//import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException;
|
|
||||||
import org.wso2.carbon.context.CarbonContext;
|
|
||||||
import org.wso2.carbon.device.mgt.common.Device;
|
import org.wso2.carbon.device.mgt.common.Device;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
|
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants;
|
||||||
@ -46,7 +37,6 @@ import org.wso2.carbon.device.mgt.common.event.config.EventConfigurationExceptio
|
|||||||
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
|
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.geo.service.Alert;
|
import org.wso2.carbon.device.mgt.common.geo.service.Alert;
|
||||||
import org.wso2.carbon.device.mgt.common.geo.service.AlertAlreadyExistException;
|
import org.wso2.carbon.device.mgt.common.geo.service.AlertAlreadyExistException;
|
||||||
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.GeoLocationBasedServiceException;
|
import org.wso2.carbon.device.mgt.common.geo.service.GeoLocationBasedServiceException;
|
||||||
import org.wso2.carbon.device.mgt.common.geo.service.GeoLocationProviderService;
|
import org.wso2.carbon.device.mgt.common.geo.service.GeoLocationProviderService;
|
||||||
@ -57,18 +47,13 @@ import org.wso2.carbon.device.mgt.core.geo.geoHash.GeoCoordinate;
|
|||||||
import org.wso2.carbon.device.mgt.core.geo.geoHash.geoHashStrategy.GeoHashLengthStrategy;
|
import org.wso2.carbon.device.mgt.core.geo.geoHash.geoHashStrategy.GeoHashLengthStrategy;
|
||||||
import org.wso2.carbon.device.mgt.core.geo.geoHash.geoHashStrategy.ZoomGeoHashLengthStrategy;
|
import org.wso2.carbon.device.mgt.core.geo.geoHash.geoHashStrategy.ZoomGeoHashLengthStrategy;
|
||||||
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
|
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
|
||||||
import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil;
|
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse;
|
import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse;
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.beans.EventAction;
|
import org.wso2.carbon.device.mgt.jaxrs.beans.EventAction;
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.beans.GeofenceWrapper;
|
import org.wso2.carbon.device.mgt.jaxrs.beans.GeofenceWrapper;
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.service.api.GeoLocationBasedService;
|
import org.wso2.carbon.device.mgt.jaxrs.service.api.GeoLocationBasedService;
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.service.impl.util.InputValidationException;
|
import org.wso2.carbon.device.mgt.jaxrs.service.impl.util.InputValidationException;
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.service.impl.util.RequestValidationUtil;
|
import org.wso2.carbon.device.mgt.jaxrs.service.impl.util.RequestValidationUtil;
|
||||||
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;
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtUtil;
|
|
||||||
import org.wso2.carbon.user.api.UserStoreException;
|
|
||||||
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
|
|
||||||
|
|
||||||
import javax.ws.rs.Consumes;
|
import javax.ws.rs.Consumes;
|
||||||
import javax.ws.rs.DELETE;
|
import javax.ws.rs.DELETE;
|
||||||
@ -82,9 +67,7 @@ import javax.ws.rs.QueryParam;
|
|||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The api for
|
* The api for
|
||||||
@ -93,6 +76,7 @@ public class GeoLocationBasedServiceImpl implements GeoLocationBasedService {
|
|||||||
|
|
||||||
private static Log log = LogFactory.getLog(GeoLocationBasedServiceImpl.class);
|
private static Log log = LogFactory.getLog(GeoLocationBasedServiceImpl.class);
|
||||||
|
|
||||||
|
//todo:amalka
|
||||||
// @Path("stats/{deviceType}/{deviceId}")
|
// @Path("stats/{deviceType}/{deviceId}")
|
||||||
// @GET
|
// @GET
|
||||||
// @Consumes("application/json")
|
// @Consumes("application/json")
|
||||||
@ -471,6 +455,7 @@ public class GeoLocationBasedServiceImpl implements GeoLocationBasedService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo:amalka
|
||||||
// @Path("alerts/history/{deviceType}/{deviceId}")
|
// @Path("alerts/history/{deviceType}/{deviceId}")
|
||||||
// @GET
|
// @GET
|
||||||
// @Consumes("application/json")
|
// @Consumes("application/json")
|
||||||
@ -521,6 +506,7 @@ public class GeoLocationBasedServiceImpl implements GeoLocationBasedService {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
//todo:amalka
|
||||||
// @Path("alerts/history")
|
// @Path("alerts/history")
|
||||||
// @GET
|
// @GET
|
||||||
// @Consumes("application/json")
|
// @Consumes("application/json")
|
||||||
|
|||||||
@ -21,7 +21,6 @@ package org.wso2.carbon.device.mgt.jaxrs.util;
|
|||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.wso2.carbon.context.CarbonContext;
|
import org.wso2.carbon.context.CarbonContext;
|
||||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse;
|
import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse;
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.beans.OldPasswordResetWrapper;
|
import org.wso2.carbon.device.mgt.jaxrs.beans.OldPasswordResetWrapper;
|
||||||
import org.wso2.carbon.device.mgt.jaxrs.beans.PasswordResetWrapper;
|
import org.wso2.carbon.device.mgt.jaxrs.beans.PasswordResetWrapper;
|
||||||
|
|||||||
@ -45,31 +45,28 @@ import org.apache.commons.httpclient.protocol.Protocol;
|
|||||||
import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
|
import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceStub;
|
|
||||||
//import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService;
|
|
||||||
import org.wso2.carbon.base.ServerConfiguration;
|
|
||||||
import org.wso2.carbon.analytics.api.AnalyticsDataAPI;
|
import org.wso2.carbon.analytics.api.AnalyticsDataAPI;
|
||||||
|
import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceStub;
|
||||||
|
import org.wso2.carbon.base.ServerConfiguration;
|
||||||
import org.wso2.carbon.context.CarbonContext;
|
import org.wso2.carbon.context.CarbonContext;
|
||||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
||||||
import org.wso2.carbon.core.util.Utils;
|
import org.wso2.carbon.core.util.Utils;
|
||||||
import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager;
|
import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager;
|
||||||
//import org.wso2.carbon.device.mgt.analytics.data.publisher.service.EventsPublisherService;
|
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
|
||||||
import org.wso2.carbon.device.mgt.common.Device;
|
import org.wso2.carbon.device.mgt.common.Device;
|
||||||
|
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
||||||
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
|
import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
|
||||||
import org.wso2.carbon.device.mgt.common.OperationMonitoringTaskConfig;
|
|
||||||
import org.wso2.carbon.device.mgt.common.MonitoringOperation;
|
import org.wso2.carbon.device.mgt.common.MonitoringOperation;
|
||||||
|
import org.wso2.carbon.device.mgt.common.OperationMonitoringTaskConfig;
|
||||||
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException;
|
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException;
|
||||||
import org.wso2.carbon.device.mgt.common.device.details.DeviceLocationHistory;
|
|
||||||
import org.wso2.carbon.device.mgt.common.device.details.DeviceLocationHistorySnapshot;
|
|
||||||
import org.wso2.carbon.device.mgt.common.device.details.DeviceLocationHistorySnapshotWrapper;
|
|
||||||
import org.wso2.carbon.device.mgt.common.event.config.EventConfigurationProviderService;
|
|
||||||
import org.wso2.carbon.device.mgt.common.exceptions.BadRequestException;
|
|
||||||
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
|
|
||||||
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationService;
|
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationService;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService;
|
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService;
|
||||||
|
import org.wso2.carbon.device.mgt.common.device.details.DeviceLocationHistory;
|
||||||
|
import org.wso2.carbon.device.mgt.common.device.details.DeviceLocationHistorySnapshot;
|
||||||
|
import org.wso2.carbon.device.mgt.common.device.details.DeviceLocationHistorySnapshotWrapper;
|
||||||
|
import org.wso2.carbon.device.mgt.common.exceptions.BadRequestException;
|
||||||
|
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.exceptions.UnAuthorizedException;
|
import org.wso2.carbon.device.mgt.common.exceptions.UnAuthorizedException;
|
||||||
import org.wso2.carbon.device.mgt.common.geo.service.GeoLocationProviderService;
|
import org.wso2.carbon.device.mgt.common.geo.service.GeoLocationProviderService;
|
||||||
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup;
|
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup;
|
||||||
@ -373,24 +370,6 @@ public class DeviceMgtAPIUtils {
|
|||||||
return privacyComplianceProvider;
|
return privacyComplianceProvider;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// public static IntegrationClientService getIntegrationClientService() {
|
|
||||||
// if (integrationClientService == null) {
|
|
||||||
// synchronized (DeviceMgtAPIUtils.class) {
|
|
||||||
// if (integrationClientService == null) {
|
|
||||||
// PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
|
|
||||||
// integrationClientService = (IntegrationClientService) ctx.getOSGiService(IntegrationClientService.class, null);
|
|
||||||
// if (integrationClientService == null) {
|
|
||||||
// String msg = "IntegrationClientService is not initialized";
|
|
||||||
// log.error(msg);
|
|
||||||
// throw new IllegalStateException(msg);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// return integrationClientService;
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Initializing and accessing method for OTPManagementService.
|
* Initializing and accessing method for OTPManagementService.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -50,7 +50,6 @@
|
|||||||
<Import-Package>
|
<Import-Package>
|
||||||
javax.xml.bind.annotation; version="${javax.xml.bind.imp.pkg.version}",
|
javax.xml.bind.annotation; version="${javax.xml.bind.imp.pkg.version}",
|
||||||
com.fasterxml.jackson.annotation;version="${jackson-annotations.version}",
|
com.fasterxml.jackson.annotation;version="${jackson-annotations.version}",
|
||||||
<!--org.wso2.carbon.analytics.datasource.commons;version="${carbon.analytics.version.range}",-->
|
|
||||||
io.swagger.annotations; version="${swagger.annotations.version}"; resolution:=optional,
|
io.swagger.annotations; version="${swagger.annotations.version}"; resolution:=optional,
|
||||||
com.google.gson
|
com.google.gson
|
||||||
</Import-Package>
|
</Import-Package>
|
||||||
@ -96,14 +95,6 @@
|
|||||||
<groupId>org.wso2.orbit.com.fasterxml.jackson.core</groupId>
|
<groupId>org.wso2.orbit.com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-annotations</artifactId>
|
<artifactId>jackson-annotations</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--<dependency>-->
|
|
||||||
<!--<groupId>org.wso2.carbon.analytics</groupId>-->
|
|
||||||
<!--<artifactId>org.wso2.carbon.analytics.api</artifactId>-->
|
|
||||||
<!--</dependency>-->
|
|
||||||
<!--<dependency>-->
|
|
||||||
<!--<groupId>org.wso2.carbon.analytics</groupId>-->
|
|
||||||
<!--<artifactId>org.wso2.carbon.analytics.datasource.commons</artifactId>-->
|
|
||||||
<!--</dependency>-->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.google.code.gson</groupId>
|
<groupId>com.google.code.gson</groupId>
|
||||||
<artifactId>gson</artifactId>
|
<artifactId>gson</artifactId>
|
||||||
|
|||||||
@ -90,7 +90,6 @@
|
|||||||
org.wso2.carbon.core,
|
org.wso2.carbon.core,
|
||||||
org.wso2.carbon.utils.*,
|
org.wso2.carbon.utils.*,
|
||||||
org.wso2.carbon.device.mgt.common.*,
|
org.wso2.carbon.device.mgt.common.*,
|
||||||
<!--org.wso2.carbon.device.mgt.analytics.data.publisher.service,-->
|
|
||||||
org.wso2.carbon.user.api,
|
org.wso2.carbon.user.api,
|
||||||
org.wso2.carbon.user.core.*,
|
org.wso2.carbon.user.core.*,
|
||||||
org.wso2.carbon.registry.core.service,
|
org.wso2.carbon.registry.core.service,
|
||||||
@ -104,8 +103,6 @@
|
|||||||
org.wso2.carbon.ndatasource.core,
|
org.wso2.carbon.ndatasource.core,
|
||||||
org.wso2.carbon.ntask.core.*,
|
org.wso2.carbon.ntask.core.*,
|
||||||
org.wso2.carbon.ntask.common,
|
org.wso2.carbon.ntask.common,
|
||||||
<!--org.apache.catalina,-->
|
|
||||||
<!--org.apache.catalina.core,-->
|
|
||||||
org.apache.commons.collections;version="${commons-collections.version.range}",
|
org.apache.commons.collections;version="${commons-collections.version.range}",
|
||||||
org.wso2.carbon.email.sender.*,
|
org.wso2.carbon.email.sender.*,
|
||||||
io.swagger.annotations.*;resolution:=optional,
|
io.swagger.annotations.*;resolution:=optional,
|
||||||
@ -166,32 +163,6 @@
|
|||||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||||
<artifactId>org.wso2.carbon.device.mgt.common</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.common</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!--<dependency>-->
|
|
||||||
<!--<groupId>org.wso2.carbon.devicemgt</groupId>-->
|
|
||||||
<!--<artifactId>org.wso2.carbon.device.mgt.analytics.data.publisher</artifactId>-->
|
|
||||||
<!--<exclusions>-->
|
|
||||||
<!--<exclusion>-->
|
|
||||||
<!--<groupId>org.slf4j</groupId>-->
|
|
||||||
<!--<artifactId>slf4j-api</artifactId>-->
|
|
||||||
<!--</exclusion>-->
|
|
||||||
<!--<exclusion>-->
|
|
||||||
<!--<groupId>javax.servlet</groupId>-->
|
|
||||||
<!--<artifactId>javax.servlet-api</artifactId>-->
|
|
||||||
<!--</exclusion>-->
|
|
||||||
<!--<exclusion>-->
|
|
||||||
<!--<groupId>org.wso2.carbon.registry</groupId>-->
|
|
||||||
<!--<artifactId>org.wso2.carbon.registry.indexing</artifactId>-->
|
|
||||||
<!--</exclusion>-->
|
|
||||||
<!--<exclusion>-->
|
|
||||||
<!--<groupId>org.wso2.carbon.identity.framework</groupId>-->
|
|
||||||
<!--<artifactId>org.wso2.carbon.user.mgt</artifactId>-->
|
|
||||||
<!--</exclusion>-->
|
|
||||||
<!--<exclusion>-->
|
|
||||||
<!--<groupId>commons-lang</groupId>-->
|
|
||||||
<!--<artifactId>commons-lang</artifactId>-->
|
|
||||||
<!--</exclusion>-->
|
|
||||||
<!--</exclusions>-->
|
|
||||||
<!--</dependency>-->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon</groupId>
|
<groupId>org.wso2.carbon</groupId>
|
||||||
<artifactId>org.wso2.carbon.logging</artifactId>
|
<artifactId>org.wso2.carbon.logging</artifactId>
|
||||||
|
|||||||
@ -22,22 +22,17 @@ import org.apache.commons.lang.StringUtils;
|
|||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.wso2.carbon.context.CarbonContext;
|
import org.wso2.carbon.context.CarbonContext;
|
||||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
|
||||||
//import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException;
|
|
||||||
import org.wso2.carbon.device.mgt.common.Device;
|
import org.wso2.carbon.device.mgt.common.Device;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
|
||||||
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService;
|
|
||||||
import org.wso2.carbon.device.mgt.common.device.details.DeviceData;
|
|
||||||
import org.wso2.carbon.device.mgt.common.device.details.DeviceDetailsWrapper;
|
import org.wso2.carbon.device.mgt.common.device.details.DeviceDetailsWrapper;
|
||||||
|
import org.wso2.carbon.device.mgt.common.device.details.DeviceInfo;
|
||||||
|
import org.wso2.carbon.device.mgt.common.device.details.DeviceLocation;
|
||||||
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
|
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.exceptions.EventPublishingException;
|
import org.wso2.carbon.device.mgt.common.exceptions.EventPublishingException;
|
||||||
import org.wso2.carbon.device.mgt.common.exceptions.TransactionManagementException;
|
import org.wso2.carbon.device.mgt.common.exceptions.TransactionManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.device.details.DeviceInfo;
|
|
||||||
import org.wso2.carbon.device.mgt.common.device.details.DeviceLocation;
|
|
||||||
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup;
|
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup;
|
||||||
import org.wso2.carbon.device.mgt.common.group.mgt.GroupManagementException;
|
import org.wso2.carbon.device.mgt.common.group.mgt.GroupManagementException;
|
||||||
import org.wso2.carbon.device.mgt.core.DeviceManagementConstants;
|
import org.wso2.carbon.device.mgt.core.DeviceManagementConstants;
|
||||||
import org.wso2.carbon.device.mgt.core.config.tenant.PlatformConfigurationManagementServiceImpl;
|
|
||||||
import org.wso2.carbon.device.mgt.core.dao.DeviceDAO;
|
import org.wso2.carbon.device.mgt.core.dao.DeviceDAO;
|
||||||
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOException;
|
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOException;
|
||||||
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
|
import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory;
|
||||||
@ -46,18 +41,14 @@ import org.wso2.carbon.device.mgt.core.device.details.mgt.DeviceInformationManag
|
|||||||
import org.wso2.carbon.device.mgt.core.device.details.mgt.dao.DeviceDetailsDAO;
|
import org.wso2.carbon.device.mgt.core.device.details.mgt.dao.DeviceDetailsDAO;
|
||||||
import org.wso2.carbon.device.mgt.core.device.details.mgt.dao.DeviceDetailsMgtDAOException;
|
import org.wso2.carbon.device.mgt.core.device.details.mgt.dao.DeviceDetailsMgtDAOException;
|
||||||
import org.wso2.carbon.device.mgt.core.internal.DeviceManagementDataHolder;
|
import org.wso2.carbon.device.mgt.core.internal.DeviceManagementDataHolder;
|
||||||
|
|
||||||
import org.wso2.carbon.device.mgt.core.service.GroupManagementProviderService;
|
|
||||||
import org.wso2.carbon.device.mgt.core.report.mgt.Constants;
|
import org.wso2.carbon.device.mgt.core.report.mgt.Constants;
|
||||||
import org.wso2.carbon.device.mgt.core.service.GroupManagementProviderService;
|
import org.wso2.carbon.device.mgt.core.service.GroupManagementProviderService;
|
||||||
import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil;
|
import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil;
|
||||||
import org.wso2.carbon.device.mgt.core.util.HttpReportingUtil;
|
import org.wso2.carbon.device.mgt.core.util.HttpReportingUtil;
|
||||||
import org.wso2.carbon.user.api.UserRealm;
|
|
||||||
import org.wso2.carbon.user.api.UserStoreException;
|
import org.wso2.carbon.user.api.UserStoreException;
|
||||||
|
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -178,6 +169,7 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
|
|||||||
deviceInfo.getAvailableRAMMemory(),
|
deviceInfo.getAvailableRAMMemory(),
|
||||||
deviceInfo.isPluggedIn()
|
deviceInfo.isPluggedIn()
|
||||||
};
|
};
|
||||||
|
//todo:amalka
|
||||||
// DeviceManagerUtil.getEventPublisherService().publishEvent(
|
// DeviceManagerUtil.getEventPublisherService().publishEvent(
|
||||||
// DEVICE_INFO_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload
|
// DEVICE_INFO_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload
|
||||||
// );
|
// );
|
||||||
@ -193,6 +185,7 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
|
|||||||
DeviceManagementDAOFactory.rollbackTransaction();
|
DeviceManagementDAOFactory.rollbackTransaction();
|
||||||
throw new DeviceDetailsMgtException("Error occurred while updating the last update timestamp of the " +
|
throw new DeviceDetailsMgtException("Error occurred while updating the last update timestamp of the " +
|
||||||
"device", e);
|
"device", e);
|
||||||
|
//todo:amalka
|
||||||
// } catch (DataPublisherConfigurationException e) {
|
// } catch (DataPublisherConfigurationException e) {
|
||||||
// throw new DeviceDetailsMgtException("Error occurred while publishing the device location information.", e);
|
// throw new DeviceDetailsMgtException("Error occurred while publishing the device location information.", e);
|
||||||
} finally {
|
} finally {
|
||||||
@ -389,6 +382,7 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
|
|||||||
deviceLocation.getBearing(),
|
deviceLocation.getBearing(),
|
||||||
deviceLocation.getDistance()
|
deviceLocation.getDistance()
|
||||||
};
|
};
|
||||||
|
//todo:amalka
|
||||||
// DeviceManagerUtil.getEventPublisherService().publishEvent(
|
// DeviceManagerUtil.getEventPublisherService().publishEvent(
|
||||||
// LOCATION_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload
|
// LOCATION_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload
|
||||||
// );
|
// );
|
||||||
@ -403,6 +397,7 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
|
|||||||
} catch (DeviceManagementException e) {
|
} catch (DeviceManagementException e) {
|
||||||
DeviceManagementDAOFactory.rollbackTransaction();
|
DeviceManagementDAOFactory.rollbackTransaction();
|
||||||
throw new DeviceDetailsMgtException("Error occurred while getting the device information.", e);
|
throw new DeviceDetailsMgtException("Error occurred while getting the device information.", e);
|
||||||
|
//todo:amalka
|
||||||
// } catch (DataPublisherConfigurationException e) {
|
// } catch (DataPublisherConfigurationException e) {
|
||||||
// DeviceManagementDAOFactory.rollbackTransaction();
|
// DeviceManagementDAOFactory.rollbackTransaction();
|
||||||
// throw new DeviceDetailsMgtException("Error occurred while publishing the device location information.", e);
|
// throw new DeviceDetailsMgtException("Error occurred while publishing the device location information.", e);
|
||||||
|
|||||||
@ -49,7 +49,6 @@ import org.apache.http.protocol.HTTP;
|
|||||||
import org.wso2.carbon.CarbonConstants;
|
import org.wso2.carbon.CarbonConstants;
|
||||||
import org.wso2.carbon.context.CarbonContext;
|
import org.wso2.carbon.context.CarbonContext;
|
||||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
||||||
//import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException;
|
|
||||||
import org.wso2.carbon.device.mgt.common.ActivityPaginationRequest;
|
import org.wso2.carbon.device.mgt.common.ActivityPaginationRequest;
|
||||||
import org.wso2.carbon.device.mgt.common.Device;
|
import org.wso2.carbon.device.mgt.common.Device;
|
||||||
import org.wso2.carbon.device.mgt.common.DeviceEnrollmentInfoNotification;
|
import org.wso2.carbon.device.mgt.common.DeviceEnrollmentInfoNotification;
|
||||||
@ -163,6 +162,8 @@ import java.util.Map;
|
|||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
//import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException;
|
||||||
|
|
||||||
public class DeviceManagementProviderServiceImpl implements DeviceManagementProviderService,
|
public class DeviceManagementProviderServiceImpl implements DeviceManagementProviderService,
|
||||||
PluginInitializationListener {
|
PluginInitializationListener {
|
||||||
|
|
||||||
@ -1964,6 +1965,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|||||||
operation.getStatus() != null ? operation.getStatus().toString() : null,
|
operation.getStatus() != null ? operation.getStatus().toString() : null,
|
||||||
operation.getOperationResponse()
|
operation.getOperationResponse()
|
||||||
};
|
};
|
||||||
|
//todo:amalka
|
||||||
// DeviceManagerUtil.getEventPublisherService().publishEvent(
|
// DeviceManagerUtil.getEventPublisherService().publishEvent(
|
||||||
// OPERATION_RESPONSE_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload
|
// OPERATION_RESPONSE_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload
|
||||||
// );
|
// );
|
||||||
@ -1973,6 +1975,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|||||||
String msg = "Error occurred while reading configs.";
|
String msg = "Error occurred while reading configs.";
|
||||||
log.error(msg, e);
|
log.error(msg, e);
|
||||||
throw new OperationManagementException(msg, e);
|
throw new OperationManagementException(msg, e);
|
||||||
|
//todo:amalka
|
||||||
} //catch (DataPublisherConfigurationException e) {
|
} //catch (DataPublisherConfigurationException e) {
|
||||||
// String msg = "Error occurred while publishing event.";
|
// String msg = "Error occurred while publishing event.";
|
||||||
// log.error(msg, e);
|
// log.error(msg, e);
|
||||||
@ -2006,6 +2009,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|||||||
operation.getStatus() != null ? operation.getStatus().toString() : null,
|
operation.getStatus() != null ? operation.getStatus().toString() : null,
|
||||||
operation.getOperationResponse()
|
operation.getOperationResponse()
|
||||||
};
|
};
|
||||||
|
//todo:amalka
|
||||||
// DeviceManagerUtil.getEventPublisherService().publishEvent(
|
// DeviceManagerUtil.getEventPublisherService().publishEvent(
|
||||||
// OPERATION_RESPONSE_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload
|
// OPERATION_RESPONSE_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload
|
||||||
// );
|
// );
|
||||||
@ -2015,6 +2019,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
|
|||||||
String msg = "Error occurred while reading configs.";
|
String msg = "Error occurred while reading configs.";
|
||||||
log.error(msg, e);
|
log.error(msg, e);
|
||||||
throw new OperationManagementException(msg, e);
|
throw new OperationManagementException(msg, e);
|
||||||
|
//todo:amalka
|
||||||
} //catch (DataPublisherConfigurationException e) {
|
} //catch (DataPublisherConfigurationException e) {
|
||||||
// String msg = "Error occurred while publishing event.";
|
// String msg = "Error occurred while publishing event.";
|
||||||
// log.error(msg, e);
|
// log.error(msg, e);
|
||||||
|
|||||||
@ -50,7 +50,6 @@ import org.wso2.carbon.base.MultitenantConstants;
|
|||||||
import org.wso2.carbon.caching.impl.CacheImpl;
|
import org.wso2.carbon.caching.impl.CacheImpl;
|
||||||
import org.wso2.carbon.context.CarbonContext;
|
import org.wso2.carbon.context.CarbonContext;
|
||||||
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
import org.wso2.carbon.context.PrivilegedCarbonContext;
|
||||||
//import org.wso2.carbon.device.mgt.analytics.data.publisher.service.EventsPublisherService;
|
|
||||||
import org.wso2.carbon.device.mgt.common.AppRegistrationCredentials;
|
import org.wso2.carbon.device.mgt.common.AppRegistrationCredentials;
|
||||||
import org.wso2.carbon.device.mgt.common.ApplicationRegistration;
|
import org.wso2.carbon.device.mgt.common.ApplicationRegistration;
|
||||||
import org.wso2.carbon.device.mgt.common.ApplicationRegistrationException;
|
import org.wso2.carbon.device.mgt.common.ApplicationRegistrationException;
|
||||||
@ -67,11 +66,11 @@ import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration
|
|||||||
import org.wso2.carbon.device.mgt.common.event.config.EventConfigurationProviderService;
|
import org.wso2.carbon.device.mgt.common.event.config.EventConfigurationProviderService;
|
||||||
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
|
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.exceptions.DeviceNotFoundException;
|
import org.wso2.carbon.device.mgt.common.exceptions.DeviceNotFoundException;
|
||||||
|
import org.wso2.carbon.device.mgt.common.exceptions.MetadataManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.exceptions.TransactionManagementException;
|
import org.wso2.carbon.device.mgt.common.exceptions.TransactionManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.geo.service.GeofenceData;
|
import org.wso2.carbon.device.mgt.common.geo.service.GeofenceData;
|
||||||
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup;
|
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup;
|
||||||
import org.wso2.carbon.device.mgt.common.group.mgt.GroupManagementException;
|
import org.wso2.carbon.device.mgt.common.group.mgt.GroupManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.exceptions.MetadataManagementException;
|
|
||||||
import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementException;
|
import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
|
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
|
||||||
import org.wso2.carbon.device.mgt.common.type.mgt.DeviceTypeMetaDefinition;
|
import org.wso2.carbon.device.mgt.common.type.mgt.DeviceTypeMetaDefinition;
|
||||||
@ -129,6 +128,8 @@ import java.util.regex.Matcher;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
|
|
||||||
|
//import org.wso2.carbon.device.mgt.analytics.data.publisher.service.EventsPublisherService;
|
||||||
|
|
||||||
public final class DeviceManagerUtil {
|
public final class DeviceManagerUtil {
|
||||||
|
|
||||||
private static final Log log = LogFactory.getLog(DeviceManagerUtil.class);
|
private static final Log log = LogFactory.getLog(DeviceManagerUtil.class);
|
||||||
@ -595,6 +596,7 @@ public final class DeviceManagerUtil {
|
|||||||
return Caching.getCacheManagerFactory().getCacheManager(DeviceManagementConstants.DM_CACHE_MANAGER);
|
return Caching.getCacheManagerFactory().getCacheManager(DeviceManagementConstants.DM_CACHE_MANAGER);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo:amalka
|
||||||
// public static EventsPublisherService getEventPublisherService() {
|
// public static EventsPublisherService getEventPublisherService() {
|
||||||
// PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
|
// PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
|
||||||
// EventsPublisherService eventsPublisherService =
|
// EventsPublisherService eventsPublisherService =
|
||||||
|
|||||||
@ -36,11 +36,8 @@
|
|||||||
<module>org.wso2.carbon.device.mgt.core</module>
|
<module>org.wso2.carbon.device.mgt.core</module>
|
||||||
<module>org.wso2.carbon.device.mgt.common</module>
|
<module>org.wso2.carbon.device.mgt.common</module>
|
||||||
<module>org.wso2.carbon.device.mgt.extensions</module>
|
<module>org.wso2.carbon.device.mgt.extensions</module>
|
||||||
<module>org.wso2.carbon.device.mgt.ui</module>
|
|
||||||
<module>org.wso2.carbon.device.mgt.api</module>
|
<module>org.wso2.carbon.device.mgt.api</module>
|
||||||
<!--<module>org.wso2.carbon.device.mgt.analytics.data.publisher</module>-->
|
|
||||||
<module>org.wso2.carbon.device.mgt.url.printer</module>
|
<module>org.wso2.carbon.device.mgt.url.printer</module>
|
||||||
<!--<module>org.wso2.carbon.device.mgt.analytics.wsproxy</module>-->
|
|
||||||
<module>io.entgra.carbon.device.mgt.config.api</module>
|
<module>io.entgra.carbon.device.mgt.config.api</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
|
|||||||
@ -39,11 +39,11 @@
|
|||||||
<artifactId>org.wso2.carbon.device.mgt.server.feature</artifactId>
|
<artifactId>org.wso2.carbon.device.mgt.server.feature</artifactId>
|
||||||
<type>zip</type>
|
<type>zip</type>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<!--<dependency>-->
|
||||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
<!--<groupId>org.wso2.carbon.devicemgt</groupId>-->
|
||||||
<artifactId>org.wso2.carbon.device.mgt.ui.feature</artifactId>
|
<!--<artifactId>org.wso2.carbon.device.mgt.ui.feature</artifactId>-->
|
||||||
<type>zip</type>
|
<!--<type>zip</type>-->
|
||||||
</dependency>
|
<!--</dependency>-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.servlet.jsp</groupId>
|
<groupId>javax.servlet.jsp</groupId>
|
||||||
<artifactId>javax.servlet.jsp-api</artifactId>
|
<artifactId>javax.servlet.jsp-api</artifactId>
|
||||||
@ -80,7 +80,7 @@
|
|||||||
</adviceFile>
|
</adviceFile>
|
||||||
<includedFeatures>
|
<includedFeatures>
|
||||||
<includedFeatureDef>org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.server.feature:${carbon.device.mgt.version}</includedFeatureDef>
|
<includedFeatureDef>org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.server.feature:${carbon.device.mgt.version}</includedFeatureDef>
|
||||||
<includedFeatureDef>org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.ui.feature:${carbon.device.mgt.version}</includedFeatureDef>
|
<!--<includedFeatureDef>org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.ui.feature:${carbon.device.mgt.version}</includedFeatureDef>-->
|
||||||
</includedFeatures>
|
</includedFeatures>
|
||||||
<bundles>
|
<bundles>
|
||||||
<bundleDef>javax.servlet.jsp:javax.servlet.jsp-api</bundleDef>
|
<bundleDef>javax.servlet.jsp:javax.servlet.jsp-api</bundleDef>
|
||||||
|
|||||||
@ -35,7 +35,7 @@
|
|||||||
<modules>
|
<modules>
|
||||||
<module>org.wso2.carbon.device.mgt.basics.feature</module>
|
<module>org.wso2.carbon.device.mgt.basics.feature</module>
|
||||||
<module>org.wso2.carbon.device.mgt.server.feature</module>
|
<module>org.wso2.carbon.device.mgt.server.feature</module>
|
||||||
<module>org.wso2.carbon.device.mgt.ui.feature</module>
|
<!--<module>org.wso2.carbon.device.mgt.ui.feature</module>-->
|
||||||
<module>org.wso2.carbon.device.mgt.api.feature</module>
|
<module>org.wso2.carbon.device.mgt.api.feature</module>
|
||||||
<module>org.wso2.carbon.device.mgt.feature</module>
|
<module>org.wso2.carbon.device.mgt.feature</module>
|
||||||
<module>org.wso2.carbon.device.mgt.extensions.feature</module>
|
<module>org.wso2.carbon.device.mgt.extensions.feature</module>
|
||||||
|
|||||||
12
pom.xml
12
pom.xml
@ -310,12 +310,12 @@
|
|||||||
<type>zip</type>
|
<type>zip</type>
|
||||||
<version>${carbon.device.mgt.version}</version>
|
<version>${carbon.device.mgt.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<!--<dependency>-->
|
||||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
<!--<groupId>org.wso2.carbon.devicemgt</groupId>-->
|
||||||
<artifactId>org.wso2.carbon.device.mgt.ui.feature</artifactId>
|
<!--<artifactId>org.wso2.carbon.device.mgt.ui.feature</artifactId>-->
|
||||||
<type>zip</type>
|
<!--<type>zip</type>-->
|
||||||
<version>${carbon.device.mgt.version}</version>
|
<!--<version>${carbon.device.mgt.version}</version>-->
|
||||||
</dependency>
|
<!--</dependency>-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.wso2.carbon.devicemgt</groupId>
|
<groupId>org.wso2.carbon.devicemgt</groupId>
|
||||||
<artifactId>org.wso2.carbon.apimgt.application.extension</artifactId>
|
<artifactId>org.wso2.carbon.apimgt.application.extension</artifactId>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user