Merge pull request #1088 from charithag/add-emm-analytics

Add emm analytics
revert-70aa11f8
Geeth 7 years ago committed by GitHub
commit ef15bc77d2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -31,15 +31,15 @@ import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException
import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceManagementConstants.GeoServices; import org.wso2.carbon.device.mgt.common.DeviceManagementConstants.GeoServices;
import org.wso2.carbon.device.mgt.common.DeviceManagementException;
import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException; import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException;
import org.wso2.carbon.device.mgt.common.geo.service.Alert; import org.wso2.carbon.device.mgt.common.geo.service.Alert;
import org.wso2.carbon.device.mgt.common.geo.service.Event; import org.wso2.carbon.device.mgt.common.geo.service.Event;
import org.wso2.carbon.device.mgt.common.geo.service.GeoFence; import org.wso2.carbon.device.mgt.common.geo.service.GeoFence;
import org.wso2.carbon.device.mgt.common.geo.service.GeoLocationProviderService;
import org.wso2.carbon.device.mgt.common.geo.service.GeoLocationBasedServiceException; import org.wso2.carbon.device.mgt.common.geo.service.GeoLocationBasedServiceException;
import org.wso2.carbon.device.mgt.common.geo.service.GeoLocationProviderService;
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroupConstants; import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroupConstants;
import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager; import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil;
import org.wso2.carbon.device.mgt.core.config.DeviceManagementConfig;
import org.wso2.carbon.device.mgt.jaxrs.service.api.GeoLocationBasedService; import org.wso2.carbon.device.mgt.jaxrs.service.api.GeoLocationBasedService;
import org.wso2.carbon.device.mgt.jaxrs.util.Constants; import org.wso2.carbon.device.mgt.jaxrs.util.Constants;
import org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils; import org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils;
@ -76,13 +76,13 @@ public class GeoLocationBasedServiceImpl implements GeoLocationBasedService {
public Response getGeoDeviceStats(@PathParam("deviceId") String deviceId, public Response getGeoDeviceStats(@PathParam("deviceId") String deviceId,
@PathParam("deviceType") String deviceType, @PathParam("deviceType") String deviceType,
@QueryParam("from") long from, @QueryParam("to") long to) { @QueryParam("from") long from, @QueryParam("to") long to) {
//First, check whether the Geo Location service has been enabled in the cdmf-config.xml file try {
DeviceManagementConfig deviceManagementConfig = DeviceConfigurationManager.getInstance() if (!DeviceManagerUtil.isPublishOperationResponseEnabled()) {
.getDeviceManagementConfig(); return Response.status(Response.Status.BAD_REQUEST.getStatusCode())
if (deviceManagementConfig != null) { .entity("Unable to retrive Geo Device stats. Geo Data publishing does not enabled.").build();
if(!deviceManagementConfig.getGeoLocationConfiguration().getPublishLocationOperationResponse()){
return Response.status(Response.Status.BAD_REQUEST.getStatusCode()).build();
} }
} catch (DeviceManagementException e) {
return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(e.getMessage()).build();
} }
String tableName = "IOT_PER_DEVICE_STREAM_GEO_FUSEDSPATIALEVENT"; String tableName = "IOT_PER_DEVICE_STREAM_GEO_FUSEDSPATIALEVENT";
String fromDate = String.valueOf(from); String fromDate = String.valueOf(from);

@ -19,7 +19,6 @@ package org.wso2.carbon.device.mgt.jaxrs.service.impl.util;
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.Feature;
import org.wso2.carbon.device.mgt.common.device.details.DeviceInfo; import org.wso2.carbon.device.mgt.common.device.details.DeviceInfo;
import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationConfig; import org.wso2.carbon.device.mgt.common.push.notification.PushNotificationConfig;
import org.wso2.carbon.device.mgt.common.type.mgt.DeviceTypeMetaDefinition; import org.wso2.carbon.device.mgt.common.type.mgt.DeviceTypeMetaDefinition;
@ -37,7 +36,6 @@ public class DeviceMgtAPITestHelper {
private static final String DEVICE_TYPE_DESCRIPTION = "Dummy Description"; private static final String DEVICE_TYPE_DESCRIPTION = "Dummy Description";
public static final String DEVICE_TYPE = "TEST_DEVICE_TYPE"; public static final String DEVICE_TYPE = "TEST_DEVICE_TYPE";
public static final String DEVICE_NAME = "TEST_DEVICE"; public static final String DEVICE_NAME = "TEST_DEVICE";
public static final String DEVICE_IDENTIFIER = "12345";
public final static String OWNER = "admin"; public final static String OWNER = "admin";
/** /**
@ -110,8 +108,6 @@ public class DeviceMgtAPITestHelper {
public static DeviceInfo generateDeviceInfo() { public static DeviceInfo generateDeviceInfo() {
DeviceInfo deviceInfo = new DeviceInfo(); DeviceInfo deviceInfo = new DeviceInfo();
deviceInfo.setIMEI("IMEI-12345");
deviceInfo.setIMSI("IMSI-12344");
deviceInfo.setDeviceModel("DUMMY_MODEL"); deviceInfo.setDeviceModel("DUMMY_MODEL");
deviceInfo.setVendor("WSO2"); deviceInfo.setVendor("WSO2");
deviceInfo.setOsVersion("OREO"); deviceInfo.setOsVersion("OREO");

@ -144,30 +144,6 @@ public class DeviceInfo implements Serializable {
this.location = location; this.location = location;
} }
public String getIMEI() {
if (IMEI != null) {
return IMEI;
} else {
return "";
}
}
public void setIMEI(String IMEI) {
this.IMEI = IMEI;
}
public String getIMSI() {
if (IMSI != null) {
return IMSI;
} else {
return "";
}
}
public void setIMSI(String IMSI) {
this.IMSI = IMSI;
}
public String getDeviceModel() { public String getDeviceModel() {
if (deviceModel != null) { if (deviceModel != null) {
return deviceModel; return deviceModel;

@ -18,7 +18,7 @@
package org.wso2.carbon.device.mgt.core.config; package org.wso2.carbon.device.mgt.core.config;
import org.wso2.carbon.device.mgt.core.config.cache.CertificateCacheConfiguration; import org.wso2.carbon.device.mgt.core.config.cache.CertificateCacheConfiguration;
import org.wso2.carbon.device.mgt.core.config.geo.location.GeoLocationConfiguration; import org.wso2.carbon.device.mgt.core.config.geo.location.OperationAnalyticsConfiguration;
import org.wso2.carbon.device.mgt.core.config.cache.DeviceCacheConfiguration; import org.wso2.carbon.device.mgt.core.config.cache.DeviceCacheConfiguration;
import org.wso2.carbon.device.mgt.core.config.identity.IdentityConfigurations; import org.wso2.carbon.device.mgt.core.config.identity.IdentityConfigurations;
import org.wso2.carbon.device.mgt.core.config.pagination.PaginationConfiguration; import org.wso2.carbon.device.mgt.core.config.pagination.PaginationConfiguration;
@ -48,7 +48,7 @@ public final class DeviceManagementConfig {
private DeviceStatusTaskConfig deviceStatusTaskConfig; private DeviceStatusTaskConfig deviceStatusTaskConfig;
private DeviceCacheConfiguration deviceCacheConfiguration; private DeviceCacheConfiguration deviceCacheConfiguration;
private CertificateCacheConfiguration certificateCacheConfiguration; private CertificateCacheConfiguration certificateCacheConfiguration;
private GeoLocationConfiguration geoLocationConfiguration; private OperationAnalyticsConfiguration operationAnalyticsConfiguration;
private String defaultGroupsConfiguration; private String defaultGroupsConfiguration;
@XmlElement(name = "ManagementRepository", required = true) @XmlElement(name = "ManagementRepository", required = true)
@ -142,13 +142,13 @@ public final class DeviceManagementConfig {
this.certificateCacheConfiguration = certificateCacheConfiguration; this.certificateCacheConfiguration = certificateCacheConfiguration;
} }
@XmlElement(name = "GeoLocationConfiguration", required = true) @XmlElement(name = "OperationAnalyticsConfiguration", required = true)
public GeoLocationConfiguration getGeoLocationConfiguration() { public OperationAnalyticsConfiguration getOperationAnalyticsConfiguration() {
return geoLocationConfiguration; return operationAnalyticsConfiguration;
} }
public void setGeoLocationConfiguration(GeoLocationConfiguration geoLocationConfiguration) { public void setOperationAnalyticsConfiguration(OperationAnalyticsConfiguration operationAnalyticsConfiguration) {
this.geoLocationConfiguration = geoLocationConfiguration; this.operationAnalyticsConfiguration = operationAnalyticsConfiguration;
} }
@XmlElement(name = "DefaultGroupsConfiguration", required = true) @XmlElement(name = "DefaultGroupsConfiguration", required = true)

@ -22,21 +22,21 @@ import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement; import javax.xml.bind.annotation.XmlRootElement;
/** /**
* This class represents the information related to Geo Location configuration. * This class represents the information related to Device Operation Analytics configuration.
*/ */
@XmlRootElement(name = "GeoLocationConfiguration") @XmlRootElement(name = "OperationAnalyticsConfiguration")
public class GeoLocationConfiguration { public class OperationAnalyticsConfiguration {
private boolean publishLocationOperationResponse; private boolean publishOperationResponse;
private boolean isEnabled; private boolean isEnabled;
public boolean getPublishLocationOperationResponse() { public boolean getPublishOperationResponse() {
return publishLocationOperationResponse; return publishOperationResponse;
} }
@XmlElement(name = "PublishLocationOperationResponse", required = true) @XmlElement(name = "PublishOperationResponse", required = true)
public void setPublishLocationOperationResponse(boolean publishLocationOperationResponse) { public void setPublishOperationResponse(boolean publishOperationResponse) {
this.publishLocationOperationResponse = publishLocationOperationResponse; this.publishOperationResponse = publishOperationResponse;
} }
public boolean getIsEnabled() { public boolean getIsEnabled() {

@ -41,6 +41,7 @@ import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil;
import java.sql.SQLException; import java.sql.SQLException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -50,7 +51,9 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
private DeviceDetailsDAO deviceDetailsDAO; private DeviceDetailsDAO deviceDetailsDAO;
private DeviceDAO deviceDAO; private DeviceDAO deviceDAO;
private static final Log log = LogFactory.getLog(DeviceInformationManagerImpl.class); private static final Log log = LogFactory.getLog(DeviceInformationManagerImpl.class);
private static final String EVENT_STREAM_DEFINITION = "org.wso2.iot.LocationStream"; private static final String LOCATION_EVENT_STREAM_DEFINITION = "org.wso2.iot.LocationStream";
private static final String DEVICE_INFO_EVENT_STREAM_DEFINITION = "org.wso2.iot.DeviceInfoStream";
public DeviceInformationManagerImpl() { public DeviceInformationManagerImpl() {
this.deviceDAO = DeviceManagementDAOFactory.getDeviceDAO(); this.deviceDAO = DeviceManagementDAOFactory.getDeviceDAO();
@ -70,6 +73,35 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
deviceDetailsDAO.addDeviceInformation(device.getId(), deviceInfo); deviceDetailsDAO.addDeviceInformation(device.getId(), deviceInfo);
deviceDetailsDAO.addDeviceProperties(deviceInfo.getDeviceDetailsMap(), device.getId()); deviceDetailsDAO.addDeviceProperties(deviceInfo.getDeviceDetailsMap(), device.getId());
DeviceManagementDAOFactory.commitTransaction(); DeviceManagementDAOFactory.commitTransaction();
if (DeviceManagerUtil.isPublishOperationResponseEnabled()) {
Object[] metaData = {device.getDeviceIdentifier(), device.getType()};
Object[] payload = new Object[]{
Calendar.getInstance().getTimeInMillis(),
deviceInfo.getDeviceDetailsMap().get("IMEI"),
deviceInfo.getDeviceDetailsMap().get("IMSI"),
deviceInfo.getDeviceModel(),
deviceInfo.getVendor(),
deviceInfo.getOsVersion(),
deviceInfo.getOsBuildDate(),
deviceInfo.getBatteryLevel(),
deviceInfo.getInternalTotalMemory(),
deviceInfo.getInternalAvailableMemory(),
deviceInfo.getExternalTotalMemory(),
deviceInfo.getExternalAvailableMemory(),
deviceInfo.getOperator(),
deviceInfo.getConnectionType(),
deviceInfo.getMobileSignalStrength(),
deviceInfo.getSsid(),
deviceInfo.getCpuUsage(),
deviceInfo.getTotalRAMMemory(),
deviceInfo.getAvailableRAMMemory(),
deviceInfo.isPluggedIn()
};
DeviceManagerUtil.getEventPublisherService().publishEvent(
DEVICE_INFO_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload
);
}
} catch (TransactionManagementException e) { } catch (TransactionManagementException e) {
DeviceManagementDAOFactory.rollbackTransaction(); DeviceManagementDAOFactory.rollbackTransaction();
throw new DeviceDetailsMgtException("Transactional error occurred while adding the device information.", e); throw new DeviceDetailsMgtException("Transactional error occurred while adding the device information.", e);
@ -83,6 +115,9 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
DeviceManagementDAOFactory.rollbackTransaction(); DeviceManagementDAOFactory.rollbackTransaction();
throw new DeviceDetailsMgtException("Error occurred while updating the last update timestamp of the " + throw new DeviceDetailsMgtException("Error occurred while updating the last update timestamp of the " +
"device", e); "device", e);
} catch (DataPublisherConfigurationException e) {
DeviceManagementDAOFactory.rollbackTransaction();
throw new DeviceDetailsMgtException("Error occurred while publishing the device location information.", e);
} finally { } finally {
DeviceManagementDAOFactory.closeConnection(); DeviceManagementDAOFactory.closeConnection();
} }
@ -90,20 +125,10 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
@Override @Override
public DeviceInfo getDeviceInfo(DeviceIdentifier deviceId) throws DeviceDetailsMgtException { public DeviceInfo getDeviceInfo(DeviceIdentifier deviceId) throws DeviceDetailsMgtException {
Device device; Device device = getDevice(deviceId);
try {
device = DeviceManagementDataHolder.getInstance().
getDeviceManagementProvider().getDevice(deviceId, false);
if (device == null) { if (device == null) {
if (log.isDebugEnabled()) {
log.debug("No device is found upon the device identifier '" + deviceId.getId() +
"' and type '" + deviceId.getType() + "'. Therefore returning null");
}
return null; return null;
} }
} catch (DeviceManagementException e) {
throw new DeviceDetailsMgtException("Exception occurred while retrieving the device.", e);
}
try { try {
DeviceManagementDAOFactory.openConnection(); DeviceManagementDAOFactory.openConnection();
DeviceInfo deviceInfo = deviceDetailsDAO.getDeviceInformation(device.getId()); DeviceInfo deviceInfo = deviceDetailsDAO.getDeviceInformation(device.getId());
@ -111,7 +136,8 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
return deviceInfo; return deviceInfo;
} catch (SQLException e) { } catch (SQLException e) {
throw new DeviceDetailsMgtException("SQL error occurred while retrieving device from database.", e); throw new DeviceDetailsMgtException("SQL error occurred while retrieving device " + deviceId.toString()
+ "'s info from database.", e);
} catch (DeviceDetailsMgtDAOException e) { } catch (DeviceDetailsMgtDAOException e) {
throw new DeviceDetailsMgtException("Exception occurred while retrieving device details.", e); throw new DeviceDetailsMgtException("Exception occurred while retrieving device details.", e);
} finally { } finally {
@ -166,15 +192,15 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
deviceDAO.updateDevice(device, CarbonContext.getThreadLocalCarbonContext().getTenantId()); deviceDAO.updateDevice(device, CarbonContext.getThreadLocalCarbonContext().getTenantId());
deviceDetailsDAO.deleteDeviceLocation(deviceLocation.getDeviceId()); deviceDetailsDAO.deleteDeviceLocation(deviceLocation.getDeviceId());
deviceDetailsDAO.addDeviceLocation(deviceLocation); deviceDetailsDAO.addDeviceLocation(deviceLocation);
if (DeviceManagerUtil.isPublishLocationOperationResEnabled()) { if (DeviceManagerUtil.isPublishOperationResponseEnabled()) {
Object metaData[] = {device.getDeviceIdentifier(), device.getType()}; Object[] metaData = {device.getDeviceIdentifier(), device.getType()};
Object payload[] = new Object[]{ Object[] payload = new Object[]{
deviceLocation.getUpdatedTime().getTime(), deviceLocation.getUpdatedTime().getTime(),
deviceLocation.getLatitude(), deviceLocation.getLatitude(),
deviceLocation.getLongitude() deviceLocation.getLongitude()
}; };
DeviceManagerUtil.getEventPublisherService().publishEvent( DeviceManagerUtil.getEventPublisherService().publishEvent(
EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload LOCATION_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload
); );
} }
DeviceManagementDAOFactory.commitTransaction(); DeviceManagementDAOFactory.commitTransaction();
@ -201,19 +227,10 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
@Override @Override
public DeviceLocation getDeviceLocation(DeviceIdentifier deviceId) throws DeviceDetailsMgtException { public DeviceLocation getDeviceLocation(DeviceIdentifier deviceId) throws DeviceDetailsMgtException {
Device device; Device device = getDevice(deviceId);
try {
device = DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().getDevice(deviceId, false);
if (device == null) { if (device == null) {
if (log.isDebugEnabled()) {
log.debug("No device is found upon the device identifier '" + deviceId.getId() +
"' and type '" + deviceId.getType() + "'. Therefore returning null");
}
return null; return null;
} }
} catch (DeviceManagementException e) {
throw new DeviceDetailsMgtException("Exception occurred while retrieving the device.", e);
}
try { try {
DeviceManagementDAOFactory.openConnection(); DeviceManagementDAOFactory.openConnection();
return deviceDetailsDAO.getDeviceLocation(device.getId()); return deviceDetailsDAO.getDeviceLocation(device.getId());
@ -226,6 +243,23 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
} }
} }
private Device getDevice(DeviceIdentifier deviceId) throws DeviceDetailsMgtException {
Device device;
try {
device = DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().getDevice(deviceId, false);
if (device == null) {
if (log.isDebugEnabled()) {
log.debug("No device is found upon the device identifier '" + deviceId.getId() +
"' and type '" + deviceId.getType() + "'. Therefore returning null");
}
return null;
}
} catch (DeviceManagementException e) {
throw new DeviceDetailsMgtException("Exception occurred while retrieving the device.", e);
}
return device;
}
@Override @Override
public List<DeviceLocation> getDeviceLocations( public List<DeviceLocation> getDeviceLocations(
List<DeviceIdentifier> deviceIdentifiers) throws DeviceDetailsMgtException { List<DeviceIdentifier> deviceIdentifiers) throws DeviceDetailsMgtException {

@ -26,8 +26,8 @@ import org.wso2.carbon.device.mgt.common.PaginationResult;
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup; import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup;
import org.wso2.carbon.device.mgt.common.group.mgt.GroupAlreadyExistException; import org.wso2.carbon.device.mgt.common.group.mgt.GroupAlreadyExistException;
import org.wso2.carbon.device.mgt.common.group.mgt.GroupManagementException; import org.wso2.carbon.device.mgt.common.group.mgt.GroupManagementException;
import org.wso2.carbon.device.mgt.common.group.mgt.RoleDoesNotExistException;
import org.wso2.carbon.device.mgt.common.group.mgt.GroupNotExistException; import org.wso2.carbon.device.mgt.common.group.mgt.GroupNotExistException;
import org.wso2.carbon.device.mgt.common.group.mgt.RoleDoesNotExistException;
import java.util.List; import java.util.List;
@ -215,10 +215,19 @@ public interface GroupManagementProviderService {
/** /**
* Checks for the default group existence and create group based on device ownership. * Checks for the default group existence and create group based on device ownership.
* @param groupName * @param groupName of the group
* @return * @return DeviceGroup object
* @throws GroupManagementException * @throws GroupManagementException
*/ */
DeviceGroup createDefaultGroup(String groupName) throws GroupManagementException; DeviceGroup createDefaultGroup(String groupName) throws GroupManagementException;
/**
* Check device is belonging to a Device Group.
*
* @param groupId of Device Group.
* @param deviceIdentifier of the device.
* @throws GroupManagementException on errors.
*/
boolean isDeviceMappedToGroup(int groupId, DeviceIdentifier deviceIdentifier) throws GroupManagementException;
} }

@ -30,7 +30,12 @@ import org.wso2.carbon.device.mgt.common.DeviceNotFoundException;
import org.wso2.carbon.device.mgt.common.GroupPaginationRequest; import org.wso2.carbon.device.mgt.common.GroupPaginationRequest;
import org.wso2.carbon.device.mgt.common.PaginationResult; import org.wso2.carbon.device.mgt.common.PaginationResult;
import org.wso2.carbon.device.mgt.common.TransactionManagementException; import org.wso2.carbon.device.mgt.common.TransactionManagementException;
import org.wso2.carbon.device.mgt.common.group.mgt.*; import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup;
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroupConstants;
import org.wso2.carbon.device.mgt.common.group.mgt.GroupAlreadyExistException;
import org.wso2.carbon.device.mgt.common.group.mgt.GroupManagementException;
import org.wso2.carbon.device.mgt.common.group.mgt.GroupNotExistException;
import org.wso2.carbon.device.mgt.common.group.mgt.RoleDoesNotExistException;
import org.wso2.carbon.device.mgt.core.dao.GroupDAO; import org.wso2.carbon.device.mgt.core.dao.GroupDAO;
import org.wso2.carbon.device.mgt.core.dao.GroupManagementDAOException; import org.wso2.carbon.device.mgt.core.dao.GroupManagementDAOException;
import org.wso2.carbon.device.mgt.core.dao.GroupManagementDAOFactory; import org.wso2.carbon.device.mgt.core.dao.GroupManagementDAOFactory;
@ -823,4 +828,39 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
return defaultGroup; return defaultGroup;
} }
} }
/**
* {@inheritDoc}
*/
@Override
public boolean isDeviceMappedToGroup(int groupId, DeviceIdentifier deviceIdentifier)
throws GroupManagementException {
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
Device device;
try {
device = DeviceManagementDataHolder.getInstance().getDeviceManagementProvider().
getDevice(deviceIdentifier, false);
if (device == null) {
throw new GroupManagementException("Device not found for id '" + deviceIdentifier.getId() +
"' type '" + deviceIdentifier.getType() + "'");
}
} catch (DeviceManagementException e) {
throw new GroupManagementException("Device management exception occurred when retrieving device. " +
e.getMessage(), e);
}
try{
GroupManagementDAOFactory.openConnection();
return this.groupDAO.isDeviceMappedToGroup(groupId, device.getId(), tenantId);
} catch (GroupManagementDAOException e) {
throw new GroupManagementException("Error occurred when checking device, group mapping between device id '" +
deviceIdentifier.getId() + "' and group id '" + groupId + "'", e);
} catch (SQLException e) {
throw new GroupManagementException("Error occurred when opening db connection to check device, group " +
"mapping between device id '" + deviceIdentifier.getId() +
"' and group id '" + groupId + "'", e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
}
} }

@ -31,6 +31,7 @@ import org.wso2.carbon.device.mgt.common.EnrolmentInfo;
import org.wso2.carbon.device.mgt.common.GroupPaginationRequest; import org.wso2.carbon.device.mgt.common.GroupPaginationRequest;
import org.wso2.carbon.device.mgt.common.PaginationRequest; import org.wso2.carbon.device.mgt.common.PaginationRequest;
import org.wso2.carbon.device.mgt.common.TransactionManagementException; import org.wso2.carbon.device.mgt.common.TransactionManagementException;
import org.wso2.carbon.device.mgt.common.device.details.DeviceInfo;
import org.wso2.carbon.device.mgt.common.group.mgt.GroupManagementException; import org.wso2.carbon.device.mgt.common.group.mgt.GroupManagementException;
import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementException; import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementException;
import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException;
@ -415,11 +416,23 @@ public final class DeviceManagerUtil {
return limit; return limit;
} }
public static boolean isPublishLocationOperationResEnabled() throws DeviceManagementException { public static boolean isOperationAnalyticsEnabled() throws DeviceManagementException {
DeviceManagementConfig deviceManagementConfig = DeviceConfigurationManager.getInstance(). DeviceManagementConfig deviceManagementConfig = DeviceConfigurationManager.getInstance().
getDeviceManagementConfig(); getDeviceManagementConfig();
if (deviceManagementConfig != null) { if (deviceManagementConfig != null) {
return deviceManagementConfig.getGeoLocationConfiguration().getPublishLocationOperationResponse(); return deviceManagementConfig.getOperationAnalyticsConfiguration().getIsEnabled();
} else {
throw new DeviceManagementException("Device-Mgt configuration has not initialized. Please check the " +
"cdm-config.xml file.");
}
}
public static boolean isPublishOperationResponseEnabled() throws DeviceManagementException {
DeviceManagementConfig deviceManagementConfig = DeviceConfigurationManager.getInstance().
getDeviceManagementConfig();
if (deviceManagementConfig != null) {
return isOperationAnalyticsEnabled()
&& deviceManagementConfig.getOperationAnalyticsConfiguration().getPublishOperationResponse();
} else { } else {
throw new DeviceManagementException("Device-Mgt configuration has not initialized. Please check the " + throw new DeviceManagementException("Device-Mgt configuration has not initialized. Please check the " +
"cdm-config.xml file."); "cdm-config.xml file.");

@ -66,8 +66,6 @@ public class TestDataHolder {
public static DeviceInfo generateDummyDeviceInfo() { public static DeviceInfo generateDummyDeviceInfo() {
DeviceInfo deviceInfo = new DeviceInfo(); DeviceInfo deviceInfo = new DeviceInfo();
deviceInfo.setIMEI("IMEI-12345");
deviceInfo.setIMSI("IMSI-12344");
deviceInfo.setDeviceModel("DUMMY_MODEL"); deviceInfo.setDeviceModel("DUMMY_MODEL");
deviceInfo.setVendor("WSO2"); deviceInfo.setVendor("WSO2");
deviceInfo.setOsVersion("OREO"); deviceInfo.setOsVersion("OREO");

@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. * Copyright (c) 2017, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
* *
* WSO2 Inc. licenses this file to you under the Apache License, * WSO2 Inc. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except * Version 2.0 (the "License"); you may not use this file except
@ -20,26 +20,17 @@ package org.wso2.carbon.device.mgt.core.search.util;
import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.device.details.DeviceInfo; import org.wso2.carbon.device.mgt.common.device.details.DeviceInfo;
import org.wso2.carbon.device.mgt.common.device.details.DeviceLocation; import org.wso2.carbon.device.mgt.common.device.details.DeviceLocation;
import org.wso2.carbon.device.mgt.common.search.Condition;
import org.wso2.carbon.device.mgt.common.search.SearchContext;
import org.wso2.carbon.device.mgt.core.common.TestDataHolder; import org.wso2.carbon.device.mgt.core.common.TestDataHolder;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import static org.wso2.carbon.device.mgt.common.search.Condition.State.AND;
import static org.wso2.carbon.device.mgt.common.search.Condition.State.OR;
public class Utils { public class Utils {
public static DeviceInfo getDeviceInfo() { public static DeviceInfo getDeviceInfo() {
DeviceInfo deviceInfo = new DeviceInfo(); DeviceInfo deviceInfo = new DeviceInfo();
deviceInfo.setIMSI("e6f236ac82537a8e");
deviceInfo.setSsid("FAFDA"); deviceInfo.setSsid("FAFDA");
deviceInfo.setAvailableRAMMemory(1.24); deviceInfo.setAvailableRAMMemory(1.24);
deviceInfo.setBatteryLevel(40.0); deviceInfo.setBatteryLevel(40.0);
deviceInfo.setConnectionType("GSM"); deviceInfo.setConnectionType("GSM");
@ -47,8 +38,6 @@ public class Utils {
deviceInfo.setDeviceModel("SM-T520"); deviceInfo.setDeviceModel("SM-T520");
deviceInfo.setExternalAvailableMemory(2.45); deviceInfo.setExternalAvailableMemory(2.45);
deviceInfo.setExternalTotalMemory(16.23); deviceInfo.setExternalTotalMemory(16.23);
deviceInfo.setIMEI("e6f236ac82537a8e");
deviceInfo.setIMSI("GT-0WDA");
deviceInfo.setInternalAvailableMemory(3.56); deviceInfo.setInternalAvailableMemory(3.56);
deviceInfo.setInternalTotalMemory(7.89); deviceInfo.setInternalTotalMemory(7.89);
deviceInfo.setMobileSignalStrength(0.67); deviceInfo.setMobileSignalStrength(0.67);
@ -70,6 +59,8 @@ public class Utils {
propertyMap.put("MEMORY_THRESHOLD", "100663296"); propertyMap.put("MEMORY_THRESHOLD", "100663296");
propertyMap.put("CPU_IOW", "12"); propertyMap.put("CPU_IOW", "12");
propertyMap.put("CPU_IRQ", "1"); propertyMap.put("CPU_IRQ", "1");
propertyMap.put("IMEI", "e6f236ac82537a8e");
propertyMap.put("IMSI", "432659632123654845");
deviceInfo.setDeviceDetailsMap(propertyMap); deviceInfo.setDeviceDetailsMap(propertyMap);
@ -77,7 +68,7 @@ public class Utils {
} }
public static DeviceLocation getSampleDeviceLocation(){ private static DeviceLocation getSampleDeviceLocation(){
DeviceLocation deviceLocation = new DeviceLocation(); DeviceLocation deviceLocation = new DeviceLocation();
deviceLocation.setDeviceIdentifier(Utils.getDeviceIdentifier()); deviceLocation.setDeviceIdentifier(Utils.getDeviceIdentifier());
deviceLocation.setLatitude(76.2422); deviceLocation.setLatitude(76.2422);

@ -16,21 +16,27 @@
* under the License. * under the License.
*/ */
package org.wso2.carbon.device.mgt.core.service; package org.wso2.carbon.device.mgt.core.service;
import org.testng.Assert; import org.testng.Assert;
import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test; import org.testng.annotations.Test;
import org.wso2.carbon.device.mgt.common.*; import org.wso2.carbon.device.mgt.common.Device;
import org.wso2.carbon.device.mgt.common.group.mgt.*; import org.wso2.carbon.device.mgt.common.DeviceIdentifier;
import org.wso2.carbon.device.mgt.common.DeviceNotFoundException;
import org.wso2.carbon.device.mgt.common.GroupPaginationRequest;
import org.wso2.carbon.device.mgt.common.PaginationResult;
import org.wso2.carbon.device.mgt.common.TransactionManagementException;
import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup;
import org.wso2.carbon.device.mgt.common.group.mgt.GroupAlreadyExistException;
import org.wso2.carbon.device.mgt.common.group.mgt.GroupManagementException;
import org.wso2.carbon.device.mgt.common.group.mgt.GroupNotExistException;
import org.wso2.carbon.device.mgt.common.group.mgt.RoleDoesNotExistException;
import org.wso2.carbon.device.mgt.core.TestUtils; import org.wso2.carbon.device.mgt.core.TestUtils;
import org.wso2.carbon.device.mgt.core.common.BaseDeviceManagementTest; import org.wso2.carbon.device.mgt.core.common.BaseDeviceManagementTest;
import org.wso2.carbon.device.mgt.core.common.TestDataHolder; import org.wso2.carbon.device.mgt.core.common.TestDataHolder;
import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager; import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager;
import org.wso2.carbon.device.mgt.core.config.cache.DeviceCacheConfiguration; import org.wso2.carbon.device.mgt.core.config.cache.DeviceCacheConfiguration;
import org.wso2.carbon.device.mgt.core.dao.GroupManagementDAOFactory;
import org.wso2.carbon.device.mgt.core.internal.DeviceManagementDataHolder; import org.wso2.carbon.device.mgt.core.internal.DeviceManagementDataHolder;
import org.wso2.carbon.registry.core.jdbc.realm.InMemoryRealmService; import org.wso2.carbon.registry.core.jdbc.realm.InMemoryRealmService;
import org.wso2.carbon.user.api.Permission; import org.wso2.carbon.user.api.Permission;
@ -66,7 +72,6 @@ public class GroupManagementProviderServiceTest extends BaseDeviceManagementTest
@Test(expectedExceptions = {GroupManagementException.class, GroupAlreadyExistException.class, TransactionManagementException.class}) @Test(expectedExceptions = {GroupManagementException.class, GroupAlreadyExistException.class, TransactionManagementException.class})
public void createGroupError() throws GroupManagementException, GroupAlreadyExistException, TransactionManagementException { public void createGroupError() throws GroupManagementException, GroupAlreadyExistException, TransactionManagementException {
GroupManagementDAOFactory.beginTransaction();
groupManagementProviderService.createGroup(TestUtils.createDeviceGroup4(), DEFAULT_ADMIN_ROLE, DEFAULT_ADMIN_PERMISSIONS); groupManagementProviderService.createGroup(TestUtils.createDeviceGroup4(), DEFAULT_ADMIN_ROLE, DEFAULT_ADMIN_PERMISSIONS);
} }
@ -126,7 +131,6 @@ public class GroupManagementProviderServiceTest extends BaseDeviceManagementTest
@Test(dependsOnMethods = ("createGroup")) @Test(dependsOnMethods = ("createGroup"))
public void getGroup() throws GroupManagementException { public void getGroup() throws GroupManagementException {
DeviceGroup deviceGroup = groupManagementProviderService.getGroup(TestUtils.createDeviceGroup3().getName()); DeviceGroup deviceGroup = groupManagementProviderService.getGroup(TestUtils.createDeviceGroup3().getName());
Assert.assertNotNull(groupManagementProviderService.getGroup(deviceGroup.getGroupId())); Assert.assertNotNull(groupManagementProviderService.getGroup(deviceGroup.getGroupId()));
} }
@ -161,8 +165,7 @@ public class GroupManagementProviderServiceTest extends BaseDeviceManagementTest
@Test(dependsOnMethods = ("createGroup"), expectedExceptions = {GroupManagementException.class}) @Test(dependsOnMethods = ("createGroup"), expectedExceptions = {GroupManagementException.class})
public void getGroupsByPaginationError() throws GroupManagementException { public void getGroupsByPaginationError() throws GroupManagementException {
GroupPaginationRequest request = null; groupManagementProviderService.getGroups((GroupPaginationRequest) null);
groupManagementProviderService.getGroups(request);
} }
@Test(dependsOnMethods = ("createGroup")) @Test(dependsOnMethods = ("createGroup"))
@ -282,5 +285,29 @@ public class GroupManagementProviderServiceTest extends BaseDeviceManagementTest
groupManagementProviderService.createDefaultGroup("BYOD"); groupManagementProviderService.createDefaultGroup("BYOD");
} }
@Test(dependsOnMethods = {"createGroup", "addDevices", "updateGroupSecondTime"})
public void checkDeviceBelongsToGroup() throws GroupManagementException {
List<DeviceIdentifier> list = TestUtils.getDeviceIdentifiersList();
boolean isMapped = groupManagementProviderService
.isDeviceMappedToGroup(groupManagementProviderService.getGroup(
TestUtils.createDeviceGroup1().getName()).getGroupId(), list.get(0));
Assert.assertEquals(isMapped, true);
}
@Test
public void checkDeviceBelongsToNonExistingGroup() throws GroupManagementException {
List<DeviceIdentifier> list = TestUtils.getDeviceIdentifiersList();
boolean isMapped = groupManagementProviderService
.isDeviceMappedToGroup(1500, list.get(0));
Assert.assertEquals(isMapped, false);
}
@Test(dependsOnMethods = {"createGroup", "updateGroupSecondTime"}, expectedExceptions = {GroupManagementException.class})
public void checkNullDeviceBelongsToGroup() throws GroupManagementException {
groupManagementProviderService.isDeviceMappedToGroup(groupManagementProviderService.getGroup(
TestUtils.createDeviceGroup1().getName()).getGroupId(), null);
}
} }

@ -87,10 +87,10 @@
<Enable>false</Enable> <Enable>false</Enable>
<ExpiryTime>86400</ExpiryTime> <ExpiryTime>86400</ExpiryTime>
</CertificateCacheConfiguration> </CertificateCacheConfiguration>
<GeoLocationConfiguration> <OperationAnalyticsConfiguration>
<isEnabled>false</isEnabled> <isEnabled>false</isEnabled>
<PublishLocationOperationResponse>false</PublishLocationOperationResponse> <PublishOperationResponse>false</PublishOperationResponse>
</GeoLocationConfiguration> </OperationAnalyticsConfiguration>
<DefaultGroupsConfiguration>BYOD,COPE</DefaultGroupsConfiguration> <DefaultGroupsConfiguration>BYOD,COPE</DefaultGroupsConfiguration>
</DeviceMgtConfiguration> </DeviceMgtConfiguration>

@ -73,7 +73,7 @@ deviceModule = function () {
} }
var userName = carbonUser.username + "@" + carbonUser.domain; var userName = carbonUser.username + "@" + carbonUser.domain;
var locationHistory = []; var locationHistory = [];
var geoServicesEnabled = devicemgtProps.serverConfig.geoLocationConfiguration.isEnabled; var geoServicesEnabled = devicemgtProps.serverConfig.operationAnalyticsConfiguration.isEnabled;
if (geoServicesEnabled) { if (geoServicesEnabled) {
try { try {
var fromDate = new Date(); var fromDate = new Date();

@ -60,6 +60,6 @@ function onRequest(context) {
} else { } else {
viewModel.lastLocation = stringify({}); viewModel.lastLocation = stringify({});
} }
viewModel.geoServicesEnabled = devicemgtProps.serverConfig.geoLocationConfiguration.isEnabled; viewModel.geoServicesEnabled = devicemgtProps.serverConfig.operationAnalyticsConfiguration.isEnabled;
return viewModel; return viewModel;
} }

@ -0,0 +1,172 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2016, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
~
~ WSO2 Inc. licenses this file to you under the Apache License,
~ Version 2.0 (the "License"); you may not use this file except
~ in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-feature</artifactId>
<version>3.0.170-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.basics.feature</artifactId>
<packaging>pom</packaging>
<name>WSO2 Carbon - Device Management Basics Feature</name>
<url>http://wso2.org</url>
<description>This feature contains the core bundles required for Basic Device Management functionality
</description>
<dependencies>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.core</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.common</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.analytics.data.publisher</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.registry</groupId>
<artifactId>org.wso2.carbon.registry.indexing</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.analytics-common</groupId>
<artifactId>org.wso2.carbon.event.receiver.stub</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.analytics-common</groupId>
<artifactId>org.wso2.carbon.event.stream.stub</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.analytics-common</groupId>
<artifactId>org.wso2.carbon.event.publisher.stub</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.analytics-common</groupId>
<artifactId>org.wso2.carbon.event.stream.persistence.stub</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.orbit.org.scannotation</groupId>
<artifactId>scannotation</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>generate-resources</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>src/main/resources</outputDirectory>
<resources>
<resource>
<directory>resources</directory>
<includes>
<include>build.properties</include>
<include>p2.inf</include>
</includes>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.wso2.maven</groupId>
<artifactId>carbon-p2-plugin</artifactId>
<version>${carbon.p2.plugin.version}</version>
<executions>
<execution>
<id>p2-feature-generation</id>
<phase>package</phase>
<goals>
<goal>p2-feature-gen</goal>
</goals>
<configuration>
<id>org.wso2.carbon.device.mgt.basics</id>
<propertiesFile>../../../features/etc/feature.properties</propertiesFile>
<adviceFile>
<properties>
<propertyDef>org.wso2.carbon.p2.category.type:server</propertyDef>
<propertyDef>org.eclipse.equinox.p2.type.group:false</propertyDef>
</properties>
</adviceFile>
<bundles>
<bundleDef>
org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.core:${carbon.device.mgt.version}
</bundleDef>
<bundleDef>
org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.common:${carbon.device.mgt.version}
</bundleDef>
<bundleDef>
org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.analytics.data.publisher:${carbon.device.mgt.version}
</bundleDef>
<bundleDef>
org.wso2.carbon.analytics-common:org.wso2.carbon.event.receiver.stub:${carbon.analytics.common.version}
</bundleDef>
<bundleDef>
org.wso2.carbon.analytics-common:org.wso2.carbon.event.stream.stub:${carbon.analytics.common.version}
</bundleDef>
<bundleDef>
org.wso2.carbon.analytics-common:org.wso2.carbon.event.publisher.stub:${carbon.analytics.common.version}
</bundleDef>
<bundleDef>
org.wso2.carbon.analytics-common:org.wso2.carbon.event.stream.persistence.stub:${carbon.analytics.common.version}
</bundleDef>
<bundleDef>
org.wso2.orbit.com.fasterxml.jackson.core:jackson-annotations:${jackson-annotations.version}
</bundleDef>
<bundleDef>
org.wso2.orbit.org.scannotation:scannotation:${scannotation.version}
</bundleDef>
</bundles>
<importBundles>
<importBundleDef>
org.wso2.carbon.registry:org.wso2.carbon.registry.indexing:${carbon.registry.version}
</importBundleDef>
</importBundles>
<importFeatures>
<importFeatureDef>
org.wso2.carbon.core.server:${carbon.kernel.version}
</importFeatureDef>
<importFeatureDef>
org.wso2.carbon.email.sender:${carbon.device.mgt.version}
</importFeatureDef>
</importFeatures>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

@ -87,10 +87,10 @@
<Enable>true</Enable> <Enable>true</Enable>
<ExpiryTime>86400</ExpiryTime> <ExpiryTime>86400</ExpiryTime>
</CertificateCacheConfiguration> </CertificateCacheConfiguration>
<GeoLocationConfiguration> <OperationAnalyticsConfiguration>
<isEnabled>false</isEnabled> <isEnabled>false</isEnabled>
<PublishLocationOperationResponse>false</PublishLocationOperationResponse> <PublishOperationResponse>false</PublishOperationResponse>
</GeoLocationConfiguration> </OperationAnalyticsConfiguration>
<DefaultGroupsConfiguration>BYOD,COPE</DefaultGroupsConfiguration> <DefaultGroupsConfiguration>BYOD,COPE</DefaultGroupsConfiguration>
</DeviceMgtConfiguration> </DeviceMgtConfiguration>

@ -1,8 +1,8 @@
instructions.configure = \ instructions.configure = \
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/conf/cdm-config.xml,target:${installFolder}/../../conf/cdm-config.xml,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.basics_${feature.version}/conf/cdm-config.xml,target:${installFolder}/../../conf/cdm-config.xml,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/conf/license-config.xml,target:${installFolder}/../../conf/etc/license-config.xml,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.basics_${feature.version}/conf/license-config.xml,target:${installFolder}/../../conf/etc/license-config.xml,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/conf/remote-appmanager-config.xml,target:${installFolder}/../../conf/etc/remote-appmanager-config.xml,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.basics_${feature.version}/conf/remote-appmanager-config.xml,target:${installFolder}/../../conf/etc/remote-appmanager-config.xml,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/dbscripts/cdm,target:${installFolder}/../../../dbscripts/cdm,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.basics_${feature.version}/dbscripts/cdm,target:${installFolder}/../../../dbscripts/cdm,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/rxts/license.rxt,target:${installFolder}/../../../repository/resources/rxts/license.rxt,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.basics_${feature.version}/rxts/license.rxt,target:${installFolder}/../../../repository/resources/rxts/license.rxt,overwrite:true);\
org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/email-templates);\ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/email-templates);\
org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.server_${feature.version}/email/templates,target:${installFolder}/../../../repository/resources/email-templates,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.basics_${feature.version}/email/templates,target:${installFolder}/../../../repository/resources/email-templates,overwrite:true);\

@ -40,46 +40,22 @@
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.core</artifactId> <artifactId>org.wso2.carbon.device.mgt.core</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.url.printer</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.common</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.api.feature</artifactId> <artifactId>org.wso2.carbon.device.mgt.api.feature</artifactId>
<type>zip</type> <type>zip</type>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.orbit.org.apache.pdfbox</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>pdfbox</artifactId> <artifactId>org.wso2.carbon.device.mgt.url.printer</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.carbon.devicemgt</groupId> <groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.extensions.pull.notification</artifactId> <artifactId>org.wso2.carbon.device.mgt.extensions.pull.notification</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.wso2.carbon.registry</groupId> <groupId>org.wso2.orbit.org.apache.pdfbox</groupId>
<artifactId>org.wso2.carbon.registry.indexing</artifactId> <artifactId>pdfbox</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.analytics-common</groupId>
<artifactId>org.wso2.carbon.event.receiver.stub</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.analytics-common</groupId>
<artifactId>org.wso2.carbon.event.stream.stub</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.analytics-common</groupId>
<artifactId>org.wso2.carbon.event.publisher.stub</artifactId>
</dependency>
<dependency>
<groupId>org.wso2.carbon.analytics-common</groupId>
<artifactId>org.wso2.carbon.event.stream.persistence.stub</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
@ -131,55 +107,31 @@
</properties> </properties>
</adviceFile> </adviceFile>
<includedFeatures> <includedFeatures>
<includedFeatureDef>
org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.basics.feature:${carbon.device.mgt.version}
</includedFeatureDef>
<includedFeatureDef> <includedFeatureDef>
org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.api.feature:${carbon.device.mgt.version} org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.api.feature:${carbon.device.mgt.version}
</includedFeatureDef> </includedFeatureDef>
</includedFeatures> </includedFeatures>
<bundles> <bundles>
<bundleDef>
org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.core:${carbon.device.mgt.version}
</bundleDef>
<bundleDef>
org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.common:${carbon.device.mgt.version}
</bundleDef>
<bundleDef> <bundleDef>
org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.url.printer:${carbon.device.mgt.version} org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.url.printer:${carbon.device.mgt.version}
</bundleDef> </bundleDef>
<bundleDef> <bundleDef>
org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.extensions.pull.notification:${carbon.device.mgt.version} org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.extensions.pull.notification:${carbon.device.mgt.version}
</bundleDef> </bundleDef>
<!--<bundleDef>-->
<!--org.wso2.carbon.commons:org.wso2.carbon.email.verification-->
<!--</bundleDef>-->
<bundleDef> <bundleDef>
org.wso2.carbon.identity.inbound.auth.oauth2:org.wso2.carbon.identity.oauth.stub:${identity.inbound.auth.oauth.version} org.wso2.carbon.identity.inbound.auth.oauth2:org.wso2.carbon.identity.oauth.stub:${identity.inbound.auth.oauth.version}
</bundleDef> </bundleDef>
<bundleDef>
org.wso2.orbit.com.fasterxml.jackson.core:jackson-annotations:${jackson-annotations.version}
</bundleDef>
<bundleDef>
org.wso2.carbon.analytics-common:org.wso2.carbon.event.receiver.stub:${carbon.analytics.common.version}
</bundleDef>
<bundleDef>
org.wso2.carbon.analytics-common:org.wso2.carbon.event.stream.stub:${carbon.analytics.common.version}
</bundleDef>
<bundleDef>
org.wso2.carbon.analytics-common:org.wso2.carbon.event.publisher.stub:${carbon.analytics.common.version}
</bundleDef>
<bundleDef>
org.wso2.carbon.analytics-common:org.wso2.carbon.event.stream.persistence.stub:${carbon.analytics.common.version}
</bundleDef>
<!-- Below should be bundled with the email verification -->
</bundles> </bundles>
<importBundles> <importBundles>
<importBundleDef>org.wso2.carbon.apimgt:org.wso2.carbon.apimgt.keymgt:${carbon.api.mgt.version}</importBundleDef> <importBundleDef>org.wso2.carbon.apimgt:org.wso2.carbon.apimgt.keymgt:${carbon.api.mgt.version}</importBundleDef>
<importBundleDef>org.wso2.orbit.org.apache.pdfbox:pdfbox:${orbit.version.pdfbox}</importBundleDef> <importBundleDef>org.wso2.orbit.org.apache.pdfbox:pdfbox:${orbit.version.pdfbox}</importBundleDef>
<importBundleDef>org.wso2.carbon.registry:org.wso2.carbon.registry.indexing:${carbon.registry.version}</importBundleDef>
</importBundles> </importBundles>
<importFeatures> <importFeatures>
<importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}</importFeatureDef> <importFeatureDef>org.wso2.carbon.core.server:${carbon.kernel.version}</importFeatureDef>
<importFeatureDef>org.wso2.carbon.device.mgt.extensions:${carbon.device.mgt.version}</importFeatureDef> <importFeatureDef>org.wso2.carbon.device.mgt.extensions:${carbon.device.mgt.version}</importFeatureDef>
<importFeatureDef>org.wso2.carbon.email.sender:${carbon.device.mgt.version}</importFeatureDef>
</importFeatures> </importFeatures>
</configuration> </configuration>
</execution> </execution>

@ -33,6 +33,7 @@
<url>http://wso2.org</url> <url>http://wso2.org</url>
<modules> <modules>
<module>org.wso2.carbon.device.mgt.basics.feature</module>
<module>org.wso2.carbon.device.mgt.server.feature</module> <module>org.wso2.carbon.device.mgt.server.feature</module>
<module>org.wso2.carbon.device.mgt.ui.feature</module> <module>org.wso2.carbon.device.mgt.ui.feature</module>
<module>org.wso2.carbon.device.mgt.api.feature</module> <module>org.wso2.carbon.device.mgt.api.feature</module>

Loading…
Cancel
Save