Merge branch 'kernel-4.6.2' into 'kernel-4.6.x'

Updated to work with carbon kernel 4.6.2

See merge request entgra/carbon-device-mgt-plugins!182
kernel-4.6.x
Charitha Goonetilleke 3 years ago
commit 81cdc8eee3

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>iot-analytics</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>iot-analytics</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>analytics</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -66,8 +66,8 @@
!org.wso2.carbon.device.mgt.input.adapter.extension.internal,
</Export-Package>
<Import-Package>
org.osgi.framework,
org.osgi.service.component,
org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
org.osgi.service.*;version="${imp.package.version.osgi.service}",
com.jayway.jsonpath,
org.apache.commons.logging,
org.json.simple,

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@ -140,8 +140,8 @@
com.nimbusds.jose,
com.nimbusds.jose.crypto,
com.nimbusds.jwt,
org.osgi.framework,
org.osgi.service.component,
org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
org.osgi.service.*;version="${imp.package.version.osgi.service}",
javax.servlet,
javax.servlet.http,
org.osgi.service.http,

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -142,9 +142,8 @@
org.apache.commons.codec.binary,
org.apache.commons.logging,
org.apache.http.entity,
org.osgi.framework,
org.osgi.service.component,
org.osgi.service.http,
org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.wso2.carbon.context,
org.wso2.carbon.core,
org.wso2.carbon.device.mgt.input.adapter.extension,

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@ -111,8 +111,8 @@
!javax.xml.namespace,
javax.xml.namespace; version=0.0.0,
org.apache.commons.logging,
org.osgi.framework,
org.osgi.service.component,
org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.wso2.carbon.context,
org.wso2.carbon.databridge.commons,
org.wso2.carbon.databridge.core,

