Merge branch 'master' of https://github.com/wso2/carbon-device-mgt into geo-fencing

This commit is contained in:
Rasika Perera 2017-06-12 15:11:14 +05:30
commit 6d02075a99
107 changed files with 1151 additions and 1075 deletions

View File

@ -22,13 +22,13 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.annotations</artifactId> <artifactId>org.wso2.carbon.apimgt.annotations</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Annotations</name> <name>WSO2 Carbon - API Management Annotations</name>
<description>WSO2 Carbon - API Management Custom Annotation Module</description> <description>WSO2 Carbon - API Management Custom Annotation Module</description>

View File

@ -21,12 +21,12 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<artifactId>org.wso2.carbon.apimgt.application.extension.api</artifactId> <artifactId>org.wso2.carbon.apimgt.application.extension.api</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<name>WSO2 Carbon - API Application Management API</name> <name>WSO2 Carbon - API Application Management API</name>

View File

@ -22,12 +22,12 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<artifactId>org.wso2.carbon.apimgt.application.extension</artifactId> <artifactId>org.wso2.carbon.apimgt.application.extension</artifactId>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Application Management</name> <name>WSO2 Carbon - API Application Management</name>

View File

@ -21,13 +21,13 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.handlers</artifactId> <artifactId>org.wso2.carbon.apimgt.handlers</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Security Handler Component</name> <name>WSO2 Carbon - API Security Handler Component</name>
<description>WSO2 Carbon - API Management Security Handler Module</description> <description>WSO2 Carbon - API Management Security Handler Module</description>

View File

@ -13,13 +13,13 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.integration.client</artifactId> <artifactId>org.wso2.carbon.apimgt.integration.client</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Integration Client</name> <name>WSO2 Carbon - API Management Integration Client</name>
<description>WSO2 Carbon - API Management Integration Client</description> <description>WSO2 Carbon - API Management Integration Client</description>

View File

@ -13,13 +13,13 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.integration.generated.client</artifactId> <artifactId>org.wso2.carbon.apimgt.integration.generated.client</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Integration Generated Client</name> <name>WSO2 Carbon - API Management Integration Generated Client</name>
<description>WSO2 Carbon - API Management Integration Client</description> <description>WSO2 Carbon - API Management Integration Client</description>

View File

@ -22,13 +22,13 @@
<parent> <parent>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.webapp.publisher</artifactId> <artifactId>org.wso2.carbon.apimgt.webapp.publisher</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Webapp Publisher</name> <name>WSO2 Carbon - API Management Webapp Publisher</name>
<description>WSO2 Carbon - API Management Webapp Publisher</description> <description>WSO2 Carbon - API Management Webapp Publisher</description>

View File

@ -22,13 +22,13 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>apimgt-extensions</artifactId> <artifactId>apimgt-extensions</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - API Management Extensions Component</name> <name>WSO2 Carbon - API Management Extensions Component</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

View File

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -21,13 +21,13 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.certificate.mgt.core</artifactId> <artifactId>org.wso2.carbon.certificate.mgt.core</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Certificate Management Core</name> <name>WSO2 Carbon - Certificate Management Core</name>
<description>WSO2 Carbon - Certificate Management Core</description> <description>WSO2 Carbon - Certificate Management Core</description>

View File

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt</artifactId> <artifactId>certificate-mgt</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Certificate Management Component</name> <name>WSO2 Carbon - Certificate Management Component</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

View File

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

View File

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

View File

@ -57,7 +57,7 @@ public class FCMNotificationStrategy implements NotificationStrategy {
public void execute(NotificationContext ctx) throws PushNotificationExecutionFailedException { public void execute(NotificationContext ctx) throws PushNotificationExecutionFailedException {
try { try {
Device device = Device device =
FCMDataHolder.getInstance().getDeviceManagementProviderService().getDevice(ctx.getDeviceId()); FCMDataHolder.getInstance().getDeviceManagementProviderService().getDeviceWithTypeProperties(ctx.getDeviceId());
this.sendWakeUpCall(ctx.getOperation().getCode(), device); this.sendWakeUpCall(ctx.getOperation().getCode(), device);
} catch (DeviceManagementException e) { } catch (DeviceManagementException e) {
throw new PushNotificationExecutionFailedException("Error occurred while retrieving device information", e); throw new PushNotificationExecutionFailedException("Error occurred while retrieving device information", e);

View File

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

View File

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

View File

@ -22,7 +22,7 @@
<parent> <parent>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -3,7 +3,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

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

View File

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

View File

@ -267,6 +267,13 @@ public interface DeviceManagementService {
required = false) required = false)
@HeaderParam("If-Modified-Since") @HeaderParam("If-Modified-Since")
String timestamp, String timestamp,
@ApiParam(
name = "requireDeviceInfo",
value = "Boolean flag indicating whether to include device-info (location, application list etc) \n" +
" to the device object.",
required = false)
@QueryParam("requireDeviceInfo")
boolean requireDeviceInfo,
@ApiParam( @ApiParam(
name = "offset", name = "offset",
value = "The starting pagination index for the complete list of qualified items.", value = "The starting pagination index for the complete list of qualified items.",
@ -333,6 +340,13 @@ public interface DeviceManagementService {
}) })
@Path("/user-devices") @Path("/user-devices")
Response getDeviceByUser( Response getDeviceByUser(
@ApiParam(
name = "requireDeviceInfo",
value = "Boolean flag indicating whether to include device-info (location, application list etc) \n" +
" to the device object.",
required = false)
@QueryParam("requireDeviceInfo")
boolean requireDeviceInfo,
@ApiParam( @ApiParam(
name = "offset", name = "offset",
value = "The starting pagination index for the complete list of qualified items.", value = "The starting pagination index for the complete list of qualified items.",

View File

@ -83,6 +83,10 @@ public class ActivityProviderServiceImpl implements ActivityInfoProviderService
long timestamp = 0; long timestamp = 0;
boolean isIfModifiedSinceSet = false; boolean isIfModifiedSinceSet = false;
boolean isSinceSet = false; boolean isSinceSet = false;
if (log.isDebugEnabled()) {
log.debug("getActivities since: " + since + " , offset: " + offset + " ,limit: " + limit + " ," +
"ifModifiedSince: " + ifModifiedSince);
}
RequestValidationUtil.validatePaginationParameters(offset, limit); RequestValidationUtil.validatePaginationParameters(offset, limit);
if (ifModifiedSince != null && !ifModifiedSince.isEmpty()) { if (ifModifiedSince != null && !ifModifiedSince.isEmpty()) {
Date ifSinceDate; Date ifSinceDate;
@ -112,14 +116,32 @@ public class ActivityProviderServiceImpl implements ActivityInfoProviderService
timestamp = sinceTimestamp / 1000; timestamp = sinceTimestamp / 1000;
} }
if (timestamp == 0) {
//If timestamp is not sent by the user, a default value is set, that is equal to current time-12 hours.
long time = System.currentTimeMillis() / 1000;
timestamp = time - 42300;
}
if (log.isDebugEnabled()) {
log.debug("getActivities final timestamp " + timestamp);
}
List<Activity> activities; List<Activity> activities;
ActivityList activityList = new ActivityList(); ActivityList activityList = new ActivityList();
DeviceManagementProviderService dmService; DeviceManagementProviderService dmService;
try { try {
if (log.isDebugEnabled()) {
log.debug("Calling database to get activities.");
}
dmService = DeviceMgtAPIUtils.getDeviceManagementService(); dmService = DeviceMgtAPIUtils.getDeviceManagementService();
activities = dmService.getActivitiesUpdatedAfter(timestamp, limit, offset); activities = dmService.getActivitiesUpdatedAfter(timestamp, limit, offset);
activityList.setList(activities); activityList.setList(activities);
if (log.isDebugEnabled()) {
log.debug("Calling database to get activity count.");
}
int count = dmService.getActivityCountUpdatedAfter(timestamp); int count = dmService.getActivityCountUpdatedAfter(timestamp);
if (log.isDebugEnabled()) {
log.debug("Activity count: " + count);
}
activityList.setCount(count); activityList.setCount(count);
if (activities == null || activities.size() == 0) { if (activities == null || activities.size() == 0) {
if (isIfModifiedSinceSet) { if (isIfModifiedSinceSet) {

View File

@ -18,7 +18,6 @@
*/ */
package org.wso2.carbon.device.mgt.jaxrs.service.impl; package org.wso2.carbon.device.mgt.jaxrs.service.impl;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang.StringUtils; 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;
@ -97,6 +96,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
@QueryParam("groupId") int groupId, @QueryParam("groupId") int groupId,
@QueryParam("since") String since, @QueryParam("since") String since,
@HeaderParam("If-Modified-Since") String ifModifiedSince, @HeaderParam("If-Modified-Since") String ifModifiedSince,
@QueryParam("requireDeviceInfo") boolean requireDeviceInfo,
@QueryParam("offset") int offset, @QueryParam("offset") int offset,
@QueryParam("limit") int limit) { @QueryParam("limit") int limit) {
try { try {
@ -180,7 +180,12 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
"string is provided in 'If-Modified-Since' header").build()).build(); "string is provided in 'If-Modified-Since' header").build()).build();
} }
request.setSince(sinceDate); request.setSince(sinceDate);
if (requireDeviceInfo) {
result = dms.getAllDevices(request); result = dms.getAllDevices(request);
} else {
result = dms.getAllDevices(request, false);
}
if (result == null || result.getData() == null || result.getData().size() <= 0) { if (result == null || result.getData() == null || result.getData().size() <= 0) {
return Response.status(Response.Status.NOT_MODIFIED).entity("No device is modified " + return Response.status(Response.Status.NOT_MODIFIED).entity("No device is modified " +
"after the timestamp provided in 'If-Modified-Since' header").build(); "after the timestamp provided in 'If-Modified-Since' header").build();
@ -196,14 +201,22 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
"string is provided in 'since' filter").build()).build(); "string is provided in 'since' filter").build()).build();
} }
request.setSince(sinceDate); request.setSince(sinceDate);
if (requireDeviceInfo) {
result = dms.getAllDevices(request); result = dms.getAllDevices(request);
} else {
result = dms.getAllDevices(request, false);
}
if (result == null || result.getData() == null || result.getData().size() <= 0) { if (result == null || result.getData() == null || result.getData().size() <= 0) {
devices.setList(new ArrayList<Device>()); devices.setList(new ArrayList<Device>());
devices.setCount(0); devices.setCount(0);
return Response.status(Response.Status.OK).entity(devices).build(); return Response.status(Response.Status.OK).entity(devices).build();
} }
} else { } else {
if (requireDeviceInfo) {
result = dms.getAllDevices(request); result = dms.getAllDevices(request);
} else {
result = dms.getAllDevices(request, false);
}
int resultCount = result.getRecordsTotal(); int resultCount = result.getRecordsTotal();
if (resultCount == 0) { if (resultCount == 0) {
Response.status(Response.Status.OK).entity(devices).build(); Response.status(Response.Status.OK).entity(devices).build();
@ -229,7 +242,8 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
@GET @GET
@Override @Override
@Path("/user-devices") @Path("/user-devices")
public Response getDeviceByUser(@QueryParam("offset") int offset, public Response getDeviceByUser(@QueryParam("requireDeviceInfo") boolean requireDeviceInfo,
@QueryParam("offset") int offset,
@QueryParam("limit") int limit) { @QueryParam("limit") int limit) {
RequestValidationUtil.validatePaginationParameters(offset, limit); RequestValidationUtil.validatePaginationParameters(offset, limit);
@ -241,7 +255,11 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
request.setOwner(currentUser); request.setOwner(currentUser);
try { try {
if (requireDeviceInfo) {
result = DeviceMgtAPIUtils.getDeviceManagementService().getDevicesOfUser(request); result = DeviceMgtAPIUtils.getDeviceManagementService().getDevicesOfUser(request);
} else {
result = DeviceMgtAPIUtils.getDeviceManagementService().getDevicesOfUser(request, false);
}
devices.setList((List<Device>) result.getData()); devices.setList((List<Device>) result.getData());
devices.setCount(result.getRecordsTotal()); devices.setCount(result.getRecordsTotal());
return Response.status(Response.Status.OK).entity(devices).build(); return Response.status(Response.Status.OK).entity(devices).build();
@ -261,7 +279,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
DeviceMgtAPIUtils.getDeviceManagementService(); DeviceMgtAPIUtils.getDeviceManagementService();
try { try {
DeviceIdentifier deviceIdentifier = new DeviceIdentifier(deviceId, deviceType); DeviceIdentifier deviceIdentifier = new DeviceIdentifier(deviceId, deviceType);
Device persistedDevice = deviceManagementProviderService.getDevice(deviceIdentifier); Device persistedDevice = deviceManagementProviderService.getDevice(deviceIdentifier, true);
if (persistedDevice == null) { if (persistedDevice == null) {
return Response.status(Response.Status.NOT_FOUND).build(); return Response.status(Response.Status.NOT_FOUND).build();
} }
@ -287,7 +305,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
DeviceManagementProviderService deviceManagementProviderService = DeviceMgtAPIUtils.getDeviceManagementService(); DeviceManagementProviderService deviceManagementProviderService = DeviceMgtAPIUtils.getDeviceManagementService();
try { try {
Device persistedDevice = deviceManagementProviderService.getDevice(new DeviceIdentifier Device persistedDevice = deviceManagementProviderService.getDevice(new DeviceIdentifier
(deviceId, deviceType)); (deviceId, deviceType), true);
persistedDevice.setName(device.getName()); persistedDevice.setName(device.getName());
boolean response = deviceManagementProviderService.modifyEnrollment(persistedDevice); boolean response = deviceManagementProviderService.modifyEnrollment(persistedDevice);
return Response.status(Response.Status.CREATED).entity(response).build(); return Response.status(Response.Status.CREATED).entity(response).build();
@ -586,7 +604,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService {
DeviceMgtAPIUtils.getDeviceManagementService(); DeviceMgtAPIUtils.getDeviceManagementService();
try { try {
DeviceIdentifier deviceIdentifier = new DeviceIdentifier(id, type); DeviceIdentifier deviceIdentifier = new DeviceIdentifier(id, type);
Device persistedDevice = deviceManagementProviderService.getDevice(deviceIdentifier); Device persistedDevice = deviceManagementProviderService.getDevice(deviceIdentifier, false);
if (persistedDevice == null) { if (persistedDevice == null) {
return Response.status(Response.Status.NOT_FOUND).build(); return Response.status(Response.Status.NOT_FOUND).build();
} }

View File

@ -128,7 +128,7 @@ public class PolicyManagementServiceImpl implements PolicyManagementService {
List<DeviceIdentifier> deviceIdentifiers = policyWrapper.getDeviceIdentifiers(); List<DeviceIdentifier> deviceIdentifiers = policyWrapper.getDeviceIdentifiers();
if (deviceIdentifiers != null) { if (deviceIdentifiers != null) {
for (DeviceIdentifier id : deviceIdentifiers) { for (DeviceIdentifier id : deviceIdentifiers) {
devices.add(DeviceMgtAPIUtils.getDeviceManagementService().getDevice(id)); devices.add(DeviceMgtAPIUtils.getDeviceManagementService().getDevice(id, false));
} }
} }
policy.setDevices(devices); policy.setDevices(devices);

View File

@ -25,6 +25,7 @@ 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.Device; import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.PaginationRequest;
import org.wso2.carbon.device.mgt.jaxrs.beans.DeviceList; import org.wso2.carbon.device.mgt.jaxrs.beans.DeviceList;
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.service.api.admin.DeviceManagementAdminService; import org.wso2.carbon.device.mgt.jaxrs.service.api.admin.DeviceManagementAdminService;
@ -64,8 +65,11 @@ public class DeviceManagementAdminServiceImpl implements DeviceManagementAdminSe
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomain); PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomain);
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(DeviceMgtAPIUtils.getTenantId(tenantDomain)); PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(DeviceMgtAPIUtils.getTenantId(tenantDomain));
PaginationRequest request = new PaginationRequest(offset, limit);
request.setDeviceType(type);
request.setDeviceName(name);
List<Device> devices = DeviceMgtAPIUtils.getDeviceManagementService(). List<Device> devices = DeviceMgtAPIUtils.getDeviceManagementService().
getDevicesByNameAndType(name, type, offset, limit); getDevicesByNameAndType(request, false);
// setting up paginated result // setting up paginated result
DeviceList deviceList = new DeviceList(); DeviceList deviceList = new DeviceList();

View File

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

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

View File

@ -114,7 +114,7 @@ public class ApplicationManagerProviderServiceImpl implements ApplicationManagem
for (String user : userNameList) { for (String user : userNameList) {
userName = user; userName = user;
deviceList = DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().getDevicesOfUser deviceList = DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().getDevicesOfUser
(user); (user, false);
for (Device device : deviceList) { for (Device device : deviceList) {
deviceIdentifier = new DeviceIdentifier(); deviceIdentifier = new DeviceIdentifier();
deviceIdentifier.setId(Integer.toString(device.getId())); deviceIdentifier.setId(Integer.toString(device.getId()));
@ -156,7 +156,7 @@ public class ApplicationManagerProviderServiceImpl implements ApplicationManagem
for (String role : userRoleList) { for (String role : userRoleList) {
userRole = role; userRole = role;
deviceList = DeviceManagementDataHolder.getInstance().getDeviceManagementProvider() deviceList = DeviceManagementDataHolder.getInstance().getDeviceManagementProvider()
.getAllDevicesOfRole(userRole); .getAllDevicesOfRole(userRole, false);
for (Device device : deviceList) { for (Device device : deviceList) {
deviceIdentifier = new DeviceIdentifier(); deviceIdentifier = new DeviceIdentifier();
deviceIdentifier.setId(Integer.toString(device.getId())); deviceIdentifier.setId(Integer.toString(device.getId()));

View File

@ -61,7 +61,7 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
public void addDeviceInfo(DeviceIdentifier deviceId, DeviceInfo deviceInfo) throws DeviceDetailsMgtException { public void addDeviceInfo(DeviceIdentifier deviceId, DeviceInfo deviceInfo) throws DeviceDetailsMgtException {
try { try {
Device device = DeviceManagementDataHolder.getInstance(). Device device = DeviceManagementDataHolder.getInstance().
getDeviceManagementProvider().getDevice(deviceId); getDeviceManagementProvider().getDevice(deviceId, false);
DeviceManagementDAOFactory.beginTransaction(); DeviceManagementDAOFactory.beginTransaction();
deviceDAO.updateDevice(device, CarbonContext.getThreadLocalCarbonContext().getTenantId()); deviceDAO.updateDevice(device, CarbonContext.getThreadLocalCarbonContext().getTenantId());
@ -93,7 +93,7 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
Device device; Device device;
try { try {
device = DeviceManagementDataHolder.getInstance(). device = DeviceManagementDataHolder.getInstance().
getDeviceManagementProvider().getDevice(deviceId); getDeviceManagementProvider().getDevice(deviceId, false);
if (device == null) { if (device == null) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("No device is found upon the device identifier '" + deviceId.getId() + log.debug("No device is found upon the device identifier '" + deviceId.getId() +
@ -129,8 +129,8 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
} }
try { try {
List<Integer> deviceIds = new ArrayList<>(); List<Integer> deviceIds = new ArrayList<>();
List<Device> devices = DeviceManagementDataHolder.getInstance(). List<Device> devices = DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().
getDeviceManagementProvider().getAllDevices(); getAllDevices(false);
for (Device device : devices) { for (Device device : devices) {
if (identifierMap.containsKey(device.getDeviceIdentifier()) && if (identifierMap.containsKey(device.getDeviceIdentifier()) &&
device.getType().equals(identifierMap.get(device.getDeviceIdentifier()).getType())) { device.getType().equals(identifierMap.get(device.getDeviceIdentifier()).getType())) {
@ -160,7 +160,7 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
try { try {
Device device = DeviceManagementDataHolder.getInstance(). Device device = DeviceManagementDataHolder.getInstance().
getDeviceManagementProvider().getDevice(deviceLocation.getDeviceIdentifier()); getDeviceManagementProvider().getDevice(deviceLocation.getDeviceIdentifier(), false);
deviceLocation.setDeviceId(device.getId()); deviceLocation.setDeviceId(device.getId());
DeviceManagementDAOFactory.beginTransaction(); DeviceManagementDAOFactory.beginTransaction();
deviceDAO.updateDevice(device, CarbonContext.getThreadLocalCarbonContext().getTenantId()); deviceDAO.updateDevice(device, CarbonContext.getThreadLocalCarbonContext().getTenantId());
@ -203,7 +203,7 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
public DeviceLocation getDeviceLocation(DeviceIdentifier deviceId) throws DeviceDetailsMgtException { public DeviceLocation getDeviceLocation(DeviceIdentifier deviceId) throws DeviceDetailsMgtException {
Device device; Device device;
try { try {
device = DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().getDevice(deviceId); device = DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().getDevice(deviceId, false);
if (device == null) { if (device == null) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("No device is found upon the device identifier '" + deviceId.getId() + log.debug("No device is found upon the device identifier '" + deviceId.getId() +
@ -232,7 +232,7 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
try { try {
List<Device> devices = DeviceManagementDataHolder.getInstance(). List<Device> devices = DeviceManagementDataHolder.getInstance().
getDeviceManagementProvider().getAllDevices(deviceIdentifiers.get(0).getType()); getDeviceManagementProvider().getAllDevices(deviceIdentifiers.get(0).getType(), false);
List<DeviceLocation> deviceLocations = new ArrayList<>(); List<DeviceLocation> deviceLocations = new ArrayList<>();
DeviceManagementDAOFactory.openConnection(); DeviceManagementDAOFactory.openConnection();
for (Device device : devices) { for (Device device : devices) {

View File

@ -54,6 +54,18 @@ public interface DeviceManagementProviderService {
*/ */
List<Device> getAllDevices(String deviceType) throws DeviceManagementException; List<Device> getAllDevices(String deviceType) throws DeviceManagementException;
/**
* Method to retrieve all the devices of a given device type.
*
* @param deviceType Device-type of the required devices
* @param requireDeviceInfo - A boolean indicating whether the device-info (location, app-info etc) is also required
* along with the device data.
* @return List of devices of given device-type.
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* devices.
*/
List<Device> getAllDevices(String deviceType, boolean requireDeviceInfo) throws DeviceManagementException;
/** /**
* Method to retrieve all the devices registered in the system. * Method to retrieve all the devices registered in the system.
* *
@ -63,6 +75,38 @@ public interface DeviceManagementProviderService {
*/ */
List<Device> getAllDevices() throws DeviceManagementException; List<Device> getAllDevices() throws DeviceManagementException;
/**
* Method to retrieve all the devices registered in the system.
*
* @param requireDeviceInfo - A boolean indicating whether the device-info (location, app-info etc) is also required
* along with the device data.
* @return List of registered devices.
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* devices.
*/
List<Device> getAllDevices(boolean requireDeviceInfo) throws DeviceManagementException;
/**
* Method to retrieve all the devices registered in the system.
*
* @param since - Date value where the resource was last modified
* @return List of registered devices.
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* devices.
*/
List<Device> getDevices(Date since) throws DeviceManagementException;
/**
* Method to retrieve all the devices registered in the system.
*
* @param requireDeviceInfo - A boolean indicating whether the device-info (location, app-info etc) is also required
* along with the device data.
* @return List of registered devices.
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* devices.
*/
List<Device> getDevices(Date since, boolean requireDeviceInfo) throws DeviceManagementException;
/** /**
* Method to retrieve all the devices with pagination support. * Method to retrieve all the devices with pagination support.
* *
@ -73,6 +117,18 @@ public interface DeviceManagementProviderService {
*/ */
PaginationResult getDevicesByType(PaginationRequest request) throws DeviceManagementException; PaginationResult getDevicesByType(PaginationRequest request) throws DeviceManagementException;
/**
* Method to retrieve all the devices with pagination support.
*
* @param request PaginationRequest object holding the data for pagination
* @param requireDeviceInfo - A boolean indicating whether the device-info (location, app-info etc) is also required
* along with the device data.
* @return PaginationResult - Result including the required parameters necessary to do pagination.
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* devices.
*/
PaginationResult getDevicesByType(PaginationRequest request, boolean requireDeviceInfo) throws DeviceManagementException;
/** /**
* Method to retrieve all the devices with pagination support. * Method to retrieve all the devices with pagination support.
* *
@ -83,21 +139,91 @@ public interface DeviceManagementProviderService {
*/ */
PaginationResult getAllDevices(PaginationRequest request) throws DeviceManagementException; PaginationResult getAllDevices(PaginationRequest request) throws DeviceManagementException;
void sendEnrolmentInvitation(String templateName, EmailMetaInfo metaInfo) throws DeviceManagementException; /**
* Method to retrieve all the devices with pagination support.
void sendRegistrationEmail(EmailMetaInfo metaInfo) throws DeviceManagementException; *
* @param request PaginationRequest object holding the data for pagination
FeatureManager getFeatureManager(String deviceType) throws DeviceManagementException; * @param requireDeviceInfo - A boolean indicating whether the device-info (location, app-info etc) is also required
* along with the device data.
* @return PaginationResult - Result including the required parameters necessary to do pagination.
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* devices.
*/
PaginationResult getAllDevices(PaginationRequest request, boolean requireDeviceInfo) throws DeviceManagementException;
/** /**
* Proxy method to get the tenant configuration of a given platform. * Returns the device of specified id.
* *
* @param deviceType Device platform * @param deviceId device Id
* @return Tenant configuration settings of the particular tenant and platform. * @return Device returns null when device is not available.
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the * @throws DeviceManagementException
* configuration.
*/ */
PlatformConfiguration getConfiguration(String deviceType) throws DeviceManagementException; Device getDevice(DeviceIdentifier deviceId) throws DeviceManagementException;
/**
* Returns the device of specified id.
*
* @param deviceId device Id
* @return Device returns null when device is not available.
* @throws DeviceManagementException
*/
Device getDeviceWithTypeProperties(DeviceIdentifier deviceId) throws DeviceManagementException;
/**
* Returns the device of specified id.
*
* @param deviceId device Id
* @param requireDeviceInfo - A boolean indicating whether the device-info (location, app-info etc) is also required
* along with the device data.
* @return Device returns null when device is not available.
* @throws DeviceManagementException
*/
Device getDevice(DeviceIdentifier deviceId, boolean requireDeviceInfo) throws DeviceManagementException;
/**
* Returns the device of specified id.
*
* @param deviceId device Id
* @param since - Date value where the resource was last modified
* @return Device returns null when device is not available.
* @throws DeviceManagementException
*/
Device getDevice(DeviceIdentifier deviceId, Date since) throws DeviceManagementException;
/**
* Returns the device of specified id.
*
* @param deviceId device Id
* @param since - Date value where the resource was last modified
* @param requireDeviceInfo - A boolean indicating whether the device-info (location, app-info etc) is also required
* along with the device data.
* @return Device returns null when device is not available.
* @throws DeviceManagementException
*/
Device getDevice(DeviceIdentifier deviceId, Date since, boolean requireDeviceInfo) throws DeviceManagementException;
/**
* Returns the device of specified id with the given status.
*
* @param deviceId device Id
* @param status - Status of the device
*
* @return Device returns null when device is not available.
* @throws DeviceManagementException
*/
Device getDevice(DeviceIdentifier deviceId, EnrolmentInfo.Status status) throws DeviceManagementException;
/**
* Returns the device of specified id with the given status.
*
* @param deviceId device Id
* @param status - Status of the device
* @param requireDeviceInfo - A boolean indicating whether the device-info (location, app-info etc) is also required
* along with the device data.
* @return Device returns null when device is not available.
* @throws DeviceManagementException
*/
Device getDevice(DeviceIdentifier deviceId, EnrolmentInfo.Status status, boolean requireDeviceInfo) throws DeviceManagementException;
/** /**
* Method to get the list of devices owned by an user with paging information. * Method to get the list of devices owned by an user with paging information.
@ -109,6 +235,18 @@ public interface DeviceManagementProviderService {
*/ */
PaginationResult getDevicesOfUser(PaginationRequest request) throws DeviceManagementException; PaginationResult getDevicesOfUser(PaginationRequest request) throws DeviceManagementException;
/**
* Method to get the list of devices owned by an user with paging information.
*
* @param request PaginationRequest object holding the data for pagination
* @param requireDeviceInfo - A boolean indicating whether the device-info (location, app-info etc) is also required
* along with the device data.
* @return List of devices owned by a particular user along with the required parameters necessary to do pagination.
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* device list
*/
PaginationResult getDevicesOfUser(PaginationRequest request, boolean requireDeviceInfo) throws DeviceManagementException;
/** /**
* Method to get the list of devices filtered by the ownership with paging information. * Method to get the list of devices filtered by the ownership with paging information.
* *
@ -119,6 +257,18 @@ public interface DeviceManagementProviderService {
*/ */
PaginationResult getDevicesByOwnership(PaginationRequest request) throws DeviceManagementException; PaginationResult getDevicesByOwnership(PaginationRequest request) throws DeviceManagementException;
/**
* Method to get the list of devices filtered by the ownership with paging information.
*
* @param request PaginationRequest object holding the data for pagination
* @param requireDeviceInfo - A boolean indicating whether the device-info (location, app-info etc) is also required
* along with the device data.
* @return List of devices owned by a particular user along with the required parameters necessary to do pagination.
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* device list
*/
PaginationResult getDevicesByOwnership(PaginationRequest request, boolean requireDeviceInfo) throws DeviceManagementException;
/** /**
* Method to get the list of devices owned by an user. * Method to get the list of devices owned by an user.
* *
@ -129,16 +279,42 @@ public interface DeviceManagementProviderService {
*/ */
List<Device> getDevicesOfUser(String userName) throws DeviceManagementException; List<Device> getDevicesOfUser(String userName) throws DeviceManagementException;
/**
* Method to get the list of devices owned by an user.
*
* @param userName Username of the user
* @param requireDeviceInfo - A boolean indicating whether the device-info (location, app-info etc) is also required
* along with the device data.
* @return List of devices owned by a particular user
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* device list
*/
List<Device> getDevicesOfUser(String userName, boolean requireDeviceInfo) throws DeviceManagementException;
/** /**
* This method returns the list of device owned by a user of given device type. * This method returns the list of device owned by a user of given device type.
* *
* @param userName user name. * @param userName user name.
* @param deviceType device type name * @param deviceType device type name
* @return * @return List of device owned by the given user and type.
* @throws DeviceManagementException * @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* device list
*/ */
List<Device> getDevicesOfUser(String userName, String deviceType) throws DeviceManagementException; List<Device> getDevicesOfUser(String userName, String deviceType) throws DeviceManagementException;
/**
* This method returns the list of device owned by a user of given device type.
*
* @param userName user name.
* @param deviceType device type name
* @param requireDeviceInfo - A boolean indicating whether the device-info (location, app-info etc) is also required
* along with the device data.
* @return List of device owned by the given user and type.
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* device list
*/
List<Device> getDevicesOfUser(String userName, String deviceType, boolean requireDeviceInfo) throws DeviceManagementException;
/** /**
* Method to get the list of devices owned by users of a particular user-role. * Method to get the list of devices owned by users of a particular user-role.
* *
@ -149,6 +325,94 @@ public interface DeviceManagementProviderService {
*/ */
List<Device> getAllDevicesOfRole(String roleName) throws DeviceManagementException; List<Device> getAllDevicesOfRole(String roleName) throws DeviceManagementException;
/**
* Method to get the list of devices owned by users of a particular user-role.
*
* @param roleName Role name of the users
* @param requireDeviceInfo - A boolean indicating whether the device-info (location, app-info etc) is also required
* along with the device data.
* @return List of devices owned by users of a particular role
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* device list
*/
List<Device> getAllDevicesOfRole(String roleName, boolean requireDeviceInfo) throws DeviceManagementException;
/**
* This method is used to retrieve list of devices based on the device status with paging information.
*
* @param request PaginationRequest object holding the data for pagination and filter info
* @return List of devices in given status along with the required parameters necessary to do pagination.
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* device list
*/
PaginationResult getDevicesByStatus(PaginationRequest request) throws DeviceManagementException;
/**
* This method is used to retrieve list of devices based on the device status with paging information.
*
* @param request PaginationRequest object holding the data for pagination and filter info
* @param requireDeviceInfo - A boolean indicating whether the device-info (location, app-info etc) is also required
* along with the device data.
* @return List of devices in given status along with the required parameters necessary to do pagination.
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* device list
*/
PaginationResult getDevicesByStatus(PaginationRequest request, boolean requireDeviceInfo) throws DeviceManagementException;
/**
* Method to get the list of devices that matches with the given device name.
*
* @param request PaginationRequest object holding the data for pagination and filter info
* @param requireDeviceInfo - A boolean indicating whether the device-info (location, app-info etc) is also required
* along with the device data.
* @return List of devices that matches with the given device name.
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* device list
*/
List<Device> getDevicesByNameAndType(PaginationRequest request, boolean requireDeviceInfo) throws DeviceManagementException;
/**
* This method is used to retrieve list of devices that matches with the given device name with paging information.
*
* @param request PaginationRequest object holding the data for pagination
* @return List of devices in given status along with the required parameters necessary to do pagination.
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* device list
*/
PaginationResult getDevicesByName(PaginationRequest request) throws DeviceManagementException;
/**
* This method is used to retrieve list of devices that matches with the given device name with paging information.
*
* @param request PaginationRequest object holding the data for pagination
* @param requireDeviceInfo - A boolean indicating whether the device-info (location, app-info etc) is also required
* along with the device data.
* @return List of devices in given status along with the required parameters necessary to do pagination.
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* device list
*/
PaginationResult getDevicesByName(PaginationRequest request, boolean requireDeviceInfo) throws DeviceManagementException;
/**
* This method is used to retrieve list of devices based on the device status.
*
* @param status Device status
* @return List of devices
* @throws DeviceManagementException
*/
List<Device> getDevicesByStatus(EnrolmentInfo.Status status) throws DeviceManagementException;
/**
* This method is used to retrieve list of devices based on the device status.
*
* @param status Device status
* @param requireDeviceInfo - A boolean indicating whether the device-info (location, app-info etc) is also required
* along with the device data.
* @return List of devices
* @throws DeviceManagementException
*/
List<Device> getDevicesByStatus(EnrolmentInfo.Status status, boolean requireDeviceInfo) throws DeviceManagementException;
/** /**
* Method to get the device count of user. * Method to get the device count of user.
* *
@ -167,47 +431,26 @@ public interface DeviceManagementProviderService {
*/ */
int getDeviceCount() throws DeviceManagementException; int getDeviceCount() throws DeviceManagementException;
/** HashMap<Integer, Device> getTenantedDevice(DeviceIdentifier deviceIdentifier) throws DeviceManagementException;
* Method to get the list of devices that matches with the given device name.
* void sendEnrolmentInvitation(String templateName, EmailMetaInfo metaInfo) throws DeviceManagementException;
* @param deviceName name of the device
* @return List of devices that matches with the given device name. void sendRegistrationEmail(EmailMetaInfo metaInfo) throws DeviceManagementException;
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* device list FeatureManager getFeatureManager(String deviceType) throws DeviceManagementException;
*/
List<Device> getDevicesByNameAndType(String deviceName, String type, int offset, int limit) throws DeviceManagementException;
/** /**
* This method is used to retrieve list of devices that matches with the given device name with paging information. * Proxy method to get the tenant configuration of a given platform.
* *
* @param request PaginationRequest object holding the data for pagination * @param deviceType Device platform
* @return List of devices in given status along with the required parameters necessary to do pagination. * @return Tenant configuration settings of the particular tenant and platform.
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the * @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* device list * configuration.
*/ */
PaginationResult getDevicesByName(PaginationRequest request) throws DeviceManagementException; PlatformConfiguration getConfiguration(String deviceType) throws DeviceManagementException;
void updateDeviceEnrolmentInfo(Device device, EnrolmentInfo.Status active) throws DeviceManagementException; void updateDeviceEnrolmentInfo(Device device, EnrolmentInfo.Status active) throws DeviceManagementException;
/**
* This method is used to retrieve list of devices based on the device status.
*
* @param status Device status
* @return List of devices
* @throws DeviceManagementException
*/
List<Device> getDevicesByStatus(EnrolmentInfo.Status status) throws DeviceManagementException;
/**
* This method is used to retrieve list of devices based on the device status with paging information.
*
* @param request PaginationRequest object holding the data for pagination
* @return List of devices in given status along with the required parameters necessary to do pagination.
* @throws DeviceManagementException If some unusual behaviour is observed while fetching the
* device list
*/
PaginationResult getDevicesByStatus(PaginationRequest request) throws DeviceManagementException;
/** /**
* This method is used to check whether the device is enrolled with the give user. * This method is used to check whether the device is enrolled with the give user.
* *
@ -247,21 +490,6 @@ public interface DeviceManagementProviderService {
boolean setActive(DeviceIdentifier deviceId, boolean status) throws DeviceManagementException; boolean setActive(DeviceIdentifier deviceId, boolean status) throws DeviceManagementException;
/**
* Returns the device of specified id.
*
* @param deviceId device Id
* @return Device returns null when device is not avaialble.
* @throws DeviceManagementException
*/
Device getDevice(DeviceIdentifier deviceId) throws DeviceManagementException;
Device getDevice(DeviceIdentifier deviceId, Date since) throws DeviceManagementException;
HashMap<Integer, Device> getTenantedDevice(DeviceIdentifier deviceIdentifier) throws DeviceManagementException;
Device getDevice(DeviceIdentifier deviceId, EnrolmentInfo.Status status) throws DeviceManagementException;
List<String> getAvailableDeviceTypes() throws DeviceManagementException; List<String> getAvailableDeviceTypes() throws DeviceManagementException;
boolean updateDeviceInfo(DeviceIdentifier deviceIdentifier, Device device) throws DeviceManagementException; boolean updateDeviceInfo(DeviceIdentifier deviceIdentifier, Device device) throws DeviceManagementException;

View File

@ -472,7 +472,8 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
GroupManagementDAOFactory.beginTransaction(); GroupManagementDAOFactory.beginTransaction();
for (DeviceIdentifier deviceIdentifier : deviceIdentifiers) { for (DeviceIdentifier deviceIdentifier : deviceIdentifiers) {
device = DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().getDevice(deviceIdentifier); device = DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().
getDevice(deviceIdentifier, false);
if (device == null) { if (device == null) {
throw new DeviceNotFoundException("Device not found for id '" + deviceIdentifier.getId() + "'"); throw new DeviceNotFoundException("Device not found for id '" + deviceIdentifier.getId() + "'");
} }
@ -504,7 +505,8 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
GroupManagementDAOFactory.beginTransaction(); GroupManagementDAOFactory.beginTransaction();
for (DeviceIdentifier deviceIdentifier : deviceIdentifiers) { for (DeviceIdentifier deviceIdentifier : deviceIdentifiers) {
device = DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().getDevice(deviceIdentifier); device = DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().
getDevice(deviceIdentifier, false);
if (device == null) { if (device == null) {
throw new DeviceNotFoundException("Device not found for id '" + deviceIdentifier.getId() + "'"); throw new DeviceNotFoundException("Device not found for id '" + deviceIdentifier.getId() + "'");
} }
@ -553,7 +555,7 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
public List<DeviceGroup> getGroups(DeviceIdentifier deviceIdentifier) throws GroupManagementException { public List<DeviceGroup> getGroups(DeviceIdentifier deviceIdentifier) throws GroupManagementException {
DeviceManagementProviderService managementProviderService = new DeviceManagementProviderServiceImpl(); DeviceManagementProviderService managementProviderService = new DeviceManagementProviderServiceImpl();
try { try {
Device device = managementProviderService.getDevice(deviceIdentifier); Device device = managementProviderService.getDevice(deviceIdentifier, false);
GroupManagementDAOFactory.openConnection(); GroupManagementDAOFactory.openConnection();
return groupDAO.getGroups(device.getId(), return groupDAO.getGroups(device.getId(),
PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId()); PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());

View File

@ -90,7 +90,7 @@ public class DeviceTaskManagerImpl implements DeviceTaskManager {
List<String> operations; List<String> operations;
operations = this.getValidOperationNames(); //list operations for each device type operations = this.getValidOperationNames(); //list operations for each device type
devices = deviceManagementProviderService.getAllDevices(deviceType);//list devices for each type devices = deviceManagementProviderService.getAllDevices(deviceType, false);//list devices for each type
if (!devices.isEmpty()) { if (!devices.isEmpty()) {
for (String str : operations) { for (String str : operations) {
CommandOperation operation = new CommandOperation(); CommandOperation operation = new CommandOperation();

View File

@ -444,7 +444,8 @@ public final class DeviceManagerUtil {
} }
public static boolean isValidDeviceIdentifier(DeviceIdentifier deviceIdentifier) throws DeviceManagementException { public static boolean isValidDeviceIdentifier(DeviceIdentifier deviceIdentifier) throws DeviceManagementException {
Device device = DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().getDevice(deviceIdentifier); Device device = DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().getDevice(deviceIdentifier,
false);
if (device == null || device.getDeviceIdentifier() == null || if (device == null || device.getDeviceIdentifier() == null ||
device.getDeviceIdentifier().isEmpty() || device.getEnrolmentInfo() == null) { device.getDeviceIdentifier().isEmpty() || device.getEnrolmentInfo() == null) {
return false; return false;

View File

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

View File

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

View File

@ -519,8 +519,8 @@
{{/zone}} {{/zone}}
{{#zone "bottomJs"}} {{#zone "bottomJs"}}
<script id="device-listing" data-analitics-url="{{analyticsURL}}" data-current-user="{{@user.username}}" data-device-types="{{deviceTypes}}" <script id="device-listing" data-server-url="{{serverUrl}}" data-current-user="{{@user.username}}" data-device-types="{{deviceTypes}}"
type="text/x-handlebars-template"></script> data-portal-url="{{portalUrl}}" data-user-domain="{{userDomain}}" type="text/x-handlebars-template"></script>
{{js "js/listing.js"}} {{js "js/listing.js"}}
{{/zone}} {{/zone}}

View File

@ -60,6 +60,8 @@ function onRequest(context) {
if (data) { if (data) {
for (var i = 0; i < data.length; i++) { for (var i = 0; i < data.length; i++) {
var config = utility.getDeviceTypeConfig(data[i]); var config = utility.getDeviceTypeConfig(data[i]);
var log = new Log("devices.js");
if (!config) { if (!config) {
continue; continue;
} }
@ -70,7 +72,8 @@ function onRequest(context) {
"label": deviceType.label, "label": deviceType.label,
"thumb": utility.getDeviceThumb(data[i]), "thumb": utility.getDeviceThumb(data[i]),
"analyticsEnabled": deviceType.analyticsEnabled, "analyticsEnabled": deviceType.analyticsEnabled,
"groupingEnabled": deviceType.groupingEnabled "groupingEnabled": deviceType.groupingEnabled,
"analyticsView" : deviceType.analyticsView
}); });
} }
} }
@ -80,9 +83,11 @@ function onRequest(context) {
} }
var mdmProps = require("/app/modules/conf-reader/main.js")["conf"]; var mdmProps = require("/app/modules/conf-reader/main.js")["conf"];
var analyticsServer = mdmProps["dashboardServerURL"]; var serverUrl = mdmProps["httpsURL"];
var analyticsURL = analyticsServer + "/portal/t/" + context.user.userDomain + "/dashboards/android-iot/battery?owner=" + context.user.username + "&deviceId="; var portalUrl = mdmProps["portalURL"];
viewModel.analyticsURL = analyticsURL; var userDomain = context.user.domain;
viewModel.serverUrl = serverUrl;
viewModel.portalUrl = portalUrl;
viewModel.userDomain = userDomain;
return viewModel; return viewModel;
} }

View File

@ -224,6 +224,22 @@ function loadDevices(searchType, searchParam) {
return true; return true;
} }
// Read "analyticsView" from config.json and return value if exists
function getAnalyticsView(type) {
var deviceTypes = deviceListing.data("deviceTypes");
for (var i = 0; i < deviceTypes.length; i++) {
if (deviceTypes[i].type == type) {
var analyticsView = deviceTypes[i].analyticsView;
if (analyticsEnabled == undefined) {
// if undefined go to default analytics view
return "none";
}
return analyticsView;
}
}
return "none";
}
function groupingEnabled(type) { function groupingEnabled(type) {
var deviceTypes = deviceListing.data("deviceTypes"); var deviceTypes = deviceListing.data("deviceTypes");
for (var i = 0; i < deviceTypes.length; i++) { for (var i = 0; i < deviceTypes.length; i++) {
@ -323,12 +339,20 @@ function loadDevices(searchType, searchParam) {
var deviceType = row.deviceType; var deviceType = row.deviceType;
var deviceIdentifier = row.deviceIdentifier; var deviceIdentifier = row.deviceIdentifier;
var html = '<span></span>'; var html = '<span></span>';
var statURL = $("#device-listing").data("analitics-url"); var portalUrl = $("#device-listing").data("portal-url");
var serverUrl = $("#device-listing").data("server-url");
var userDomain = $("#device-listing").data("userDomain");
var statURL;
if (status != 'REMOVED') { if (status != 'REMOVED') {
html = ''; html = '';
if (analyticsEnabled(row.deviceType)) { if (analyticsEnabled(row.deviceType)) {
// redirecting to respective analytics view depending on device configs
switch (getAnalyticsView(deviceType)) {
case "DAS" : { statURL =portalUrl + "/portal/t/"+ userDomain+ "/dashboards/android-iot/battery?owner=" +currentUser+"&deviceId=";break;}
default : {statURL=context+ "/device/" + row.deviceType +"/analytics?deviceId="}
}
html += '<a href="' + statURL + html += '<a href="' + statURL +
deviceIdentifier + '&deviceName=' + row.name + '" ' + 'data-click-event="remove-form"' + deviceIdentifier + '&deviceName=' + row.name + '" ' + 'data-click-event="remove-form"' +

View File

@ -23,7 +23,7 @@
<parent> <parent>
<artifactId>device-mgt</artifactId> <artifactId>device-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>email-sender</artifactId> <artifactId>email-sender</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>dynamic-client-registration</artifactId> <artifactId>dynamic-client-registration</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>dynamic-client-registration</artifactId> <artifactId>dynamic-client-registration</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -21,13 +21,13 @@
<parent> <parent>
<artifactId>dynamic-client-registration</artifactId> <artifactId>dynamic-client-registration</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.dynamic.client.registration</artifactId> <artifactId>org.wso2.carbon.dynamic.client.registration</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Dynamic client registration service</name> <name>WSO2 Carbon - Dynamic client registration service</name>
<description>WSO2 Carbon - Dynamic Client Registration Service</description> <description>WSO2 Carbon - Dynamic Client Registration Service</description>

View File

@ -21,13 +21,13 @@
<parent> <parent>
<artifactId>dynamic-client-registration</artifactId> <artifactId>dynamic-client-registration</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.dynamic.client.web.app.registration</artifactId> <artifactId>org.wso2.carbon.dynamic.client.web.app.registration</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Dynamic client web app registration</name> <name>WSO2 Carbon - Dynamic client web app registration</name>
<description>WSO2 Carbon - Dynamic Client Web-app Registration Service</description> <description>WSO2 Carbon - Dynamic Client Web-app Registration Service</description>

View File

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>identity-extensions</artifactId> <artifactId>identity-extensions</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>dynamic-client-registration</artifactId> <artifactId>dynamic-client-registration</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Dynamic client registration</name> <name>WSO2 Carbon - Dynamic client registration</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

View File

@ -22,18 +22,22 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>identity-extensions</artifactId> <artifactId>identity-extensions</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.oauth.extensions</artifactId> <artifactId>org.wso2.carbon.device.mgt.oauth.extensions</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - OAuth Extensions</name> <name>WSO2 Carbon - OAuth Extensions</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<dependencies> <dependencies>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.identity.authenticator.backend.oauth</artifactId>
</dependency>
<dependency> <dependency>
<groupId>commons-codec.wso2</groupId> <groupId>commons-codec.wso2</groupId>
<artifactId>commons-codec</artifactId> <artifactId>commons-codec</artifactId>
@ -87,13 +91,18 @@
org.wso2.carbon.device.mgt.oauth.extensions.* org.wso2.carbon.device.mgt.oauth.extensions.*
</Export-Package> </Export-Package>
<Import-Package> <Import-Package>
org.wso2.carbon.identity.authenticator.backend.oauth.*,
org.wso2.carbon.identity.oauth2.grant.jwt;version="${carbon.identity.jwt.grant.version.range}", org.wso2.carbon.identity.oauth2.grant.jwt;version="${carbon.identity.jwt.grant.version.range}",
org.apache.commons.lang,
org.apache.commons.logging, org.apache.commons.logging,
org.osgi.service.component, org.osgi.service.component,
org.wso2.carbon.identity.application.common.model;version="${carbon.identity.framework.version.range}", org.wso2.carbon.identity.application.common.model;version="${carbon.identity.framework.version.range}",
org.wso2.carbon.identity.application.common;version="${carbon.identity.framework.version.range}",
org.wso2.carbon.identity.application.mgt.*;version="${carbon.identity.framework.version.range}",
org.wso2.carbon.user.api, org.wso2.carbon.user.api,
org.wso2.carbon.user.core.service, org.wso2.carbon.user.core.service,
org.wso2.carbon.user.core.tenant, org.wso2.carbon.user.core.tenant,
org.wso2.carbon.user.core.util,
org.json.simple, org.json.simple,
javax.cache, javax.cache,
org.wso2.carbon.identity.core.util;version="${carbon.identity.framework.version.range}", org.wso2.carbon.identity.core.util;version="${carbon.identity.framework.version.range}",
@ -105,7 +114,8 @@
org.wso2.carbon.identity.application.authentication.framework.model;version="${carbon.identity.framework.version.range}", org.wso2.carbon.identity.application.authentication.framework.model;version="${carbon.identity.framework.version.range}",
org.wso2.carbon.identity.base;version="${carbon.identity.framework.version.range}", org.wso2.carbon.identity.base;version="${carbon.identity.framework.version.range}",
org.wso2.carbon.identity.oauth2.*;version="${carbon.identity.framework.version.range}", org.wso2.carbon.identity.oauth2.*;version="${carbon.identity.framework.version.range}",
org.wso2.carbon.utils.multitenancy org.wso2.carbon.utils.multitenancy,
org.apache.oltu.oauth2.common.validators
</Import-Package> </Import-Package>
</instructions> </instructions>
</configuration> </configuration>

View File

@ -0,0 +1,140 @@
/*
* Copyright (c) 2017, 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.
*/
package org.wso2.carbon.device.mgt.oauth.extensions.handlers.grant;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.apimgt.keymgt.ScopesIssuer;
import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser;
import org.wso2.carbon.identity.application.common.IdentityApplicationManagementException;
import org.wso2.carbon.identity.application.common.model.ServiceProvider;
import org.wso2.carbon.identity.authenticator.backend.oauth.validator.OAuth2TokenValidator;
import org.wso2.carbon.identity.authenticator.backend.oauth.validator.OAuthValidationResponse;
import org.wso2.carbon.identity.authenticator.backend.oauth.validator.OAuthValidatorFactory;
import org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception;
import org.wso2.carbon.identity.oauth2.dto.OAuth2AccessTokenReqDTO;
import org.wso2.carbon.identity.oauth2.internal.OAuth2ServiceComponentHolder;
import org.wso2.carbon.identity.oauth2.model.RequestParameter;
import org.wso2.carbon.identity.oauth2.token.OAuthTokenReqMessageContext;
import org.wso2.carbon.identity.oauth2.token.handlers.grant.AbstractAuthorizationGrantHandler;
import org.wso2.carbon.identity.oauth2.util.OAuth2Util;
import org.wso2.carbon.user.core.util.UserCoreUtil;
import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
import java.rmi.RemoteException;
/**
* This allows user to generate a new access token using an existing access token.
*/
@SuppressWarnings("unused")
public class AccessTokenGrantHandler extends AbstractAuthorizationGrantHandler {
private static Log log = LogFactory.getLog(AccessTokenGrantHandler.class);
private static final String TENANT_DOMAIN_KEY = "tenantDomain";
private OAuth2TokenValidator tokenValidator;
public static final String TOKEN_GRANT_PARAM = "admin_access_token";
public AccessTokenGrantHandler() {
try {
tokenValidator = OAuthValidatorFactory.getValidator();
} catch (IllegalArgumentException e) {
log.error("Failed to initialise Authenticator", e);
}
}
@Override
public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx) {
return ScopesIssuer.getInstance().setScopes(tokReqMsgCtx);
}
@Override
public boolean validateGrant(OAuthTokenReqMessageContext tokReqMsgCtx) throws IdentityOAuth2Exception {
if (!super.validateGrant(tokReqMsgCtx)) {
return false;
} else {
OAuth2AccessTokenReqDTO oAuth2AccessTokenReqDTO = tokReqMsgCtx.getOauth2AccessTokenReqDTO();
String username = null;
String userTenantDomain = null;
String clientId = oAuth2AccessTokenReqDTO.getClientId();
String spTenantDomain = null;
OAuthValidationResponse response;
ServiceProvider serviceProvider;
boolean authStatus = false;
String accessToken = null;
RequestParameter[] parameters = tokReqMsgCtx.getOauth2AccessTokenReqDTO().getRequestParameters();
for (RequestParameter parameter : parameters) {
if (TOKEN_GRANT_PARAM.equals(parameter.getKey())) {
if (parameter.getValue() != null && parameter.getValue().length > 0) {
accessToken = parameter.getValue()[0];
}
}
}
if (accessToken != null && !accessToken.isEmpty()) {
try {
response = tokenValidator.validateToken(accessToken);
} catch (RemoteException e) {
log.error("Failed to validate the OAuth token provided.", e);
return false;
}
if (response != null && response.isValid()) {
authStatus = true;
username = response.getUserName();
userTenantDomain = MultitenantUtils.getTenantDomain(username);
spTenantDomain = response.getTenantDomain();
}
}
try {
serviceProvider = OAuth2ServiceComponentHolder.getApplicationMgtService()
.getServiceProviderByClientId(clientId, "oauth2", spTenantDomain);
} catch (IdentityApplicationManagementException var15) {
throw new IdentityOAuth2Exception("Error occurred while retrieving OAuth2 application data for client id "
+ clientId, var15);
}
if (!serviceProvider.isSaasApp() && !userTenantDomain.equals(spTenantDomain)) {
if (log.isDebugEnabled()) {
log.debug("Non-SaaS service provider tenant domain is not same as user tenant domain; "
+ spTenantDomain + " != " + userTenantDomain);
}
return false;
} else {
String tenantAwareUserName = MultitenantUtils.getTenantAwareUsername(username);
username = tenantAwareUserName + "@" + userTenantDomain;
if (authStatus) {
if (!username.contains("/") && StringUtils.isNotBlank(UserCoreUtil.getDomainFromThreadLocal())) {
username = UserCoreUtil.getDomainFromThreadLocal() + "/" + username;
}
AuthenticatedUser user = OAuth2Util.getUserFromUserName(username);
user.setAuthenticatedSubjectIdentifier(user.toString());
tokReqMsgCtx.setAuthorizedUser(user);
tokReqMsgCtx.setScope(oAuth2AccessTokenReqDTO.getScope());
return authStatus;
} else {
throw new IdentityOAuth2Exception("Authentication failed for " + username);
}
}
}
}
}

View File

@ -0,0 +1,33 @@
/*
* Copyright (c) 2017, 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.
*/
package org.wso2.carbon.device.mgt.oauth.extensions.validators;
import org.apache.oltu.oauth2.common.validators.AbstractValidator;
import org.wso2.carbon.device.mgt.oauth.extensions.handlers.grant.AccessTokenGrantHandler;
import javax.servlet.http.HttpServletRequest;
@SuppressWarnings("unused")
public class AccessTokenGrantValidator extends AbstractValidator<HttpServletRequest> {
public AccessTokenGrantValidator() {
requiredParams.add(AccessTokenGrantHandler.TOKEN_GRANT_PARAM);
}
}

View File

@ -21,7 +21,7 @@
<parent> <parent>
<artifactId>identity-extensions</artifactId> <artifactId>identity-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>

View File

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>identity-extensions</artifactId> <artifactId>identity-extensions</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
@ -34,10 +34,10 @@
<url>http://wso2.org</url> <url>http://wso2.org</url>
<modules> <modules>
<module>org.wso2.carbon.identity.authenticator.backend.oauth</module>
<module>org.wso2.carbon.device.mgt.oauth.extensions</module> <module>org.wso2.carbon.device.mgt.oauth.extensions</module>
<module>org.wso2.carbon.identity.jwt.client.extension</module> <module>org.wso2.carbon.identity.jwt.client.extension</module>
<module>dynamic-client-registration</module> <module>dynamic-client-registration</module>
<module>org.wso2.carbon.identity.authenticator.backend.oauth</module>
</modules> </modules>
</project> </project>

View File

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.complex.policy.decision.point</artifactId> <artifactId>org.wso2.carbon.complex.policy.decision.point</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Policy Decision Point</name> <name>WSO2 Carbon - Policy Decision Point</name>
<description>WSO2 Carbon - Policy Decision Point</description> <description>WSO2 Carbon - Policy Decision Point</description>

View File

@ -3,14 +3,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.policy.decision.point</artifactId> <artifactId>org.wso2.carbon.policy.decision.point</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Policy Decision Point</name> <name>WSO2 Carbon - Policy Decision Point</name>
<description>WSO2 Carbon - Policy Decision Point</description> <description>WSO2 Carbon - Policy Decision Point</description>

View File

@ -3,7 +3,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
@ -11,7 +11,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.policy.information.point</artifactId> <artifactId>org.wso2.carbon.policy.information.point</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Policy Information Point</name> <name>WSO2 Carbon - Policy Information Point</name>
<description>WSO2 Carbon - Policy Information Point</description> <description>WSO2 Carbon - Policy Information Point</description>

View File

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.policy.mgt.common</artifactId> <artifactId>org.wso2.carbon.policy.mgt.common</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Policy Management Common</name> <name>WSO2 Carbon - Policy Management Common</name>
<description>WSO2 Carbon - Policy Management Common</description> <description>WSO2 Carbon - Policy Management Common</description>

View File

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.policy.mgt.core</artifactId> <artifactId>org.wso2.carbon.policy.mgt.core</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Policy Management Core</name> <name>WSO2 Carbon - Policy Management Core</name>
<description>WSO2 Carbon - Policy Management Core</description> <description>WSO2 Carbon - Policy Management Core</description>

View File

@ -22,7 +22,6 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.core.dto.DeviceType;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
import org.wso2.carbon.ntask.core.Task; import org.wso2.carbon.ntask.core.Task;
import org.wso2.carbon.policy.mgt.common.PolicyManagementException; import org.wso2.carbon.policy.mgt.common.PolicyManagementException;
@ -64,15 +63,15 @@ public class DelegationTask implements Task {
log.debug("Number of device types which policies are changed .......... : " + deviceTypes.size()); log.debug("Number of device types which policies are changed .......... : " + deviceTypes.size());
} }
if (!deviceTypes.isEmpty()) { if (!deviceTypes.isEmpty()) {
DeviceManagementProviderService service = PolicyManagementDataHolder.getInstance() DeviceManagementProviderService service = PolicyManagementDataHolder.getInstance().
.getDeviceManagementService(); getDeviceManagementService();
List<Device> devices; List<Device> devices;
List<Device> toBeNotified; List<Device> toBeNotified;
for (String deviceType : deviceTypes) { for (String deviceType : deviceTypes) {
try { try {
devices = new ArrayList<>(); devices = new ArrayList<>();
toBeNotified = new ArrayList<>(); toBeNotified = new ArrayList<>();
devices.addAll(service.getAllDevices(deviceType)); devices.addAll(service.getAllDevices(deviceType, false));
//HashMap<Integer, Integer> deviceIdPolicy = policyManager.getAppliedPolicyIdsDeviceIds(); //HashMap<Integer, Integer> deviceIdPolicy = policyManager.getAppliedPolicyIdsDeviceIds();
for (Device device : devices) { for (Device device : devices) {
// if (deviceIdPolicy.containsKey(device.getId())) { // if (deviceIdPolicy.containsKey(device.getId())) {

View File

@ -54,7 +54,7 @@ public class ComplianceDecisionPointImpl implements ComplianceDecisionPoint {
try { try {
DeviceManagementProviderService service = this.getDeviceManagementProviderService(); DeviceManagementProviderService service = this.getDeviceManagementProviderService();
for (DeviceIdentifier deviceIdentifier : deviceIdentifiers) { for (DeviceIdentifier deviceIdentifier : deviceIdentifiers) {
Device device = service.getDevice(deviceIdentifier); Device device = service.getDevice(deviceIdentifier, false);
service.setStatus(deviceIdentifier, device.getEnrolmentInfo().getOwner(), service.setStatus(deviceIdentifier, device.getEnrolmentInfo().getOwner(),
EnrolmentInfo.Status.UNREACHABLE); EnrolmentInfo.Status.UNREACHABLE);
} }
@ -71,7 +71,7 @@ public class ComplianceDecisionPointImpl implements ComplianceDecisionPoint {
try { try {
DeviceManagementProviderService service = this.getDeviceManagementProviderService(); DeviceManagementProviderService service = this.getDeviceManagementProviderService();
for (DeviceIdentifier deviceIdentifier : deviceIdentifiers) { for (DeviceIdentifier deviceIdentifier : deviceIdentifiers) {
Device device = service.getDevice(deviceIdentifier); Device device = service.getDevice(deviceIdentifier, false);
service.setStatus(deviceIdentifier, device.getEnrolmentInfo().getOwner(), service.setStatus(deviceIdentifier, device.getEnrolmentInfo().getOwner(),
EnrolmentInfo.Status.INACTIVE); EnrolmentInfo.Status.INACTIVE);
} }
@ -106,7 +106,7 @@ public class ComplianceDecisionPointImpl implements ComplianceDecisionPoint {
try { try {
DeviceManagementProviderService service = this.getDeviceManagementProviderService(); DeviceManagementProviderService service = this.getDeviceManagementProviderService();
Device device = service.getDevice(deviceIdentifier); Device device = service.getDevice(deviceIdentifier, false);
service.setStatus(deviceIdentifier, device.getEnrolmentInfo().getOwner(), service.setStatus(deviceIdentifier, device.getEnrolmentInfo().getOwner(),
EnrolmentInfo.Status.ACTIVE); EnrolmentInfo.Status.ACTIVE);
@ -213,7 +213,7 @@ public class ComplianceDecisionPointImpl implements ComplianceDecisionPoint {
try { try {
DeviceManagementProviderService service = this.getDeviceManagementProviderService(); DeviceManagementProviderService service = this.getDeviceManagementProviderService();
Device device = service.getDevice(deviceIdentifier); Device device = service.getDevice(deviceIdentifier, false);
service.setStatus(deviceIdentifier, device.getEnrolmentInfo().getOwner(), service.setStatus(deviceIdentifier, device.getEnrolmentInfo().getOwner(),
EnrolmentInfo.Status.ACTIVE); EnrolmentInfo.Status.ACTIVE);
@ -231,7 +231,7 @@ public class ComplianceDecisionPointImpl implements ComplianceDecisionPoint {
try { try {
DeviceManagementProviderService service = this.getDeviceManagementProviderService(); DeviceManagementProviderService service = this.getDeviceManagementProviderService();
Device device = service.getDevice(deviceIdentifier); Device device = service.getDevice(deviceIdentifier, false);
service.setStatus(deviceIdentifier, device.getEnrolmentInfo().getOwner(), service.setStatus(deviceIdentifier, device.getEnrolmentInfo().getOwner(),
EnrolmentInfo.Status.INACTIVE); EnrolmentInfo.Status.INACTIVE);
@ -248,7 +248,7 @@ public class ComplianceDecisionPointImpl implements ComplianceDecisionPoint {
try { try {
DeviceManagementProviderService service = this.getDeviceManagementProviderService(); DeviceManagementProviderService service = this.getDeviceManagementProviderService();
Device device = service.getDevice(deviceIdentifier); Device device = service.getDevice(deviceIdentifier, false);
service.setStatus(deviceIdentifier, device.getEnrolmentInfo().getOwner(), service.setStatus(deviceIdentifier, device.getEnrolmentInfo().getOwner(),
EnrolmentInfo.Status.ACTIVE); EnrolmentInfo.Status.ACTIVE);

View File

@ -79,7 +79,7 @@ public class MonitoringManagerImpl implements MonitoringManager {
DeviceManagementProviderService service = DeviceManagementProviderService service =
PolicyManagementDataHolder.getInstance().getDeviceManagementService(); PolicyManagementDataHolder.getInstance().getDeviceManagementService();
PolicyManager manager = PolicyManagementDataHolder.getInstance().getPolicyManager(); PolicyManager manager = PolicyManagementDataHolder.getInstance().getPolicyManager();
Device device = service.getDevice(deviceIdentifier); Device device = service.getDevice(deviceIdentifier, false);
Policy policy = manager.getAppliedPolicyToDevice(deviceIdentifier); Policy policy = manager.getAppliedPolicyToDevice(deviceIdentifier);
if (policy != null) { if (policy != null) {
PolicyMonitoringManager monitoringService = PolicyManagementDataHolder.getInstance(). PolicyMonitoringManager monitoringService = PolicyManagementDataHolder.getInstance().
@ -177,7 +177,7 @@ public class MonitoringManagerImpl implements MonitoringManager {
try { try {
DeviceManagementProviderService service = DeviceManagementProviderService service =
PolicyManagementDataHolder.getInstance().getDeviceManagementService(); PolicyManagementDataHolder.getInstance().getDeviceManagementService();
Device device = service.getDevice(deviceIdentifier); Device device = service.getDevice(deviceIdentifier, false);
PolicyManagementDAOFactory.openConnection(); PolicyManagementDAOFactory.openConnection();
NonComplianceData complianceData = monitoringDAO.getCompliance(device.getId(), device.getEnrolmentInfo() NonComplianceData complianceData = monitoringDAO.getCompliance(device.getId(), device.getEnrolmentInfo()
.getId()); .getId());
@ -207,7 +207,7 @@ public class MonitoringManagerImpl implements MonitoringManager {
PolicyManagementDAOFactory.openConnection(); PolicyManagementDAOFactory.openConnection();
DeviceManagementProviderService service = DeviceManagementProviderService service =
PolicyManagementDataHolder.getInstance().getDeviceManagementService(); PolicyManagementDataHolder.getInstance().getDeviceManagementService();
Device device = service.getDevice(deviceIdentifier); Device device = service.getDevice(deviceIdentifier, false);
complianceData = monitoringDAO.getCompliance(device.getId(), device.getEnrolmentInfo().getId()); complianceData = monitoringDAO.getCompliance(device.getId(), device.getEnrolmentInfo().getId());
List<ComplianceFeature> complianceFeatures = List<ComplianceFeature> complianceFeatures =
monitoringDAO.getNoneComplianceFeatures(complianceData.getId()); monitoringDAO.getNoneComplianceFeatures(complianceData.getId());

View File

@ -392,7 +392,7 @@ public class PolicyManagerImpl implements PolicyManager {
DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl(); DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl();
for (DeviceIdentifier deviceIdentifier : deviceIdentifierList) { for (DeviceIdentifier deviceIdentifier : deviceIdentifierList) {
try { try {
Device device = service.getDevice(deviceIdentifier); Device device = service.getDevice(deviceIdentifier, false);
deviceList.add(device); deviceList.add(device);
} catch (DeviceManagementException e) { } catch (DeviceManagementException e) {
throw new PolicyManagementException("Error occurred while retrieving device information", e); throw new PolicyManagementException("Error occurred while retrieving device information", e);
@ -641,7 +641,7 @@ public class PolicyManagerImpl implements PolicyManager {
try { try {
DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl(); DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl();
Device device = service.getDevice(deviceIdentifier); Device device = service.getDevice(deviceIdentifier, false);
PolicyManagementDAOFactory.openConnection(); PolicyManagementDAOFactory.openConnection();
policyIdList = policyDAO.getPolicyIdsOfDevice(device); policyIdList = policyDAO.getPolicyIdsOfDevice(device);
@ -807,7 +807,7 @@ public class PolicyManagerImpl implements PolicyManager {
int deviceId = -1; int deviceId = -1;
try { try {
DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl(); DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl();
Device device = service.getDevice(deviceIdentifier); Device device = service.getDevice(deviceIdentifier, false);
deviceId = device.getId(); deviceId = device.getId();
PolicyManagementDAOFactory.beginTransaction(); PolicyManagementDAOFactory.beginTransaction();
@ -879,7 +879,7 @@ public class PolicyManagerImpl implements PolicyManager {
int deviceId = -1; int deviceId = -1;
try { try {
DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl(); DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl();
Device device = service.getDevice(deviceIdentifier); Device device = service.getDevice(deviceIdentifier, false);
deviceId = device.getId(); deviceId = device.getId();
PolicyManagementDAOFactory.beginTransaction(); PolicyManagementDAOFactory.beginTransaction();
@ -909,7 +909,7 @@ public class PolicyManagerImpl implements PolicyManager {
int deviceId = -1; int deviceId = -1;
try { try {
DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl(); DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl();
Device device = service.getDevice(deviceIdentifier); Device device = service.getDevice(deviceIdentifier, false);
deviceId = device.getId(); deviceId = device.getId();
PolicyManagementDAOFactory.beginTransaction(); PolicyManagementDAOFactory.beginTransaction();
@ -937,7 +937,7 @@ public class PolicyManagerImpl implements PolicyManager {
boolean exist; boolean exist;
try { try {
DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl(); DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl();
Device device = service.getDevice(deviceIdentifier); Device device = service.getDevice(deviceIdentifier, false);
PolicyManagementDAOFactory.openConnection(); PolicyManagementDAOFactory.openConnection();
exist = policyDAO.checkPolicyAvailable(device.getId(), device.getEnrolmentInfo().getId()); exist = policyDAO.checkPolicyAvailable(device.getId(), device.getEnrolmentInfo().getId());
} catch (PolicyManagerDAOException e) { } catch (PolicyManagerDAOException e) {
@ -958,7 +958,7 @@ public class PolicyManagerImpl implements PolicyManager {
public boolean setPolicyApplied(DeviceIdentifier deviceIdentifier) throws PolicyManagementException { public boolean setPolicyApplied(DeviceIdentifier deviceIdentifier) throws PolicyManagementException {
try { try {
DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl(); DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl();
Device device = service.getDevice(deviceIdentifier); Device device = service.getDevice(deviceIdentifier, false);
PolicyManagementDAOFactory.openConnection(); PolicyManagementDAOFactory.openConnection();
policyDAO.setPolicyApplied(device.getId(), device.getEnrolmentInfo().getId()); policyDAO.setPolicyApplied(device.getId(), device.getEnrolmentInfo().getId());
@ -996,7 +996,7 @@ public class PolicyManagerImpl implements PolicyManager {
DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl(); DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl();
Device device; Device device;
try { try {
device = service.getDevice(deviceId); device = service.getDevice(deviceId, false);
if (device == null) { if (device == null) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("No device is found upon the device identifier '" + deviceId.getId() + log.debug("No device is found upon the device identifier '" + deviceId.getId() +

View File

@ -24,11 +24,9 @@ import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.EnrolmentInfo; import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
import org.wso2.carbon.device.mgt.common.policy.mgt.PolicyMonitoringManager; import org.wso2.carbon.device.mgt.common.policy.mgt.PolicyMonitoringManager;
import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager; import org.wso2.carbon.device.mgt.common.policy.mgt.monitor.PolicyComplianceException;
import org.wso2.carbon.device.mgt.core.config.policy.PolicyConfiguration;
import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService;
import org.wso2.carbon.ntask.core.Task; import org.wso2.carbon.ntask.core.Task;
import org.wso2.carbon.device.mgt.common.policy.mgt.monitor.PolicyComplianceException;
import org.wso2.carbon.policy.mgt.core.internal.PolicyManagementDataHolder; import org.wso2.carbon.policy.mgt.core.internal.PolicyManagementDataHolder;
import org.wso2.carbon.policy.mgt.core.mgt.MonitoringManager; import org.wso2.carbon.policy.mgt.core.mgt.MonitoringManager;
@ -83,7 +81,7 @@ public class MonitoringTask implements Task {
PolicyMonitoringManager monitoringService = PolicyMonitoringManager monitoringService =
PolicyManagementDataHolder.getInstance().getDeviceManagementService() PolicyManagementDataHolder.getInstance().getDeviceManagementService()
.getPolicyMonitoringManager(deviceType); .getPolicyMonitoringManager(deviceType);
List<Device> devices = deviceManagementProviderService.getAllDevices(deviceType); List<Device> devices = deviceManagementProviderService.getAllDevices(deviceType, false);
if (monitoringService != null && !devices.isEmpty()) { if (monitoringService != null && !devices.isEmpty()) {
List<Device> notifiableDevices = new ArrayList<>(); List<Device> notifiableDevices = new ArrayList<>();
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {

View File

@ -140,7 +140,7 @@ public class MonitoringTestCase extends BasePolicyManagementDAOTest {
MonitoringManager monitoringManager = new MonitoringManagerImpl(); MonitoringManager monitoringManager = new MonitoringManagerImpl();
DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl(); DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl();
List<Device> devices = service.getAllDevices(ANDROID); List<Device> devices = service.getAllDevices(ANDROID, false);
// monitoringManager.addMonitoringOperation(devices); // monitoringManager.addMonitoringOperation(devices);

View File

@ -118,7 +118,7 @@ public class PolicyDAOTestCase extends BasePolicyManagementDAOTest {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug("Printing device taken by calling the service layer with device type."); log.debug("Printing device taken by calling the service layer with device type.");
} }
List<Device> devices3 = service.getAllDevices("android"); List<Device> devices3 = service.getAllDevices("android", false);
log.debug("Device list size ...! " + devices3.size()); log.debug("Device list size ...! " + devices3.size());
for (Device device : devices3) { for (Device device : devices3) {
@ -437,7 +437,7 @@ public class PolicyDAOTestCase extends BasePolicyManagementDAOTest {
PolicyManagerService policyManagerService = new PolicyManagerServiceImpl(); PolicyManagerService policyManagerService = new PolicyManagerServiceImpl();
List<Policy> policies = policyManagerService.getPolicies("android"); List<Policy> policies = policyManagerService.getPolicies("android");
List<Device> devices = service.getAllDevices("android"); List<Device> devices = service.getAllDevices("android", false);
for (Policy policy : policies) { for (Policy policy : policies) {
log.debug("Policy Name : " + policy.getPolicyName()); log.debug("Policy Name : " + policy.getPolicyName());

View File

@ -95,7 +95,7 @@ public class PolicyEvaluationTestCase extends BasePolicyManagementDAOTest {
log.debug("Getting effective policy for device started .........."); log.debug("Getting effective policy for device started ..........");
DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl(); DeviceManagementProviderService service = new DeviceManagementProviderServiceImpl();
List<Device> devices = service.getAllDevices(ANDROID); List<Device> devices = service.getAllDevices(ANDROID, false);
PolicyEvaluationPoint evaluationPoint = PolicyManagementDataHolder.getInstance().getPolicyEvaluationPoint(); PolicyEvaluationPoint evaluationPoint = PolicyManagementDataHolder.getInstance().getPolicyEvaluationPoint();

View File

@ -23,13 +23,13 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>policy-mgt</artifactId> <artifactId>policy-mgt</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Policy Management Component</name> <name>WSO2 Carbon - Policy Management Component</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

View File

@ -21,14 +21,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>webapp-authenticator-framework</artifactId> <artifactId>webapp-authenticator-framework</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.webapp.authenticator.framework</artifactId> <artifactId>org.wso2.carbon.webapp.authenticator.framework</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>bundle</packaging> <packaging>bundle</packaging>
<name>WSO2 Carbon - Web Application Authenticator Framework Bundle</name> <name>WSO2 Carbon - Web Application Authenticator Framework Bundle</name>
<description>WSO2 Carbon - Web Application Authenticator Framework Bundle</description> <description>WSO2 Carbon - Web Application Authenticator Framework Bundle</description>

View File

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>webapp-authenticator-framework</artifactId> <artifactId>webapp-authenticator-framework</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Webapp Authenticator Framework</name> <name>WSO2 Carbon - Webapp Authenticator Framework</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

View File

@ -21,14 +21,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>apimgt-extensions-feature</artifactId> <artifactId>apimgt-extensions-feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.application.extension.feature</artifactId> <artifactId>org.wso2.carbon.apimgt.application.extension.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<name>WSO2 Carbon - API Management Application Extension Feature</name> <name>WSO2 Carbon - API Management Application Extension Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>This feature contains an implementation of a api application registration, which takes care of subscription <description>This feature contains an implementation of a api application registration, which takes care of subscription

View File

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>apimgt-extensions-feature</artifactId> <artifactId>apimgt-extensions-feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.handler.server.feature</artifactId> <artifactId>org.wso2.carbon.apimgt.handler.server.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<name>WSO2 Carbon - Device Management - APIM handler Server Feature</name> <name>WSO2 Carbon - Device Management - APIM handler Server Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>This feature contains the handler for the api authentications <description>This feature contains the handler for the api authentications

View File

@ -19,20 +19,20 @@
<ServerConfiguration> <ServerConfiguration>
<!-- IoT server host name, this is referred from APIM gateway to call to IoT server for certificate validation--> <!-- IoT server host name, this is referred from APIM gateway to call to IoT server for certificate validation-->
<Hostname>https://localhost:9443/</Hostname> <Hostname>https://${iot.core.host}:${iot.core.https.port}/</Hostname>
<!--End point to verify the certificate--> <!--End point to verify the certificate-->
<VerificationEndpoint>https://localhost:9443/api/certificate-mgt/v1.0/admin/certificates/verify/</VerificationEndpoint> <VerificationEndpoint>https://${iot.core.host}:${iot.core.https.port}/api/certificate-mgt/v1.0/admin/certificates/verify/</VerificationEndpoint>
<!--Admin username/password - this is to use for oauth token generation--> <!--Admin username/password - this is to use for oauth token generation-->
<Username>admin</Username> <Username>admin</Username>
<Password>admin</Password> <Password>admin</Password>
<!--Dynamic client registration endpoint--> <!--Dynamic client registration endpoint-->
<DynamicClientRegistrationEndpoint>https://localhost:9443/dynamic-client-web/register</DynamicClientRegistrationEndpoint> <DynamicClientRegistrationEndpoint>https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.11/register</DynamicClientRegistrationEndpoint>
<!--Oauth token endpoint--> <!--Oauth token endpoint-->
<OauthTokenEndpoint>https://localhost:9443/oauth2/token</OauthTokenEndpoint> <OauthTokenEndpoint>https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token</OauthTokenEndpoint>
<APIS> <APIS>
<ContextPath>/services</ContextPath> <ContextPath>/services</ContextPath>

View File

@ -21,13 +21,13 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>apimgt-extensions-feature</artifactId> <artifactId>apimgt-extensions-feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.integration.client.feature</artifactId> <artifactId>org.wso2.carbon.apimgt.integration.client.feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - APIM Integration Client Feature</name> <name>WSO2 Carbon - APIM Integration Client Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

View File

@ -21,14 +21,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>apimgt-extensions-feature</artifactId> <artifactId>apimgt-extensions-feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.webapp.publisher.feature</artifactId> <artifactId>org.wso2.carbon.apimgt.webapp.publisher.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<name>WSO2 Carbon - API Management Webapp Publisher Feature</name> <name>WSO2 Carbon - API Management Webapp Publisher Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>This feature contains an implementation of a Tomcat lifecycle listener, which takes care of publishing <description>This feature contains an implementation of a Tomcat lifecycle listener, which takes care of publishing

View File

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>apimgt-extensions-feature</artifactId> <artifactId>apimgt-extensions-feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - API Management Extensions Feature</name> <name>WSO2 Carbon - API Management Extensions Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

View File

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt-feature</artifactId> <artifactId>certificate-mgt-feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt-feature</artifactId> <artifactId>certificate-mgt-feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>

View File

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt-feature</artifactId> <artifactId>certificate-mgt-feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.certificate.mgt.server.feature</artifactId> <artifactId>org.wso2.carbon.certificate.mgt.server.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<name>WSO2 Carbon - Certificate Management Server Feature</name> <name>WSO2 Carbon - Certificate Management Server Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>This feature contains the core bundles required for back-end Certificate Management functionality <description>This feature contains the core bundles required for back-end Certificate Management functionality

View File

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt-feature</artifactId> <artifactId>certificate-mgt-feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Certificate Management Feature</name> <name>WSO2 Carbon - Certificate Management Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

View File

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-extensions-feature</artifactId> <artifactId>device-mgt-extensions-feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature</artifactId> <artifactId>org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<name>WSO2 Carbon - Device Type Deployer Feature</name> <name>WSO2 Carbon - Device Type Deployer Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>WSO2 Carbon - Device Type Deployer Feature</description> <description>WSO2 Carbon - Device Type Deployer Feature</description>

View File

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-extensions-feature</artifactId> <artifactId>device-mgt-extensions-feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature</artifactId> <artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<name>WSO2 Carbon - FCM Based Push Notification Provider Feature</name> <name>WSO2 Carbon - FCM Based Push Notification Provider Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>WSO2 Carbon - MQTT Based Push Notification Provider Feature</description> <description>WSO2 Carbon - MQTT Based Push Notification Provider Feature</description>

View File

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-extensions-feature</artifactId> <artifactId>device-mgt-extensions-feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature</artifactId> <artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<name>WSO2 Carbon - MQTT Based Push Notification Provider Feature</name> <name>WSO2 Carbon - MQTT Based Push Notification Provider Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>WSO2 Carbon - MQTT Based Push Notification Provider Feature</description> <description>WSO2 Carbon - MQTT Based Push Notification Provider Feature</description>

View File

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-extensions-feature</artifactId> <artifactId>device-mgt-extensions-feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature</artifactId> <artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<name>WSO2 Carbon - XMPP Based Push Notification Provider Feature</name> <name>WSO2 Carbon - XMPP Based Push Notification Provider Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>WSO2 Carbon - XMPP Based Push Notification Provider Feature</description> <description>WSO2 Carbon - XMPP Based Push Notification Provider Feature</description>

View File

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -3,13 +3,13 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-feature</artifactId> <artifactId>device-mgt-feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.analytics.dashboard.feature</artifactId> <artifactId>org.wso2.carbon.device.mgt.analytics.dashboard.feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Device Management Dashboard Analytics Feature</name> <name>WSO2 Carbon - Device Management Dashboard Analytics Feature</name>
<description>WSO2 Carbon - Device Management Dashboard Analytics Feature</description> <description>WSO2 Carbon - Device Management Dashboard Analytics Feature</description>

View File

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-feature</artifactId> <artifactId>device-mgt-feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.analytics.data.publisher.feature</artifactId> <artifactId>org.wso2.carbon.device.mgt.analytics.data.publisher.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<name>WSO2 Carbon - Device Management Server Feature</name> <name>WSO2 Carbon - Device Management Server Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>This feature contains bundles related to device analytics data publisher</description> <description>This feature contains bundles related to device analytics data publisher</description>

View File

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

View File

@ -4,14 +4,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-feature</artifactId> <artifactId>device-mgt-feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.extensions.feature</artifactId> <artifactId>org.wso2.carbon.device.mgt.extensions.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<name>WSO2 Carbon - Device Management Extensions Feature</name> <name>WSO2 Carbon - Device Management Extensions Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>This feature contains common extensions used by key device management functionalities <description>This feature contains common extensions used by key device management functionalities

View File

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

View File

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-feature</artifactId> <artifactId>device-mgt-feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.server.feature</artifactId> <artifactId>org.wso2.carbon.device.mgt.server.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<name>WSO2 Carbon - Device Management Server Feature</name> <name>WSO2 Carbon - Device Management Server Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>This feature contains the core bundles required for Back-end Device Management functionality <description>This feature contains the core bundles required for Back-end Device Management functionality

View File

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

View File

@ -22,7 +22,7 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>

View File

@ -23,14 +23,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>dynamic-client-registration-feature</artifactId> <artifactId>dynamic-client-registration-feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.dynamic.client.registration.server.feature</artifactId> <artifactId>org.wso2.carbon.dynamic.client.registration.server.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<name>WSO2 Carbon - Dynamic Client Registration Server Feature</name> <name>WSO2 Carbon - Dynamic Client Registration Server Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>This feature contains dynamic client registration features</description> <description>This feature contains dynamic client registration features</description>

View File

@ -23,14 +23,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>dynamic-client-registration-feature</artifactId> <artifactId>dynamic-client-registration-feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Dynamic Client Registration Feature</name> <name>WSO2 Carbon - Dynamic Client Registration Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

View File

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>email-sender-feature</artifactId> <artifactId>email-sender-feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.email.sender.feature</artifactId> <artifactId>org.wso2.carbon.email.sender.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<name>WSO2 Carbon - Email Sender Feature</name> <name>WSO2 Carbon - Email Sender Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>This feature contains the core bundles required for email sender related functionality <description>This feature contains the core bundles required for email sender related functionality

View File

@ -22,14 +22,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>email-sender-feature</artifactId> <artifactId>email-sender-feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Email Sender Feature</name> <name>WSO2 Carbon - Email Sender Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

View File

@ -23,14 +23,14 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>jwt-client-feature</artifactId> <artifactId>jwt-client-feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.identity.jwt.client.extension.feature</artifactId> <artifactId>org.wso2.carbon.identity.jwt.client.extension.feature</artifactId>
<packaging>pom</packaging> <packaging>pom</packaging>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<name>WSO2 Carbon - JWT Client Feature</name> <name>WSO2 Carbon - JWT Client Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>
<description>This feature contains jwt client implementation from which we can get a access token using the jwt <description>This feature contains jwt client implementation from which we can get a access token using the jwt

View File

@ -23,13 +23,13 @@
<parent> <parent>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId> <artifactId>carbon-devicemgt</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath> <relativePath>../../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>jwt-client-feature</artifactId> <artifactId>jwt-client-feature</artifactId>
<version>2.0.72-SNAPSHOT</version> <version>2.0.75-SNAPSHOT</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>WSO2 Carbon - Dynamic Client Registration Feature</name> <name>WSO2 Carbon - Dynamic Client Registration Feature</name>
<url>http://wso2.org</url> <url>http://wso2.org</url>

Some files were not shown because too many files have changed in this diff Show More