@ -36,7 +36,7 @@ import java.util.concurrent.ConcurrentHashMap;
/**
* @scr.component name="input.wso2EventAdapterService.component" immediate="true"
* @scr.component name="input.iot.thrift.AdapterService.component" immediate="true"
* @scr.reference name="agentserverservice.service"
* interface="org.wso2.carbon.databridge.core.DataBridgeSubscriberService" cardinality="1..1"
* policy="dynamic" bind="setDataBridgeSubscriberService" unbind="unSetDataBridgeSubscriberService"

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -118,9 +118,8 @@
org.wso2.carbon.base,
org.wso2.carbon.core.util,
org.apache.commons.logging,
org.osgi.framework,
org.osgi.service.component,
org.osgi.service.http,
org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.wso2.carbon.context,
org.wso2.carbon.core,
org.wso2.carbon.device.mgt.input.adapter.extension,

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -118,8 +118,8 @@
org.eclipse.paho.client.mqttv3.persist,
org.json.simple,
org.json.simple.parser,
org.osgi.framework,
org.osgi.service.component,
org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.wso2.carbon.context,
org.apache.commons.codec.binary,
org.apache.http.client.entity,

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
@ -127,8 +127,8 @@
org.eclipse.paho.client.mqttv3.persist,
org.json.simple,
org.json.simple.parser,
org.osgi.framework,
org.osgi.service.component,
org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.wso2.carbon.context,
org.apache.commons.codec.binary,
org.apache.http.client.entity,

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@ -154,8 +154,8 @@
com.google.gson,
javax.websocket,
org.apache.commons.logging,
org.osgi.framework,
org.osgi.service.component,
org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.wso2.carbon.context,
org.wso2.carbon.databridge.commons,
org.wso2.carbon.event.stream.core,

@ -20,7 +20,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>cdmf-transport-adapters</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@ -96,8 +96,8 @@
org.wso2.carbon.event.output.adapter.core.*,
org.jivesoftware.smack.*,
org.apache.commons.logging,
org.osgi.framework,
org.osgi.service.component,
org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.wso2.carbon.context
</Import-Package>
</instructions>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>mb-extensions</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>mb-extensions</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
@ -34,7 +34,7 @@
<modules>
<module>cdmf-transport-adapters</module>
<module>mb-extensions</module>
<!--<module>mb-extensions</module>-->
<module>pull-notification-listeners</module>
</modules>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>pull-notification-listeners</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -86,8 +86,8 @@
org.wso2.carbon.device.mgt.mqtt.notification.listener.*
</Export-Package>
<Import-Package>
org.osgi.framework,
org.osgi.service.component,
org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.apache.commons.logging,
org.wso2.carbon.device.mgt.common.*,
org.wso2.carbon.device.mgt.core.service,

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,7 +21,7 @@
<parent>
<artifactId>android-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -172,6 +172,15 @@
</profiles>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.json.wso2</groupId>
<artifactId>json</artifactId>
</dependency>
<!--project dependancies-->
<dependency>
<groupId>org.apache.cxf</groupId>
@ -247,22 +256,6 @@
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.analytics.data.publisher</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.wso2.carbon.analytics</groupId>
<artifactId>org.wso2.carbon.analytics.api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-annotations</artifactId>

@ -22,8 +22,6 @@ import com.google.gson.Gson;
import com.google.gson.JsonObject;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException;
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.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException;
@ -69,58 +67,58 @@ public class EventReceiverServiceImpl implements EventReceiverService {
if (log.isDebugEnabled()) {
log.debug("Invoking Android device event logging.");
}
Device device;
try {
if (!DeviceManagerUtil.isPublishLocationResponseEnabled()) {
return Response.status(Response.Status.ACCEPTED).entity("Event is publishing has not enabled.").build();
}
DeviceIdentifier deviceIdentifier = new DeviceIdentifier(eventBeanWrapper.getDeviceIdentifier(),
AndroidConstants.DEVICE_TYPE_ANDROID);
device = AndroidAPIUtils.getDeviceManagementService().getDevice(deviceIdentifier, false);
if (device != null && EnrolmentInfo.Status.ACTIVE != device.getEnrolmentInfo().getStatus()){
return Response.status(Response.Status.ACCEPTED).entity("Device is not in Active state.").build();
} else if (device == null){
return Response.status(Response.Status.ACCEPTED).entity("Device is not enrolled yet.").build();
}
} catch (DeviceManagementException e) {
log.error("Error occurred while checking Operation Analytics is Enabled.", e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build();
}
String eventType = eventBeanWrapper.getType();
if (!LOCATION_EVENT_TYPE.equals(eventType)) {
String msg = "Dropping Android " + eventType + " Event.Only Location Event Type is supported.";
log.warn(msg);
return Response.status(Response.Status.BAD_REQUEST).entity(msg).build();
}
Message message = new Message();
Object[] metaData = {eventBeanWrapper.getDeviceIdentifier(), device.getEnrolmentInfo().getOwner(),
AndroidConstants.DEVICE_TYPE_ANDROID};
String eventPayload = eventBeanWrapper.getPayload();
JsonObject jsonObject = gson.fromJson(eventPayload, JsonObject.class);
Object[] payload = {
jsonObject.get(TIME_STAMP).getAsLong(),
jsonObject.get(LATITUDE).getAsDouble(),
jsonObject.get(LONGITUDE).getAsDouble()
};
try {
if (AndroidAPIUtils.getEventPublisherService().publishEvent(
EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload)) {
message.setResponseCode("Event is published successfully.");
return Response.status(Response.Status.CREATED).entity(message).build();
} else {
log.warn("Error occurred while trying to publish the event. This could be due to unavailability " +
"of the publishing service. Please make sure that analytics server is running and accessible " +
"by this server");
throw new UnexpectedServerErrorException(
new ErrorResponse.ErrorResponseBuilder().setCode(503l).setMessage("Error occurred due to " +
"unavailability of the publishing service.").build());
}
} catch (DataPublisherConfigurationException e) {
// Device device;
// try {
// if (!DeviceManagerUtil.isPublishLocationResponseEnabled()) {
// return Response.status(Response.Status.ACCEPTED).entity("Event is publishing has not enabled.").build();
// }
// DeviceIdentifier deviceIdentifier = new DeviceIdentifier(eventBeanWrapper.getDeviceIdentifier(),
// AndroidConstants.DEVICE_TYPE_ANDROID);
// device = AndroidAPIUtils.getDeviceManagementService().getDevice(deviceIdentifier, false);
// if (device != null && EnrolmentInfo.Status.ACTIVE != device.getEnrolmentInfo().getStatus()){
// return Response.status(Response.Status.ACCEPTED).entity("Device is not in Active state.").build();
// } else if (device == null){
// return Response.status(Response.Status.ACCEPTED).entity("Device is not enrolled yet.").build();
// }
// } catch (DeviceManagementException e) {
// log.error("Error occurred while checking Operation Analytics is Enabled.", e);
// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(e.getMessage()).build();
// }
// String eventType = eventBeanWrapper.getType();
// if (!LOCATION_EVENT_TYPE.equals(eventType)) {
// String msg = "Dropping Android " + eventType + " Event.Only Location Event Type is supported.";
// log.warn(msg);
// return Response.status(Response.Status.BAD_REQUEST).entity(msg).build();
// }
// Message message = new Message();
// Object[] metaData = {eventBeanWrapper.getDeviceIdentifier(), device.getEnrolmentInfo().getOwner(),
// AndroidConstants.DEVICE_TYPE_ANDROID};
// String eventPayload = eventBeanWrapper.getPayload();
// JsonObject jsonObject = gson.fromJson(eventPayload, JsonObject.class);
// Object[] payload = {
// jsonObject.get(TIME_STAMP).getAsLong(),
// jsonObject.get(LATITUDE).getAsDouble(),
// jsonObject.get(LONGITUDE).getAsDouble()
// };
// try {
// if (AndroidAPIUtils.getEventPublisherService().publishEvent(
// EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload)) {
// message.setResponseCode("Event is published successfully.");
// return Response.status(Response.Status.CREATED).entity(message).build();
// } else {
// log.warn("Error occurred while trying to publish the event. This could be due to unavailability " +
// "of the publishing service. Please make sure that analytics server is running and accessible " +
// "by this server");
// throw new UnexpectedServerErrorException(
// new ErrorResponse.ErrorResponseBuilder().setCode(503l).setMessage("Error occurred due to " +
// "unavailability of the publishing service.").build());
// }
// } catch (DataPublisherConfigurationException e) {
String msg = "Error occurred while getting the Data publisher Service instance.";
log.error(msg, e);
// log.error(msg, e);
throw new UnexpectedServerErrorException(
new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build());
}
// }
}
@GET
@ -134,94 +132,94 @@ public class EventReceiverServiceImpl implements EventReceiverService {
@QueryParam("type") String type,
@HeaderParam("If-Modified-Since") String ifModifiedSince) {
if (from != 0l && to != 0l && deviceId != null) {
return retrieveAlertFromDate(deviceId, from, to);
} else if (deviceId != null && type != null) {
return retrieveAlertByType(deviceId, type);
} else if (deviceId != null) {
return retrieveAlert(deviceId);
} else {
// if (from != 0l && to != 0l && deviceId != null) {
// return retrieveAlertFromDate(deviceId, from, to);
// } else if (deviceId != null && type != null) {
// return retrieveAlertByType(deviceId, type);
// } else if (deviceId != null) {
// return retrieveAlert(deviceId);
// } else {
throw new BadRequestException(
new ErrorResponse.ErrorResponseBuilder().setCode(400l).setMessage("Request must contain " +
"the device identifier. Optionally, both from and to value should be present to get " +
"alerts between times.").build());
}
}
private Response retrieveAlert(String deviceId) {
if (log.isDebugEnabled()) {
log.debug("Retrieving events for given device Identifier.");
}
String query = "deviceIdentifier:" + deviceId;
List<DeviceState> deviceStates;
try {
deviceStates = AndroidDeviceUtils.getAllEventsForDevice(EVENT_STREAM_DEFINITION, query);
if (deviceStates == null) {
throw new NotFoundException(
new ErrorResponse.ErrorResponseBuilder().setCode(404l).setMessage("No any alerts are " +
"published for Device: " + deviceId + ".").build());
} else {
return Response.status(Response.Status.OK).entity(deviceStates).build();
}
} catch (AnalyticsException e) {
String msg = "Error occurred while getting published events for specific device: " + deviceId + ".";
log.error(msg, e);
throw new UnexpectedServerErrorException(
new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build());
}
}
private Response retrieveAlertFromDate(String deviceId, long from, long to) {
String fromDate = String.valueOf(from);
String toDate = String.valueOf(to);
if (log.isDebugEnabled()) {
log.debug("Retrieving events for given device Identifier and time period.");
}
String query = "deviceIdentifier:" + deviceId + " AND _timestamp: [" + fromDate + " TO " + toDate + "]";
List<DeviceState> deviceStates;
try {
deviceStates = AndroidDeviceUtils.getAllEventsForDevice(EVENT_STREAM_DEFINITION, query);
if (deviceStates == null) {
throw new NotFoundException(
new ErrorResponse.ErrorResponseBuilder().setCode(404l).setMessage("No any alerts are " +
"published on given date for given Device: " + deviceId + ".").build());
} else {
return Response.status(Response.Status.OK).entity(deviceStates).build();
}
} catch (AnalyticsException e) {
String msg = "Error occurred while getting published events for specific " +
"Device: " + deviceId + " on given Date.";
log.error(msg, e);
throw new UnexpectedServerErrorException(
new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build());
}
// }
}
private Response retrieveAlertByType(String deviceId, String type) {
if (log.isDebugEnabled()) {
log.debug("Retrieving events for given device identifier and type.");
}
String query = "deviceIdentifier:" + deviceId + " AND type:" + type;
List<DeviceState> deviceStates;
try {
deviceStates = AndroidDeviceUtils.getAllEventsForDevice(EVENT_STREAM_DEFINITION, query);
if (deviceStates == null) {
throw new NotFoundException(
new ErrorResponse.ErrorResponseBuilder().setCode(404l).setMessage("No any alerts are " +
"published for given Device: '" + deviceId + "' and given specific Type.").build());
} else {
return Response.status(Response.Status.OK).entity(deviceStates).build();
}
} catch (AnalyticsException e) {
String msg = "Error occurred while getting published events for specific " +
"Device: " + deviceId + "and given specific Type.";
log.error(msg, e);
throw new UnexpectedServerErrorException(
new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build());
}
}
// private Response retrieveAlert(String deviceId) {
// if (log.isDebugEnabled()) {
// log.debug("Retrieving events for given device Identifier.");
// }
// String query = "deviceIdentifier:" + deviceId;
// List<DeviceState> deviceStates;
// try {
// deviceStates = AndroidDeviceUtils.getAllEventsForDevice(EVENT_STREAM_DEFINITION, query);
// if (deviceStates == null) {
// throw new NotFoundException(
// new ErrorResponse.ErrorResponseBuilder().setCode(404l).setMessage("No any alerts are " +
// "published for Device: " + deviceId + ".").build());
// } else {
// return Response.status(Response.Status.OK).entity(deviceStates).build();
// }
// } catch (AnalyticsException e) {
// String msg = "Error occurred while getting published events for specific device: " + deviceId + ".";
// log.error(msg, e);
// throw new UnexpectedServerErrorException(
// new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build());
// }
// }
//
// private Response retrieveAlertFromDate(String deviceId, long from, long to) {
// String fromDate = String.valueOf(from);
// String toDate = String.valueOf(to);
// if (log.isDebugEnabled()) {
// log.debug("Retrieving events for given device Identifier and time period.");
// }
//
// String query = "deviceIdentifier:" + deviceId + " AND _timestamp: [" + fromDate + " TO " + toDate + "]";
// List<DeviceState> deviceStates;
// try {
// deviceStates = AndroidDeviceUtils.getAllEventsForDevice(EVENT_STREAM_DEFINITION, query);
// if (deviceStates == null) {
// throw new NotFoundException(
// new ErrorResponse.ErrorResponseBuilder().setCode(404l).setMessage("No any alerts are " +
// "published on given date for given Device: " + deviceId + ".").build());
//
// } else {
// return Response.status(Response.Status.OK).entity(deviceStates).build();
// }
// } catch (AnalyticsException e) {
// String msg = "Error occurred while getting published events for specific " +
// "Device: " + deviceId + " on given Date.";
// log.error(msg, e);
// throw new UnexpectedServerErrorException(
// new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build());
// }
// }
//
// private Response retrieveAlertByType(String deviceId, String type) {
// if (log.isDebugEnabled()) {
// log.debug("Retrieving events for given device identifier and type.");
// }
// String query = "deviceIdentifier:" + deviceId + " AND type:" + type;
// List<DeviceState> deviceStates;
// try {
// deviceStates = AndroidDeviceUtils.getAllEventsForDevice(EVENT_STREAM_DEFINITION, query);
// if (deviceStates == null) {
// throw new NotFoundException(
// new ErrorResponse.ErrorResponseBuilder().setCode(404l).setMessage("No any alerts are " +
// "published for given Device: '" + deviceId + "' and given specific Type.").build());
//
// } else {
// return Response.status(Response.Status.OK).entity(deviceStates).build();
// }
// } catch (AnalyticsException e) {
// String msg = "Error occurred while getting published events for specific " +
// "Device: " + deviceId + "and given specific Type.";
// log.error(msg, e);
// throw new UnexpectedServerErrorException(
// new ErrorResponse.ErrorResponseBuilder().setCode(500l).setMessage(msg).build());
// }
// }
}

@ -20,9 +20,7 @@ package org.wso2.carbon.mdm.services.android.util;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.analytics.api.AnalyticsDataAPI;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.analytics.data.publisher.service.EventsPublisherService;
import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementService;
import org.wso2.carbon.device.mgt.core.app.mgt.ApplicationManagementProviderService;
import org.wso2.carbon.device.mgt.core.device.details.mgt.DeviceInformationManager;
@ -41,8 +39,8 @@ public class AndroidAPIUtils {
private static PolicyManagerService policyManagerService = null;
private static ApplicationManagementProviderService applicationManagementProviderService = null;
private static NotificationManagementService notificationManagementService = null;
private static EventsPublisherService eventsPublisherService = null;
private static AnalyticsDataAPI analyticsDataAPI = null;
// private static EventsPublisherService eventsPublisherService = null;
// private static AnalyticsDataAPI analyticsDataAPI = null;
private AndroidAPIUtils() {
throw new IllegalStateException("Utility class");
@ -126,30 +124,30 @@ public class AndroidAPIUtils {
return notificationManagementService;
}
public static EventsPublisherService getEventPublisherService() {
if (eventsPublisherService == null) {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
eventsPublisherService = (EventsPublisherService) ctx.getOSGiService(EventsPublisherService.class, null);
if (eventsPublisherService == null) {
String msg = "Event Publisher service has not initialized.";
log.error(msg);
throw new IllegalStateException(msg);
}
}
return eventsPublisherService;
}
// public static EventsPublisherService getEventPublisherService() {
// if (eventsPublisherService == null) {
// PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
// eventsPublisherService = (EventsPublisherService) ctx.getOSGiService(EventsPublisherService.class, null);
// if (eventsPublisherService == null) {
// String msg = "Event Publisher service has not initialized.";
// log.error(msg);
// throw new IllegalStateException(msg);
// }
// }
// return eventsPublisherService;
// }
public static AnalyticsDataAPI getAnalyticsDataAPI() {
if (analyticsDataAPI == null) {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
analyticsDataAPI = (AnalyticsDataAPI) ctx.getOSGiService(AnalyticsDataAPI.class, null);
if (analyticsDataAPI == null) {
String msg = "Analytics api service has not initialized.";
log.error(msg);
throw new IllegalStateException(msg);
}
}
return analyticsDataAPI;
}
// public static AnalyticsDataAPI getAnalyticsDataAPI() {
// if (analyticsDataAPI == null) {
// PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
// analyticsDataAPI = (AnalyticsDataAPI) ctx.getOSGiService(AnalyticsDataAPI.class, null);
// if (analyticsDataAPI == null) {
// String msg = "Analytics api service has not initialized.";
// log.error(msg);
// throw new IllegalStateException(msg);
// }
// }
// return analyticsDataAPI;
// }
}

@ -26,12 +26,6 @@ import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import org.apache.commons.logging.Log;
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.datasource.commons.Record;
import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.common.Device;
@ -108,53 +102,53 @@ public class AndroidDeviceUtils {
DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_ANDROID, operation, deviceIdentifiers);
}
public static List<DeviceState> getAllEventsForDevice(String tableName, String query) throws AnalyticsException {
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
AnalyticsDataAPI analyticsDataAPI = AndroidAPIUtils.getAnalyticsDataAPI();
int eventCount = analyticsDataAPI.searchCount(tenantId, tableName, query);
if (eventCount == 0) {
return null;
}
List<SearchResultEntry> resultEntries = analyticsDataAPI.search(tenantId, tableName, query, 0, eventCount);
List<String> recordIds = getRecordIds(resultEntries);
AnalyticsDataResponse response = analyticsDataAPI.get(tenantId, tableName, 1, null, recordIds);
Map<String, DeviceState> deviceStateses = createDeviceStatusData(AnalyticsDataAPIUtil.listRecords(
analyticsDataAPI, response));
return getSortedDeviceStateData(deviceStateses, resultEntries);
}
private static List<String> getRecordIds(List<SearchResultEntry> searchResults) {
List<String> ids = new ArrayList<>();
for (SearchResultEntry searchResult : searchResults) {
ids.add(searchResult.getId());
}
return ids;
}
public static Map<String, DeviceState> createDeviceStatusData(List<Record> records) {
Map<String, DeviceState> deviceStatuses = new HashMap<>();
for (Record record : records) {
DeviceState deviceState = createDeviceStatusData(record);
deviceStatuses.put(deviceState.getId(), deviceState);
}
return deviceStatuses;
}
private static DeviceState createDeviceStatusData(Record record) {
DeviceState deviceState = new DeviceState();
deviceState.setId(record.getId());
deviceState.setValues(record.getValues());
return deviceState;
}
public static List<DeviceState> getSortedDeviceStateData(Map<String, DeviceState> sensorDatas,
List<SearchResultEntry> searchResults) {
List<DeviceState> sortedRecords = new ArrayList<>();
for (SearchResultEntry searchResultEntry : searchResults) {
sortedRecords.add(sensorDatas.get(searchResultEntry.getId()));
}
return sortedRecords;
}
// public static List<DeviceState> getAllEventsForDevice(String tableName, String query) throws AnalyticsException {
// int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
// AnalyticsDataAPI analyticsDataAPI = AndroidAPIUtils.getAnalyticsDataAPI();
// int eventCount = analyticsDataAPI.searchCount(tenantId, tableName, query);
// if (eventCount == 0) {
// return null;
// }
// List<SearchResultEntry> resultEntries = analyticsDataAPI.search(tenantId, tableName, query, 0, eventCount);
// List<String> recordIds = getRecordIds(resultEntries);
// AnalyticsDataResponse response = analyticsDataAPI.get(tenantId, tableName, 1, null, recordIds);
// Map<String, DeviceState> deviceStateses = createDeviceStatusData(AnalyticsDataAPIUtil.listRecords(
// analyticsDataAPI, response));
// return getSortedDeviceStateData(deviceStateses, resultEntries);
// }
// private static List<String> getRecordIds(List<SearchResultEntry> searchResults) {
// List<String> ids = new ArrayList<>();
// for (SearchResultEntry searchResult : searchResults) {
// ids.add(searchResult.getId());
// }
// return ids;
// }
// public static Map<String, DeviceState> createDeviceStatusData(List<Record> records) {
// Map<String, DeviceState> deviceStatuses = new HashMap<>();
// for (Record record : records) {
// DeviceState deviceState = createDeviceStatusData(record);
// deviceStatuses.put(deviceState.getId(), deviceState);
// }
// return deviceStatuses;
// }
// private static DeviceState createDeviceStatusData(Record record) {
// DeviceState deviceState = new DeviceState();
// deviceState.setId(record.getId());
// deviceState.setValues(record.getValues());
// return deviceState;
// }
// public static List<DeviceState> getSortedDeviceStateData(Map<String, DeviceState> sensorDatas,
// List<SearchResultEntry> searchResults) {
// List<DeviceState> sortedRecords = new ArrayList<>();
// for (SearchResultEntry searchResultEntry : searchResults) {
// sortedRecords.add(sensorDatas.get(searchResultEntry.getId()));
// }
// return sortedRecords;
// }
public static void updateOperation(Device device, Operation operation)
throws OperationManagementException, PolicyComplianceException, ApplicationManagementException {

@ -31,5 +31,5 @@
Tomcat environment is the default and every webapps gets it even if they didn't specify it.
e.g. If a webapps requires CXF, they will get both Tomcat and CXF.
-->
<Environments>CXF,Carbon</Environments>
<Environments>CXF3,Carbon</Environments>
</Classloading>

@ -61,6 +61,8 @@ import org.wso2.carbon.device.mgt.common.exceptions.UnauthorizedDeviceAccessExce
import org.wso2.carbon.device.mgt.common.exceptions.UserNotFoundException;
import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationManagementException;
import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration;
import org.wso2.carbon.device.mgt.common.geo.service.GeoCluster;
import org.wso2.carbon.device.mgt.common.geo.service.GeoQuery;
import org.wso2.carbon.device.mgt.common.invitation.mgt.DeviceEnrollmentInvitationDetails;
import org.wso2.carbon.device.mgt.common.license.mgt.License;
import org.wso2.carbon.device.mgt.common.operation.mgt.Activity;
@ -72,8 +74,6 @@ import org.wso2.carbon.device.mgt.common.push.notification.NotificationStrategy;
import org.wso2.carbon.device.mgt.common.spi.DeviceManagementService;
import org.wso2.carbon.device.mgt.core.dto.DeviceType;
import org.wso2.carbon.device.mgt.core.dto.DeviceTypeVersion;
import org.wso2.carbon.device.mgt.core.geo.GeoCluster;
import org.wso2.carbon.device.mgt.core.geo.geoHash.GeoCoordinate;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
import org.wso2.carbon.device.mgt.core.service.EmailMetaInfo;
import org.wso2.carbon.mdm.services.android.utils.TestUtils;
@ -674,8 +674,7 @@ public class DeviceManagementProviderServiceMock implements DeviceManagementProv
}
@Override
public List<GeoCluster> findGeoClusters(String deviceType, GeoCoordinate geoCoordinate,
GeoCoordinate geoCoordinate1, int i) throws DeviceManagementException {
public List<GeoCluster> findGeoClusters(GeoQuery geoQuery) throws DeviceManagementException {
return null;
}

@ -21,7 +21,7 @@
<parent>
<artifactId>android-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<artifactId>android-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<artifactId>android-plugin</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -56,8 +56,8 @@
<Bundle-Description>Device Management Mobile Android Impl Bundle</Bundle-Description>
<Private-Package>org.wso2.carbon.device.mgt.mobile.android.internal</Private-Package>
<Import-Package>
org.osgi.framework,
org.osgi.service.component,
org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
org.osgi.service.*;version="${imp.package.version.osgi.service}",
org.apache.commons.logging,
javax.xml,
javax.xml.stream,

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>mobile-plugins</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -23,13 +23,12 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>analytics-feature</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.iot.analytics.feature</artifactId>
<version>5.0.16-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - IoT Server Analytics Feature</name>
<url>http://wso2.org</url>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>analytics-feature</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions-feature</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,7 +23,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions-feature</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -23,14 +23,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions-feature</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.adapter.feature</artifactId>
<packaging>pom</packaging>
<version>5.0.16-SNAPSHOT</version>
<name>WSO2 Carbon - Device Management Adapters Feature</name>
<url>http://wso2.org</url>
<description>This feature contains the adapter bundles required for IoT Server</description>

@ -3,14 +3,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>extensions-feature</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.notification.listener.feature</artifactId>
<packaging>pom</packaging>
<version>5.0.16-SNAPSHOT</version>
<name>WSO2 Carbon - Notification Listener</name>
<url>http://wso2.org</url>
<description>This feature contains the core bundles required iot core listeners</description>

@ -22,21 +22,20 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>extensions-feature</artifactId>
<version>5.0.16-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - Device Management Extensions</name>
<url>http://wso2.org</url>
<modules>
<module>org.wso2.carbon.device.mgt.adapter.feature</module>
<module>org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.feature</module>
<module>org.wso2.carbon.andes.extensions.device.mgt.api.feature</module>
<!--<module>org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.feature</module>-->
<!--<module>org.wso2.carbon.andes.extensions.device.mgt.api.feature</module>-->
<module>org.wso2.carbon.device.mgt.notification.listener.feature</module>
</modules>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>android-plugin-feature</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -14,7 +14,6 @@
</send>
</inSequence>
<outSequence>
<class name="org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtResponseHandler"/>
<send/>
</outSequence>
</resource>
@ -30,7 +29,6 @@
</send>
</inSequence>
<outSequence>
<class name="org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtResponseHandler"/>
<send/>
</outSequence>
</resource>

@ -13,7 +13,6 @@
</send>
</inSequence>
<outSequence>
<class name="org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtResponseHandler"/>
<send/>
</outSequence>
</resource>
@ -29,7 +28,6 @@
</send>
</inSequence>
<outSequence>
<class name="org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtResponseHandler"/>
<send/>
</outSequence>
</resource>
@ -45,7 +43,6 @@
</send>
</inSequence>
<outSequence>
<class name="org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtResponseHandler"/>
<send/>
</outSequence>
</resource>
@ -61,7 +58,6 @@
</send>
</inSequence>
<outSequence>
<class name="org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtResponseHandler"/>
<send/>
</outSequence>
</resource>
@ -77,7 +73,6 @@
</send>
</inSequence>
<outSequence>
<class name="org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtResponseHandler"/>
<send/>
</outSequence>
</resource>

@ -13,7 +13,6 @@
</send>
</inSequence>
<outSequence>
<class name="org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtResponseHandler"/>
<send/>
</outSequence>
</resource>
@ -29,7 +28,6 @@
</send>
</inSequence>
<outSequence>
<class name="org.wso2.carbon.apimgt.gateway.handlers.analytics.APIMgtResponseHandler"/>
<send/>
</outSequence>
</resource>

@ -0,0 +1,63 @@
<!--
~ Copyright (C) 2020. Entgra (Pvt) Ltd, https://entgra.io
~ All Rights Reserved.
~
~ Unauthorized copying/redistribution of this file, via any medium
~ is strictly prohibited.
~ Proprietary and confidential.
~
~ Licensed under the Entgra Commercial License,
~ Version 1.0 (the "License");
~ you may not use this file except in compliance with the License.
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
~
~ You may obtain a copy of the License at
~ https://entgra.io/licenses/entgra-commercial/1.0
-->
<datasources-configuration xmlns:svns="http://org.wso2.securevault/configuration">
<providers>
<provider>org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader</provider>
</providers>
<datasources>
<datasource>
<name>Android_DB</name>
<description>The datasource used as the Android Device Management database</description>
<jndiConfig>
<name>jdbc/MobileAndroidDM_DS</name>
</jndiConfig>
<definition type="RDBMS">
<configuration>
{% if database.android is defined %}
<url>{{database.android.url}}</url>
<username>{{database.android.username}}</username>
<password>{{database.android.password}}</password>
<driverClassName>{{database.android.driver}}</driverClassName>
<validationQuery>{{database.android.validationQuery}}</validationQuery>
{% for property_name,property_value in database.android.pool_options.items() %}
<{{property_name}}>{{property_value}}</{{property_name}}>
{% endfor %}
{% else %}
<url>jdbc:h2:./repository/database/WSO2MobileAndroid_DB;DB_CLOSE_ON_EXIT=FALSE</url>
<username>wso2carbon</username>
<password>wso2carbon</password>
<driverClassName>org.h2.Driver</driverClassName>
<maxActive>50</maxActive>
<maxWait>60000</maxWait>
<testOnBorrow>true</testOnBorrow>
<validationQuery>SELECT 1</validationQuery>
<validationInterval>30000</validationInterval>
{% endif %}
</configuration>
</definition>
</datasource>
</datasources>
</datasources-configuration>

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<MobileDeviceMgtConfiguration>
<ManagementRepository>
<DataSourceConfigurations>
<DataSourceConfiguration type="android">
<JndiLookupDefinition>
{% if mobile_conf.datasource.android.name is defined %}
<Name>{{mobile_conf.datasource.android.name}}</Name>
{% else %}
<Name>jdbc/MobileAndroidDM_DS</Name>
{% endif %}
</JndiLookupDefinition>
</DataSourceConfiguration>
</DataSourceConfigurations>
</ManagementRepository>
<APIPublisher>
<APIs>
<!--todo remove this -->
<API>
<Name>appmanager</Name>
<Owner>admin</Owner>
<Context>/devices</Context>
<Version>1.0.0</Version>
<Endpoint>http://localhost:9763/test/app</Endpoint>
<Transports>http,https</Transports>
</API>
<API>
<Name>enrol</Name>
<Owner>admin</Owner>
<Context>/enroll</Context>
<Version>1.0.0</Version>
<Endpoint>http://localhost:9763/mdm-android-agent/enrollment</Endpoint>
<Transports>http,https</Transports>
</API>
<API>
<Name>license</Name>
<Owner>admin</Owner>
<Context>/license</Context>
<Version>1.0.0</Version>
<Endpoint>http://localhost:9763/mdm-android-agent/devices/license</Endpoint>
<Transports>http,https</Transports>
</API>
<API>
<Name>operation</Name>
<Owner>admin</Owner>
<Context>/operation</Context>
<Version>1.0.0</Version>
<Endpoint>http://localhost:9763/mdm-android-agent/operations</Endpoint>
<Transports>http,https</Transports>
</API>
</APIs>
</APIPublisher>
</MobileDeviceMgtConfiguration>

@ -30,8 +30,7 @@
</jndiConfig>
<definition type="RDBMS">
<configuration>
<url>jdbc:h2:repository/database/WSO2MobileAndroid_DB;DB_CLOSE_ON_EXIT=FALSE
</url>
<url>jdbc:h2:./repository/database/WSO2MobileAndroid_DB;DB_CLOSE_ON_EXIT=FALSE</url>
<username>wso2carbon</username>
<password>wso2carbon</password>
<driverClassName>org.h2.Driver</driverClassName>

@ -1,8 +1,8 @@
instructions.configure = \
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/webapps/api#device-mgt#android#v1.0.war,target:${installFolder}/../../deployment/server/webapps/api#device-mgt#android#v1.0.war,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/jaggeryapps/devicemgt,target:${installFolder}/../../deployment/server/jaggeryapps/devicemgt,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/datasources/,target:${installFolder}/../../conf/datasources/,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/conf/mobile-config.xml,target:${installFolder}/../../conf/mobile-config.xml,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/datasources/,target:${installFolder}/../../repository/conf/datasources/,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/conf/mobile-config.xml,target:${installFolder}/../../repository/conf/mobile-config.xml,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/dbscripts/plugins/,target:${installFolder}/../../../dbscripts/cdm/plugins/android,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../database/);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/database/,target:${installFolder}/../../database/,overwrite:true);\
@ -12,10 +12,11 @@ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../featur
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/apis/admin--Android-Mutual-SSL-Configuration-Management.xml,target:${installFolder}/../../deployment/server/synapse-configs/default/api/admin--Android-Mutual-SSL-Configuration-Management.xml,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/apis/admin--Android-Mutual-SSL-Device-Management.xml,target:${installFolder}/../../deployment/server/synapse-configs/default/api/admin--Android-Mutual-SSL-Device-Management.xml,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/apis/admin--Android-Mutual-SSL-Event-Receiver.xml,target:${installFolder}/../../deployment/server/synapse-configs/default/api/admin--Android-Mutual-SSL-Event-Receiver.xml,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.mobile.android_${feature.version}/conf_templates/,target:${installFolder}/../../resources/conf/,overwrite:true);\
instructions.unconfigure = \
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/webapps/mdm-android-agent.war);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../conf/datasources/android-datasources.xml);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../repository/conf/datasources/android-datasources.xml);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/webapps/mdm-android-agent);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.operation-bar);\
org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../deployment/server/jaggeryapps/devicemgt/app/units/cdmf.unit.device.type.android.device-view);\

@ -22,13 +22,12 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>mobile-plugins-feature</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>android-plugin-feature</artifactId>
<version>5.0.16-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - Device Management Android Plugin Feature</name>
<url>http://wso2.org</url>

@ -22,13 +22,12 @@
<parent>
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>mobile-plugins-feature</artifactId>
<version>5.0.16-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - Device Management EMM Plugins Feature</name>
<url>http://wso2.org</url>

@ -23,7 +23,7 @@
<groupId>org.wso2.carbon.devicemgt-plugins</groupId>
<artifactId>carbon-device-mgt-plugins-parent</artifactId>
<packaging>pom</packaging>
<version>5.0.16-SNAPSHOT</version>
<version>6.0.0-SNAPSHOT</version>
<name>WSO2 Carbon - Device Management Plugins Parent</name>
<url>http://wso2.org</url>
<description>WSO2 Carbon - Device Management Plugins Parent</description>
@ -38,9 +38,9 @@
<module>components/extensions</module>
<module>components/mobile-plugins</module>
<!--<module>components/device-types</module>-->
<module>components/analytics</module>
<module>components/test-coverage</module>
<module>features/analytics-feature</module>
<!--<module>components/analytics</module>-->
<!--<module>components/test-coverage</module>-->
<!--<module>features/analytics-feature</module>-->
<module>features/mobile-plugins-feature</module>
<!--<module>features/device-types-feature</module>-->
<module>features/extensions-feature</module>
@ -102,7 +102,7 @@
<dependency>
<groupId>org.wso2.carbon</groupId>
<artifactId>org.wso2.carbon.logging</artifactId>
<version>${carbon.kernel.version}</version>
<version>${carbon.logging.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.log4j.wso2</groupId>
@ -300,22 +300,6 @@
<artifactId>org.wso2.carbon.certificate.mgt.core</artifactId>
<version>${carbon.devicemgt.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.analytics.data.publisher</artifactId>
<version>${carbon.devicemgt.version}</version>
<exclusions>
<exclusion>
<groupId>jboss</groupId>
<artifactId>javassist</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.dynamic.client.registration</artifactId>
<version>${carbon.devicemgt.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.identity.jwt.client.extension</artifactId>
@ -331,16 +315,6 @@
<artifactId>org.wso2.carbon.apimgt.webapp.publisher</artifactId>
<version>${carbon.devicemgt.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.event-processing</groupId>
<artifactId>org.wso2.carbon.siddhi.geo.event.fuser</artifactId>
<version>${carbon.event.processing.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.event-processing</groupId>
<artifactId>org.wso2.carbon.siddhi.geo.event.notifier</artifactId>
<version>${carbon.event.processing.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.apimgt.annotations</artifactId>
@ -403,11 +377,6 @@
<artifactId>org.wso2.carbon.databridge.core</artifactId>
<version>${carbon.analytics.common.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.analytics</groupId>
<artifactId>org.wso2.carbon.analytics.api</artifactId>
<version>${carbon.analytics.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon.analytics-common</groupId>
<artifactId>org.wso2.carbon.event.stream.core</artifactId>
@ -1154,11 +1123,11 @@
<properties>
<!-- Carbon Device Management -->
<carbon.devicemgt.version>4.1.16-SNAPSHOT</carbon.devicemgt.version>
<carbon.devicemgt.version.range>[4.0.0, 5.0.0)</carbon.devicemgt.version.range>
<carbon.devicemgt.version>5.0.0-SNAPSHOT</carbon.devicemgt.version>
<carbon.devicemgt.version.range>[5.0.0-SNAPSHOT, 6.0.0)</carbon.devicemgt.version.range>
<!-- Carbon Device Management Plugins -->
<carbon.devicemgt.plugins.version>5.0.16-SNAPSHOT</carbon.devicemgt.plugins.version>
<carbon.devicemgt.plugins.version>${project.version}</carbon.devicemgt.plugins.version>
<!-- Android Agent Artifact Version-->
<android.agent.version>4.0.0</android.agent.version>
@ -1168,10 +1137,11 @@
<wso2.maven.compiler.target>1.8</wso2.maven.compiler.target>
<!--Carbon kernel versions-->
<carbon.kernel.version>4.4.26</carbon.kernel.version>
<carbon.kernel.version.range>[4.4.0, 4.5.0)</carbon.kernel.version.range>
<carbon.kernel.version>4.6.2</carbon.kernel.version>
<carbon.kernel.version.range>[4.5.0, 5.0.0)</carbon.kernel.version.range>
<carbon.logging.version>4.4.9</carbon.logging.version>
<carbon.p2.plugin.version>1.5.4</carbon.p2.plugin.version>
<carbon.p2.plugin.version>5.1.2</carbon.p2.plugin.version>
<!-- Axis2 -->
<axis2.osgi.version.range>[1.6.1.wso2v11, 1.7.0)</axis2.osgi.version.range>
@ -1188,7 +1158,7 @@
<!--Eclipse Osgi-->
<eclipse.equinox.common.version>3.6.100.v20120522-1841</eclipse.equinox.common.version>
<eclipse.osgi.version>3.9.1.v20130814-1242</eclipse.osgi.version>
<eclipse.osgi.version>3.9.1.v20140110-1610</eclipse.osgi.version>
<!--Orbit versions-->
<orbit.h2.engine.version>1.2.140.wso2v3</orbit.h2.engine.version>
@ -1196,7 +1166,7 @@
<orbit.tomcat.jdbc.pooling.version>7.0.34.wso2v2</orbit.tomcat.jdbc.pooling.version>
<!-- CXF version -->
<cxf.version>2.6.1</cxf.version>
<cxf.version>3.3.6</cxf.version>
<cxf.bindings.version>2.5.11</cxf.bindings.version>
<jackson.version>1.9.0</jackson.version>
<javax.ws.rs.version>1.1.1</javax.ws.rs.version>
@ -1208,22 +1178,22 @@
<carbon.deployment.version>4.7.15</carbon.deployment.version>
<!-- Carbon Identity -->
<carbon.identity.framework.version>5.11.148</carbon.identity.framework.version>
<identity.inbound.auth.oauth.version>5.6.63</identity.inbound.auth.oauth.version>
<carbon.identity.version.range>[5.2.0, 6.0.0)</carbon.identity.version.range>
<identity.carbon.auth.jwt.version>5.1.2</identity.carbon.auth.jwt.version>
<carbon.identity.framework.version>5.18.187</carbon.identity.framework.version>
<identity.inbound.auth.oauth.version>6.4.111</identity.inbound.auth.oauth.version>
<carbon.identity.version.range>[5.2.0, 7.0.0)</carbon.identity.version.range>
<identity.carbon.auth.jwt.version>5.1.5</identity.carbon.auth.jwt.version>
<!-- Carbon Multi-tenancy -->
<carbon.multitenancy.version>4.6.11</carbon.multitenancy.version>
<carbon.multitenancy.version>4.9.10</carbon.multitenancy.version>
<!-- Carbon Registry -->
<carbon.registry.version>4.6.28</carbon.registry.version>
<carbon.registry.version>4.7.39</carbon.registry.version>
<!-- Carbon Governance -->
<carbon.governance.version>4.7.23</carbon.governance.version>
<carbon.governance.version>4.8.21</carbon.governance.version>
<!-- Carbon API Management -->
<carbon.api.mgt.version>6.2.201</carbon.api.mgt.version>
<carbon.api.mgt.version>9.0.174</carbon.api.mgt.version>
<!-- XMPP/MQTT Version -->
<smack.wso2.version>3.0.4.wso2v1</smack.wso2.version>
@ -1234,21 +1204,18 @@
<jetty.version>8.1.3.v20120416</jetty.version>
<!-- Swagger -->
<swagger.version>1.5.8</swagger.version>
<swagger.version>1.5.10</swagger.version>
<!-- Carbon Analytics -->
<carbon.analytics.common.version>5.1.37</carbon.analytics.common.version>
<carbon.analytics.common.version.range>[5.1.3,6.0.0)</carbon.analytics.common.version.range>
<carbon.analytics.version>1.3.25</carbon.analytics.version>
<carbon.analytics.version.range>[1.3.0,2.0.0)</carbon.analytics.version.range>
<carbon.event.processing.version>2.1.23</carbon.event.processing.version>
<carbon.analytics.common.version>5.2.34</carbon.analytics.common.version>
<carbon.analytics.common.version.range>[5.2.0,6.0.0)</carbon.analytics.common.version.range>
<!-- Third Party Dependencies-->
<spongycastle.version>1.51.0.0</spongycastle.version>
<bouncycastle.version>1.49</bouncycastle.version>
<apache.wss4j.version>2.0.0</apache.wss4j.version>
<codehaus.plexus.version>3.0.21</codehaus.plexus.version>
<google.gson.version>2.3.1</google.gson.version>
<google.gson.version>2.8.5</google.gson.version>
<gcm.server.version>1.0.2</gcm.server.version>
<commons-io-wso2.version>2.4.0.wso2v1</commons-io-wso2.version>
<commons-io.version>2.4</commons-io.version>
@ -1265,8 +1232,8 @@
<axiom-api.version>1.2.11.wso2v10</axiom-api.version>
<log4j.version>1.2.17</log4j.version>
<spring-web.version>3.0.5.RELEASE</spring-web.version>
<spring-ws-security.version>2.1.0.RELEASE</spring-ws-security.version>
<spring-web.version>5.1.13.RELEASE</spring-web.version>
<spring-ws-security.version>3.0.8.RELEASE</spring-ws-security.version>
<jaxws-rt.version>2.2.8</jaxws-rt.version>
<saaj-impl.version>1.3.18</saaj-impl.version>
<bcpkix-jdk15on.version>1.52.0.wso2v2</bcpkix-jdk15on.version>
@ -1313,7 +1280,7 @@
<!-- MB Features -->
<carbon.messaging.version>3.2.34</carbon.messaging.version>
<andes.version>3.2.50</andes.version>
<jackson-annotations.version>2.6.1.wso2v1</jackson-annotations.version>
<jackson-annotations.version>2.9.8.wso2v1</jackson-annotations.version>
<carbon.andes.mqtt.version>3.2.34</carbon.andes.mqtt.version>
<!--Feign Version-->
@ -1335,6 +1302,11 @@
<squareup.okhttp3.version>3.8.1</squareup.okhttp3.version>
<okio.version>1.13.0</okio.version>
<github.openfeign.version>9.3.1</github.openfeign.version>
<cxf-bundle-package.version>2.7.18</cxf-bundle-package.version>
<imp.package.version.osgi.framework>[1.6.0, 2.0.0)</imp.package.version.osgi.framework>
<imp.package.version.osgi.service>[1.2.0,1.3.0)</imp.package.version.osgi.service>
</properties>
<scm>

Loading…
Cancel
Save