From bd5776947d46fe2f7684e534a1402d61f228617a Mon Sep 17 00:00:00 2001 From: prathabanKavin Date: Wed, 31 May 2023 21:45:31 +0530 Subject: [PATCH 1/4] Fix issue with delete geofences with mssql db --- .../geofence/SQLServerGeofenceDAOImpl.java | 69 +++++++++++++++++-- 1 file changed, 63 insertions(+), 6 deletions(-) diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/geofence/SQLServerGeofenceDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/geofence/SQLServerGeofenceDAOImpl.java index 56d56593b5..0713f3c578 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/geofence/SQLServerGeofenceDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/geofence/SQLServerGeofenceDAOImpl.java @@ -22,17 +22,19 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfig; import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeofenceData; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.dao.EventManagementDAOFactory; -import io.entgra.device.mgt.core.device.mgt.core.dao.GeofenceDAO; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.AbstractGeofenceDAOImpl; -import io.entgra.device.mgt.core.device.mgt.core.dto.event.config.GeoFenceGroupMap; -import java.sql.*; -import java.util.Date; -import java.util.*; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; public class SQLServerGeofenceDAOImpl extends AbstractGeofenceDAOImpl { private static final Log log = LogFactory.getLog(SQLServerGeofenceDAOImpl.class); @@ -106,4 +108,59 @@ public class SQLServerGeofenceDAOImpl extends AbstractGeofenceDAOImpl { } return geofenceDataList; } + + @Override + public GeofenceData getGeofence(int fenceId, boolean requireGroupData) throws DeviceManagementDAOException { + if (!requireGroupData) { + return getGeofence(fenceId); + } + + try { + Connection con = this.getConnection(); + String sql = "SELECT " + + "G.ID AS FENCE_ID, " + + "FENCE_NAME, " + + "G.DESCRIPTION, " + + "LATITUDE, " + + "LONGITUDE, " + + "RADIUS, " + + "GEO_JSON, " + + "FENCE_SHAPE, " + + "M.GROUP_ID AS GROUP_ID, " + + "GR.GROUP_NAME " + + "FROM DM_GEOFENCE G, DM_GEOFENCE_GROUP_MAPPING M, DM_GROUP GR " + + "WHERE G.ID = M.FENCE_ID " + + "AND M.GROUP_ID = GR.ID " + + "AND G.ID = ?"; + try (PreparedStatement stmt = con.prepareStatement(sql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY)) { + stmt.setInt(1, fenceId); + try (ResultSet rst = stmt.executeQuery()) { + Map groupMap = new HashMap<>(); + GeofenceData geofenceData = null; + while (rst.next()) { + groupMap.put(rst.getInt("GROUP_ID"), rst.getString("GROUP_NAME")); + } + if (!groupMap.isEmpty()) { + rst.beforeFirst(); + rst.next(); + geofenceData = new GeofenceData(); + geofenceData.setId(rst.getInt("FENCE_ID")); + geofenceData.setFenceName(rst.getString("FENCE_NAME")); + geofenceData.setDescription(rst.getString("DESCRIPTION")); + geofenceData.setLatitude(rst.getDouble("LATITUDE")); + geofenceData.setLongitude(rst.getDouble("LONGITUDE")); + geofenceData.setRadius(rst.getFloat("RADIUS")); + geofenceData.setGeoJson(rst.getString("GEO_JSON")); + geofenceData.setFenceShape(rst.getString("FENCE_SHAPE")); + geofenceData.setGroupData(groupMap); + } + return geofenceData; + } + } + } catch (SQLException e) { + String msg = "Error occurred while retrieving Geo fence data " + fenceId; + log.error(msg, e); + throw new DeviceManagementDAOException(msg, e); + } + } } From c06fd22ecd63a9b9beb355c17125dbe7fa81f805 Mon Sep 17 00:00:00 2001 From: Sanjana Rajapakshe Date: Thu, 1 Jun 2023 16:11:35 +0000 Subject: [PATCH 2/4] Add original app icons into single device app list and application restriction policy app list Co-authored-by: Sanjana Rajapakshe Co-committed-by: Sanjana Rajapakshe --- .../common/services/ApplicationManager.java | 8 + .../mgt/core/impl/ApplicationManagerImpl.java | 62 ++++++ .../application/mgt/core/util/APIUtil.java | 14 ++ ...ApplicationManagementPublisherAPIImpl.java | 4 + .../pom.xml | 12 ++ .../device/mgt/core/dao/ApplicationDAO.java | 51 +++++ .../mgt/core/dao/impl/ApplicationDAOImpl.java | 176 ++++++++++++++++++ .../DeviceManagementProviderService.java | 39 ++++ .../DeviceManagementProviderServiceImpl.java | 126 +++++++++++++ .../src/main/resources/dbscripts/cdm/h2.sql | 10 + .../main/resources/dbscripts/cdm/mssql.sql | 11 ++ .../main/resources/dbscripts/cdm/mysql.sql | 10 + .../main/resources/dbscripts/cdm/oracle.sql | 22 +++ .../resources/dbscripts/cdm/postgresql.sql | 13 ++ 14 files changed, 558 insertions(+) diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/ApplicationManager.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/ApplicationManager.java index ff4ca7710a..88a6912a7d 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/ApplicationManager.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/ApplicationManager.java @@ -525,4 +525,12 @@ public interface ApplicationManager { String getPlistArtifact(String uuid) throws ApplicationManagementException; List getReleaseByPackageNames(List packageIds) throws ApplicationManagementException; + + /** + * @param applicationRelease {@link ApplicationRelease} + * @param oldPackageName Old package name of the application + * @throws ApplicationManagementException Application management exception + */ + void updateAppIconInfo(ApplicationRelease applicationRelease, String oldPackageName) + throws ApplicationManagementException; } diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ApplicationManagerImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ApplicationManagerImpl.java index 736613e786..b7fd8f23b5 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ApplicationManagerImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ApplicationManagerImpl.java @@ -1287,6 +1287,9 @@ public class ApplicationManagerImpl implements ApplicationManager { } applicationDTO.setId(appId); applicationDTO.setApplicationReleaseDTOs(applicationReleaseEntities); + if (applicationDTO.getType().equals("ENTERPRISE") || applicationDTO.getType().equals("PUBLIC") ) { + persistAppIconInfo(applicationReleaseDTO); + } return APIUtil.appDtoToAppResponse(applicationDTO); } } catch (LifeCycleManagementDAOException e) { @@ -1313,6 +1316,30 @@ public class ApplicationManagerImpl implements ApplicationManager { } } + /** + * Persist application icon information when creating an application + * + * @param applicationReleaseDTO {@link ApplicationReleaseDTO} + * @throws ApplicationManagementException if error occurred while persisting application icon information + */ + private void persistAppIconInfo(ApplicationReleaseDTO applicationReleaseDTO) + throws ApplicationManagementException { + try { + int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(true); + String iconPath = APIUtil.createAppIconPath(applicationReleaseDTO, tenantId); + DataHolder.getInstance().getDeviceManagementService().saveApplicationIcon(iconPath, + String.valueOf(applicationReleaseDTO.getPackageName()), applicationReleaseDTO.getVersion(), tenantId); + } catch (ApplicationManagementException e) { + String msg = "Error occurred while creating iconPath. Application package name : " + applicationReleaseDTO.getPackageName(); + log.error(msg, e); + throw new ApplicationManagementException(msg, e); + } catch (DeviceManagementException e) { + String msg = "Error occurred while saving application icon info. Application package name : " + applicationReleaseDTO.getPackageName(); + log.error(msg, e); + throw new ApplicationManagementException(msg, e); + } + } + @Override public ApplicationRelease createRelease(ApplicationDTO applicationDTO, ApplicationReleaseDTO applicationReleaseDTO, ApplicationType type, boolean isPublished) @@ -1918,6 +1945,13 @@ public class ApplicationManagerImpl implements ApplicationManager { break; } } + try { + deleteAppIconInfo(applicationDTO); + } catch (ApplicationManagementException e) { + String msg = "Error occurred while deleting application icon info. Application package name: " + applicationDTO.getPackageName(); + log.error(msg, e); + throw new ApplicationManagementException(msg, e); + } } @Override @@ -4022,4 +4056,32 @@ public class ApplicationManagerImpl implements ApplicationManager { ConnectionManagerUtil.closeDBConnection(); } } + + @Override + public void updateAppIconInfo(ApplicationRelease applicationRelease, String oldPackageName) throws ApplicationManagementException { + try { + DataHolder.getInstance().getDeviceManagementService().updateApplicationIcon(applicationRelease.getIconPath(), + oldPackageName, applicationRelease.getPackageName(), applicationRelease.getVersion()); + } catch (DeviceManagementException e) { + String msg = "Error occurred while updating application icon info. Application package name: " + oldPackageName; + log.error(msg, e); + throw new ApplicationManagementException(msg, e); + } + } + + /** + * Delete application icon information when deleting an application + * + * @param applicationDTO {@link ApplicationDTO} + * @throws ApplicationManagementException if error occurred while deleting application icon information + */ + private void deleteAppIconInfo(ApplicationDTO applicationDTO) throws ApplicationManagementException { + try { + DataHolder.getInstance().getDeviceManagementService().deleteApplicationIcon(applicationDTO.getPackageName()); + } catch (DeviceManagementException e) { + String msg = "Error occurred while deleting application icon info. Application package name: " + applicationDTO.getPackageName(); + log.error(msg, e); + throw new ApplicationManagementException(msg, e); + } + } } diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/APIUtil.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/APIUtil.java index 95f402e9cf..407b4ebcac 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/APIUtil.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/APIUtil.java @@ -510,4 +510,18 @@ public class APIUtil { return mdmConfig.getArtifactDownloadProtocol() + "://" + host + ":" + port + artifactDownloadEndpoint + Constants.FORWARD_SLASH; } + + /** + * To create the application icon path. + * + * @param applicationReleaseDTO {@link ApplicationReleaseDTO} + * @param tenantId tenant ID + * @return iconPath constructed icon path. + */ + public static String createAppIconPath(ApplicationReleaseDTO applicationReleaseDTO, int tenantId) throws ApplicationManagementException { + String basePath = getArtifactDownloadBaseURL() + tenantId + Constants.FORWARD_SLASH + applicationReleaseDTO + .getAppHashValue() + Constants.FORWARD_SLASH; + String iconPath = basePath + Constants.ICON_ARTIFACT + Constants.FORWARD_SLASH + applicationReleaseDTO.getIconName(); + return iconPath; + } } diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/impl/ApplicationManagementPublisherAPIImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/impl/ApplicationManagementPublisherAPIImpl.java index 583d4de17c..6b3f9fc06d 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/impl/ApplicationManagementPublisherAPIImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/impl/ApplicationManagementPublisherAPIImpl.java @@ -532,6 +532,8 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem log.error(msg); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } + String oldPackageName = applicationManager.getApplicationByUuid(applicationUUID).getPackageName(); + applicationManager.updateAppIconInfo(applicationRelease, oldPackageName); return Response.status(Response.Status.OK).entity(applicationRelease).build(); } catch (BadRequestException e) { String msg = e.getMessage(); @@ -572,6 +574,8 @@ public class ApplicationManagementPublisherAPIImpl implements ApplicationManagem log.error(msg); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } + String oldPackageName = applicationManager.getApplicationByUuid(applicationUUID).getPackageName(); + applicationManager.updateAppIconInfo(applicationRelease, oldPackageName); return Response.status(Response.Status.OK).entity(applicationRelease).build(); } catch (BadRequestException e) { String msg = e.getMessage(); diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/pom.xml b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/pom.xml index 200fca7478..23f16f3cda 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/pom.xml +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/pom.xml @@ -362,6 +362,18 @@ io.entgra.device.mgt.core io.entgra.device.mgt.core.notification.logger + + org.wso2.orbit.javax.xml.bind + jaxb-api + 2.3.1.wso2v1 + compile + + + org.wso2.orbit.javax.xml.bind + jaxb-api + 2.3.1.wso2v1 + compile + diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/ApplicationDAO.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/ApplicationDAO.java index ef3d07ee7c..0c1899e9af 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/ApplicationDAO.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/ApplicationDAO.java @@ -63,4 +63,55 @@ public interface ApplicationDAO { * @throws DeviceManagementDAOException If any database error occured */ List getAppVersions(int tenantId, String packageName) throws DeviceManagementDAOException; + + /** + * This method is used to save application icon information. + * @param iconPath Icon path of the application + * @param packageName Package name of the application + * @param version version of the application + * @throws DeviceManagementDAOException If any database error occurred + */ + void saveApplicationIcon(String iconPath, String packageName, String version, int tenantId) throws DeviceManagementDAOException; + + /** + * This method is used to check the package existence. + * @param packageName Package name of the application + * @throws DeviceManagementDAOException If any database error occurred + */ + int getApplicationPackageCount(String packageName) throws DeviceManagementDAOException; + + /** + * This method is used to update application icon information. + * @param iconPath Icon path of the application + * @param oldPackageName Old package name of the application + * @param newPackageName New package name of the application + * @param version Version of the application + * @throws DeviceManagementDAOException If any database error occurred + */ + void updateApplicationIcon(String iconPath, String oldPackageName, String newPackageName, String version) throws DeviceManagementDAOException; + + /** + * This method is used to delete application icon information. + * @param packageName Package name of the application + * @throws DeviceManagementDAOException If any database error occurred + */ + void deleteApplicationIcon(String packageName) throws DeviceManagementDAOException; + + /** + * This method is used to get the installed application list of a specific device + * @param deviceId ID of the device + * @param enrolmentId Enrolment ID of the device + * @param tenantId tenant ID + * @throws DeviceManagementDAOException If any database error occurred + */ + List getInstalledApplicationListOnDevice(int deviceId, int enrolmentId, int offset, int limit, int tenantId) + throws DeviceManagementDAOException; + + /** + * This method is used to retrieve the icon info of an installed app in device. + * @param applicationIdentifier application identifier. + * @return returns the application icon path. + * @throws DeviceManagementDAOException + */ + String getIconPath(String applicationIdentifier) throws DeviceManagementDAOException; } diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/ApplicationDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/ApplicationDAOImpl.java index 3b4bb1642e..8aa49c92e0 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/ApplicationDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/ApplicationDAOImpl.java @@ -34,7 +34,9 @@ import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; +import java.sql.Timestamp; import java.util.ArrayList; +import java.util.Date; import java.util.List; import java.util.Properties; @@ -394,4 +396,178 @@ public class ApplicationDAOImpl implements ApplicationDAO { return application; } + @Override + public void saveApplicationIcon(String iconPath, String packageName, String version, int tenantId) + throws DeviceManagementDAOException{ + Connection conn; + String sql = "INSERT INTO DM_APP_ICONS " + + "(ICON_PATH, " + + "PACKAGE_NAME, " + + "VERSION, " + + "CREATED_TIMESTAMP, " + + "TENANT_ID) " + + "VALUES (?, ?, ?, ?, ?)"; + try { + conn = this.getConnection(); + try (PreparedStatement stmt = conn.prepareStatement(sql)) { + stmt.setString(1,iconPath); + stmt.setString(2,packageName); + stmt.setString(3,version); + stmt.setTimestamp(4, new Timestamp(new Date().getTime())); + stmt.setInt(5, tenantId); + stmt.executeUpdate(); + } + } catch (SQLException e) { + String msg = "Error occurred while saving application icon details"; + log.error(msg, e); + throw new DeviceManagementDAOException(msg, e); + } + } + + @Override + public int getApplicationPackageCount(String packageName) throws DeviceManagementDAOException{ + Connection conn; + String sql = "SELECT " + + "COUNT(*) AS APP_PACKAGE_COUNT " + + "FROM DM_APP_ICONS " + + "WHERE PACKAGE_NAME = ?"; + try { + conn = this.getConnection(); + try (PreparedStatement stmt = conn.prepareStatement(sql)) { + stmt.setString(1, packageName); + try (ResultSet rs = stmt.executeQuery()) { + if (rs.next()) { + return rs.getInt("APP_PACKAGE_COUNT"); + } + return 0; + } + } + } catch (SQLException e) { + String msg = "Error occurred while getting application icon details"; + log.error(msg, e); + throw new DeviceManagementDAOException(msg, e); + } + } + + @Override + public void updateApplicationIcon(String iconPath, String oldPackageName, String newPackageName, String version) + throws DeviceManagementDAOException{ + Connection conn; + String sql = "UPDATE DM_APP_ICONS " + + "SET " + + "ICON_PATH= ?, " + + "PACKAGE_NAME = ?, " + + "VERSION = ? " + + "WHERE PACKAGE_NAME = ?"; + try { + conn = this.getConnection(); + try (PreparedStatement stmt = conn.prepareStatement(sql)) { + stmt.setString(1,iconPath); + stmt.setString(2,newPackageName); + stmt.setString(3,version); + stmt.setString(4,oldPackageName); + stmt.executeUpdate(); + } + } catch (SQLException e) { + String msg = "Error occurred while updating application icon details"; + log.error(msg, e); + throw new DeviceManagementDAOException(msg, e); + } + } + + @Override + public void deleteApplicationIcon(String packageName) throws DeviceManagementDAOException { + Connection conn; + String sql = "DELETE " + + "FROM DM_APP_ICONS " + + "WHERE PACKAGE_NAME = ?"; + try { + conn = this.getConnection(); + try (PreparedStatement stmt = conn.prepareStatement(sql)) { + stmt.setString(1, packageName); + stmt.executeUpdate(); + } + } catch (SQLException e) { + String msg = "Error occurred while deleting application icon details"; + log.error(msg, e); + throw new DeviceManagementDAOException(msg, e); + } + } + + @Override + public String getIconPath(String applicationIdentifier) throws DeviceManagementDAOException{ + Connection conn; + String sql = "SELECT " + + "ICON_PATH " + + "FROM DM_APP_ICONS " + + "WHERE PACKAGE_NAME = ?"; + String iconPath = null; + try { + conn = this.getConnection(); + try (PreparedStatement stmt = conn.prepareStatement(sql)) { + stmt.setString(1,applicationIdentifier); + try (ResultSet rs = stmt.executeQuery()) { + if (rs.next()) { + iconPath = rs.getString("ICON_PATH"); + } + return iconPath; + } + } + } catch (SQLException e) { + String msg = "Error occurred while retrieving app icon path of the application"; + log.error(msg, e); + throw new DeviceManagementDAOException(msg, e); + } + } + + @Override + public List getInstalledApplicationListOnDevice(int deviceId, int enrolmentId, int offset, int limit, int tenantId) + throws DeviceManagementDAOException { + Connection conn; + List applicationList = new ArrayList<>(); + Application application; + String sql = "SELECT " + + "ID, " + + "NAME, " + + "APP_IDENTIFIER, " + + "PLATFORM, " + + "CATEGORY, " + + "VERSION, " + + "TYPE, " + + "LOCATION_URL, " + + "IMAGE_URL, " + + "APP_PROPERTIES, " + + "MEMORY_USAGE, " + + "IS_ACTIVE, " + + "TENANT_ID " + + "FROM DM_APPLICATION " + + "WHERE DEVICE_ID = ? AND " + + "ENROLMENT_ID = ? AND " + + "TENANT_ID = ? " + + "LIMIT ? " + + "OFFSET ?"; + try { + conn = this.getConnection(); + try (PreparedStatement stmt = conn.prepareStatement(sql)) { + stmt.setInt(1, deviceId); + stmt.setInt(2, enrolmentId); + stmt.setInt(3, tenantId); + stmt.setInt(4, limit); + stmt.setInt(5, offset); + try (ResultSet rs = stmt.executeQuery()) { + while (rs.next()) { + application = loadApplication(rs); + applicationList.add(application); + } + } + } + + } catch (SQLException e) { + String msg = "SQL Error occurred while retrieving the list of Applications " + + "installed in device id '" + deviceId; + log.error(msg, e); + throw new DeviceManagementDAOException(msg, e); + } + return applicationList; + } } diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderService.java index 98ef9fc4ae..cb372841e6 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderService.java @@ -18,6 +18,7 @@ package io.entgra.device.mgt.core.device.mgt.core.service; +import io.entgra.device.mgt.core.device.mgt.common.app.mgt.Application; import org.apache.commons.collections.map.SingletonMap; import io.entgra.device.mgt.core.device.mgt.common.*; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.ApplicationManagementException; @@ -1017,4 +1018,42 @@ public interface DeviceManagementProviderService { throws DeviceManagementException; Boolean sendDeviceNameChangedNotification(Device device) throws DeviceManagementException; + + /** + * This method is for saving application icon info + * @param iconPath Icon path of the application + * @param packageName Package name of the application + * @param version Version of the application + * @param tenantId Tenant ID of the application created user + * @throws DeviceManagementException if any service level or DAO level error occurs + */ + void saveApplicationIcon(String iconPath, String packageName, String version, int tenantId) + throws DeviceManagementException; + + /** + * This method is for updating application icon info + * @param iconPath Icon path of the application + * @param oldPackageName Old package name of the application + * @param newPackageName New package name of the application + * @param version Version of the application + * @throws DeviceManagementException if any service level or DAO level error occurs + */ + void updateApplicationIcon(String iconPath, String oldPackageName, String newPackageName, String version) + throws DeviceManagementException; + + /** + * This method is for deleting application icon info + * @param packageName Package name of the application + * @throws DeviceManagementException if any service level or DAO level error occurs + */ + void deleteApplicationIcon(String packageName) throws DeviceManagementException; + + /** + * This method is for getting the installed application list of a device + * @param device {@link Device} + * @return list of applications {@link Application} + * @throws DeviceManagementException if any service level or DAO level error occurs + */ + List getInstalledApplicationsOnDevice(Device device, int offset, int limit) + throws DeviceManagementException; } diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderServiceImpl.java index 15955daee4..f9c5ec4f7c 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderServiceImpl.java @@ -4899,4 +4899,130 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv throw new DeviceManagementException(msg, e); } } + + @Override + public void saveApplicationIcon(String iconPath, String packageName, String version, int tenantId) throws DeviceManagementException{ + try{ + DeviceManagementDAOFactory.beginTransaction(); + if(applicationDAO.getApplicationPackageCount(packageName) == 0){ + applicationDAO.saveApplicationIcon(iconPath, packageName, version, tenantId); + } + DeviceManagementDAOFactory.commitTransaction(); + } catch (TransactionManagementException e) { + String msg = "Error occurred while initiating transaction"; + log.error(msg, e); + throw new DeviceManagementException(msg, e); + } catch (DeviceManagementDAOException e) { + DeviceManagementDAOFactory.rollbackTransaction(); + String msg = "Error occurred while saving app icon. Icon Path: " + iconPath + + " Package Name: " + packageName + + " Version: " + version + + " Tenant Id: " + tenantId; + log.error(msg, e); + throw new DeviceManagementException(msg, e); + } finally { + DeviceManagementDAOFactory.closeConnection(); + } + } + + @Override + public void updateApplicationIcon(String iconPath, String oldPackageName, String newPackageName, String version) + throws DeviceManagementException{ + try { + DeviceManagementDAOFactory.beginTransaction(); + applicationDAO.updateApplicationIcon(iconPath, oldPackageName, newPackageName, version); + DeviceManagementDAOFactory.commitTransaction(); + } catch (TransactionManagementException e) { + String msg = "Error occurred while initiating transaction"; + log.error(msg, e); + throw new DeviceManagementException(msg, e); + } catch (DeviceManagementDAOException e) { + DeviceManagementDAOFactory.rollbackTransaction(); + String msg = "Error occurred while updating app icon info." + + " Package Name: " + oldPackageName; + log.error(msg, e); + throw new DeviceManagementException(msg, e); + } finally { + DeviceManagementDAOFactory.closeConnection(); + } + } + + @Override + public void deleteApplicationIcon(String packageName) + throws DeviceManagementException { + try { + DeviceManagementDAOFactory.beginTransaction(); + applicationDAO.deleteApplicationIcon(packageName); + DeviceManagementDAOFactory.commitTransaction(); + } catch (TransactionManagementException e) { + String msg = "Error occurred while initiating transaction"; + log.error(msg, e); + throw new DeviceManagementException(msg, e); + } catch (DeviceManagementDAOException e) { + DeviceManagementDAOFactory.rollbackTransaction(); + String msg = "Error occurred while deleting app icon info." + + " Package Name: " + packageName ; + log.error(msg, e); + throw new DeviceManagementException(msg, e); + } finally { + DeviceManagementDAOFactory.closeConnection(); + } + } + + private List getInstalledAppIconInfo(List applications) throws DeviceManagementException { + String iconPath; + try { + DeviceManagementDAOFactory.openConnection(); + for (Application app : applications) { + iconPath = applicationDAO.getIconPath(app.getApplicationIdentifier()); + app.setImageUrl(iconPath); + } + } catch (DeviceManagementDAOException e) { + String msg = "Error occurred while retrieving installed app icon info"; + log.error(msg, e); + throw new DeviceManagementException(msg, e); + } catch (SQLException e) { + String msg = "Error occurred while opening a connection to the data source"; + log.error(msg); + throw new DeviceManagementException(msg, e); + } finally { + DeviceManagementDAOFactory.closeConnection(); + } + return applications; + } + + @Override + public List getInstalledApplicationsOnDevice(Device device, int offset, int limit) throws DeviceManagementException { + List applications; + try { + DeviceManagementDAOFactory.openConnection(); + int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); + applications = applicationDAO.getInstalledApplicationListOnDevice(device.getId(), + device.getEnrolmentInfo().getId(), offset, limit, tenantId); + if (applications == null) { + String msg = "Couldn't found applications for device identifier '" + device.getId() + "'"; + log.error(msg); + throw new DeviceManagementException(msg); + } + } catch (DeviceManagementDAOException e) { + String msg = "Error occurred while retrieving the application list of android device, " + + "which carries the id '" + device.getId() + "'"; + log.error(msg, e); + throw new DeviceManagementException(msg, e); + } catch (SQLException e) { + String msg = "Error occurred while opening a connection to the data source"; + log.error(msg, e); + throw new DeviceManagementException(msg, e); + } finally { + DeviceManagementDAOFactory.closeConnection(); + } + List newApplicationList; + newApplicationList = this.getInstalledAppIconInfo(applications); + if (newApplicationList == null) { + String msg = "Error occurred while getting app icon info for device identifier '" + device.getId() + "'"; + log.error(msg); + throw new DeviceManagementException(msg); + } + return newApplicationList; + } } diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/h2.sql b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/h2.sql index f675cfb0f3..ad8d4e639e 100644 --- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/h2.sql +++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/h2.sql @@ -417,6 +417,16 @@ CREATE TABLE IF NOT EXISTS DM_APPLICATION ( -- POLICY RELATED TABLES FINISHED -- +CREATE TABLE IF NOT EXISTS DM_APP_ICONS ( + ID INTEGER AUTO_INCREMENT NOT NULL, + ICON_PATH VARCHAR(150) DEFAULT NULL, + PACKAGE_NAME VARCHAR(150) NOT NULL, + VERSION VARCHAR(50) DEFAULT '1.1.0', + CREATED_TIMESTAMP TIMESTAMP NOT NULL, + TENANT_ID INTEGER NOT NULL, + PRIMARY KEY (ID) +); + -- NOTIFICATION TABLE -- CREATE TABLE IF NOT EXISTS DM_NOTIFICATION ( NOTIFICATION_ID INTEGER AUTO_INCREMENT NOT NULL, diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mssql.sql b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mssql.sql index 028c24829f..c162d41e06 100644 --- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mssql.sql +++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mssql.sql @@ -462,6 +462,17 @@ CREATE INDEX IDX_DM_APPLICATION ON DM_APPLICATION(DEVICE_ID, ENROLMENT_ID, TENAN -- POLICY RELATED TABLES FINISHED -- +IF NOT EXISTS (SELECT * SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[DM_APP_ICONS]') AND TYPE IN (N'U')) +CREATE TABLE DM_APP_ICONS ( + ID INTEGER IDENTITY(1,1) NOT NULL, + ICON_PATH VARCHAR(150) DEFAULT NULL, + PACKAGE_NAME VARCHAR(150) NOT NULL, + VERSION VARCHAR(50) DEFAULT '1.1.0', + CREATED_TIMESTAMP DATETIME2 NOT NULL, + TENANT_ID INTEGER NOT NULL, + PRIMARY KEY (ID) +); + -- POLICY AND DEVICE GROUP MAPPING -- IF NOT EXISTS (SELECT * FROM SYS.OBJECTS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[DM_DEVICE_GROUP_POLICY]') AND TYPE IN (N'U')) CREATE TABLE DM_DEVICE_GROUP_POLICY ( diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mysql.sql b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mysql.sql index 0c5a8fb090..6dcc7bec44 100644 --- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mysql.sql +++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/mysql.sql @@ -458,6 +458,16 @@ CREATE INDEX IDX_DM_APPLICATION ON DM_APPLICATION(DEVICE_ID, ENROLMENT_ID, TENAN -- END OF POLICY RELATED TABLES -- +CREATE TABLE IF NOT EXISTS DM_APP_ICONS ( + ID INTEGER AUTO_INCREMENT NOT NULL, + ICON_PATH VARCHAR(150) DEFAULT NULL, + PACKAGE_NAME VARCHAR(150) NOT NULL, + VERSION VARCHAR(50) DEFAULT '1.1.0', + CREATED_TIMESTAMP TIMESTAMP NOT NULL, + TENANT_ID INTEGER NOT NULL, + PRIMARY KEY (ID) +)ENGINE = InnoDB; + -- POLICY AND DEVICE GROUP MAPPING -- CREATE TABLE IF NOT EXISTS DM_DEVICE_GROUP_POLICY ( diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/oracle.sql b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/oracle.sql index 1a0ddb3064..a6f87c9cb6 100644 --- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/oracle.sql +++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/oracle.sql @@ -748,6 +748,28 @@ WHEN (NEW.ID IS NULL) -- POLICY RELATED TABLES FINISHED -- +CREATE TABLE DM_APP_ICONS ( + ID NUMBER(10) NOT NULL, + ICON_PATH VARCHAR2(150) DEFAULT NULL, + PACKAGE_NAME VARCHAR2(150) NOT NULL, + VERSION VARCHAR2(50) DEFAULT '1.1.0', + CREATED_TIMESTAMP TIMESTAMP(0) NOT NULL, + TENANT_ID NUMBER(10) NOT NULL, + PRIMARY KEY (ID) +) +/ + +-- Generate ID using sequence and trigger +CREATE SEQUENCE DM_APP_ICONS_seq START WITH 1 INCREMENT BY 1 NOCACHE +/ +CREATE OR REPLACE TRIGGER DM_APP_ICONS_seq_tr +BEFORE INSERT ON DM_APP_ICONS FOR EACH ROW +WHEN (NEW.ID IS NULL) + BEGIN + SELECT DM_APP_ICONS_seq.NEXTVAL INTO :NEW.ID FROM DUAL; + END; +/ + -- NOTIFICATION TABLE -- CREATE TABLE DM_NOTIFICATION ( NOTIFICATION_ID NUMBER(10) NOT NULL, diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/postgresql.sql b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/postgresql.sql index 7df9dcc065..8c601111b7 100644 --- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/postgresql.sql +++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/postgresql.sql @@ -490,6 +490,19 @@ CREATE TABLE IF NOT EXISTS DM_APPLICATION ( -- END OF POLICY RELATED TABLES -- +CREATE SEQUENCE DM_APP_ICONS_seq; + +CREATE TABLE IF NOT EXISTS DM_APP_ICONS ( + ID INTEGER DEFAULT NEXTVAL ('DM_APP_ICONS_seq') NOT NULL, + ICON_PATH VARCHAR(150) DEFAULT NULL, + PACKAGE_NAME VARCHAR(150) NOT NULL, + VERSION VARCHAR(50) DEFAULT '1.1.0', + CREATED_TIMESTAMP TIMESTAMP(0) NOT NULL, + TENANT_ID INTEGER NOT NULL, + PRIMARY KEY (ID) +) +; + -- POLICY AND DEVICE GROUP MAPPING -- CREATE SEQUENCE DM_DEVICE_GROUP_POLICY_seq; From 1fb777264de12a299f7d9db7fdb536929c1f9ac4 Mon Sep 17 00:00:00 2001 From: prathabanKavin Date: Thu, 1 Jun 2023 22:55:04 +0530 Subject: [PATCH 3/4] Check for logged in tenant id --- .../core/dao/impl/geofence/SQLServerGeofenceDAOImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/geofence/SQLServerGeofenceDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/geofence/SQLServerGeofenceDAOImpl.java index 0713f3c578..fa04264286 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/geofence/SQLServerGeofenceDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/geofence/SQLServerGeofenceDAOImpl.java @@ -26,6 +26,7 @@ import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeofenceData; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.dao.EventManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.AbstractGeofenceDAOImpl; +import org.wso2.carbon.context.CarbonContext; import java.sql.Connection; import java.sql.PreparedStatement; @@ -114,7 +115,7 @@ public class SQLServerGeofenceDAOImpl extends AbstractGeofenceDAOImpl { if (!requireGroupData) { return getGeofence(fenceId); } - + int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); try { Connection con = this.getConnection(); String sql = "SELECT " + @@ -131,9 +132,11 @@ public class SQLServerGeofenceDAOImpl extends AbstractGeofenceDAOImpl { "FROM DM_GEOFENCE G, DM_GEOFENCE_GROUP_MAPPING M, DM_GROUP GR " + "WHERE G.ID = M.FENCE_ID " + "AND M.GROUP_ID = GR.ID " + - "AND G.ID = ?"; + "AND G.ID = ? " + + "AND G.TENANT_ID = ?"; try (PreparedStatement stmt = con.prepareStatement(sql, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY)) { stmt.setInt(1, fenceId); + stmt.setInt(2, tenantId); try (ResultSet rst = stmt.executeQuery()) { Map groupMap = new HashMap<>(); GeofenceData geofenceData = null; From 1bb571acde84ab2b36dd36725d82131c2208ed03 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Tue, 6 Jun 2023 12:42:33 +0530 Subject: [PATCH 4/4] fixing dependency issues when installing on apim420 --- .../proxy/api/GrafanaAPIProxyService.java | 21 +- .../proxy/api/addons/ApiOriginFilter.java | 7 +- .../api/addons/ValidationInterceptor.java | 6 +- .../api/impl/GrafanaAPIProxyServiceImpl.java | 14 +- .../impl/util/GrafanaRequestHandlerUtil.java | 4 +- .../pom.xml | 14 +- .../pom.xml | 82 ++++-- .../GrafanaManagementServiceComponent.java | 12 +- .../pom.xml | 20 +- .../extension/AnalyticsArtifactsDeployer.java | 7 +- .../pom.xml | 29 +- .../pom.xml | 6 +- ...ApiApplicationRegistrationServiceImpl.java | 8 +- .../api/filter/ApiPermissionFilter.java | 9 +- .../extension/api/util/APIUtil.java | 6 +- .../pom.xml | 49 ++-- .../APIManagementProviderServiceImpl.java | 33 +-- .../extension/dto/ApiApplicationKey.java | 2 +- ...ApplicationManagerExtensionDataHolder.java | 2 +- ...ationManagerExtensionServiceComponent.java | 52 ++-- .../extension/util/APIManagerUtil.java | 4 +- .../pom.xml | 48 ++-- .../rest/api/APIApplicationServicesImpl.java | 14 +- .../rest/api/PublisherRESTAPIServices.java | 9 +- .../api/PublisherRESTAPIServicesImpl.java | 15 +- .../rest/api/constants/Constants.java | 8 +- .../PublisherRESTAPIServiceComponent.java | 23 +- .../rest/api/util/HttpsTrustManagerUtils.java | 24 +- .../pom.xml | 5 +- .../extension/api/KeyManagerService.java | 7 +- .../extension/api/KeyManagerServiceImpl.java | 7 +- .../src/main/webapp/WEB-INF/cxf-servlet.xml | 4 +- .../pom.xml | 53 +++- .../KeyManagerConnectorConfiguration.java | 8 +- .../extension/KeyValidationHandler.java | 16 +- .../internal/KeyMgtServiceComponent.java | 16 +- .../extension/service/KeyMgtServiceImpl.java | 31 +-- .../pom.xml | 98 ++++--- .../publisher/APIPublisherServiceImpl.java | 30 +-- .../publisher/APIPublisherStartupHandler.java | 4 +- .../webapp/publisher/APIPublisherUtil.java | 4 +- .../config/WebappPublisherConfig.java | 2 +- .../APIPublisherServiceComponent.java | 41 +-- .../APIPublisherLifecycleListener.java | 12 +- .../lifecycle/util/AnnotationProcessor.java | 19 +- .../ExtendedFileProtocolIteratorFactory.java | 1 - .../publisher/APIPublisherServiceTest.java | 14 +- .../publisher/APIPublisherUtilTest.java | 11 +- .../publisher/BaseAPIPublisherTest.java | 6 +- .../org.wso2.carbon.apimgt.handlers/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- components/apimgt-extensions/pom.xml | 21 +- .../pom.xml | 40 ++- .../mgt/addons/JSONMessageHandler.java | 6 +- .../mgt/addons/MultipartCustomProvider.java | 2 +- .../pom.xml | 1 - .../mgt/api/ArtifactDownloadAPI.java | 16 +- .../mgt/api/impl/ArtifactDownloadAPIImpl.java | 17 +- .../pom.xml | 42 +-- .../common/ApplicationInstallResponse.java | 2 +- .../common/ApplicationSubscriptionInfo.java | 1 - .../application/mgt/common/DeviceList.java | 2 +- .../mgt/common/DeviceSubscriptionData.java | 2 - .../mgt/common/InstallationDetails.java | 2 +- .../mgt/common/LifecycleState.java | 2 +- .../common/dto/ScheduledSubscriptionDTO.java | 2 +- .../common/services/ApplicationManager.java | 18 +- .../mgt/common/services/ReviewManager.java | 4 +- .../common/services/SubscriptionManager.java | 2 +- .../pom.xml | 135 +++++++--- .../mgt/core/config/Configuration.java | 4 +- .../mgt/core/config/ConfigurationManager.java | 6 +- .../mgt/core/config/Extension.java | 2 +- .../mgt/core/dao/ApplicationDAO.java | 2 +- .../mgt/core/dao/ApplicationReleaseDAO.java | 2 +- .../application/mgt/core/dao/ReviewDAO.java | 2 +- .../mgt/core/dao/SPApplicationDAO.java | 2 +- .../ApplicationManagementDAOFactory.java | 38 ++- .../GenericApplicationDAOImpl.java | 20 +- .../application/OracleApplicationDAOImpl.java | 8 +- .../SQLServerApplicationDAOImpl.java | 8 +- .../GenericApplicationReleaseDAOImpl.java | 14 +- .../OracleApplicationReleaseDAOImpl.java | 4 +- .../SQLServerApplicationReleaseDAOImpl.java | 4 +- .../GenericSPApplicationDAOImpl.java | 8 +- .../OracleSPApplicationDAOImpl.java | 9 +- .../PostgreSQLSPApplicationDAOImpl.java | 9 +- .../SQLServerSPApplicationDAOImpl.java | 9 +- .../GenericLifecycleStateDAOImpl.java | 14 +- .../dao/impl/review/GenericReviewDAOImpl.java | 17 +- .../dao/impl/review/OracleReviewDAOImpl.java | 8 +- .../impl/review/SQLServerReviewDAOImpl.java | 6 +- .../GenericSubscriptionDAOImpl.java | 26 +- .../OracleSubscriptionDAOImpl.java | 4 +- .../SQLServerSubscriptionDAOImpl.java | 4 +- .../visibility/GenericVisibilityDAOImpl.java | 4 +- .../mgt/core/impl/ApplicationManagerImpl.java | 86 ++---- .../impl/ApplicationStorageManagerImpl.java | 21 +- .../mgt/core/impl/AppmDataHandlerImpl.java | 10 +- .../mgt/core/impl/ReviewManagerImpl.java | 20 +- .../core/impl/SPApplicationManagerImpl.java | 9 +- .../core/impl/SubscriptionManagerImpl.java | 64 ++--- ...ApplicationManagementServiceComponent.java | 78 +++--- .../mgt/core/internal/DataHolder.java | 7 +- .../core/lifecycle/LifecycleStateManager.java | 8 +- .../impl/WSO2IAMSPApplicationService.java | 3 +- .../ScheduledAppSubscriptionCleanupTask.java | 6 +- .../task/ScheduledAppSubscriptionTask.java | 12 +- .../ScheduledAppSubscriptionTaskManager.java | 20 +- .../application/mgt/core/util/APIUtil.java | 37 ++- .../core/util/ApplicationManagementUtil.java | 35 +-- .../util/ApplicationMgtDatabaseCreator.java | 1 + .../mgt/core/util/ArtifactsParser.java | 12 +- .../mgt/core/util/ConnectionManagerUtil.java | 8 +- .../application/mgt/core/util/DAOUtil.java | 14 +- .../application/mgt/core/util/HelperUtil.java | 4 +- .../application/mgt/core/util/OAuthUtils.java | 6 +- .../mgt/core/ArtifactParserTest.java | 4 +- .../application/mgt/core/BaseTestCase.java | 14 +- .../mgt/core/ConfigurationTest.java | 6 +- .../core/application/mgt/core/InitTest.java | 2 +- .../mgt/core/LifeCycleStateManagerTest.java | 2 +- .../mgt/core/LifecycleManagementTest.java | 8 +- .../mgt/core/StorageManagementUtilTest.java | 6 +- .../dao/ApplicationManagementDAOTest.java | 10 +- .../management/ApplicationManagementTest.java | 14 +- .../conf/datasources/master-datasources.xml | 2 +- .../repository/conf/etc/tasks-config.xml | 2 +- .../pom.xml | 1 - .../ApplicationManagementPublisherAPI.java | 35 +-- .../publisher/api/SPApplicationService.java | 22 +- ...pplicationManagementPublisherAdminAPI.java | 20 +- .../ReviewManagementPublisherAdminAPI.java | 17 +- ...ApplicationManagementPublisherAPIImpl.java | 44 +-- .../api/impl/SPApplicationServiceImpl.java | 12 +- ...cationManagementPublisherAdminAPIImpl.java | 13 +- ...ReviewManagementPublisherAdminAPIImpl.java | 10 +- .../pom.xml | 1 - .../services/ApplicationManagementAPI.java | 22 +- .../api/services/ReviewManagementAPI.java | 23 +- .../services/SubscriptionManagementAPI.java | 19 +- .../admin/ReviewManagementStoreAdminAPI.java | 17 +- .../admin/SubscriptionManagementAdminAPI.java | 21 +- .../impl/ApplicationManagementAPIImpl.java | 13 +- .../impl/ReviewManagementAPIImpl.java | 24 +- .../impl/SubscriptionManagementAPIImpl.java | 31 +-- .../ReviewManagementStoreAdminAPIImpl.java | 12 +- .../SubscriptionManagementAdminAPIImpl.java | 21 +- .../impl/util/RequestValidationUtil.java | 6 +- .../api/services/ReviewManagementAPITest.java | 4 +- components/application-mgt/pom.xml | 19 +- .../pom.xml | 2 +- .../api/impl/CertificateMgtServiceImpl.java | 12 +- .../pom.xml | 3 +- .../cert/admin/api/beans/CertificateList.java | 2 +- ...CertificateManagementAdminServiceImpl.java | 5 +- .../api/util/CertificateMgtAPIUtils.java | 6 +- .../admin/api/util/RequestValidationUtil.java | 2 +- .../pom.xml | 127 ++++----- .../impl/CertificateCacheManagerImpl.java | 2 +- .../dao/CertificateManagementDAOFactory.java | 4 +- .../dao/impl/AbstractCertificateDAOImpl.java | 8 +- .../dao/impl/GenericCertificateDAOImpl.java | 8 +- .../dao/impl/OracleCertificateDAOImpl.java | 8 +- .../impl/PostgreSQLCertificateDAOImpl.java | 8 +- .../dao/impl/SQLServerCertificateDAOImpl.java | 8 +- .../mgt/core/impl/CertificateGenerator.java | 46 +--- .../mgt/core/impl/KeyStoreReader.java | 10 +- ...CertificateManagementServiceComponent.java | 33 +-- .../mgt/core/scep/SCEPManagerImpl.java | 8 +- .../mgt/core/util/CertificateManagerUtil.java | 6 +- .../util/CertificateMgtSchemaInitializer.java | 2 +- .../certificate/mgt/core/util/Serializer.java | 6 +- .../BaseDeviceManagementCertificateTest.java | 8 +- .../CertificateCacheManagerImplTests.java | 4 +- .../CertificateGeneratorNegativeTests.java | 15 +- .../impl/CertificateGeneratorTestSuite.java | 4 +- .../core/impl/CertificateGeneratorTests.java | 2 +- ...ateManagementServiceImplNegativeTests.java | 8 +- ...CertificateManagementServiceImplTests.java | 25 +- .../mgt/core/impl/CertificateTests.java | 2 +- .../mgt/core/util/DummyCertificate.java | 13 +- .../conf/datasources/master-datasources.xml | 2 +- components/certificate-mgt/pom.xml | 21 +- .../pom.xml | 44 ++- .../internal/RoleManagerServiceComponent.java | 37 +-- .../pom.xml | 66 +++-- .../type/deployer/DeviceTypeCAppDeployer.java | 2 +- .../deployer/DeviceTypePluginDeployer.java | 14 +- .../DeviceTypeManagementServiceComponent.java | 45 ++-- .../deployer/util/DeviceTypeConfigUtil.java | 2 +- .../deployer/DeviceTypeCAppDeployerTest.java | 4 +- .../DeviceTypePluginDeployerTest.java | 4 +- .../pom.xml | 7 +- .../pom.xml | 45 ++-- .../PullNotificationSubscriberImpl.java | 6 +- .../PullNotificationServiceComponent.java | 52 ++-- .../pom.xml | 41 +-- .../provider/fcm/FCMNotificationStrategy.java | 4 +- .../FCMPushNotificationServiceComponent.java | 25 +- .../pom.xml | 44 ++- .../provider/http/HTTPMessageExecutor.java | 4 +- .../http/HTTPNotificationStrategy.java | 8 +- .../HTTPPushNotificationServiceComponent.java | 10 +- .../pom.xml | 49 ++-- .../mqtt/MQTTNotificationStrategy.java | 8 +- .../mqtt/internal/MQTTDataHolder.java | 1 - .../MQTTPushNotificationServiceComponent.java | 36 +-- ...MQTTBasedPushNotificationProviderTest.java | 9 +- .../mqtt/MQTTNotificationStrategyTest.java | 20 +- .../pom.xml | 43 ++- .../xmpp/XMPPNotificationStrategy.java | 4 +- .../XMPPPushNotificationServiceComponent.java | 36 +-- .../pom.xml | 28 +- .../stateengine/spi/DeviceStateMachine.java | 4 +- components/device-mgt-extensions/pom.xml | 2 +- .../pom.xml | 47 +--- .../mgt/api/jaxrs/NotificationContext.java | 4 +- .../mgt/api/jaxrs/NotificationList.java | 2 +- .../mgt/api/jaxrs/beans/ActivityList.java | 2 +- .../mgt/api/jaxrs/beans/ApplicationList.java | 2 +- .../api/jaxrs/beans/ApplicationWrapper.java | 4 +- .../api/jaxrs/beans/AuthorizationRequest.java | 2 +- .../api/jaxrs/beans/ComplianceDeviceList.java | 2 +- .../mgt/api/jaxrs/beans/Credential.java | 2 +- .../mgt/api/jaxrs/beans/DeviceCompliance.java | 2 +- .../mgt/api/jaxrs/beans/DeviceConfig.java | 4 +- .../mgt/api/jaxrs/beans/DeviceList.java | 2 +- .../jaxrs/beans/DeviceToGroupsAssignment.java | 3 +- .../mgt/api/jaxrs/beans/DeviceTypeList.java | 1 - .../mgt/api/jaxrs/beans/MetadataList.java | 2 +- .../mgt/api/jaxrs/beans/NotificationList.java | 2 +- .../mgt/api/jaxrs/beans/OperationList.java | 2 +- .../mgt/api/jaxrs/beans/OperationRequest.java | 2 +- .../mgt/api/jaxrs/beans/PermissionList.java | 1 + .../mgt/api/jaxrs/beans/PolicyList.java | 2 +- .../mgt/api/jaxrs/beans/PolicyWrapper.java | 4 +- .../mgt/api/jaxrs/beans/ProfileFeature.java | 2 +- .../api/jaxrs/beans/RemoteSessionInfo.java | 4 - .../device/mgt/api/jaxrs/beans/RoleInfo.java | 2 - .../beans/analytics/AdapterConfiguration.java | 2 +- .../beans/analytics/DeviceTypeEvent.java | 2 - .../beans/analytics/EventAttributeList.java | 2 - .../jaxrs/beans/analytics/EventRecords.java | 5 +- .../jaxrs/beans/analytics/EventStream.java | 1 - .../exception/GlobalThrowableMapper.java | 2 +- .../api/ActivityInfoProviderService.java | 24 +- .../AnalyticsArtifactsManagementService.java | 20 +- .../api/ConfigurationManagementService.java | 16 +- .../jaxrs/service/api/DeviceAgentService.java | 26 +- .../api/DeviceEventManagementService.java | 22 +- .../service/api/DeviceManagementService.java | 32 +-- .../api/DeviceTypeManagementService.java | 24 +- .../service/api/GeoLocationBasedService.java | 26 +- .../service/api/GroupManagementService.java | 33 +-- .../jaxrs/service/api/MetadataService.java | 27 +- .../api/NotificationManagementService.java | 23 +- .../service/api/PolicyManagementService.java | 24 +- .../service/api/RemoteSessionService.java | 12 +- .../service/api/ReportManagementService.java | 26 +- .../service/api/RoleManagementService.java | 2 +- .../service/api/UserManagementService.java | 41 +-- .../jaxrs/service/api/WhiteLabelService.java | 27 +- .../ApplicationManagementAdminService.java | 13 +- ...DeviceAccessAuthorizationAdminService.java | 12 +- ...AnalyticsArtifactUploaderAdminService.java | 4 +- .../admin/DeviceManagementAdminService.java | 26 +- .../DeviceTypeManagementAdminService.java | 25 +- .../admin/GroupManagementAdminService.java | 16 +- .../api/admin/UserManagementAdminService.java | 6 +- .../impl/ActivityProviderServiceImpl.java | 25 +- ...alyticsArtifactsManagementServiceImpl.java | 33 +-- .../impl/ConfigurationServiceImpl.java | 13 +- .../service/impl/DeviceAgentServiceImpl.java | 36 ++- .../DeviceEventManagementServiceImpl.java | 18 +- .../impl/DeviceManagementServiceImpl.java | 42 ++- .../impl/DeviceTypeManagementServiceImpl.java | 28 +- .../impl/GeoLocationBasedServiceImpl.java | 70 ++--- .../impl/GroupManagementServiceImpl.java | 36 +-- .../service/impl/MetadataServiceImpl.java | 35 +-- .../NotificationManagementServiceImpl.java | 23 +- .../impl/PolicyManagementServiceImpl.java | 26 +- .../impl/RemoteSessionServiceImpl.java | 14 +- .../impl/ReportManagementServiceImpl.java | 26 +- .../impl/RoleManagementServiceImpl.java | 12 +- .../impl/UserManagementServiceImpl.java | 67 ++--- .../service/impl/WhiteLabelServiceImpl.java | 20 +- ...ApplicationManagementAdminServiceImpl.java | 18 +- ...ceAccessAuthorizationAdminServiceImpl.java | 12 +- ...yticsArtifactUploaderAdminServiceImpl.java | 184 +++++++------ .../DeviceManagementAdminServiceImpl.java | 42 +-- .../DeviceTypeManagementAdminServiceImpl.java | 28 +- .../GroupManagementAdminServiceImpl.java | 12 +- .../admin/UserManagementAdminServiceImpl.java | 8 +- .../impl/util/RequestValidationUtil.java | 36 +-- .../SecurityDefinitionConfigurator.java | 3 - .../CredentialManagementResponseBuilder.java | 6 +- .../mgt/api/jaxrs/util/DeviceMgtAPIUtils.java | 60 ++--- .../mgt/api/jaxrs/util/DeviceMgtUtil.java | 2 +- .../impl/ActivityProviderServiceImplTest.java | 26 +- .../impl/ConfigurationServiceImplTest.java | 14 +- .../service/impl/DeviceAgentServiceTest.java | 40 ++- .../impl/DeviceManagementServiceImplTest.java | 32 +-- .../DeviceTypeManagementAdminServiceTest.java | 20 +- .../impl/DeviceTypeManagementServiceTest.java | 16 +- .../impl/GeoLocationBasedServiceImplTest.java | 12 +- .../impl/GroupManagementServiceImplTest.java | 28 +- ...NotificationManagementServiceImplTest.java | 11 +- .../impl/UserManagementServiceImplTest.java | 28 +- .../pom.xml | 36 ++- .../mgt/core/device/mgt/common/Billing.java | 1 + .../device/mgt/common/BillingResponse.java | 1 + .../mgt/core/device/mgt/common/Device.java | 6 +- .../core/device/mgt/common/DeviceBilling.java | 4 +- .../core/device/mgt/common/EnrolmentInfo.java | 1 - .../device/mgt/common/PaginationRequest.java | 6 +- .../device/details/DeviceDetailsWrapper.java | 1 - .../common/device/details/DeviceLocation.java | 2 +- .../device/mgt/common/geo/service/Alert.java | 6 +- .../device/mgt/common/geo/service/Event.java | 6 +- .../service/GeoLocationProviderService.java | 2 - .../mgt/common/geo/service/GeofenceData.java | 1 - .../mgt/common/group/mgt/GroupUser.java | 2 - .../mgt/MetadataManagementService.java | 1 + .../common/operation/mgt/ActivityStatus.java | 2 +- .../operation/mgt/OperationManager.java | 7 +- .../device/mgt/common/policy/mgt/Policy.java | 2 +- .../mgt/common/policy/mgt/ui/Modal.java | 1 - .../mgt/common/policy/mgt/ui/SearchInput.java | 2 - .../report/mgt/ReportManagementService.java | 1 - .../type/mgt/DeviceTypeMetaDefinition.java | 1 - .../pom.xml | 5 + .../mgt/config/api/ApiOriginFilter.java | 7 +- .../api/common/GsonMessageBodyHandler.java | 6 +- .../DeviceManagementConfigService.java | 25 +- .../DeviceManagementConfigServiceImpl.java | 23 +- .../config/api/util/DeviceMgtAPIUtils.java | 2 +- .../pom.xml | 254 ++++++++++++++---- .../DeviceManagementPluginRepository.java | 10 +- ...ApplicationManagerProviderServiceImpl.java | 12 +- .../AppManagementConfigurationManager.java | 2 +- .../app/mgt/oauth/ServiceAuthenticator.java | 2 +- .../core/archival/ArchivalServiceImpl.java | 10 +- .../dao/ArchivalDestinationDAOFactory.java | 4 +- .../dao/ArchivalSourceDAOFactory.java | 4 +- .../archival/dao/impl/ArchivalDAOImpl.java | 15 +- .../dao/impl/DataDeletionDAOImpl.java | 4 +- .../DeviceAccessAuthorizationServiceImpl.java | 11 +- .../mgt/core/cache/DeviceCacheManager.java | 2 +- .../cache/impl/BillingCacheManagerImpl.java | 4 +- .../cache/impl/DeviceCacheManagerImpl.java | 4 +- .../device/mgt/core/common/util/FileUtil.java | 2 +- .../device/mgt/core/common/util/HttpUtil.java | 3 +- .../common/util/StorageManagementUtil.java | 12 +- .../config/DeviceConfigurationManager.java | 2 +- .../core/config/DeviceManagementConfig.java | 6 +- .../license/LicenseConfigurationManager.java | 4 +- .../permission/AnnotationProcessor.java | 12 +- .../WebAppDeploymentLifecycleListener.java | 10 +- ...ormConfigurationManagementServiceImpl.java | 6 +- .../config/ui/UIConfigurationManager.java | 6 +- .../config/util/ConfigurationManagerUtil.java | 2 +- .../device/mgt/core/dao/ApplicationDAO.java | 1 - .../core/device/mgt/core/dao/DeviceDAO.java | 4 +- .../core/dao/DeviceManagementDAOFactory.java | 8 +- .../device/mgt/core/dao/DeviceStatusDAO.java | 3 - .../device/mgt/core/dao/EnrollmentDAO.java | 1 - .../device/mgt/core/dao/EventConfigDAO.java | 1 - .../core/dao/EventManagementDAOFactory.java | 5 +- .../core/device/mgt/core/dao/GroupDAO.java | 1 - .../core/dao/GroupManagementDAOFactory.java | 4 +- .../core/dao/TrackerManagementDAOFactory.java | 4 +- .../core/dao/impl/AbstractDeviceDAOImpl.java | 24 +- .../dao/impl/AbstractEnrollmentDAOImpl.java | 9 +- .../core/dao/impl/AbstractEventConfigDAO.java | 8 +- .../dao/impl/AbstractGeofenceDAOImpl.java | 19 +- .../core/dao/impl/AbstractGroupDAOImpl.java | 12 +- .../mgt/core/dao/impl/ApplicationDAOImpl.java | 5 +- .../core/dao/impl/DeviceStatusDAOImpl.java | 1 - .../mgt/core/dao/impl/DeviceTypeDAOImpl.java | 21 +- .../dao/impl/device/GenericDeviceDAOImpl.java | 16 +- .../dao/impl/device/OracleDeviceDAOImpl.java | 14 +- .../impl/device/PostgreSQLDeviceDAOImpl.java | 12 +- .../impl/device/SQLServerDeviceDAOImpl.java | 15 +- .../enrolment/GenericEnrollmentDAOImpl.java | 2 +- .../enrolment/SQLServerEnrollmentDAOImpl.java | 3 +- .../impl/event/GenericEventConfigDAOImpl.java | 11 +- .../dao/impl/event/H2EventConfigDAOImpl.java | 12 +- .../impl/geofence/GenericGeofenceDAOImpl.java | 5 +- .../geofence/SQLServerGeofenceDAOImpl.java | 16 +- .../dao/impl/group/OracleGroupDAOImpl.java | 2 +- .../impl/group/PostgreSQLGroupDAOImpl.java | 2 +- .../dao/impl/group/SQLServerGroupDAOImpl.java | 2 +- .../core/dao/impl/tracker/TrackerDAOImpl.java | 10 +- .../dao/util/DeviceManagementDAOUtil.java | 24 +- .../core/dao/util/GroupManagementDAOUtil.java | 2 +- .../dao/util/TrackerManagementDAOUtil.java | 4 +- .../details/mgt/DeviceInformationManager.java | 2 - .../details/mgt/dao/DeviceDetailsDAO.java | 1 - .../mgt/dao/impl/DeviceDetailsDAOImpl.java | 7 +- .../impl/DeviceInformationManagerImpl.java | 15 +- .../core/device/mgt/core/dto/DeviceType.java | 2 +- ...EventConfigurationProviderServiceImpl.java | 18 +- .../event/config/EventOperationExecutor.java | 18 +- ...GroupAssignmentEventOperationExecutor.java | 6 +- .../GeoLocationProviderServiceImpl.java | 56 ++-- .../task/GeoFenceEventOperationManager.java | 4 +- .../ActivityDataPurgingServiceComponent.java | 39 +-- .../internal/DeviceManagementDataHolder.java | 4 +- .../DeviceManagementServiceComponent.java | 125 +++++---- .../DeviceTaskManagerServiceComponent.java | 31 +-- .../core/internal/TenantCreateObserver.java | 10 +- .../core/internal/UserRoleCreateObserver.java | 2 +- .../mgt/MetadataManagementServiceImpl.java | 9 +- .../mgt/WhiteLabelManagementServiceImpl.java | 23 +- .../mgt/dao/MetadataManagementDAOFactory.java | 6 +- .../mgt/dao/impl/AbstractMetadataDAOImpl.java | 10 +- .../mgt/dao/impl/GenericMetadataDAOImpl.java | 4 +- .../mgt/dao/impl/OracleMetadataDAOImpl.java | 4 +- .../dao/impl/SQLServerMetadataDAOImpl.java | 4 +- .../mgt/dao/util/MetadataDAOUtil.java | 2 +- .../mgt/util/WhiteLabelStorageUtil.java | 7 +- .../NotificationManagementServiceImpl.java | 10 +- .../dao/NotificationManagementDAOFactory.java | 9 +- .../dao/impl/AbstractNotificationDAOImpl.java | 7 +- .../dao/impl/OracleNotificationDAOImpl.java | 6 +- .../mgt/dao/util/NotificationDAOUtil.java | 6 +- .../operation/mgt/OperationManagerImpl.java | 41 +-- .../mgt/OperationManagerRepository.java | 2 +- .../dao/OperationManagementDAOFactory.java | 4 +- .../mgt/dao/impl/CommandOperationDAOImpl.java | 6 +- .../mgt/dao/impl/ConfigOperationDAOImpl.java | 14 +- .../dao/impl/ConfigOperationMSSQLDAOImpl.java | 17 +- .../impl/ConfigOperationPostgresDAOImpl.java | 17 +- .../mgt/dao/impl/GenericOperationDAOImpl.java | 18 +- .../mgt/dao/impl/OperationMappingDAOImpl.java | 8 +- .../mgt/dao/impl/PolicyOperationDAOImpl.java | 4 +- .../mgt/dao/impl/ProfileOperationDAOImpl.java | 5 +- .../impl/operation/MySQLOperationDAOImpl.java | 6 +- .../operation/OracleOperationDAOImpl.java | 12 +- .../operation/PostgreSQLOperationDAOImpl.java | 8 +- .../operation/SQLServerOperationDAOImpl.java | 20 +- .../mgt/dao/util/OperationDAOUtil.java | 15 +- .../task/impl/OperationTimeoutTask.java | 4 +- ...perationTimeoutTaskManagerServiceImpl.java | 6 +- .../otp/mgt/dao/OTPManagementDAOFactory.java | 4 +- .../dao/impl/GenericOTPManagementDAOImpl.java | 11 +- .../mgt/service/OTPManagementServiceImpl.java | 22 +- .../otp/mgt/util/ConnectionManagerUtil.java | 6 +- .../core/permission/mgt/PermissionNode.java | 6 +- .../core/permission/mgt/PermissionTree.java | 2 +- .../core/permission/mgt/PermissionUtils.java | 4 +- .../dao/impl/PrivacyComplianceDAOImpl.java | 4 +- .../impl/PrivacyComplianceProviderImpl.java | 6 +- .../mgt/PushNotificationConfigRepository.java | 2 +- .../PushNotificationProviderRepository.java | 2 +- .../task/PushNotificationSchedulerTask.java | 6 +- .../mgt/ReportManagementServiceImpl.java | 19 +- .../config/ReportMgtConfigurationManager.java | 4 +- .../common/ReportMgtConnectionManager.java | 4 +- .../core/search/mgt/impl/ProcessorImpl.java | 21 +- .../search/mgt/impl/QueryBuilderImpl.java | 8 +- .../mgt/impl/ResultSetAggregatorImpl.java | 6 +- .../DeviceManagementProviderService.java | 18 +- .../DeviceManagementProviderServiceImpl.java | 97 ++----- .../GroupManagementProviderService.java | 9 +- .../GroupManagementProviderServiceImpl.java | 35 +-- .../task/impl/DeviceStatusMonitoringTask.java | 4 +- .../DeviceStatusTaskManagerServiceImpl.java | 4 +- .../mgt/core/task/impl/ArchivalTask.java | 4 +- .../task/impl/ArchivalTaskManagerImpl.java | 6 +- .../task/impl/ArchivedDataDeletionTask.java | 4 +- .../task/impl/DeviceDetailsRetrieverTask.java | 8 +- .../core/task/impl/DeviceTaskManagerImpl.java | 18 +- .../impl/DeviceTaskManagerServiceImpl.java | 6 +- .../impl/DynamicPartitionedScheduleTask.java | 6 +- .../impl/RandomlyAssignedScheduleTask.java | 2 +- .../api/service/TraccarClientFactory.java | 31 +-- .../api/service/addons/TraccarClientImpl.java | 30 +-- .../impl/DeviceAPIClientServiceImpl.java | 8 +- .../core/traccar/common/util/TraccarUtil.java | 2 +- .../config/TraccarConfigurationManager.java | 6 +- .../DeviceManagementSchemaInitializer.java | 2 +- .../mgt/core/util/DeviceManagerUtil.java | 58 ++-- .../mgt/core/util/HttpReportingUtil.java | 5 +- .../core/util/MDMAndroidOperationUtil.java | 4 +- .../mgt/core/util/MDMIOSOperationUtil.java | 2 +- .../core/util/MDMWindowsOperationUtil.java | 4 +- .../mgt/core/DeviceManagementConfigTests.java | 2 +- .../core/DeviceManagementRepositoryTests.java | 6 +- .../device/mgt/core/TestDeviceManager.java | 7 +- .../core/TestHeartBeatManagementService.java | 2 +- .../device/mgt/core/TestTaskServiceImpl.java | 2 - .../mgt/core/device/mgt/core/TestUtils.java | 4 +- ...AppManagementConfigurationManagerTest.java | 2 +- ...licationManagementProviderServiceTest.java | 12 +- .../DeviceAccessAuthorizationServiceTest.java | 33 ++- .../cache/DeviceCacheManagerImplTest.java | 11 +- .../core/common/BaseDeviceManagementTest.java | 22 +- .../mgt/core/common/TestDataHolder.java | 6 +- .../mgt/core/dao/DevicePersistTests.java | 15 +- .../dao/DeviceStatusPersistenceTests.java | 11 +- .../core/dao/EnrolmentPersistenceTests.java | 8 +- .../mgt/core/dao/GroupPersistTests.java | 10 +- .../GeoLocationProviderServiceTest.java | 8 +- .../device/mgt/core/mock/MockConnection.java | 18 +- .../device/mgt/core/mock/MockDataSource.java | 4 +- .../mgt/core/mock/MockDatabaseMetaData.java | 6 +- .../device/mgt/core/mock/MockJDBCDriver.java | 6 +- .../device/mgt/core/mock/MockResultSet.java | 16 +- .../device/mgt/core/mock/MockStatement.java | 19 +- ...otificationManagementServiceImplTests.java | 12 +- ...tionManagementNegativeDBOperationTest.java | 12 +- .../OperationManagementNoDBSchemaTests.java | 12 +- .../operation/OperationManagementTests.java | 32 +-- .../ScheduledTaskOperationTests.java | 10 +- .../mgt/PermissionManagerServiceTest.java | 7 +- .../PushNotificationSchedulerTaskTest.java | 12 +- .../device/mgt/core/search/DeviceDetails.java | 8 +- .../mgt/core/search/ProcessorImplTest.java | 6 +- .../search/SearchManagementServiceTest.java | 12 +- .../mgt/core/search/SearchMgtUtilTest.java | 6 +- .../DeviceManagementProviderServiceTest.java | 29 +- ...ManagementProviderServiceNegativeTest.java | 4 +- .../GroupManagementProviderServiceTest.java | 16 +- .../task/DeviceTaskManagerServiceTest.java | 10 +- .../mgt/core/task/DeviceTaskManagerTest.java | 22 +- .../conf/datasources/master-datasources.xml | 2 +- .../repository/conf/etc/tasks-config.xml | 2 +- .../pom.xml | 93 ++++--- .../type/template/DeviceTypeManager.java | 23 +- .../template/DeviceTypeManagerService.java | 23 +- .../DeviceTypePluginExtensionServiceImpl.java | 4 +- .../HTTPDeviceTypeManagerService.java | 13 +- .../type/template/config/Attributes.java | 4 +- .../template/config/ConfigProperties.java | 4 +- .../type/template/config/DataPanel.java | 6 +- .../type/template/config/DeviceDetails.java | 6 +- .../config/DeviceTypeConfiguration.java | 7 +- .../device/type/template/config/Feature.java | 7 +- .../config/InitialOperationConfig.java | 4 +- .../type/template/config/Operation.java | 6 +- .../template/config/OperationMetadata.java | 6 +- .../device/type/template/config/Option.java | 1 - .../type/template/config/OptionalData.java | 1 - .../device/type/template/config/Policy.java | 7 +- .../template/config/PolicyMonitoring.java | 6 +- .../type/template/config/Properties.java | 4 +- .../device/type/template/config/Property.java | 6 +- .../PullNotificationSubscriberConfig.java | 6 +- .../config/PushNotificationProvider.java | 6 +- .../device/type/template/config/Table.java | 6 +- .../type/template/config/TableConfig.java | 4 +- .../type/template/config/UIParameter.java | 6 +- .../template/dao/DeviceTypeDAOHandler.java | 4 +- .../template/dao/DeviceTypePluginDAOImpl.java | 12 +- .../dao/DeviceTypePluginDAOManager.java | 2 +- .../dao/PropertyBasedPluginDAOImpl.java | 12 +- .../ConfigurationBasedFeatureManager.java | 4 +- .../mgt/DefaultPolicyMonitoringManager.java | 4 +- .../type/template/util/DeviceTypeUtils.java | 5 +- .../DeviceTypeExtensionDataHolder.java | 2 +- .../DeviceTypeExtensionServiceComponent.java | 38 +-- .../MetaRepositoryBasedLicenseManager.java | 8 +- .../GenericArtifactManagerFactory.java | 2 +- .../registry/RegistryBasedLicenseManager.java | 9 +- .../type/template/BaseExtensionsTest.java | 25 +- .../DeviceTypeManagerNegativeTest.java | 16 +- .../DeviceTypeManagerServiceTest.java | 19 +- .../type/template/DeviceTypeManagerTest.java | 17 +- ...rviceAndDeviceTypeGeneratorServceTest.java | 8 +- .../dao/DeviceDAODefinitionNegativeTest.java | 2 +- .../mock/TypeXDeviceManagementService.java | 10 +- .../extensions/mock/TypeXDeviceManager.java | 6 +- .../device/mgt/extensions/utils/Utils.java | 4 +- .../mgt/extensions/utils/UtilsTest.java | 10 +- .../pom.xml | 28 +- .../url/printer/URLPrinterStartupHandler.java | 2 +- .../internal/UrlPrinterServiceComponent.java | 25 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../org.wso2.carbon.device.mgt.ui/pom.xml | 2 +- components/device-mgt/pom.xml | 2 +- .../pom.xml | 85 ++---- .../beacon/HeartBeatBeaconUtils.java | 7 +- .../datasource/JNDILookupDefinition.java | 6 +- .../beacon/dao/HeartBeatBeaconDAOFactory.java | 6 +- .../dao/impl/GenericHeartBeatDAOImpl.java | 7 +- .../internal/HeartBeatBeaconComponent.java | 22 +- .../service/HeartBeatManagementService.java | 2 +- .../HeartBeatManagementServiceImpl.java | 11 +- .../pom.xml | 74 +++-- .../handlers/ScopeValidationHandler.java | 2 +- .../grant/AccessTokenGrantHandler.java | 5 +- .../OAuthAuthenticatorServiceComponent.java | 21 +- .../OAuthExtensionServiceComponent.java | 46 ++-- .../ExtendedJDBCScopeValidator.java | 2 +- .../PermissionBasedScopeValidator.java | 2 +- .../validators/RoleBasedScopeValidator.java | 2 +- .../pom.xml | 81 +++--- .../jwt/client/extension/JWTClient.java | 10 +- .../jwt/client/extension/dto/JWTConfig.java | 2 +- .../JWTClientExtensionServiceComponent.java | 72 ++--- .../service/JWTClientManagerServiceImpl.java | 10 +- .../client/extension/util/JWTClientUtil.java | 23 +- .../service/JWTClientManagerServiceTest.java | 6 +- .../extension/service/JWTClientTest.java | 10 +- .../extension/service/JWTClientUtilTest.java | 6 +- .../common/BaseJWTClientManagerExtTest.java | 2 +- .../conf/datasources/master-datasources.xml | 2 +- .../repository/conf/etc/tasks-config.xml | 2 +- components/identity-extensions/pom.xml | 2 +- .../pom.xml | 21 +- components/logger/pom.xml | 2 - .../pom.xml | 77 +++--- .../dao/OperationTemplateDAOFactory.java | 2 +- .../dao/impl/OperationTemplateDAOImpl.java | 11 +- .../config/DeviceConfigurationManager.java | 2 +- .../util/OperationTemplateManagementUtil.java | 2 +- .../impl/OperationTemplateServiceImpl.java | 2 +- .../OperationTemplateMgtDataHolder.java | 2 +- .../OperationTemplateMgtServiceComponent.java | 22 +- .../template/util/ConnectionManagerUtils.java | 11 +- .../template/ServiceNegativeTest.java | 2 +- .../mock/BaseOperationTemplatePluginTest.java | 8 +- .../template/mock/MockConnection.java | 16 +- .../template/mock/MockDatabaseMetaData.java | 6 +- .../template/mock/MockResultSet.java | 16 +- .../template/mock/MockStatement.java | 18 +- .../pom.xml | 35 +-- ...ergedPolicyEvaluationServiceComponent.java | 38 +-- .../PolicyEvaluationServiceComponent.java | 39 +-- .../point/merged/MergedEvaluationPoint.java | 8 +- .../simple/PolicyEvaluationServiceImpl.java | 2 +- .../point/simple/SimpleEvaluationImpl.java | 6 +- .../pom.xml | 27 +- .../point/PolicyInformationServiceImpl.java | 2 +- ...PolicyInformationPointBundleActivator.java | 4 +- .../pom.xml | 30 +-- .../mgt/common/PolicyAdministratorPoint.java | 2 +- .../monitor/ComplianceDecisionPoint.java | 2 +- .../pom.xml | 88 +++--- .../policy/mgt/core/PolicyManagerService.java | 9 +- .../mgt/core/PolicyManagerServiceImpl.java | 13 +- .../mgt/core/cache/PolicyCacheManager.java | 1 - .../cache/impl/PolicyCacheManagerImpl.java | 5 +- .../config/PolicyConfigurationManager.java | 2 +- .../policy/mgt/core/dao/MonitoringDAO.java | 2 +- .../core/policy/mgt/core/dao/PolicyDAO.java | 2 +- .../core/dao/PolicyManagementDAOFactory.java | 4 +- .../mgt/core/dao/impl/MonitoringDAOImpl.java | 8 +- .../mgt/core/dao/impl/ProfileDAOImpl.java | 7 +- .../dao/impl/feature/AbstractFeatureDAO.java | 6 +- .../impl/feature/GenericFeatureDAOImpl.java | 6 +- .../feature/OracleServerFeatureDAOImpl.java | 2 +- .../impl/feature/SQLServerFeatureDAOImpl.java | 6 +- .../impl/policy/AbstractPolicyDAOImpl.java | 19 +- .../dao/impl/policy/GenericPolicyDAOImpl.java | 6 +- .../dao/impl/policy/OraclePolicyDAOImpl.java | 6 +- .../impl/policy/PostgreSQLPolicyDAOImpl.java | 6 +- .../impl/policy/SQLServerPolicyDAOImpl.java | 6 +- .../mgt/core/enforcement/DelegationTask.java | 4 +- .../PolicyEnforcementDelegatorImpl.java | 4 +- .../impl/ComplianceDecisionPointImpl.java | 18 +- .../impl/PolicyAdministratorPointImpl.java | 19 +- .../mgt/core/impl/PolicyFilterImpl.java | 4 +- .../core/impl/PolicyInformationPointImpl.java | 12 +- .../internal/PolicyManagementDataHolder.java | 4 +- .../PolicyManagementServiceComponent.java | 66 ++--- .../mgt/core/mgt/MonitoringManager.java | 2 +- .../policy/mgt/core/mgt/PolicyManager.java | 1 - .../mgt/core/mgt/impl/FeatureManagerImpl.java | 11 +- .../core/mgt/impl/MonitoringManagerImpl.java | 10 +- .../mgt/core/mgt/impl/PolicyManagerImpl.java | 29 +- .../mgt/core/mgt/impl/ProfileManagerImpl.java | 12 +- .../policy/mgt/core/task/MonitoringTask.java | 8 +- .../core/task/TaskScheduleServiceImpl.java | 12 +- .../mgt/core/util/PolicyManagerUtil.java | 15 +- .../mgt/core/BasePolicyManagementDAOTest.java | 36 +-- .../policy/mgt/core/MonitoringTestCase.java | 22 +- .../policy/mgt/core/PolicyDAOTestCase.java | 24 +- .../mgt/core/PolicyEvaluationTestCase.java | 12 +- .../core/PolicyManagerServiceImplTest.java | 40 +-- .../core/mgt/impl/FeatureManagerImplTest.java | 16 +- .../mgt/impl/MonitoringManagerImplTest.java | 30 +-- .../core/mgt/impl/ProfileManagerImplTest.java | 16 +- .../mock/TestHeartBeatManagementService.java | 2 +- .../mock/TestPolicyMonitoringManager.java | 4 +- .../services/PolicyMonitoringManagerTest.java | 4 +- .../services/SimplePolicyEvaluationTest.java | 6 +- .../task/TaskSchedulerServiceImplTest.java | 4 +- .../conf/datasources/master-datasources.xml | 2 +- .../repository/conf/etc/tasks-config.xml | 2 +- .../pom.xml | 2 +- components/policy-mgt/pom.xml | 22 +- .../pom.xml | 81 +++--- .../cache/GetDeviceSubTypeCacheLoader.java | 2 +- .../subtype/mgt/dao/DeviceSubTypeDAO.java | 2 +- .../mgt/dao/DeviceSubTypeDAOFactory.java | 6 +- .../mgt/dao/impl/DeviceSubTypeDAOImpl.java | 6 +- .../mgt/dao/util/ConnectionManagerUtil.java | 6 +- .../mgt/impl/DeviceSubTypeServiceImpl.java | 10 +- .../internal/DeviceSubTypeMgtDataHolder.java | 2 +- .../DeviceSubTypeMgtServiceComponent.java | 57 ++-- .../subtype/mgt/spi/DeviceSubTypeService.java | 2 +- .../mgt/util/DeviceSubTypeMgtUtil.java | 2 +- .../mgt/mock/BaseDeviceSubTypePluginTest.java | 8 +- .../core/subtype/mgt/mock/MockConnection.java | 16 +- .../mgt/mock/MockDatabaseMetaData.java | 6 +- .../core/subtype/mgt/mock/MockResultSet.java | 16 +- .../core/subtype/mgt/mock/MockStatement.java | 18 +- .../pom.xml | 12 + .../mgt/common/spi/TaskManagementService.java | 2 +- .../pom.xml | 62 +++-- .../core/config/TaskConfigurationManager.java | 2 +- .../dao/common/TaskManagementDAOFactory.java | 2 +- .../mgt/core/dao/impl/DynamicTaskDAOImpl.java | 4 +- .../core/dao/impl/DynamicTaskPropDAOImpl.java | 4 +- .../internal/TaskManagerServiceComponent.java | 52 ++-- .../service/TaskManagementServiceImpl.java | 8 +- .../pom.xml | 47 ++-- .../task/mgt/watcher/IoTSStartupHandler.java | 9 +- .../internal/TaskWatcherServiceComponent.java | 61 ++--- .../pom.xml | 12 +- .../pom.xml | 56 ++-- .../mgt/core/impl/TenantManagerImpl.java | 16 +- .../core/impl/TenantManagerServiceImpl.java | 2 +- .../core/internal/TenantMgtDataHolder.java | 2 +- .../internal/TenantMgtServiceComponent.java | 38 +-- .../listener/DeviceMgtTenantListener.java | 2 +- .../pom.xml | 112 +++----- .../mgt/email/sender/core/EmailContext.java | 4 +- .../core/RegistryBasedResourceLoader.java | 63 +++-- .../VelocityBasedEmailContentProvider.java | 20 +- ...EmailSenderAxis2ConfigContextObserver.java | 2 +- .../core/internal/EmailSenderDataHolder.java | 23 +- .../internal/EmailSenderServiceComponent.java | 87 +++--- .../sender/core/internal/EmailUtils.java | 33 +-- components/transport-mgt/email-sender/pom.xml | 2 +- .../pom.xml | 1 - .../api/ConfigurationManagementService.java | 13 +- .../handler/api/addons/ApiOriginFilter.java | 7 +- .../api/addons/GsonMessageBodyHandler.java | 6 +- .../ConfigurationManagementServiceImpl.java | 2 +- .../src/main/webapp/WEB-INF/cxf-servlet.xml | 4 +- .../pom.xml | 13 +- .../pom.xml | 39 ++- .../core/config/SMSConfigurationManager.java | 4 +- .../internal/SMSHandlerServiceComponent.java | 13 +- .../interceptor/DefaultTokenHandler.java | 2 +- .../request/interceptor/GrafanaHandler.java | 2 +- .../request/interceptor/InvokerHandler.java | 9 +- .../ui/request/interceptor/LoginHandler.java | 8 +- .../ui/request/interceptor/LogoutHandler.java | 2 +- .../interceptor/OTPInvokerHandler.java | 9 +- .../interceptor/SsoLoginCallbackHandler.java | 2 +- .../request/interceptor/SsoLoginHandler.java | 8 +- .../request/interceptor/SsoLogoutHandler.java | 8 +- .../ui/request/interceptor/UserHandler.java | 10 +- .../request/interceptor/util/HandlerUtil.java | 15 +- .../websocket/GrafanaLiveSecurityFilter.java | 7 +- .../websocket/GrafanaWebSocketClient.java | 15 +- .../websocket/GrafanaWebSocketHandler.java | 7 +- .../pom.xml | 133 ++++----- .../AuthenticationFrameworkUtil.java | 2 +- .../authenticator/framework/Utils/Utils.java | 14 +- .../framework/WebappAuthenticationValve.java | 6 +- .../framework/WebappAuthenticatorFactory.java | 2 +- .../authenticator/BSTAuthenticator.java | 12 +- .../authenticator/BasicAuthAuthenticator.java | 10 +- .../CertificateAuthenticator.java | 10 +- .../authenticator/JWTAuthenticator.java | 10 +- .../authenticator/OAuthAuthenticator.java | 10 +- .../OneTimeTokenAuthenticator.java | 6 +- .../authenticator/WebappAuthenticator.java | 2 +- .../oauth/impl/LocalOAuthValidator.java | 10 +- .../oauth/impl/RemoteOAuthValidator.java | 8 +- .../authorizer/PermissionAuthorizer.java | 6 +- .../authorizer/WebappTenantAuthorizer.java | 2 +- .../config/WebappAuthenticatorConfig.java | 4 +- .../AuthenticatorFrameworkDataHolder.java | 2 +- ...uthenticatorFrameworkServiceComponent.java | 113 ++++---- .../BaseWebAppAuthenticatorFrameworkTest.java | 10 +- .../WebappAuthenticationValveTest.java | 2 +- .../WebappAuthenticatorConfigTest.java | 9 +- .../WebappAuthenticatorFrameworkUtilTest.java | 2 +- .../WebappAuthenticatorRepositoryTest.java | 5 +- .../authenticator/BSTAuthenticatorTest.java | 8 +- .../BasicAuthAuthenticatorTest.java | 5 +- .../CertificateAuthenticatorTest.java | 34 +-- .../authenticator/JWTAuthenticatorTest.java | 8 +- .../authenticator/OauthAuthenticatorTest.java | 7 +- .../util/MalformedAuthenticator.java | 4 +- .../util/TestCertificateGenerator.java | 19 +- .../util/TestWebappAuthenticator.java | 4 +- .../webapp-authenticator-framework/pom.xml | 21 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 6 +- .../pom.xml | 2 +- .../pom.xml | 2 +- features/apimgt-extensions/pom.xml | 2 +- .../application-mgt-datasources.xml | 2 +- .../dbscripts/cdm/application-mgt/h2.sql | 3 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 6 +- features/certificate-mgt/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- features/device-mgt-extensions/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../conf/datasources/cdm-datasources.xml | 2 +- .../datasources/reporting-mgt-datasources.xml | 2 +- .../src/main/resources/dbscripts/cdm/h2.sql | 75 +++--- .../pom.xml | 2 +- .../pom.xml | 11 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- features/device-mgt/pom.xml | 2 +- .../datasources/heart-beat-datasources.xml | 2 +- .../pom.xml | 2 +- features/jwt-client/pom.xml | 2 +- .../pom.xml | 1 - .../pom.xml | 2 +- features/oauth-extensions/pom.xml | 2 +- .../pom.xml | 2 +- features/policy-mgt/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 1 - .../pom.xml | 9 +- features/transport-mgt/email-sender/pom.xml | 2 +- .../resources/payloads/update-app-request.xml | 3 +- .../pom.xml | 2 +- .../webapp-authenticator-framework/pom.xml | 2 +- pom.xml | 236 ++-------------- 842 files changed, 4975 insertions(+), 7069 deletions(-) diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/GrafanaAPIProxyService.java b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/GrafanaAPIProxyService.java index 3979e472d3..a03e0b3759 100644 --- a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/GrafanaAPIProxyService.java +++ b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/GrafanaAPIProxyService.java @@ -18,25 +18,12 @@ package io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api; import com.google.gson.JsonObject; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; +import io.swagger.annotations.*; + +import javax.ws.rs.*; +import javax.ws.rs.core.*; @SwaggerDefinition( info = @Info( diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/addons/ApiOriginFilter.java b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/addons/ApiOriginFilter.java index 206adf4700..cf85c47747 100644 --- a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/addons/ApiOriginFilter.java +++ b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/addons/ApiOriginFilter.java @@ -18,12 +18,7 @@ package io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api.addons; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import javax.servlet.*; import javax.servlet.http.HttpServletResponse; import java.io.IOException; diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/addons/ValidationInterceptor.java b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/addons/ValidationInterceptor.java index 4726adf0b3..1ac97283d8 100644 --- a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/addons/ValidationInterceptor.java +++ b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/addons/ValidationInterceptor.java @@ -27,11 +27,7 @@ import org.apache.cxf.message.MessageContentsList; import org.apache.cxf.phase.AbstractPhaseInterceptor; import org.apache.cxf.phase.Phase; -import javax.validation.ConstraintViolation; -import javax.validation.ConstraintViolationException; -import javax.validation.Validation; -import javax.validation.Validator; -import javax.validation.ValidatorFactory; +import javax.validation.*; import javax.validation.executable.ExecutableValidator; import java.lang.reflect.Method; import java.util.List; diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/impl/GrafanaAPIProxyServiceImpl.java b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/impl/GrafanaAPIProxyServiceImpl.java index 23a56e2d14..3c5aee3c24 100644 --- a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/impl/GrafanaAPIProxyServiceImpl.java +++ b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/impl/GrafanaAPIProxyServiceImpl.java @@ -9,20 +9,12 @@ import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.common.exception.Gr import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.bean.GrafanaPanelIdentifier; import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.exception.MaliciousQueryAttempt; import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.internal.GrafanaMgtDataHolder; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DBConnectionException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DBConnectionException; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.HttpHeaders; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; +import javax.ws.rs.*; +import javax.ws.rs.core.*; import java.io.IOException; import java.sql.SQLException; diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/impl/util/GrafanaRequestHandlerUtil.java b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/impl/util/GrafanaRequestHandlerUtil.java index 12d4e9295b..1f94fcdd97 100644 --- a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/impl/util/GrafanaRequestHandlerUtil.java +++ b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/api/impl/util/GrafanaRequestHandlerUtil.java @@ -26,6 +26,8 @@ import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.bean.GrafanaPa import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.exception.GrafanaEnvVariablesNotDefined; import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.util.GrafanaConstants; import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.util.GrafanaUtil; +import io.entgra.device.mgt.core.device.mgt.core.common.util.HttpUtil; +import io.entgra.device.mgt.core.device.mgt.core.report.mgt.Constants; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.http.HttpResponse; @@ -36,8 +38,6 @@ import org.apache.http.client.methods.HttpRequestBase; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; -import io.entgra.device.mgt.core.device.mgt.core.common.util.HttpUtil; -import io.entgra.device.mgt.core.device.mgt.core.report.mgt.Constants; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.common/pom.xml b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.common/pom.xml index 68425f07e0..4d01a9520a 100644 --- a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.common/pom.xml +++ b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.common/pom.xml @@ -35,6 +35,14 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + org.apache.felix maven-bundle-plugin @@ -48,12 +56,6 @@ io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.common.* - - javax.xml.bind.annotation; version="${javax.xml.bind.imp.pkg.version}", - com.fasterxml.jackson.annotation;version="${jackson-annotations.version}", - io.swagger.annotations; version="${swagger.annotations.version}"; resolution:=optional, - com.google.gson - diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core/pom.xml b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core/pom.xml index 0e921289d8..a9728f9704 100644 --- a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core/pom.xml +++ b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core/pom.xml @@ -35,10 +35,6 @@ - - org.apache.felix - maven-scr-plugin - org.jacoco jacoco-maven-plugin @@ -65,6 +61,14 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + org.apache.felix maven-bundle-plugin @@ -77,15 +81,47 @@ Grafana API Management Core Bundle io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.internal - io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.common.*, - javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional, - javax.xml.bind.annotation, - javax.xml.bind, - org.apache.commons.lang, - org.wso2.carbon, - io.entgra.device.mgt.core.device.mgt.common.*, - io.entgra.device.mgt.core.device.mgt.core.* - io.entgra.device.mgt.core.application.mgt.core.* + com.google.common.cache;version="[31.0,32)", + com.google.gson;version="[2.9,3)", + io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.common.exception;version="[5.0,6)", + io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.bean, + io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.config, + io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.config.xml.bean, + io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.exception, + io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.service, + io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.service.bean, + io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.service.cache, + io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.service.impl, + io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.sql.connection, + io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.sql.query, + io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.sql.query.encoder, + io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.util, + io.entgra.device.mgt.core.application.mgt.common.exception;version="[5.0,6)", + io.entgra.device.mgt.core.application.mgt.core.config;version="[5.0,6)", + io.entgra.device.mgt.core.application.mgt.core.util;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.exceptions;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.common.util;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.config;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.config.datasource;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.dao;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.report.mgt.config;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.report.mgt.dao.common;version="[5.0,6)", + javax.xml.bind;version="[0.0,1)", + javax.xml.bind.annotation;version="[0.0,1)", + javax.xml.parsers, + org.apache.commons.codec.binary;version="[1.9,2)", + org.apache.commons.lang;version="[2.6,3)", + org.apache.commons.lang3;version="[3.1,4)", + org.apache.commons.logging;version="[1.2,2)", + org.apache.http;version="[4.4,5)", + org.apache.http.client, + org.apache.http.client.methods, + org.apache.http.impl.client, + org.apache.juli.logging;version="[9.0,10)", + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", + org.w3c.dom,org.wso2.carbon.context;version="[4.8,5)", + org.wso2.carbon.utils;version="[4.8,5)" !io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.internal, @@ -103,15 +139,12 @@ - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.osgi - org.eclipse.osgi.services + org.apache.felix + org.apache.felix.scr.ds-annotations + provided - org.wso2.orbit.org.scannotation + io.entgra.org.scannotation scannotation @@ -132,7 +165,6 @@ org.ops4j.pax.logging pax-logging-api provided - org.wso2.carbon @@ -246,14 +278,6 @@ org.apache.ws.commons.axiom.wso2 axiom - org.apache.axis2.wso2 axis2 diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/core/internal/GrafanaManagementServiceComponent.java b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/core/internal/GrafanaManagementServiceComponent.java index 2b4899bbac..e10a7f2b38 100644 --- a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/core/internal/GrafanaManagementServiceComponent.java +++ b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core/src/main/java/io/entgra/device/mgt/core/analytics/mgt/grafana/proxy/core/internal/GrafanaManagementServiceComponent.java @@ -26,16 +26,19 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleContext; import org.osgi.service.component.ComponentContext; -import org.wso2.carbon.context.PrivilegedCarbonContext; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Deactivate; -/** - * @scr.component name="io.entgra.analytics.mgt.grafana.proxy.grafanamanagementservicecomponent" immediate="true" - */ +@Component( + name = "io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.internal.GrafanaManagementServiceComponent", + immediate = true) public class GrafanaManagementServiceComponent { private static Log log = LogFactory.getLog(GrafanaManagementServiceComponent.class); @SuppressWarnings("unused") + @Activate protected void activate(ComponentContext componentContext) { try { if (log.isDebugEnabled()) { @@ -60,6 +63,7 @@ public class GrafanaManagementServiceComponent { } @SuppressWarnings("unused") + @Deactivate protected void deactivate(ComponentContext componentContext) { if (log.isDebugEnabled()) { log.debug("De-activating Grafana Management Service Component"); diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.analytics.extension/pom.xml b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.analytics.extension/pom.xml index 438fb28d72..3d9ce4d2d4 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.analytics.extension/pom.xml +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.analytics.extension/pom.xml @@ -27,9 +27,14 @@ io.entgra.device.mgt.core.apimgt.analytics.extension bundle Entgra - API mgt analytics extension - http://wso2.org + https://entgra.io + + org.apache.felix + org.apache.felix.scr.ds-annotations + provided + org.wso2.carbon org.wso2.carbon.core @@ -40,7 +45,7 @@ org.apache.velocity - velocity + velocity-engine-core @@ -56,8 +61,12 @@ - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -72,10 +81,11 @@ io.entgra.device.mgt.core.apimgt.application.extension.internal io.entgra.device.mgt.core.apimgt.analytics.extension.dto, + io.entgra.device.mgt.core.apimgt.analytics.extension.exception, org.apache.velocity, org.apache.velocity.app, org.apache.velocity.context, - org.wso2.carbon.utils;version="[4.6,5)" + org.wso2.carbon.utils;version="[4.8,5)" io.entgra.device.mgt.core.apimgt.analytics.extension.* diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.analytics.extension/src/main/java/io/entgra/device/mgt/core/apimgt/analytics/extension/AnalyticsArtifactsDeployer.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.analytics.extension/src/main/java/io/entgra/device/mgt/core/apimgt/analytics/extension/AnalyticsArtifactsDeployer.java index fcd197bb0e..66e15be064 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.analytics.extension/src/main/java/io/entgra/device/mgt/core/apimgt/analytics/extension/AnalyticsArtifactsDeployer.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.analytics.extension/src/main/java/io/entgra/device/mgt/core/apimgt/analytics/extension/AnalyticsArtifactsDeployer.java @@ -27,16 +27,11 @@ import io.entgra.device.mgt.core.apimgt.analytics.extension.exception.EventStrea import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; import org.apache.velocity.app.VelocityEngine; - import org.apache.velocity.runtime.RuntimeConstants; import org.wso2.carbon.utils.CarbonUtils; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; -import java.io.File; -import java.io.FileNotFoundException; -import java.io.PrintWriter; -import java.io.StringWriter; -import java.io.UnsupportedEncodingException; +import java.io.*; public class AnalyticsArtifactsDeployer { diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.annotations/pom.xml b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.annotations/pom.xml index 58e0ac2d1a..4b3dcb1b66 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.annotations/pom.xml +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.annotations/pom.xml @@ -31,22 +31,18 @@ bundle WSO2 Carbon - API Management Annotations WSO2 Carbon - API Management Custom Annotation Module - http://wso2.org + https://entgra.io - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.osgi - org.eclipse.osgi.services + org.apache.felix + org.apache.felix.scr.ds-annotations + provided org.ops4j.pax.logging pax-logging-api provided - javax.ws.rs @@ -56,8 +52,12 @@ - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -72,15 +72,6 @@ io.entgra.device.mgt.core.apimgt.annotations.* - - org.osgi.framework.*;version="${imp.package.version.osgi.framework}", - org.osgi.service.*;version="${imp.package.version.osgi.service}", - org.apache.commons.logging, - javax.servlet, - javax.xml.*, - javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional, - org.apache.commons.lang - scribe;scope=compile|runtime;inline=false; diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.api/pom.xml b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.api/pom.xml index a3dcb68c37..83b56581d5 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.api/pom.xml +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.api/pom.xml @@ -30,7 +30,7 @@ war WSO2 Carbon - API Application Management API This module provides capability to create api manager application. - http://wso2.org + https://entgra.io @@ -159,10 +159,6 @@ org.wso2.carbon.registry.core provided - - org.wso2.orbit.javax.xml.bind - jaxb-api - diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.api/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/api/ApiApplicationRegistrationServiceImpl.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.api/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/api/ApiApplicationRegistrationServiceImpl.java index 6b328232eb..95a68ac99c 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.api/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/api/ApiApplicationRegistrationServiceImpl.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.api/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/api/ApiApplicationRegistrationServiceImpl.java @@ -18,18 +18,18 @@ package io.entgra.device.mgt.core.apimgt.application.extension.api; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.apimgt.application.extension.APIManagementProviderService; import io.entgra.device.mgt.core.apimgt.application.extension.api.util.APIUtil; import io.entgra.device.mgt.core.apimgt.application.extension.api.util.RegistrationProfile; import io.entgra.device.mgt.core.apimgt.application.extension.constants.ApiApplicationConstants; import io.entgra.device.mgt.core.apimgt.application.extension.dto.ApiApplicationKey; import io.entgra.device.mgt.core.apimgt.application.extension.exception.APIManagerException; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import org.wso2.carbon.user.api.UserStoreException; import javax.ws.rs.POST; diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.api/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/api/filter/ApiPermissionFilter.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.api/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/api/filter/ApiPermissionFilter.java index 0170cc61ec..1d1400032a 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.api/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/api/filter/ApiPermissionFilter.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.api/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/api/filter/ApiPermissionFilter.java @@ -17,20 +17,15 @@ */ package io.entgra.device.mgt.core.apimgt.application.extension.api.filter; +import io.entgra.device.mgt.core.apimgt.application.extension.api.util.APIUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.apimgt.application.extension.api.util.APIUtil; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.user.api.UserRealm; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.utils.multitenancy.MultitenantUtils; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import javax.servlet.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.xml.bind.JAXBContext; diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.api/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/api/util/APIUtil.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.api/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/api/util/APIUtil.java index 968fcca10e..c6801405a2 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.api/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/api/util/APIUtil.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.api/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/api/util/APIUtil.java @@ -18,13 +18,13 @@ package io.entgra.device.mgt.core.apimgt.application.extension.api.util; +import io.entgra.device.mgt.core.apimgt.application.extension.APIManagementProviderService; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.apimgt.application.extension.APIManagementProviderService; import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import org.wso2.carbon.registry.api.Resource; import org.wso2.carbon.registry.core.Registry; import org.wso2.carbon.registry.core.exceptions.RegistryException; diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/pom.xml b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/pom.xml index 48ad10e3eb..deaca8ffc0 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/pom.xml +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/pom.xml @@ -31,9 +31,14 @@ bundle WSO2 Carbon - API Application Management This module provides capability to create api manager application. - http://wso2.org + https://entgra.io + + org.apache.felix + org.apache.felix.scr.ds-annotations + provided + org.wso2.carbon org.wso2.carbon.registry.core @@ -88,8 +93,12 @@ - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -103,30 +112,30 @@ API Management Application Bundle io.entgra.device.mgt.core.apimgt.application.extension.internal + io.entgra.device.mgt.core.apimgt.application.extension.bean, + io.entgra.device.mgt.core.apimgt.application.extension.dto, + io.entgra.device.mgt.core.apimgt.application.extension.exception, + io.entgra.device.mgt.core.identity.jwt.client.extension;version="[5.0,6)", + io.entgra.device.mgt.core.identity.jwt.client.extension.dto;version="[5.0,6)", + io.entgra.device.mgt.core.identity.jwt.client.extension.exception;version="[5.0,6)", + io.entgra.device.mgt.core.identity.jwt.client.extension.service;version="[5.0,6)", org.apache.commons.lang;version="[2.6,3)", org.apache.commons.logging;version="[1.2,2)", - org.json.simple, + org.json.simple;version="[1.1,2)", org.osgi.framework.*;version="${imp.package.version.osgi.framework}", org.osgi.service.*;version="${imp.package.version.osgi.service}", - org.wso2.carbon.apimgt.api;version="${carbon.api.mgt.version.range}", - org.wso2.carbon.apimgt.api.dto;version="${carbon.api.mgt.version.range}", - org.wso2.carbon.apimgt.api.model;version="${carbon.api.mgt.version.range}", - io.entgra.device.mgt.core.apimgt.application.extension.bean, - io.entgra.device.mgt.core.apimgt.application.extension.dto, - io.entgra.device.mgt.core.apimgt.application.extension.exception, - org.wso2.carbon.apimgt.impl;version="${carbon.api.mgt.version.range}", - org.wso2.carbon.apimgt.impl.utils;version="${carbon.api.mgt.version.range}", - org.wso2.carbon.context;version="${carbon.kernel.version.range}", - io.entgra.device.mgt.core.identity.jwt.client.extension, - io.entgra.device.mgt.core.identity.jwt.client.extension.dto, - io.entgra.device.mgt.core.identity.jwt.client.extension.exception, - io.entgra.device.mgt.core.identity.jwt.client.extension.service, + org.wso2.carbon.apimgt.api;version="[9.28,10)", + org.wso2.carbon.apimgt.api.dto;version="[9.28,10)", + org.wso2.carbon.apimgt.api.model;version="[9.28,10)", + org.wso2.carbon.apimgt.impl;version="[9.28,10)", + org.wso2.carbon.apimgt.impl.utils;version="[9.28,10)", + org.wso2.carbon.context;version="[4.8,5)", org.wso2.carbon.registry.core.exceptions;version="[1.0,2)", org.wso2.carbon.registry.core.service;version="[1.0,2)", - org.wso2.carbon.registry.indexing.service;version="${carbon.registry.imp.pkg.version.range}", + org.wso2.carbon.registry.indexing.service;version="[4.8,5)", org.wso2.carbon.user.api;version="[1.0,2)", - org.wso2.carbon.user.core.service;version="${carbon.kernel.version.range}", - org.wso2.carbon.user.core.tenant;version="${carbon.kernel.version.range}" + org.wso2.carbon.user.core.service;version="[4.8,5)", + org.wso2.carbon.user.core.tenant;version="[4.8,5)" !io.entgra.device.mgt.core.apimgt.application.extension.internal, diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/APIManagementProviderServiceImpl.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/APIManagementProviderServiceImpl.java index b73ea49b7e..e78c2dca7e 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/APIManagementProviderServiceImpl.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/APIManagementProviderServiceImpl.java @@ -18,6 +18,16 @@ package io.entgra.device.mgt.core.apimgt.application.extension; +import io.entgra.device.mgt.core.apimgt.application.extension.bean.APIRegistrationProfile; +import io.entgra.device.mgt.core.apimgt.application.extension.constants.ApiApplicationConstants; +import io.entgra.device.mgt.core.apimgt.application.extension.dto.ApiApplicationKey; +import io.entgra.device.mgt.core.apimgt.application.extension.exception.APIManagerException; +import io.entgra.device.mgt.core.apimgt.application.extension.internal.APIApplicationManagerExtensionDataHolder; +import io.entgra.device.mgt.core.apimgt.application.extension.util.APIManagerUtil; +import io.entgra.device.mgt.core.identity.jwt.client.extension.JWTClient; +import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.AccessTokenInfo; +import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; +import io.entgra.device.mgt.core.identity.jwt.client.extension.service.JWTClientManagerService; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -25,35 +35,16 @@ import org.wso2.carbon.apimgt.api.APIAdmin; import org.wso2.carbon.apimgt.api.APIConsumer; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO; -import org.wso2.carbon.apimgt.api.model.API; -import org.wso2.carbon.apimgt.api.model.APIKey; -import org.wso2.carbon.apimgt.api.model.ApiTypeWrapper; -import org.wso2.carbon.apimgt.api.model.Application; -import org.wso2.carbon.apimgt.api.model.SubscribedAPI; -import org.wso2.carbon.apimgt.api.model.Subscriber; -import io.entgra.device.mgt.core.apimgt.application.extension.bean.APIRegistrationProfile; -import io.entgra.device.mgt.core.apimgt.application.extension.constants.ApiApplicationConstants; -import io.entgra.device.mgt.core.apimgt.application.extension.dto.ApiApplicationKey; -import io.entgra.device.mgt.core.apimgt.application.extension.exception.APIManagerException; -import io.entgra.device.mgt.core.apimgt.application.extension.internal.APIApplicationManagerExtensionDataHolder; -import io.entgra.device.mgt.core.apimgt.application.extension.util.APIManagerUtil; +import org.wso2.carbon.apimgt.api.model.*; import org.wso2.carbon.apimgt.impl.APIAdminImpl; import org.wso2.carbon.apimgt.impl.APIConstants; import org.wso2.carbon.apimgt.impl.APIManagerFactory; import org.wso2.carbon.apimgt.impl.utils.APIUtil; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.identity.jwt.client.extension.JWTClient; -import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.AccessTokenInfo; -import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; -import io.entgra.device.mgt.core.identity.jwt.client.extension.service.JWTClientManagerService; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; /** * This class represents an implementation of APIManagementProviderService. diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/dto/ApiApplicationKey.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/dto/ApiApplicationKey.java index f0aeb45c79..5e7634c987 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/dto/ApiApplicationKey.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/dto/ApiApplicationKey.java @@ -18,8 +18,8 @@ package io.entgra.device.mgt.core.apimgt.application.extension.dto; -import org.json.simple.JSONObject; import io.entgra.device.mgt.core.apimgt.application.extension.constants.ApiApplicationConstants; +import org.json.simple.JSONObject; /** * This holds api application consumer key and secret. diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java index 0ee0306775..4e863ba118 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java @@ -18,8 +18,8 @@ package io.entgra.device.mgt.core.apimgt.application.extension.internal; import io.entgra.device.mgt.core.apimgt.application.extension.APIManagementProviderService; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.identity.jwt.client.extension.service.JWTClientManagerService; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.registry.core.service.TenantRegistryLoader; import org.wso2.carbon.registry.indexing.service.TenantIndexingLoader; import org.wso2.carbon.user.core.service.RealmService; diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java index b32b591fbc..5335338260 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java @@ -17,42 +17,25 @@ */ package io.entgra.device.mgt.core.apimgt.application.extension.internal; +import io.entgra.device.mgt.core.apimgt.application.extension.APIManagementProviderService; +import io.entgra.device.mgt.core.apimgt.application.extension.APIManagementProviderServiceImpl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleContext; -import org.osgi.service.component.ComponentContext;; -import io.entgra.device.mgt.core.apimgt.application.extension.APIManagementProviderService; -import io.entgra.device.mgt.core.apimgt.application.extension.APIManagementProviderServiceImpl; +import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.*; import org.wso2.carbon.registry.core.service.TenantRegistryLoader; import org.wso2.carbon.registry.indexing.service.TenantIndexingLoader; import org.wso2.carbon.user.core.service.RealmService; -/** - * @scr.component name="io.entgra.device.mgt.core.apimgt.application.extension.internal.APIApplicationManagerExtensionServiceComponent" - * @scr.reference name="tenant.registryloader" - * interface="org.wso2.carbon.registry.core.service.TenantRegistryLoader" - * cardinality="1..1" - * policy="dynamic" - * bind="setTenantRegistryLoader" - * unbind="unsetTenantRegistryLoader" - * @scr.reference name="tenant.indexloader" - * interface="org.wso2.carbon.registry.indexing.service.TenantIndexingLoader" - * cardinality="1..1" - * policy="dynamic" - * bind="setIndexLoader" - * unbind="unsetIndexLoader" - * @scr.reference name="realm.service" - * immediate="true" - * interface="org.wso2.carbon.user.core.service.RealmService" - * cardinality="1..1" - * policy="dynamic" - * bind="setRealmService" - * unbind="unsetRealmService" - */ +@Component( + name = "io.entgra.device.mgt.core.apimgt.application.extension.internal.APIApplicationManagerExtensionServiceComponent", + immediate = true) public class APIApplicationManagerExtensionServiceComponent { private static final Log log = LogFactory.getLog(APIApplicationManagerExtensionServiceComponent.class); + @Activate protected void activate(ComponentContext componentContext) { try { if (log.isDebugEnabled()) { @@ -67,10 +50,17 @@ public class APIApplicationManagerExtensionServiceComponent { } } + @Deactivate protected void deactivate(ComponentContext componentContext) { //do nothing } + @Reference( + name = "tenant.registry.loader", + service = org.wso2.carbon.registry.core.service.TenantRegistryLoader.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetTenantRegistryLoader") protected void setTenantRegistryLoader(TenantRegistryLoader tenantRegistryLoader) { APIApplicationManagerExtensionDataHolder.getInstance().setTenantRegistryLoader(tenantRegistryLoader); } @@ -79,6 +69,12 @@ public class APIApplicationManagerExtensionServiceComponent { APIApplicationManagerExtensionDataHolder.getInstance().setTenantRegistryLoader(null); } + @Reference( + name = "tenant.index.loader", + service = org.wso2.carbon.registry.indexing.service.TenantIndexingLoader.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetIndexLoader") protected void setIndexLoader(TenantIndexingLoader indexLoader) { if (indexLoader != null && log.isDebugEnabled()) { log.debug("IndexLoader service initialized"); @@ -95,6 +91,12 @@ public class APIApplicationManagerExtensionServiceComponent { * * @param realmService An instance of RealmService */ + @Reference( + name = "realm.service", + service = org.wso2.carbon.user.core.service.RealmService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetRealmService") protected void setRealmService(RealmService realmService) { if (log.isDebugEnabled()) { log.debug("Setting Realm Service"); diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/util/APIManagerUtil.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/util/APIManagerUtil.java index 37829a2d68..94da658a08 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/util/APIManagerUtil.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/src/main/java/io/entgra/device/mgt/core/apimgt/application/extension/util/APIManagerUtil.java @@ -17,10 +17,10 @@ */ package io.entgra.device.mgt.core.apimgt.application.extension.util; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.apimgt.application.extension.exception.APIManagerException; import io.entgra.device.mgt.core.apimgt.application.extension.internal.APIApplicationManagerExtensionDataHolder; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.registry.core.exceptions.RegistryException; diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/pom.xml b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/pom.xml index 47bdfcc258..2301d92e0e 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/pom.xml +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/pom.xml @@ -34,6 +34,11 @@ https://entgra.io + + org.apache.felix + org.apache.felix.scr.ds-annotations + provided + commons-httpclient.wso2 commons-httpclient @@ -54,17 +59,6 @@ org.wso2.carbon.core provided - - org.eclipse.osgi - org.eclipse.osgi - provided - - - org.eclipse.osgi - org.eclipse.osgi.services - provided - - org.json.wso2 json @@ -89,8 +83,12 @@ - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -110,17 +108,23 @@ io.entgra.device.mgt.core.apimgt.extension.rest.api.* + com.google.gson;version="[2.9,3)", + io.entgra.device.mgt.core.apimgt.extension.rest.api, + io.entgra.device.mgt.core.apimgt.extension.rest.api.dto, + io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo, + io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions, + io.entgra.device.mgt.core.apimgt.extension.rest.api.util, + javax.net.ssl,okhttp3;version="[4.9,5)", + org.apache.commons.lang;version="[2.6,3)", + org.apache.commons.logging;version="[1.2,2)", + org.apache.commons.ssl;version="[3.1,4)", + org.json;version="[3.0,4)", org.osgi.framework.*;version="${imp.package.version.osgi.framework}", org.osgi.service.*;version="${imp.package.version.osgi.service}", - org.wso2.carbon.core;version="4.6", - org.wso2.carbon.core.util;version="4.6", - org.apache.commons.ssl, - org.wso2.carbon.apimgt.api.model, - okhttp3.*, - org.wso2.carbon.apimgt.impl;version="${carbon.api.mgt.version.range}", - org.wso2.carbon.apimgt.impl.utils;version="${carbon.api.mgt.version.range}", - org.wso2.carbon.apimgt.impl.internal;version="${carbon.api.mgt.version.range}", - org.json + org.wso2.carbon.apimgt.api.model;version="[9.28,10)", + org.wso2.carbon.apimgt.impl;version="[9.28,10)", + org.wso2.carbon.apimgt.impl.internal;version="[9.28,10)", + org.wso2.carbon.base;version="[1.0,2)" diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/APIApplicationServicesImpl.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/APIApplicationServicesImpl.java index 68faf24b80..c6cca34843 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/APIApplicationServicesImpl.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/APIApplicationServicesImpl.java @@ -19,22 +19,18 @@ package io.entgra.device.mgt.core.apimgt.extension.rest.api; import com.google.gson.Gson; -import org.json.JSONObject; -import io.entgra.device.mgt.core.apimgt.extension.rest.api.util.HttpsTrustManagerUtils; -import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIApplicationKey; import io.entgra.device.mgt.core.apimgt.extension.rest.api.constants.Constants; +import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIApplicationKey; import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.AccessTokenInfo; import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.APIServicesException; -import okhttp3.MediaType; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.RequestBody; -import okhttp3.Credentials; +import io.entgra.device.mgt.core.apimgt.extension.rest.api.util.HttpsTrustManagerUtils; +import okhttp3.*; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.json.JSONObject; import org.wso2.carbon.apimgt.impl.APIManagerConfiguration; import org.wso2.carbon.apimgt.impl.internal.ServiceReferenceHolder; + import java.io.IOException; public class APIApplicationServicesImpl implements APIApplicationServices { diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServices.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServices.java index 6bc3f17318..be134dbb4d 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServices.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServices.java @@ -19,18 +19,13 @@ package io.entgra.device.mgt.core.apimgt.extension.rest.api; import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIApplicationKey; +import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.APIInfo; import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.AccessTokenInfo; import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.APIServicesException; import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.BadRequestException; import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.UnexpectedResponseException; -import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.APIInfo; import org.json.JSONObject; -import org.wso2.carbon.apimgt.api.model.APIIdentifier; -import org.wso2.carbon.apimgt.api.model.Scope; -import org.wso2.carbon.apimgt.api.model.Mediation; -import org.wso2.carbon.apimgt.api.model.APIRevision; -import org.wso2.carbon.apimgt.api.model.APIRevisionDeployment; -import org.wso2.carbon.apimgt.api.model.Documentation; +import org.wso2.carbon.apimgt.api.model.*; import java.util.List; diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServicesImpl.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServicesImpl.java index 3308f13115..455ddb6c5b 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServicesImpl.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServicesImpl.java @@ -21,30 +21,21 @@ package io.entgra.device.mgt.core.apimgt.extension.rest.api; import com.google.gson.Gson; import io.entgra.device.mgt.core.apimgt.extension.rest.api.constants.Constants; import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIApplicationKey; +import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.APIInfo; import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.AccessTokenInfo; import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.APIServicesException; import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.BadRequestException; import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.UnexpectedResponseException; -import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.APIInfo; import io.entgra.device.mgt.core.apimgt.extension.rest.api.util.HttpsTrustManagerUtils; import io.entgra.device.mgt.core.apimgt.extension.rest.api.util.ScopeUtils; -import okhttp3.MediaType; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.Response; -import okhttp3.RequestBody; +import okhttp3.*; import org.apache.commons.httpclient.HttpStatus; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.ssl.Base64; import org.json.JSONArray; import org.json.JSONObject; -import org.wso2.carbon.apimgt.api.model.APIIdentifier; -import org.wso2.carbon.apimgt.api.model.Scope; -import org.wso2.carbon.apimgt.api.model.Mediation; -import org.wso2.carbon.apimgt.api.model.APIRevision; -import org.wso2.carbon.apimgt.api.model.APIRevisionDeployment; -import org.wso2.carbon.apimgt.api.model.Documentation; +import org.wso2.carbon.apimgt.api.model.*; import java.io.IOException; import java.util.List; diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/constants/Constants.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/constants/Constants.java index 30074c7b4a..c2691c4e05 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/constants/Constants.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/constants/Constants.java @@ -61,10 +61,10 @@ public final class Constants { public static final String SPACE = " "; public static final String IOT_CORE_HOST = "iot.core.host"; public static final String IOT_CORE_HTTPS_PORT = "iot.core.https.port"; - public static final String GET_ALL_SCOPES = "/api/am/publisher/v2/scopes?limit=1000"; - public static final String SCOPE_API_ENDPOINT = "/api/am/publisher/v2/scopes/"; - public static final String API_ENDPOINT = "/api/am/publisher/v2/apis/"; - public static final String GET_ALL_APIS = "/api/am/publisher/v2/apis?limit=1000"; + public static final String GET_ALL_SCOPES = "/api/am/publisher/v4/scopes?limit=1000"; + public static final String SCOPE_API_ENDPOINT = "/api/am/publisher/v4/scopes/"; + public static final String API_ENDPOINT = "/api/am/publisher/v4/apis/"; + public static final String GET_ALL_APIS = "/api/am/publisher/v4/apis?limit=1000"; } diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/internal/PublisherRESTAPIServiceComponent.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/internal/PublisherRESTAPIServiceComponent.java index 989a547729..5ee6d99b19 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/internal/PublisherRESTAPIServiceComponent.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/internal/PublisherRESTAPIServiceComponent.java @@ -24,22 +24,17 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleContext; import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.*; import org.wso2.carbon.apimgt.impl.APIManagerConfigurationService; -/** - * @scr.component name="internal.io.entgra.device.mgt.core.apimgt.extension.rest.api.PublisherRESTAPIServiceComponent" - * immediate="true" - * @scr.reference name="user.apimanagerconfigurationservice.default" - * interface="org.wso2.carbon.apimgt.impl.APIManagerConfigurationService" - * cardinality="1..1" - * policy="dynamic" - * bind="setAPIManagerConfigurationService" - * unbind="unsetAPIManagerConfigurationService" - */ +@Component( + name = "io.entgra.device.mgt.core.apimgt.extension.rest.api.internal.PublisherRESTAPIServiceComponent", + immediate = true) public class PublisherRESTAPIServiceComponent { private static Log log = LogFactory.getLog(PublisherRESTAPIServiceComponent.class); + @Activate protected void activate(ComponentContext componentContext) { if (log.isDebugEnabled()) { log.debug("Initializing publisher API extension bundle"); @@ -58,11 +53,17 @@ public class PublisherRESTAPIServiceComponent { log.error("Error occurred while initializing API Application bundle", e); } } - + @Deactivate protected void deactivate(ComponentContext componentContext) { //do nothing } + @Reference( + name = "apim.configuration.service", + service = org.wso2.carbon.apimgt.impl.APIManagerConfigurationService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetAPIManagerConfigurationService") protected void setAPIManagerConfigurationService(APIManagerConfigurationService apiManagerConfigurationService) { if (log.isDebugEnabled()) { log.debug("Setting API Manager Configuration Service"); diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/util/HttpsTrustManagerUtils.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/util/HttpsTrustManagerUtils.java index 745ceee40a..826186d555 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/util/HttpsTrustManagerUtils.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/util/HttpsTrustManagerUtils.java @@ -25,30 +25,12 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.base.ServerConfiguration; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLSocketFactory; -import javax.net.ssl.TrustManager; -import javax.net.ssl.X509TrustManager; -import javax.net.ssl.SSLSession; -import javax.net.ssl.KeyManagerFactory; -import javax.net.ssl.TrustManagerFactory; -import javax.net.ssl.HostnameVerifier; - +import javax.net.ssl.*; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; -import java.net.Proxy; -import java.net.ProxySelector; -import java.net.InetSocketAddress; -import java.net.SocketAddress; -import java.net.URI; - -import java.security.KeyManagementException; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.UnrecoverableKeyException; -import java.security.SecureRandom; +import java.net.*; +import java.security.*; import java.security.cert.CertificateException; import java.util.ArrayList; import java.util.List; diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.api/pom.xml b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.api/pom.xml index 5561082608..1574f824e5 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.api/pom.xml +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.api/pom.xml @@ -11,15 +11,16 @@ war WSO2 Carbon - API Key Management API This module extends the API manager's key management apis. - http://wso2.org + https://entgra.io + org.apache.maven.plugins maven-compiler-plugin - + org.apache.maven.plugins maven-war-plugin WEB-INF/lib/*cxf*.jar diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.api/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/api/KeyManagerService.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.api/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/api/KeyManagerService.java index 4d7af948e8..b58511f170 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.api/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/api/KeyManagerService.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.api/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/api/KeyManagerService.java @@ -18,12 +18,7 @@ package io.entgra.device.mgt.core.apimgt.keymgt.extension.api; -import javax.ws.rs.Consumes; -import javax.ws.rs.FormParam; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.api/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/api/KeyManagerServiceImpl.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.api/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/api/KeyManagerServiceImpl.java index 27cfa87573..5179e8f4e2 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.api/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/api/KeyManagerServiceImpl.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.api/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/api/KeyManagerServiceImpl.java @@ -28,12 +28,7 @@ import io.entgra.device.mgt.core.apimgt.keymgt.extension.service.KeyMgtService; import io.entgra.device.mgt.core.apimgt.keymgt.extension.service.KeyMgtServiceImpl; import io.entgra.device.mgt.core.device.mgt.common.exceptions.UnAuthorizedException; -import javax.ws.rs.Consumes; -import javax.ws.rs.FormParam; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.Base64; diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.api/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.api/src/main/webapp/WEB-INF/cxf-servlet.xml index f93f453965..72fa3b82a2 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.api/src/main/webapp/WEB-INF/cxf-servlet.xml +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.api/src/main/webapp/WEB-INF/cxf-servlet.xml @@ -19,9 +19,9 @@ + http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd"> diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/pom.xml b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/pom.xml index c7d84703db..ef9b856fbe 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/pom.xml +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/pom.xml @@ -12,9 +12,14 @@ bundle WSO2 Carbon - API Key Management This module extends the API manager's key management. - http://wso2.org + https://entgra.io + + org.apache.felix + org.apache.felix.scr.ds-annotations + provided + commons-codec.wso2 commons-codec @@ -37,8 +42,12 @@ - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -52,10 +61,40 @@ API Management Application Bundle io.entgra.device.mgt.core.apimgt.keymgt.extension.internal - io.entgra.device.mgt.core.apimgt.application.extension, - io.entgra.device.mgt.core.apimgt.application.extension.*, - io.entgra.device.mgt.core.device.mgt.common.*, - io.entgra.device.mgt.core.device.mgt.core.* + com.google.gson;version="[2.9,3)", + io.entgra.device.mgt.core.apimgt.keymgt.extension, + io.entgra.device.mgt.core.apimgt.keymgt.extension.exception, + io.entgra.device.mgt.core.apimgt.keymgt.extension.service, + io.entgra.device.mgt.core.device.mgt.common.permission.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.config;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.config.keymanager;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.permission.mgt;version="[5.0,6)", + javax.cache;version="[1.0,2)", + javax.net.ssl,okhttp3;version="[4.9,5)", + org.apache.commons.lang;version="[2.4,3)", + org.apache.commons.logging;version="[1.2,2)", + org.json;version="[3.0,4)", + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", + org.wso2.carbon.apimgt.api;version="[9.28,10)", + org.wso2.carbon.apimgt.api.model;version="[9.28,10)", + org.wso2.carbon.apimgt.api.model.subscription;version="[9.28,10)", + org.wso2.carbon.apimgt.impl;version="[9.28,10)", + org.wso2.carbon.apimgt.impl.caching;version="[9.28,10)", + org.wso2.carbon.apimgt.impl.dto;version="[9.28,10)", + org.wso2.carbon.apimgt.impl.factory;version="[9.28,10)", + org.wso2.carbon.apimgt.impl.jwt;version="[9.28,10)", + org.wso2.carbon.apimgt.impl.utils;version="[9.28,10)", + org.wso2.carbon.apimgt.keymgt;version="[9.28,10)", + org.wso2.carbon.apimgt.keymgt.handlers;version="[9.28,10)", + org.wso2.carbon.apimgt.keymgt.model;version="[9.28,10)", + org.wso2.carbon.apimgt.keymgt.model.entity;version="[9.28,10)", + org.wso2.carbon.apimgt.keymgt.service;version="[9.28,10)", + org.wso2.carbon.context;version="[4.8,5)", + org.wso2.carbon.user.api;version="[1.0,2)", + org.wso2.carbon.user.core.service;version="[4.8,5)", + org.wso2.carbon.user.core.tenant;version="[4.8,5)", + org.wso2.carbon.utils.multitenancy;version="[4.8,5)" !io.entgra.device.mgt.core.apimgt.keymgt.extension.internal, diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/KeyManagerConnectorConfiguration.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/KeyManagerConnectorConfiguration.java index ddc6eed83d..0be25b31a7 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/KeyManagerConnectorConfiguration.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/KeyManagerConnectorConfiguration.java @@ -18,6 +18,7 @@ package io.entgra.device.mgt.core.apimgt.keymgt.extension; +import org.osgi.service.component.annotations.Component; import org.wso2.carbon.apimgt.api.model.ConfigurationDto; import org.wso2.carbon.apimgt.impl.APIConstants; import org.wso2.carbon.apimgt.impl.DefaultKeyManagerConnectorConfiguration; @@ -27,9 +28,10 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -/** - * @scr.component name="io.entgra.device.mgt.core.apimgt.keymgt.extension.customKeyManagerConfigComponent" immediate="true" - */ +@Component( + name = "io.entgra.device.mgt.core.apimgt.keymgt.extension.KeyManagerConnectorConfiguration", + service = DefaultKeyManagerConnectorConfiguration.class, + immediate = true) public class KeyManagerConnectorConfiguration extends DefaultKeyManagerConnectorConfiguration { @Override diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/KeyValidationHandler.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/KeyValidationHandler.java index 0b8bf30bc3..d580b6ea5e 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/KeyValidationHandler.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/KeyValidationHandler.java @@ -17,6 +17,10 @@ */ package io.entgra.device.mgt.core.apimgt.keymgt.extension; +import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.Permission; +import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagementException; +import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagerService; +import io.entgra.device.mgt.core.device.mgt.core.permission.mgt.PermissionManagerServiceImpl; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -36,22 +40,12 @@ import org.wso2.carbon.apimgt.keymgt.model.SubscriptionDataStore; import org.wso2.carbon.apimgt.keymgt.model.entity.API; import org.wso2.carbon.apimgt.keymgt.service.TokenValidationContext; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.Permission; -import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagementException; -import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagerService; -import io.entgra.device.mgt.core.device.mgt.core.permission.mgt.PermissionManagerServiceImpl; import org.wso2.carbon.user.api.UserRealm; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.core.service.RealmService; import org.wso2.carbon.utils.multitenancy.MultitenantUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Set; -import java.util.StringTokenizer; +import java.util.*; public class KeyValidationHandler extends DefaultKeyValidationHandler { diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/internal/KeyMgtServiceComponent.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/internal/KeyMgtServiceComponent.java index d86c3d7ca7..737fa907c3 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/internal/KeyMgtServiceComponent.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/internal/KeyMgtServiceComponent.java @@ -18,21 +18,24 @@ package io.entgra.device.mgt.core.apimgt.keymgt.extension.internal; +import io.entgra.device.mgt.core.apimgt.keymgt.extension.service.KeyMgtService; +import io.entgra.device.mgt.core.apimgt.keymgt.extension.service.KeyMgtServiceImpl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleContext; import org.osgi.service.component.ComponentContext; -import io.entgra.device.mgt.core.apimgt.keymgt.extension.service.KeyMgtService; -import io.entgra.device.mgt.core.apimgt.keymgt.extension.service.KeyMgtServiceImpl; - -/** - * @scr.component name="io.entgra.device.mgt.core.apimgt.keymgt.extension.keyMgtServiceComponent" immediate="true" - */ +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Deactivate; +@Component( + name = "io.entgra.device.mgt.core.apimgt.keymgt.extension.internal.KeyMgtServiceComponent", + immediate = true) public class KeyMgtServiceComponent { private static final Log log = LogFactory.getLog(KeyMgtServiceComponent.class); @SuppressWarnings("unused") + @Activate protected void activate(ComponentContext componentContext) { try { if (log.isDebugEnabled()) { @@ -54,6 +57,7 @@ public class KeyMgtServiceComponent { } @SuppressWarnings("unused") + @Deactivate protected void deactivate(ComponentContext componentContext) { if (log.isDebugEnabled()) { log.debug("De-activating Key Management Service Component"); diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/service/KeyMgtServiceImpl.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/service/KeyMgtServiceImpl.java index c7da98973b..e674c459d2 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/service/KeyMgtServiceImpl.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/src/main/java/io/entgra/device/mgt/core/apimgt/keymgt/extension/service/KeyMgtServiceImpl.java @@ -19,13 +19,13 @@ package io.entgra.device.mgt.core.apimgt.keymgt.extension.service; import com.google.gson.Gson; -import okhttp3.Credentials; -import okhttp3.FormBody; -import okhttp3.MediaType; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; +import io.entgra.device.mgt.core.apimgt.keymgt.extension.*; +import io.entgra.device.mgt.core.apimgt.keymgt.extension.exception.BadRequestException; +import io.entgra.device.mgt.core.apimgt.keymgt.extension.exception.KeyMgtException; +import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; +import io.entgra.device.mgt.core.device.mgt.core.config.DeviceManagementConfig; +import io.entgra.device.mgt.core.device.mgt.core.config.keymanager.KeyManagerConfigurations; +import okhttp3.*; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.json.JSONObject; @@ -34,18 +34,7 @@ import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.model.Application; import org.wso2.carbon.apimgt.impl.APIManagerFactory; import org.wso2.carbon.apimgt.impl.utils.APIUtil; -import io.entgra.device.mgt.core.apimgt.keymgt.extension.DCRResponse; -import io.entgra.device.mgt.core.apimgt.keymgt.extension.KeyManagerPayload; -import io.entgra.device.mgt.core.apimgt.keymgt.extension.KeyMgtConstants; -import io.entgra.device.mgt.core.apimgt.keymgt.extension.OAuthApplication; -import io.entgra.device.mgt.core.apimgt.keymgt.extension.TokenRequest; -import io.entgra.device.mgt.core.apimgt.keymgt.extension.TokenResponse; -import io.entgra.device.mgt.core.apimgt.keymgt.extension.exception.BadRequestException; -import io.entgra.device.mgt.core.apimgt.keymgt.extension.exception.KeyMgtException; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; -import io.entgra.device.mgt.core.device.mgt.core.config.DeviceManagementConfig; -import io.entgra.device.mgt.core.device.mgt.core.config.keymanager.KeyManagerConfigurations; import org.wso2.carbon.user.api.UserRealm; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.api.UserStoreManager; @@ -59,11 +48,7 @@ import javax.net.ssl.X509TrustManager; import java.io.IOException; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; +import java.util.*; public class KeyMgtServiceImpl implements KeyMgtService { diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/pom.xml b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/pom.xml index 2a45ffeea1..997ac34fad 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/pom.xml +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/pom.xml @@ -31,22 +31,19 @@ bundle WSO2 Carbon - API Management Webapp Publisher WSO2 Carbon - API Management Webapp Publisher - http://wso2.org + https://entgra.io + + org.apache.felix + org.apache.felix.scr.ds-annotations + provided + org.powermock powermock-api-mockito test - - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.osgi - org.eclipse.osgi.services - org.testng testng @@ -67,7 +64,6 @@ org.ops4j.pax.logging pax-logging-api provided - org.wso2.carbon @@ -82,7 +78,7 @@ gson - org.wso2.orbit.org.scannotation + io.entgra.org.scannotation scannotation @@ -139,8 +135,12 @@ - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -159,47 +159,43 @@ io.entgra.device.mgt.core.apimgt.webapp.publisher.* - com.google.gson;version="[2.3,2.8.6)", - com.google.gson.reflect;version="[2.3,2.8.6)", - io.swagger.annotations, - javax.servlet;version="2.6", - javax.xml, - javax.xml.bind, - javax.xml.bind.annotation, - javax.xml.parsers, - org.apache.catalina;version="9.0", - org.apache.catalina.core;version="9.0", - org.apache.commons.logging;version="1.2", - org.osgi.framework.*;version="${imp.package.version.osgi.framework}", - org.osgi.service.*;version="${imp.package.version.osgi.service}", - org.scannotation;version="1.0", - org.scannotation.archiveiterator;version="1.0", - org.w3c.dom, - io.entgra.device.mgt.core.apimgt.extension.rest.api.*, - io.entgra.device.mgt.core.apimgt.annotations, - org.wso2.carbon.apimgt.api, - org.wso2.carbon.apimgt.api.model, - org.wso2.carbon.apimgt.impl, - org.wso2.carbon.apimgt.impl.utils, - io.entgra.device.mgt.core.apimgt.webapp.publisher, + com.google.gson;version="[2.9,3)", + com.google.gson.reflect;version="[2.9,3)", + io.entgra.device.mgt.core.apimgt.annotations;version="[5.0,6)", + io.entgra.device.mgt.core.apimgt.extension.rest.api;version="[5.0,6)", + io.entgra.device.mgt.core.apimgt.extension.rest.api.dto;version="[5.0,6)", + io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo;version="[5.0,6)", + io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions;version="[5.0,6)", io.entgra.device.mgt.core.apimgt.webapp.publisher.config, io.entgra.device.mgt.core.apimgt.webapp.publisher.dto, io.entgra.device.mgt.core.apimgt.webapp.publisher.exception, - io.entgra.device.mgt.core.apimgt.webapp.publisher.lifecycle.listener, - io.entgra.device.mgt.core.apimgt.webapp.publisher.lifecycle.util, - org.wso2.carbon.base;version="1.0", - org.wso2.carbon.context;version="4.6", - org.wso2.carbon.core;version="4.6", - org.wso2.carbon.core.util;version="4.6", - org.wso2.carbon.registry.core.service;version="1.0", - org.wso2.carbon.user.api;version="1.0", - org.wso2.carbon.user.core.service;version="4.6", - org.wso2.carbon.user.core.tenant;version="4.6", - org.wso2.carbon.utils;version="4.6", - org.wso2.carbon.utils.multitenancy;version="4.6", - org.wso2.carbon.apimgt.impl.definitions, - org.apache.commons.lang, - org.json + io.swagger.annotations;version="[1.6,2)", + javax.servlet;version="[2.6,3)", + javax.xml.bind;version="[0.0,1)", + javax.xml.bind.annotation;version="[0.0,1)", + javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}", + org.apache.catalina;version="${catalina.version.range}", + org.apache.catalina.core;version="${catalina.version.range}", + org.apache.commons.lang;version="[2.6,3)", + org.apache.commons.logging;version="[1.2,2)", + org.json;version="[3.0,4)", + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", + org.scannotation;version="[1.0,2)", + org.scannotation.archiveiterator;version="[1.0,2)", + org.w3c.dom, + org.wso2.carbon.apimgt.api;version="[9.28,10)", + org.wso2.carbon.apimgt.api.model;version="[9.28,10)", + org.wso2.carbon.apimgt.impl;version="[9.28,10)", + org.wso2.carbon.apimgt.impl.utils;version="[9.28,10)", + org.wso2.carbon.context;version="[4.8,5)", + org.wso2.carbon.core;version="[4.8,5)", + org.wso2.carbon.core.util;version="[4.8,5)", + org.wso2.carbon.registry.core.service, + org.wso2.carbon.user.api, + org.wso2.carbon.user.core.service;version="[4.8,5)", + org.wso2.carbon.user.core.tenant;version="[4.8,5)", + org.wso2.carbon.utils;version="[4.8,5)" jsr311-api;scope=compile|runtime;inline=false diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherServiceImpl.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherServiceImpl.java index c24e38fdd2..2062f0e01d 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherServiceImpl.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherServiceImpl.java @@ -24,33 +24,26 @@ import io.entgra.device.mgt.core.apimgt.extension.rest.api.PublisherRESTAPIServi import io.entgra.device.mgt.core.apimgt.extension.rest.api.PublisherRESTAPIServicesImpl; import io.entgra.device.mgt.core.apimgt.extension.rest.api.constants.Constants; import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIApplicationKey; +import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.APIInfo; import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.AccessTokenInfo; import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.APIServicesException; import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.BadRequestException; import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.UnexpectedResponseException; -import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.APIInfo; +import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.WebappPublisherConfig; +import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiScope; +import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiUriTemplate; +import io.entgra.device.mgt.core.apimgt.webapp.publisher.exception.APIManagerPublisherException; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.apimgt.api.model.Documentation; -import org.wso2.carbon.apimgt.api.model.DocumentationType; import org.json.JSONArray; import org.json.JSONObject; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.APIProvider; -import org.wso2.carbon.apimgt.api.model.APIIdentifier; -import org.wso2.carbon.apimgt.api.model.APIRevision; -import org.wso2.carbon.apimgt.api.model.APIRevisionDeployment; -import org.wso2.carbon.apimgt.api.model.CORSConfiguration; -import org.wso2.carbon.apimgt.api.model.Mediation; -import org.wso2.carbon.apimgt.api.model.Scope; +import org.wso2.carbon.apimgt.api.model.*; import org.wso2.carbon.apimgt.impl.APIConstants; import org.wso2.carbon.apimgt.impl.APIManagerFactory; import org.wso2.carbon.apimgt.impl.utils.APIUtil; -import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.WebappPublisherConfig; -import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiScope; -import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiUriTemplate; -import io.entgra.device.mgt.core.apimgt.webapp.publisher.exception.APIManagerPublisherException; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.core.service.RealmService; @@ -66,16 +59,7 @@ import java.io.IOException; import java.nio.file.DirectoryIteratorException; import java.nio.file.Files; import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Date; +import java.util.*; /** * This class represents the concrete implementation of the APIPublisherService that corresponds to providing all diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherStartupHandler.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherStartupHandler.java index 56ec060d71..a47c1399d7 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherStartupHandler.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherStartupHandler.java @@ -19,10 +19,10 @@ package io.entgra.device.mgt.core.apimgt.webapp.publisher; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.apimgt.webapp.publisher.exception.APIManagerPublisherException; import io.entgra.device.mgt.core.apimgt.webapp.publisher.internal.APIPublisherDataHolder; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.wso2.carbon.core.ServerStartupObserver; import java.util.Stack; diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherUtil.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherUtil.java index dedd6f9c99..31e1a656ce 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherUtil.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherUtil.java @@ -23,8 +23,6 @@ import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.reflect.TypeToken; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.APIResource; import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.APIResourceConfiguration; @@ -32,6 +30,8 @@ import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.WebappPublisherC import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiScope; import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiUriTemplate; import io.entgra.device.mgt.core.apimgt.webapp.publisher.lifecycle.util.AnnotationProcessor; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.core.util.Utils; diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/config/WebappPublisherConfig.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/config/WebappPublisherConfig.java index 2d7406b4a7..29c6a79a58 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/config/WebappPublisherConfig.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/config/WebappPublisherConfig.java @@ -18,10 +18,10 @@ package io.entgra.device.mgt.core.apimgt.webapp.publisher.config; -import org.w3c.dom.Document; import io.entgra.device.mgt.core.apimgt.webapp.publisher.InvalidConfigurationStateException; import io.entgra.device.mgt.core.apimgt.webapp.publisher.WebappPublisherConfigurationFailedException; import io.entgra.device.mgt.core.apimgt.webapp.publisher.WebappPublisherUtil; +import org.w3c.dom.Document; import org.wso2.carbon.utils.CarbonUtils; import javax.xml.bind.JAXBContext; diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java index 7c67f9d0c2..af5da0cb56 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java @@ -18,37 +18,27 @@ */ package io.entgra.device.mgt.core.apimgt.webapp.publisher.internal; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.osgi.framework.BundleContext; -import org.osgi.service.component.ComponentContext; import io.entgra.device.mgt.core.apimgt.webapp.publisher.APIPublisherService; import io.entgra.device.mgt.core.apimgt.webapp.publisher.APIPublisherServiceImpl; import io.entgra.device.mgt.core.apimgt.webapp.publisher.APIPublisherStartupHandler; import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.WebappPublisherConfig; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.osgi.framework.BundleContext; +import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.*; import org.wso2.carbon.core.ServerStartupObserver; import org.wso2.carbon.registry.core.service.RegistryService; import org.wso2.carbon.user.core.service.RealmService; -/** - * @scr.component name="io.entgra.device.mgt.core.apimgt.webapp.publisher" immediate="true" - * @scr.reference name="user.realmservice.default" - * interface="org.wso2.carbon.user.core.service.RealmService" - * cardinality="1..1" - * policy="dynamic" - * bind="setRealmService" - * unbind="unsetRealmService" - * @scr.reference name="registry.service" - * interface="org.wso2.carbon.registry.core.service.RegistryService" - * cardinality="1..1" - * policy="dynamic" - * bind="setRegistryService" - * unbind="unsetRegistryService" - */ +@Component( + name = "io.entgra.device.mgt.core.apimgt.webapp.publisher.internal.APIPublisherServiceComponent", + immediate = true) public class APIPublisherServiceComponent { private static Log log = LogFactory.getLog(APIPublisherServiceComponent.class); + @Activate protected void activate(ComponentContext componentContext) { try { if (log.isDebugEnabled()) { @@ -72,6 +62,7 @@ public class APIPublisherServiceComponent { } } + @Deactivate protected void deactivate(ComponentContext componentContext) { //do nothing } @@ -89,6 +80,12 @@ public class APIPublisherServiceComponent { bundleContext.registerService(ServerStartupObserver.class, new APIPublisherStartupHandler(), null); } + @Reference( + name = "user.realmservice.default", + service = org.wso2.carbon.user.core.service.RealmService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetRealmService") protected void setRealmService(RealmService realmService) { if (log.isDebugEnabled()) { log.debug("Setting Realm Service"); @@ -103,6 +100,12 @@ public class APIPublisherServiceComponent { APIPublisherDataHolder.getInstance().setRealmService(null); } + @Reference( + name = "registry.service", + service = org.wso2.carbon.registry.core.service.RegistryService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetRegistryService") protected void setRegistryService(RegistryService registryService) { if (registryService != null && log.isDebugEnabled()) { log.debug("Registry service initialized"); diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/lifecycle/listener/APIPublisherLifecycleListener.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/lifecycle/listener/APIPublisherLifecycleListener.java index b486fdf267..a3abe8623e 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/lifecycle/listener/APIPublisherLifecycleListener.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/lifecycle/listener/APIPublisherLifecycleListener.java @@ -18,12 +18,6 @@ */ package io.entgra.device.mgt.core.apimgt.webapp.publisher.lifecycle.listener; -import org.apache.catalina.Lifecycle; -import org.apache.catalina.LifecycleEvent; -import org.apache.catalina.LifecycleListener; -import org.apache.catalina.core.StandardContext; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.apimgt.webapp.publisher.APIConfig; import io.entgra.device.mgt.core.apimgt.webapp.publisher.APIPublisherService; import io.entgra.device.mgt.core.apimgt.webapp.publisher.APIPublisherUtil; @@ -31,6 +25,12 @@ import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.APIResourceConfi import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.WebappPublisherConfig; import io.entgra.device.mgt.core.apimgt.webapp.publisher.internal.APIPublisherDataHolder; import io.entgra.device.mgt.core.apimgt.webapp.publisher.lifecycle.util.AnnotationProcessor; +import org.apache.catalina.Lifecycle; +import org.apache.catalina.LifecycleEvent; +import org.apache.catalina.LifecycleListener; +import org.apache.catalina.core.StandardContext; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.user.api.UserStoreException; diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/lifecycle/util/AnnotationProcessor.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/lifecycle/util/AnnotationProcessor.java index cca49ae996..b51a5a2b8b 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/lifecycle/util/AnnotationProcessor.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/lifecycle/util/AnnotationProcessor.java @@ -18,27 +18,18 @@ package io.entgra.device.mgt.core.apimgt.webapp.publisher.lifecycle.util; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; +import io.entgra.device.mgt.core.apimgt.webapp.publisher.APIPublisherUtil; +import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.APIResource; +import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.APIResourceConfiguration; +import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiScope; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.SwaggerDefinition; import org.apache.catalina.core.StandardContext; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.apimgt.webapp.publisher.APIPublisherUtil; -import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.APIResource; -import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.APIResourceConfiguration; -import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiScope; import javax.servlet.ServletContext; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.HEAD; -import javax.ws.rs.HttpMethod; -import javax.ws.rs.OPTIONS; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; +import javax.ws.rs.*; import java.io.File; import java.io.IOException; import java.lang.annotation.Annotation; diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/lifecycle/util/ExtendedFileProtocolIteratorFactory.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/lifecycle/util/ExtendedFileProtocolIteratorFactory.java index 68b8878055..f37951ff54 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/lifecycle/util/ExtendedFileProtocolIteratorFactory.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/lifecycle/util/ExtendedFileProtocolIteratorFactory.java @@ -16,7 +16,6 @@ package io.entgra.device.mgt.core.apimgt.webapp.publisher.lifecycle.util; import org.scannotation.archiveiterator.*; - import java.io.File; import java.io.IOException; import java.net.URL; diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/test/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherServiceTest.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/test/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherServiceTest.java index 5f5c8a1ddb..c08c07eb58 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/test/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherServiceTest.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/test/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherServiceTest.java @@ -17,6 +17,13 @@ */ package io.entgra.device.mgt.core.apimgt.webapp.publisher; +import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.WebappPublisherConfig; +import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiScope; +import io.entgra.device.mgt.core.apimgt.webapp.publisher.exception.APIManagerPublisherException; +import io.entgra.device.mgt.core.apimgt.webapp.publisher.internal.APIPublisherDataHolder; +import io.entgra.device.mgt.core.apimgt.webapp.publisher.utils.MockAPICollectionApi; +import io.entgra.device.mgt.core.apimgt.webapp.publisher.utils.MockAPIIndividualApi; +import io.entgra.device.mgt.core.apimgt.webapp.publisher.utils.TestUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.mockito.Mockito; @@ -32,13 +39,6 @@ import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.APIIndi import org.wso2.carbon.apimgt.integration.generated.client.publisher.model.API; import org.wso2.carbon.apimgt.integration.generated.client.publisher.model.APIInfo; import org.wso2.carbon.apimgt.integration.generated.client.publisher.model.APIList; -import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.WebappPublisherConfig; -import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiScope; -import io.entgra.device.mgt.core.apimgt.webapp.publisher.exception.APIManagerPublisherException; -import io.entgra.device.mgt.core.apimgt.webapp.publisher.internal.APIPublisherDataHolder; -import io.entgra.device.mgt.core.apimgt.webapp.publisher.utils.MockAPICollectionApi; -import io.entgra.device.mgt.core.apimgt.webapp.publisher.utils.MockAPIIndividualApi; -import io.entgra.device.mgt.core.apimgt.webapp.publisher.utils.TestUtils; import java.lang.reflect.Field; import java.util.*; diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/test/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherUtilTest.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/test/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherUtilTest.java index 70676eb845..71aebd259f 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/test/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherUtilTest.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/test/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherUtilTest.java @@ -17,9 +17,6 @@ */ package io.entgra.device.mgt.core.apimgt.webapp.publisher; -import org.testng.Assert; -import org.testng.annotations.BeforeTest; -import org.testng.annotations.Test; import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.APIResource; import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.APIResourceConfiguration; import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.WebappPublisherConfig; @@ -28,6 +25,9 @@ import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiUriTemplate; import io.entgra.device.mgt.core.apimgt.webapp.publisher.exception.APIManagerPublisherException; import io.entgra.device.mgt.core.apimgt.webapp.publisher.utils.MockServletContext; import io.entgra.device.mgt.core.apimgt.webapp.publisher.utils.TestUtils; +import org.testng.Assert; +import org.testng.annotations.BeforeTest; +import org.testng.annotations.Test; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.registry.core.exceptions.RegistryException; import org.wso2.carbon.registry.core.jdbc.realm.InMemoryRealmService; @@ -36,14 +36,11 @@ import org.wso2.carbon.user.api.UserRealm; import org.wso2.carbon.user.api.UserStoreException; import javax.servlet.ServletContext; - import java.util.ArrayList; import java.util.List; import java.util.Set; -import static io.entgra.device.mgt.core.apimgt.webapp.publisher.APIPublisherUtil.buildApiConfig; -import static io.entgra.device.mgt.core.apimgt.webapp.publisher.APIPublisherUtil.getApiEndpointUrl; -import static io.entgra.device.mgt.core.apimgt.webapp.publisher.APIPublisherUtil.setResourceAuthTypes; +import static io.entgra.device.mgt.core.apimgt.webapp.publisher.APIPublisherUtil.*; /** * This is the test class for {@link APIPublisherUtil} diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/test/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/BaseAPIPublisherTest.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/test/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/BaseAPIPublisherTest.java index d8da938cff..d5746ee348 100644 --- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/test/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/BaseAPIPublisherTest.java +++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/test/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/BaseAPIPublisherTest.java @@ -18,12 +18,13 @@ */ package io.entgra.device.mgt.core.apimgt.webapp.publisher; +import io.entgra.device.mgt.core.apimgt.webapp.publisher.internal.APIPublisherDataHolder; +import io.entgra.device.mgt.core.apimgt.webapp.publisher.utils.MockAPIIndividualApi; +import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.mockito.Mockito; import org.testng.annotations.BeforeSuite; -import io.entgra.device.mgt.core.apimgt.webapp.publisher.internal.APIPublisherDataHolder; -import io.entgra.device.mgt.core.apimgt.webapp.publisher.utils.MockAPIIndividualApi; import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.context.internal.OSGiDataHolder; @@ -34,7 +35,6 @@ import org.wso2.carbon.registry.core.jdbc.realm.InMemoryRealmService; import org.wso2.carbon.registry.core.service.RegistryService; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.core.service.RealmService; -import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; import java.io.File; import java.io.InputStream; diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml index bb79290fd6..4386f0c0f3 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml @@ -30,7 +30,7 @@ bundle WSO2 Carbon - API Security Handler Component WSO2 Carbon - API Management Security Handler Module - http://wso2.org + https://entgra.io diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml index c91bf08475..a0f940230d 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml @@ -22,7 +22,7 @@ bundle WSO2 Carbon - API Management Integration Client WSO2 Carbon - API Management Integration Client - http://wso2.org + https://entgra.io diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml index 98240ce166..b785aa270c 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml @@ -22,7 +22,7 @@ bundle WSO2 Carbon - API Management Integration Generated Client WSO2 Carbon - API Management Integration Client - http://wso2.org + https://entgra.io diff --git a/components/apimgt-extensions/pom.xml b/components/apimgt-extensions/pom.xml index ae5f8c040c..d74759438b 100644 --- a/components/apimgt-extensions/pom.xml +++ b/components/apimgt-extensions/pom.xml @@ -30,7 +30,7 @@ apimgt-extensions pom WSO2 Carbon - API Management Extensions Component - http://wso2.org + https://entgra.io io.entgra.device.mgt.core.apimgt.webapp.publisher @@ -43,23 +43,4 @@ io.entgra.device.mgt.core.apimgt.extension.rest.api - - - - - - - - - - - - - - - - - - - diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.addons/pom.xml b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.addons/pom.xml index 78dfa71168..784daa0f10 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.addons/pom.xml +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.addons/pom.xml @@ -29,12 +29,17 @@ Entgra - Application Management Add-Ons Entgra - Application Management Add-Ons https://entgra.io + bundle - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -47,8 +52,21 @@ ${io.entgra.device.mgt.core.version} Application Management Add-Ons Bundle - com.google.gson, - io.swagger.annotations.*;resolution:=optional + com.google.gson;version="[2.9,3)", + io.entgra.device.mgt.core.application.mgt.addons.jaxrs, + javax.servlet;version="[4.0,5)", + javax.servlet.http;version="[4.0,5)", + javax.validation;version="[1.1,2)", + javax.validation.executable;version="[1.1,2)", + javax.ws.rs;version="[2.1,3)", + javax.ws.rs.core;version="[2.1,3)", + javax.ws.rs.ext;version="[2.1,3)", + org.apache.commons.logging;version="[1.2,2)", + org.apache.cxf.interceptor;version="[3.5,4)", + org.apache.cxf.jaxrs.lifecycle;version="[3.5,4)", + org.apache.cxf.jaxrs.model;version="[3.5,4)", + org.apache.cxf.message;version="[3.5,4)", + org.apache.cxf.phase;version="[3.5,4)" io.entgra.device.mgt.core.application.mgt.addons.* @@ -60,6 +78,11 @@ + + org.apache.felix + org.apache.felix.scr.ds-annotations + provided + org.apache.cxf cxf-rt-frontend-jaxws @@ -75,19 +98,10 @@ cxf-rt-transports-http provided - - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.equinox - org.eclipse.equinox.common - org.ops4j.pax.logging pax-logging-api provided - commons-codec.wso2 diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.addons/src/main/java/io/entgra/device/mgt/core/application/mgt/addons/JSONMessageHandler.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.addons/src/main/java/io/entgra/device/mgt/core/application/mgt/addons/JSONMessageHandler.java index 3834cedd01..8ef8cc7fa2 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.addons/src/main/java/io/entgra/device/mgt/core/application/mgt/addons/JSONMessageHandler.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.addons/src/main/java/io/entgra/device/mgt/core/application/mgt/addons/JSONMessageHandler.java @@ -28,11 +28,7 @@ import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.ext.MessageBodyReader; import javax.ws.rs.ext.MessageBodyWriter; import javax.ws.rs.ext.Provider; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.OutputStreamWriter; +import java.io.*; import java.lang.annotation.Annotation; import java.lang.reflect.Type; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.addons/src/main/java/io/entgra/device/mgt/core/application/mgt/addons/MultipartCustomProvider.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.addons/src/main/java/io/entgra/device/mgt/core/application/mgt/addons/MultipartCustomProvider.java index 1ef766a957..3764549e40 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.addons/src/main/java/io/entgra/device/mgt/core/application/mgt/addons/MultipartCustomProvider.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.addons/src/main/java/io/entgra/device/mgt/core/application/mgt/addons/MultipartCustomProvider.java @@ -20,8 +20,8 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import org.apache.cxf.jaxrs.ext.multipart.Attachment; import io.entgra.device.mgt.core.application.mgt.addons.jaxrs.AnnotationExclusionStrategy; +import org.apache.cxf.jaxrs.ext.multipart.Attachment; import javax.ws.rs.Consumes; import javax.ws.rs.WebApplicationException; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.api/pom.xml b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.api/pom.xml index 30cc4268e9..9a0724590c 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.api/pom.xml +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.api/pom.xml @@ -140,7 +140,6 @@ org.ops4j.pax.logging pax-logging-api provided - org.json.wso2 diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.api/src/main/java/io/entgra/device/mgt/core/application/mgt/api/ArtifactDownloadAPI.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.api/src/main/java/io/entgra/device/mgt/core/application/mgt/api/ArtifactDownloadAPI.java index 6956f57b9c..39dfd51942 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.api/src/main/java/io/entgra/device/mgt/core/application/mgt/api/ArtifactDownloadAPI.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.api/src/main/java/io/entgra/device/mgt/core/application/mgt/api/ArtifactDownloadAPI.java @@ -17,23 +17,11 @@ package io.entgra.device.mgt.core.application.mgt.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.SwaggerDefinition; import io.entgra.device.mgt.core.application.mgt.common.ApplicationList; import io.entgra.device.mgt.core.application.mgt.common.ErrorResponse; +import io.swagger.annotations.*; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.api/src/main/java/io/entgra/device/mgt/core/application/mgt/api/impl/ArtifactDownloadAPIImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.api/src/main/java/io/entgra/device/mgt/core/application/mgt/api/impl/ArtifactDownloadAPIImpl.java index b6b7938132..d86cfd6e8a 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.api/src/main/java/io/entgra/device/mgt/core/application/mgt/api/impl/ArtifactDownloadAPIImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.api/src/main/java/io/entgra/device/mgt/core/application/mgt/api/impl/ArtifactDownloadAPIImpl.java @@ -17,9 +17,6 @@ package io.entgra.device.mgt.core.application.mgt.api.impl; -import org.apache.commons.io.IOUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.application.mgt.api.ArtifactDownloadAPI; import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationManager; @@ -28,18 +25,16 @@ import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestExcept import io.entgra.device.mgt.core.application.mgt.core.exception.NotFoundException; import io.entgra.device.mgt.core.application.mgt.core.util.APIUtil; import io.entgra.device.mgt.core.application.mgt.core.util.Constants; +import org.apache.commons.io.IOUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import javax.ws.rs.*; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; /** * Implementation of ApplicationDTO Management related APIs. diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/pom.xml b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/pom.xml index d1c04250dd..cd9725f50a 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/pom.xml +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/pom.xml @@ -35,8 +35,12 @@ - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -49,13 +53,23 @@ ${io.entgra.device.mgt.core.version} Application Management Common Bundle - io.entgra.device.mgt.core.device.mgt.common.*;version="${io.entgra.device.mgt.core.version}", - io.entgra.device.mgt.core.device.mgt.core.dto;version="${io.entgra.device.mgt.core.version}", - com.google.gson, - io.swagger.annotations.*;resolution:=optional, - com.fasterxml.jackson.annotation, - javax.validation.constraints, - javax.xml.bind.annotation; version="${javax.xml.bind.imp.pkg.version}", + com.fasterxml.jackson.annotation;version="[2.9,3)", + com.google.gson;version="[2.9,3)", + io.entgra.device.mgt.core.application.mgt.common, + io.entgra.device.mgt.core.application.mgt.common.config, + io.entgra.device.mgt.core.application.mgt.common.dto, + io.entgra.device.mgt.core.application.mgt.common.exception, + io.entgra.device.mgt.core.application.mgt.common.response, + io.entgra.device.mgt.core.application.mgt.common.wrapper, + io.entgra.device.mgt.core.device.mgt.common;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.app.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.operation.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.common.exception;version="[5.0,6)", + io.swagger.annotations;version="[1.6,2)", + javax.validation.constraints;version="[2.0,3)", + javax.xml.bind.annotation;version="[0.0,1)" + + io.entgra.device.mgt.core.application.mgt.common.* @@ -68,18 +82,14 @@ - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.equinox - org.eclipse.equinox.common + org.apache.felix + org.apache.felix.scr.ds-annotations + provided org.ops4j.pax.logging pax-logging-api provided - commons-codec.wso2 diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/ApplicationInstallResponse.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/ApplicationInstallResponse.java index 5d6cb77951..5a7c2b636f 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/ApplicationInstallResponse.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/ApplicationInstallResponse.java @@ -17,9 +17,9 @@ package io.entgra.device.mgt.core.application.mgt.common; -import io.swagger.annotations.ApiModelProperty; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Activity; +import io.swagger.annotations.ApiModelProperty; import java.util.List; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/ApplicationSubscriptionInfo.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/ApplicationSubscriptionInfo.java index 2b3680a41c..895513e3f2 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/ApplicationSubscriptionInfo.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/ApplicationSubscriptionInfo.java @@ -20,7 +20,6 @@ package io.entgra.device.mgt.core.application.mgt.common; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import java.util.ArrayList; import java.util.List; public class ApplicationSubscriptionInfo { diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/DeviceList.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/DeviceList.java index cf178048bb..e9a8384b47 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/DeviceList.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/DeviceList.java @@ -18,8 +18,8 @@ package io.entgra.device.mgt.core.application.mgt.common; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; import io.entgra.device.mgt.core.device.mgt.common.Device; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/DeviceSubscriptionData.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/DeviceSubscriptionData.java index 7911cee127..59eb56f9d7 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/DeviceSubscriptionData.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/DeviceSubscriptionData.java @@ -19,8 +19,6 @@ package io.entgra.device.mgt.core.application.mgt.common; import io.entgra.device.mgt.core.device.mgt.common.Device; -import java.sql.Timestamp; - public class DeviceSubscriptionData { private int subId; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/InstallationDetails.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/InstallationDetails.java index 082620261d..48237d02c7 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/InstallationDetails.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/InstallationDetails.java @@ -17,8 +17,8 @@ */ package io.entgra.device.mgt.core.application.mgt.common; -import io.swagger.annotations.ApiModelProperty; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; +import io.swagger.annotations.ApiModelProperty; import java.util.List; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/LifecycleState.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/LifecycleState.java index cc6c7c3193..8eb216c4f5 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/LifecycleState.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/LifecycleState.java @@ -17,10 +17,10 @@ */ package io.entgra.device.mgt.core.application.mgt.common; -import java.sql.Timestamp; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import java.sql.Timestamp; import java.util.List; @ApiModel(value = "LifecycleState", description = "LifecycleState represents the Lifecycle state for an application release") diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/dto/ScheduledSubscriptionDTO.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/dto/ScheduledSubscriptionDTO.java index 134c434ced..62552129aa 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/dto/ScheduledSubscriptionDTO.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/dto/ScheduledSubscriptionDTO.java @@ -20,8 +20,8 @@ package io.entgra.device.mgt.core.application.mgt.common.dto; import com.google.gson.Gson; import io.entgra.device.mgt.core.application.mgt.common.ExecutionStatus; -import io.entgra.device.mgt.core.application.mgt.common.SubscriptionType; import io.entgra.device.mgt.core.application.mgt.common.SubAction; +import io.entgra.device.mgt.core.application.mgt.common.SubscriptionType; import io.entgra.device.mgt.core.application.mgt.common.response.ApplicationRelease; import java.util.List; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/ApplicationManager.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/ApplicationManager.java index 1eb7d00395..1b7b1db255 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/ApplicationManager.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/ApplicationManager.java @@ -16,7 +16,9 @@ */ package io.entgra.device.mgt.core.application.mgt.common.services; -import io.entgra.device.mgt.core.application.mgt.common.ApplicationType; +import io.entgra.device.mgt.core.application.mgt.common.*; +import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; +import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO; import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; import io.entgra.device.mgt.core.application.mgt.common.exception.RequestValidatingException; import io.entgra.device.mgt.core.application.mgt.common.exception.ResourceManagementException; @@ -24,20 +26,10 @@ import io.entgra.device.mgt.core.application.mgt.common.response.Application; import io.entgra.device.mgt.core.application.mgt.common.response.ApplicationRelease; import io.entgra.device.mgt.core.application.mgt.common.response.Category; import io.entgra.device.mgt.core.application.mgt.common.response.Tag; +import io.entgra.device.mgt.core.application.mgt.common.wrapper.*; import io.entgra.device.mgt.core.device.mgt.common.Base64File; -import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; import org.apache.cxf.jaxrs.ext.multipart.Attachment; -import io.entgra.device.mgt.core.application.mgt.common.ApplicationArtifact; -import io.entgra.device.mgt.core.application.mgt.common.LifecycleChanger; -import io.entgra.device.mgt.core.application.mgt.common.ApplicationList; -import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO; -import io.entgra.device.mgt.core.application.mgt.common.Filter; -import io.entgra.device.mgt.core.application.mgt.common.LifecycleState; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.CustomAppReleaseWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.EntAppReleaseWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.ApplicationUpdateWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.PublicAppReleaseWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.WebAppReleaseWrapper; + import java.util.List; /** diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/ReviewManager.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/ReviewManager.java index 2a2f6d29db..6e355a3940 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/ReviewManager.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/ReviewManager.java @@ -16,12 +16,12 @@ */ package io.entgra.device.mgt.core.application.mgt.common.services; -import io.entgra.device.mgt.core.application.mgt.common.Rating; -import io.entgra.device.mgt.core.application.mgt.common.response.Review; import io.entgra.device.mgt.core.application.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.application.mgt.common.PaginationResult; +import io.entgra.device.mgt.core.application.mgt.common.Rating; import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; import io.entgra.device.mgt.core.application.mgt.common.exception.ReviewManagementException; +import io.entgra.device.mgt.core.application.mgt.common.response.Review; import io.entgra.device.mgt.core.application.mgt.common.wrapper.ReviewWrapper; /** diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/SubscriptionManager.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/SubscriptionManager.java index 078d18350e..7f9eb91049 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/SubscriptionManager.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/src/main/java/io/entgra/device/mgt/core/application/mgt/common/services/SubscriptionManager.java @@ -18,10 +18,10 @@ package io.entgra.device.mgt.core.application.mgt.common.services; import io.entgra.device.mgt.core.application.mgt.common.ApplicationInstallResponse; import io.entgra.device.mgt.core.application.mgt.common.ExecutionStatus; +import io.entgra.device.mgt.core.application.mgt.common.SubscriptionType; import io.entgra.device.mgt.core.application.mgt.common.dto.ScheduledSubscriptionDTO; import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; import io.entgra.device.mgt.core.application.mgt.common.exception.SubscriptionManagementException; -import io.entgra.device.mgt.core.application.mgt.common.SubscriptionType; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/pom.xml b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/pom.xml index d7283553df..6fa6d33f45 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/pom.xml +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/pom.xml @@ -35,8 +35,12 @@ - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -50,40 +54,91 @@ Application Management Core Bundle io.entgra.device.mgt.core.application.mgt.core.internal + com.dd.plist;version="[1.21,2)", + com.google.gson;version="[2.9,3)", + com.google.gson.reflect;version="[2.9,3)", + io.entgra.device.mgt.core.apimgt.application.extension;version="[5.0,6)", + io.entgra.device.mgt.core.apimgt.application.extension.dto;version="[5.0,6)", + io.entgra.device.mgt.core.apimgt.application.extension.exception;version="[5.0,6)", + io.entgra.device.mgt.core.application.mgt.common;version="[5.0,6)", + io.entgra.device.mgt.core.application.mgt.common.config;version="[5.0,6)", + io.entgra.device.mgt.core.application.mgt.common.dto;version="[5.0,6)", + io.entgra.device.mgt.core.application.mgt.common.exception;version="[5.0,6)", + io.entgra.device.mgt.core.application.mgt.common.response;version="[5.0,6)", + io.entgra.device.mgt.core.application.mgt.common.services;version="[5.0,6)", + io.entgra.device.mgt.core.application.mgt.common.wrapper;version="[5.0,6)", + io.entgra.device.mgt.core.application.mgt.core.config, + io.entgra.device.mgt.core.application.mgt.core.dao, + io.entgra.device.mgt.core.application.mgt.core.dao.common, + io.entgra.device.mgt.core.application.mgt.core.dao.impl, + io.entgra.device.mgt.core.application.mgt.core.dao.impl.application, + io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.release, + io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication, + io.entgra.device.mgt.core.application.mgt.core.dao.impl.lifecyclestate, + io.entgra.device.mgt.core.application.mgt.core.dao.impl.review, + io.entgra.device.mgt.core.application.mgt.core.dao.impl.subscription, + io.entgra.device.mgt.core.application.mgt.core.dao.impl.visibility, + io.entgra.device.mgt.core.application.mgt.core.exception, + io.entgra.device.mgt.core.application.mgt.core.serviceprovider, + io.entgra.device.mgt.core.device.mgt.common;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.app.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.app.mgt.android;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.exceptions;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.group.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.operation.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.permission.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.common.exception;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.common.util;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.dto;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.operation.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.permission.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.service;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.task.impl;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.util;version="[5.0,6)", + io.entgra.device.mgt.core.identity.jwt.client.extension;version="[5.0,6)", + io.entgra.device.mgt.core.identity.jwt.client.extension.dto;version="[5.0,6)", + io.entgra.device.mgt.core.identity.jwt.client.extension.exception;version="[5.0,6)", + io.entgra.device.mgt.core.identity.jwt.client.extension.service;version="[5.0,6)", + javax.annotation;version="[1.0,2)", + javax.naming, + javax.sql, + + javax.xml.bind;version="[0.0,1)", + javax.xml.bind.annotation;version="[0.0,1)", + javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}", + org.apache.commons.codec.digest;version="[1.4,2)", + org.apache.commons.httpclient;version="[3.1,4)", + org.apache.commons.httpclient.methods;version="[3.1,4)", + org.apache.commons.io;version="[2.4,3)", + org.apache.commons.lang;version="[2.6,3)", + org.apache.commons.lang3;version="[3.12,4)", + org.apache.commons.logging;version="[1.2,2)", + org.apache.commons.validator.routines;version="[1.7,2)", + + org.apache.http;version="[4.4,5)", + org.apache.http.client;version="[4.3,5)", + org.apache.http.client.methods;version="[4.3,5)", + org.apache.http.impl.client;version="[4.3,5)", + org.bouncycastle.cert, + org.bouncycastle.cert.jcajce, + org.bouncycastle.cms, + org.bouncycastle.jce.provider;version="[1.70,2)", + org.bouncycastle.util;version="[1.70,2)", + org.json;version="[3.0,4)", org.osgi.framework.*;version="${imp.package.version.osgi.framework}", org.osgi.service.*;version="${imp.package.version.osgi.service}", - org.apache.commons.logging, - javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional, - org.wso2.carbon.context.*, - org.wso2.carbon.utils.*, - org.w3c.dom, - org.json, - javax.sql, - com.google.gson.*, - javax.naming, - javax.xml.bind.annotation; version="${javax.xml.bind.imp.pkg.version}", - javax.xml.bind; version="${javax.xml.bind.imp.pkg.version}", - io.entgra.device.mgt.core.application.mgt.common.*, - io.entgra.device.mgt.core.device.mgt.core.*, - io.entgra.device.mgt.core.device.mgt.common.*, - org.wso2.carbon.user.core.*, - org.wso2.carbon.user.api.*, - org.wso2.carbon.ntask.*, - org.quartz.*, - org.wso2.carbon.ndatasource.core, - org.wso2.carbon, + org.quartz;version="[2.1,3)", + org.wso2.carbon.context;version="[4.8,5)", + org.wso2.carbon.ndatasource.core;version="[4.8,5)", + org.wso2.carbon.ntask.common;version="[4.9,5)", + org.wso2.carbon.ntask.core;version="[4.9,5)", + org.wso2.carbon.ntask.core.service;version="[4.9,5)", + org.wso2.carbon.user.api;version="[1.0,2)", + org.wso2.carbon.user.core.service;version="[4.8,5)", + org.wso2.carbon.utils;version="[4.8,5)", + org.wso2.carbon.utils.dbcreator;version="[4.8,5)", org.xml.sax, - org.xml.sax.helpers, - org.apache.commons.io, - org.apache.commons.codec.binary;version="${commons-codec.wso2.osgi.version.range}", - org.apache.commons.codec.digest;version="${commons-codec.wso2.osgi.version.range}", - org.wso2.carbon.base, - com.dd.*, - io.entgra.device.mgt.core.identity.jwt.client.extension.*, - io.entgra.device.mgt.core.apimgt.application.extension.*, - org.apache.commons.httpclient, - org.apache.commons.httpclient.methods, - org.apache.commons.validator.routines + org.xml.sax.helpers apk-parser;scope=compile|runtime;inline=false @@ -112,16 +167,9 @@ - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.osgi - org.eclipse.osgi.services - - - org.eclipse.equinox - org.eclipse.equinox.common + org.apache.felix + org.apache.felix.scr.ds-annotations + provided org.testng @@ -136,7 +184,6 @@ org.ops4j.pax.logging pax-logging-api provided - org.wso2.carbon diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/config/Configuration.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/config/Configuration.java index c5d2c871dd..cb60147180 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/config/Configuration.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/config/Configuration.java @@ -17,14 +17,14 @@ */ package io.entgra.device.mgt.core.application.mgt.core.config; +import io.entgra.device.mgt.core.application.mgt.common.config.LifecycleState; import io.entgra.device.mgt.core.application.mgt.common.config.MDMConfig; import io.entgra.device.mgt.core.application.mgt.common.config.RatingConfiguration; -import io.entgra.device.mgt.core.application.mgt.common.config.LifecycleState; -import java.util.List; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; +import java.util.List; /** * Represents the Application Management Configuration. diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/config/ConfigurationManager.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/config/ConfigurationManager.java index de441ec9e8..3926ce2590 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/config/ConfigurationManager.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/config/ConfigurationManager.java @@ -17,15 +17,15 @@ */ package io.entgra.device.mgt.core.application.mgt.core.config; +import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.device.mgt.core.application.mgt.common.exception.InvalidConfigurationException; import io.entgra.device.mgt.core.application.mgt.core.util.Constants; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; -import io.entgra.device.mgt.core.application.mgt.common.exception.InvalidConfigurationException; -import java.io.File; import javax.xml.bind.JAXBContext; import javax.xml.bind.Unmarshaller; +import java.io.File; /** * ConfigurationManager is responsible for the managing Application Management related configurations. diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/config/Extension.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/config/Extension.java index 36ba438863..1d4afc4895 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/config/Extension.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/config/Extension.java @@ -17,11 +17,11 @@ */ package io.entgra.device.mgt.core.application.mgt.core.config; -import java.util.List; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; +import java.util.List; /** * Represents a extension in the application management configuration. diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/ApplicationDAO.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/ApplicationDAO.java index 6378fe0546..497b163394 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/ApplicationDAO.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/ApplicationDAO.java @@ -17,7 +17,7 @@ */ package io.entgra.device.mgt.core.application.mgt.core.dao; -import io.entgra.device.mgt.core.application.mgt.common.*; +import io.entgra.device.mgt.core.application.mgt.common.Filter; import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; import io.entgra.device.mgt.core.application.mgt.common.dto.CategoryDTO; import io.entgra.device.mgt.core.application.mgt.common.dto.TagDTO; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/ApplicationReleaseDAO.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/ApplicationReleaseDAO.java index 19054f0ae4..6929cf074a 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/ApplicationReleaseDAO.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/ApplicationReleaseDAO.java @@ -17,8 +17,8 @@ */ package io.entgra.device.mgt.core.application.mgt.core.dao; -import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO; import io.entgra.device.mgt.core.application.mgt.common.Rating; +import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO; import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException; import java.util.List; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/ReviewDAO.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/ReviewDAO.java index 6d010a0dd7..48aab75a59 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/ReviewDAO.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/ReviewDAO.java @@ -17,9 +17,9 @@ */ package io.entgra.device.mgt.core.application.mgt.core.dao; -import io.entgra.device.mgt.core.application.mgt.common.response.Review; import io.entgra.device.mgt.core.application.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.application.mgt.common.dto.ReviewDTO; +import io.entgra.device.mgt.core.application.mgt.common.response.Review; import io.entgra.device.mgt.core.application.mgt.core.exception.ReviewManagementDAOException; import java.util.List; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/SPApplicationDAO.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/SPApplicationDAO.java index 65dc94d98f..3586ceced8 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/SPApplicationDAO.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/SPApplicationDAO.java @@ -17,8 +17,8 @@ package io.entgra.device.mgt.core.application.mgt.core.dao; -import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO; import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; +import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO; import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException; import java.util.List; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/common/ApplicationManagementDAOFactory.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/common/ApplicationManagementDAOFactory.java index babf2bd07c..5754d66950 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/common/ApplicationManagementDAOFactory.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/common/ApplicationManagementDAOFactory.java @@ -17,38 +17,25 @@ */ package io.entgra.device.mgt.core.application.mgt.core.dao.common; -import io.entgra.device.mgt.core.application.mgt.core.dao.SPApplicationDAO; -import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication.GenericSPApplicationDAOImpl; -import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication.OracleSPApplicationDAOImpl; -import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication.PostgreSQLSPApplicationDAOImpl; -import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication.SQLServerSPApplicationDAOImpl; -import io.entgra.device.mgt.core.application.mgt.core.dao.impl.visibility.GenericVisibilityDAOImpl; -import io.entgra.device.mgt.core.application.mgt.core.dao.impl.visibility.OracleVisibilityDAOImpl; -import io.entgra.device.mgt.core.application.mgt.core.dao.impl.visibility.PostgreSQLVisibilityDAOImpl; -import io.entgra.device.mgt.core.application.mgt.core.dao.impl.visibility.SQLServerVisibilityDAOImpl; -import io.entgra.device.mgt.core.application.mgt.core.util.Constants; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.application.mgt.common.exception.UnsupportedDatabaseEngineException; -import io.entgra.device.mgt.core.application.mgt.core.dao.ApplicationDAO; -import io.entgra.device.mgt.core.application.mgt.core.dao.ApplicationReleaseDAO; -import io.entgra.device.mgt.core.application.mgt.core.dao.LifecycleStateDAO; -import io.entgra.device.mgt.core.application.mgt.core.dao.ReviewDAO; -import io.entgra.device.mgt.core.application.mgt.core.dao.SubscriptionDAO; -import io.entgra.device.mgt.core.application.mgt.core.dao.VisibilityDAO; +import io.entgra.device.mgt.core.application.mgt.core.dao.*; +import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.GenericApplicationDAOImpl; +import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.OracleApplicationDAOImpl; import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.PostgreSQLApplicationDAOImpl; import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.SQLServerApplicationDAOImpl; +import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.release.GenericApplicationReleaseDAOImpl; import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.release.OracleApplicationReleaseDAOImpl; import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.release.PostgreSQLApplicationReleaseDAOImpl; import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.release.SQLServerApplicationReleaseDAOImpl; +import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication.GenericSPApplicationDAOImpl; +import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication.OracleSPApplicationDAOImpl; +import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication.PostgreSQLSPApplicationDAOImpl; +import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication.SQLServerSPApplicationDAOImpl; +import io.entgra.device.mgt.core.application.mgt.core.dao.impl.lifecyclestate.GenericLifecycleStateDAOImpl; import io.entgra.device.mgt.core.application.mgt.core.dao.impl.lifecyclestate.OracleLifecycleStateDAOImpl; import io.entgra.device.mgt.core.application.mgt.core.dao.impl.lifecyclestate.PostgreSQLLifecycleStateDAOImpl; import io.entgra.device.mgt.core.application.mgt.core.dao.impl.lifecyclestate.SQLServerLifecycleStateDAOImpl; import io.entgra.device.mgt.core.application.mgt.core.dao.impl.review.GenericReviewDAOImpl; -import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.GenericApplicationDAOImpl; -import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.release.GenericApplicationReleaseDAOImpl; -import io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.OracleApplicationDAOImpl; -import io.entgra.device.mgt.core.application.mgt.core.dao.impl.lifecyclestate.GenericLifecycleStateDAOImpl; import io.entgra.device.mgt.core.application.mgt.core.dao.impl.review.OracleReviewDAOImpl; import io.entgra.device.mgt.core.application.mgt.core.dao.impl.review.PostgreSQLReviewDAOImpl; import io.entgra.device.mgt.core.application.mgt.core.dao.impl.review.SQLServerReviewDAOImpl; @@ -56,7 +43,14 @@ import io.entgra.device.mgt.core.application.mgt.core.dao.impl.subscription.Gene import io.entgra.device.mgt.core.application.mgt.core.dao.impl.subscription.OracleSubscriptionDAOImpl; import io.entgra.device.mgt.core.application.mgt.core.dao.impl.subscription.PostgreSQLSubscriptionDAOImpl; import io.entgra.device.mgt.core.application.mgt.core.dao.impl.subscription.SQLServerSubscriptionDAOImpl; +import io.entgra.device.mgt.core.application.mgt.core.dao.impl.visibility.GenericVisibilityDAOImpl; +import io.entgra.device.mgt.core.application.mgt.core.dao.impl.visibility.OracleVisibilityDAOImpl; +import io.entgra.device.mgt.core.application.mgt.core.dao.impl.visibility.PostgreSQLVisibilityDAOImpl; +import io.entgra.device.mgt.core.application.mgt.core.dao.impl.visibility.SQLServerVisibilityDAOImpl; import io.entgra.device.mgt.core.application.mgt.core.util.ConnectionManagerUtil; +import io.entgra.device.mgt.core.application.mgt.core.util.Constants; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.sql.DataSource; import java.sql.SQLException; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java index 5480401643..b5f6001118 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java @@ -17,27 +17,23 @@ */ package io.entgra.device.mgt.core.application.mgt.core.dao.impl.application; +import io.entgra.device.mgt.core.application.mgt.common.AppLifecycleState; +import io.entgra.device.mgt.core.application.mgt.common.Filter; +import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; +import io.entgra.device.mgt.core.application.mgt.common.dto.CategoryDTO; +import io.entgra.device.mgt.core.application.mgt.common.dto.TagDTO; +import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; import io.entgra.device.mgt.core.application.mgt.core.dao.ApplicationDAO; import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl; +import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException; import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServerErrorException; import io.entgra.device.mgt.core.application.mgt.core.util.Constants; import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.application.mgt.common.AppLifecycleState; -import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; -import io.entgra.device.mgt.core.application.mgt.common.dto.CategoryDTO; -import io.entgra.device.mgt.core.application.mgt.common.Filter; -import io.entgra.device.mgt.core.application.mgt.common.dto.TagDTO; -import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; -import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; +import java.sql.*; import java.util.ArrayList; import java.util.List; import java.util.StringJoiner; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/OracleApplicationDAOImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/OracleApplicationDAOImpl.java index f342dd1c4a..19842cfbed 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/OracleApplicationDAOImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/OracleApplicationDAOImpl.java @@ -18,15 +18,15 @@ package io.entgra.device.mgt.core.application.mgt.core.dao.impl.application; +import io.entgra.device.mgt.core.application.mgt.common.Filter; +import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; +import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; +import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException; import io.entgra.device.mgt.core.application.mgt.core.util.Constants; import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.application.mgt.common.Filter; -import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; -import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; -import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/SQLServerApplicationDAOImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/SQLServerApplicationDAOImpl.java index f347080d80..4b934788ee 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/SQLServerApplicationDAOImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/SQLServerApplicationDAOImpl.java @@ -17,15 +17,15 @@ package io.entgra.device.mgt.core.application.mgt.core.dao.impl.application; +import io.entgra.device.mgt.core.application.mgt.common.Filter; +import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; +import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; +import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException; import io.entgra.device.mgt.core.application.mgt.core.util.Constants; import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.application.mgt.common.Filter; -import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; -import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; -import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/release/GenericApplicationReleaseDAOImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/release/GenericApplicationReleaseDAOImpl.java index 0506c1d396..7a99cb2c7d 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/release/GenericApplicationReleaseDAOImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/release/GenericApplicationReleaseDAOImpl.java @@ -18,21 +18,17 @@ package io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.release; -import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO; import io.entgra.device.mgt.core.application.mgt.common.Rating; +import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO; import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; import io.entgra.device.mgt.core.application.mgt.core.dao.ApplicationReleaseDAO; import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl; import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException; +import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; +import java.sql.*; import java.util.ArrayList; import java.util.List; import java.util.StringJoiner; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/release/OracleApplicationReleaseDAOImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/release/OracleApplicationReleaseDAOImpl.java index f3a525b3b3..fdd04cced4 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/release/OracleApplicationReleaseDAOImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/release/OracleApplicationReleaseDAOImpl.java @@ -17,10 +17,10 @@ package io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.release; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/release/SQLServerApplicationReleaseDAOImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/release/SQLServerApplicationReleaseDAOImpl.java index 905b193bf1..9d99d046a5 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/release/SQLServerApplicationReleaseDAOImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/release/SQLServerApplicationReleaseDAOImpl.java @@ -17,10 +17,10 @@ package io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.release; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/spapplication/GenericSPApplicationDAOImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/spapplication/GenericSPApplicationDAOImpl.java index df88bc4619..742d15deeb 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/spapplication/GenericSPApplicationDAOImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/spapplication/GenericSPApplicationDAOImpl.java @@ -17,8 +17,8 @@ package io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication; -import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO; import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; +import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO; import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; import io.entgra.device.mgt.core.application.mgt.core.dao.SPApplicationDAO; import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl; @@ -29,11 +29,7 @@ import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; +import java.sql.*; import java.util.List; public class GenericSPApplicationDAOImpl extends AbstractDAOImpl implements SPApplicationDAO { diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/spapplication/OracleSPApplicationDAOImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/spapplication/OracleSPApplicationDAOImpl.java index f68a68c790..306afff8e3 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/spapplication/OracleSPApplicationDAOImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/spapplication/OracleSPApplicationDAOImpl.java @@ -17,8 +17,8 @@ package io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication; -import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO; import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; +import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO; import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; import io.entgra.device.mgt.core.application.mgt.core.dao.SPApplicationDAO; import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl; @@ -27,11 +27,8 @@ import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServer import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; + +import java.sql.*; import java.util.List; public class OracleSPApplicationDAOImpl extends AbstractDAOImpl implements SPApplicationDAO { diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/spapplication/PostgreSQLSPApplicationDAOImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/spapplication/PostgreSQLSPApplicationDAOImpl.java index 4aeedb4f3e..3794147969 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/spapplication/PostgreSQLSPApplicationDAOImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/spapplication/PostgreSQLSPApplicationDAOImpl.java @@ -17,8 +17,8 @@ package io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication; -import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO; import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; +import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO; import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; import io.entgra.device.mgt.core.application.mgt.core.dao.SPApplicationDAO; import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl; @@ -27,11 +27,8 @@ import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServer import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; + +import java.sql.*; import java.util.List; public class PostgreSQLSPApplicationDAOImpl extends AbstractDAOImpl implements SPApplicationDAO { diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/spapplication/SQLServerSPApplicationDAOImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/spapplication/SQLServerSPApplicationDAOImpl.java index 33cfa97e0a..8d7cb35f4c 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/spapplication/SQLServerSPApplicationDAOImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/application/spapplication/SQLServerSPApplicationDAOImpl.java @@ -17,8 +17,8 @@ package io.entgra.device.mgt.core.application.mgt.core.dao.impl.application.spapplication; -import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO; import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; +import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO; import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; import io.entgra.device.mgt.core.application.mgt.core.dao.SPApplicationDAO; import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl; @@ -27,11 +27,8 @@ import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServer import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; + +import java.sql.*; import java.util.List; public class SQLServerSPApplicationDAOImpl extends AbstractDAOImpl implements SPApplicationDAO { diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/lifecyclestate/GenericLifecycleStateDAOImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/lifecyclestate/GenericLifecycleStateDAOImpl.java index 699f23cf58..4bb8967390 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/lifecyclestate/GenericLifecycleStateDAOImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/lifecyclestate/GenericLifecycleStateDAOImpl.java @@ -17,21 +17,17 @@ */ package io.entgra.device.mgt.core.application.mgt.core.dao.impl.lifecyclestate; -import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl; -import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.application.mgt.common.AppLifecycleState; import io.entgra.device.mgt.core.application.mgt.common.LifecycleState; import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; import io.entgra.device.mgt.core.application.mgt.core.dao.LifecycleStateDAO; +import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl; import io.entgra.device.mgt.core.application.mgt.core.exception.LifeCycleManagementDAOException; +import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; +import java.sql.*; import java.util.ArrayList; import java.util.List; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/review/GenericReviewDAOImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/review/GenericReviewDAOImpl.java index 22bc5a62d2..ffbc654c8b 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/review/GenericReviewDAOImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/review/GenericReviewDAOImpl.java @@ -17,24 +17,19 @@ */ package io.entgra.device.mgt.core.application.mgt.core.dao.impl.review; -import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServerErrorException; -import io.entgra.device.mgt.core.application.mgt.core.util.Constants; -import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - import io.entgra.device.mgt.core.application.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.application.mgt.common.dto.ReviewDTO; import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; import io.entgra.device.mgt.core.application.mgt.core.dao.ReviewDAO; import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl; import io.entgra.device.mgt.core.application.mgt.core.exception.ReviewManagementDAOException; +import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServerErrorException; +import io.entgra.device.mgt.core.application.mgt.core.util.Constants; +import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import java.sql.SQLException; -import java.sql.ResultSet; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.Timestamp; +import java.sql.*; import java.util.ArrayList; import java.util.List; import java.util.StringJoiner; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/review/OracleReviewDAOImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/review/OracleReviewDAOImpl.java index ad4da703fc..f8620a2562 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/review/OracleReviewDAOImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/review/OracleReviewDAOImpl.java @@ -17,14 +17,14 @@ package io.entgra.device.mgt.core.application.mgt.core.dao.impl.review; -import io.entgra.device.mgt.core.application.mgt.core.util.Constants; -import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.application.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.application.mgt.common.dto.ReviewDTO; import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; import io.entgra.device.mgt.core.application.mgt.core.exception.ReviewManagementDAOException; +import io.entgra.device.mgt.core.application.mgt.core.util.Constants; +import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/review/SQLServerReviewDAOImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/review/SQLServerReviewDAOImpl.java index eac947383f..735977063d 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/review/SQLServerReviewDAOImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/review/SQLServerReviewDAOImpl.java @@ -17,14 +17,14 @@ package io.entgra.device.mgt.core.application.mgt.core.dao.impl.review; -import io.entgra.device.mgt.core.application.mgt.core.util.Constants; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.application.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.application.mgt.common.dto.ReviewDTO; import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; import io.entgra.device.mgt.core.application.mgt.core.exception.ReviewManagementDAOException; +import io.entgra.device.mgt.core.application.mgt.core.util.Constants; import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java index a712b397a5..f6573db44f 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java @@ -17,32 +17,22 @@ */ package io.entgra.device.mgt.core.application.mgt.core.dao.impl.subscription; -import io.entgra.device.mgt.core.application.mgt.core.dao.SubscriptionDAO; -import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl; -import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServerErrorException; -import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.application.mgt.common.ExecutionStatus; import io.entgra.device.mgt.core.application.mgt.common.SubAction; import io.entgra.device.mgt.core.application.mgt.common.SubscriptionType; import io.entgra.device.mgt.core.application.mgt.common.dto.DeviceSubscriptionDTO; import io.entgra.device.mgt.core.application.mgt.common.dto.ScheduledSubscriptionDTO; import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; +import io.entgra.device.mgt.core.application.mgt.core.dao.SubscriptionDAO; +import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl; import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException; +import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServerErrorException; +import io.entgra.device.mgt.core.application.mgt.core.util.DAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Calendar; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.StringJoiner; +import java.sql.*; +import java.util.*; public class GenericSubscriptionDAOImpl extends AbstractDAOImpl implements SubscriptionDAO { private static final Log log = LogFactory.getLog(GenericSubscriptionDAOImpl.class); diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/OracleSubscriptionDAOImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/OracleSubscriptionDAOImpl.java index 9f304f9af4..7ebeeecfe6 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/OracleSubscriptionDAOImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/OracleSubscriptionDAOImpl.java @@ -17,10 +17,10 @@ package io.entgra.device.mgt.core.application.mgt.core.dao.impl.subscription; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/SQLServerSubscriptionDAOImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/SQLServerSubscriptionDAOImpl.java index e92b2c8cb4..f433802981 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/SQLServerSubscriptionDAOImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/subscription/SQLServerSubscriptionDAOImpl.java @@ -17,10 +17,10 @@ package io.entgra.device.mgt.core.application.mgt.core.dao.impl.subscription; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/visibility/GenericVisibilityDAOImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/visibility/GenericVisibilityDAOImpl.java index 582b76f4a3..e655d65459 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/visibility/GenericVisibilityDAOImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/dao/impl/visibility/GenericVisibilityDAOImpl.java @@ -17,12 +17,12 @@ */ package io.entgra.device.mgt.core.application.mgt.core.dao.impl.visibility; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; import io.entgra.device.mgt.core.application.mgt.core.dao.VisibilityDAO; import io.entgra.device.mgt.core.application.mgt.core.dao.impl.AbstractDAOImpl; import io.entgra.device.mgt.core.application.mgt.core.exception.VisibilityManagementDAOException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ApplicationManagerImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ApplicationManagerImpl.java index 81537a3ef1..9d470fb652 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ApplicationManagerImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ApplicationManagerImpl.java @@ -17,93 +17,49 @@ package io.entgra.device.mgt.core.application.mgt.core.impl; -import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException; -import io.entgra.device.mgt.core.device.mgt.common.Base64File; -import io.entgra.device.mgt.core.application.mgt.core.dao.SPApplicationDAO; -import io.entgra.device.mgt.core.application.mgt.core.util.ApplicationManagementUtil; -import org.apache.commons.codec.digest.DigestUtils; -import org.apache.commons.io.IOUtils; -import org.apache.commons.lang.StringEscapeUtils; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.validator.routines.UrlValidator; -import org.apache.cxf.jaxrs.ext.multipart.Attachment; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.CarbonContext; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.application.mgt.common.ApplicationArtifact; -import io.entgra.device.mgt.core.application.mgt.common.ApplicationInstaller; -import io.entgra.device.mgt.core.application.mgt.common.DeviceTypes; -import io.entgra.device.mgt.core.application.mgt.common.LifecycleChanger; -import io.entgra.device.mgt.core.application.mgt.common.Pagination; +import io.entgra.device.mgt.core.application.mgt.common.*; import io.entgra.device.mgt.core.application.mgt.common.config.RatingConfiguration; -import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; -import io.entgra.device.mgt.core.application.mgt.common.ApplicationList; -import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO; -import io.entgra.device.mgt.core.application.mgt.common.ApplicationSubscriptionType; -import io.entgra.device.mgt.core.application.mgt.common.ApplicationType; -import io.entgra.device.mgt.core.application.mgt.common.dto.CategoryDTO; -import io.entgra.device.mgt.core.application.mgt.common.Filter; -import io.entgra.device.mgt.core.application.mgt.common.dto.DeviceSubscriptionDTO; -import io.entgra.device.mgt.core.application.mgt.common.LifecycleState; -import io.entgra.device.mgt.core.application.mgt.common.dto.TagDTO; -import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; -import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationStorageManagementException; -import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; -import io.entgra.device.mgt.core.application.mgt.common.exception.LifecycleManagementException; -import io.entgra.device.mgt.core.application.mgt.common.exception.RequestValidatingException; -import io.entgra.device.mgt.core.application.mgt.common.exception.ResourceManagementException; -import io.entgra.device.mgt.core.application.mgt.common.exception.TransactionManagementException; +import io.entgra.device.mgt.core.application.mgt.common.dto.*; +import io.entgra.device.mgt.core.application.mgt.common.exception.*; import io.entgra.device.mgt.core.application.mgt.common.response.Application; import io.entgra.device.mgt.core.application.mgt.common.response.ApplicationRelease; import io.entgra.device.mgt.core.application.mgt.common.response.Category; import io.entgra.device.mgt.core.application.mgt.common.response.Tag; import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationManager; import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationStorageManager; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.CustomAppReleaseWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.CustomAppWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.EntAppReleaseWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.ApplicationUpdateWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.ApplicationWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.PublicAppReleaseWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.PublicAppWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.WebAppReleaseWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.WebAppWrapper; +import io.entgra.device.mgt.core.application.mgt.common.wrapper.*; import io.entgra.device.mgt.core.application.mgt.core.config.ConfigurationManager; -import io.entgra.device.mgt.core.application.mgt.core.dao.ApplicationDAO; -import io.entgra.device.mgt.core.application.mgt.core.dao.ApplicationReleaseDAO; -import io.entgra.device.mgt.core.application.mgt.core.dao.LifecycleStateDAO; -import io.entgra.device.mgt.core.application.mgt.core.dao.SubscriptionDAO; -import io.entgra.device.mgt.core.application.mgt.core.dao.VisibilityDAO; +import io.entgra.device.mgt.core.application.mgt.core.dao.*; import io.entgra.device.mgt.core.application.mgt.core.dao.common.ApplicationManagementDAOFactory; -import io.entgra.device.mgt.core.application.mgt.core.util.APIUtil; -import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException; -import io.entgra.device.mgt.core.application.mgt.core.exception.ForbiddenException; -import io.entgra.device.mgt.core.application.mgt.core.exception.LifeCycleManagementDAOException; -import io.entgra.device.mgt.core.application.mgt.core.exception.NotFoundException; -import io.entgra.device.mgt.core.application.mgt.core.exception.VisibilityManagementDAOException; +import io.entgra.device.mgt.core.application.mgt.core.exception.*; import io.entgra.device.mgt.core.application.mgt.core.internal.DataHolder; import io.entgra.device.mgt.core.application.mgt.core.lifecycle.LifecycleStateManager; +import io.entgra.device.mgt.core.application.mgt.core.util.APIUtil; +import io.entgra.device.mgt.core.application.mgt.core.util.ApplicationManagementUtil; import io.entgra.device.mgt.core.application.mgt.core.util.ConnectionManagerUtil; import io.entgra.device.mgt.core.application.mgt.core.util.Constants; -import io.entgra.device.mgt.core.device.mgt.core.common.exception.StorageManagementException; +import io.entgra.device.mgt.core.device.mgt.common.Base64File; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; - +import io.entgra.device.mgt.core.device.mgt.core.common.exception.StorageManagementException; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import org.apache.commons.codec.digest.DigestUtils; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringEscapeUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.commons.validator.routines.UrlValidator; +import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.wso2.carbon.context.CarbonContext; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.user.api.UserRealm; import org.wso2.carbon.user.api.UserStoreException; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.UUID; +import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ApplicationStorageManagerImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ApplicationStorageManagerImpl.java index 8bd02e47c7..a64efee4db 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ApplicationStorageManagerImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ApplicationStorageManagerImpl.java @@ -18,24 +18,27 @@ package io.entgra.device.mgt.core.application.mgt.core.impl; import com.dd.plist.NSDictionary; +import io.entgra.device.mgt.core.application.mgt.common.ApplicationInstaller; +import io.entgra.device.mgt.core.application.mgt.common.DeviceTypes; +import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO; +import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationStorageManagementException; +import io.entgra.device.mgt.core.application.mgt.common.exception.ResourceManagementException; +import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationStorageManager; import io.entgra.device.mgt.core.application.mgt.core.exception.ParsingException; import io.entgra.device.mgt.core.application.mgt.core.util.ArtifactsParser; import io.entgra.device.mgt.core.application.mgt.core.util.Constants; +import io.entgra.device.mgt.core.device.mgt.core.common.exception.StorageManagementException; +import io.entgra.device.mgt.core.device.mgt.core.common.util.StorageManagementUtil; import net.dongliu.apk.parser.bean.ApkMeta; import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.application.mgt.common.ApplicationInstaller; -import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO; -import io.entgra.device.mgt.core.application.mgt.common.DeviceTypes; -import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationStorageManagementException; -import io.entgra.device.mgt.core.application.mgt.common.exception.ResourceManagementException; -import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationStorageManager; -import io.entgra.device.mgt.core.device.mgt.core.common.exception.StorageManagementException; -import io.entgra.device.mgt.core.device.mgt.core.common.util.StorageManagementUtil; -import java.io.*; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; import java.util.List; import static io.entgra.device.mgt.core.device.mgt.core.common.util.StorageManagementUtil.saveFile; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/AppmDataHandlerImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/AppmDataHandlerImpl.java index a9e40e9e00..b861e5d0a3 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/AppmDataHandlerImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/AppmDataHandlerImpl.java @@ -17,22 +17,22 @@ package io.entgra.device.mgt.core.application.mgt.core.impl; -import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.application.mgt.common.config.LifecycleState; import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationStorageManagementException; import io.entgra.device.mgt.core.application.mgt.common.exception.LifecycleManagementException; import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationStorageManager; import io.entgra.device.mgt.core.application.mgt.common.services.AppmDataHandler; -import io.entgra.device.mgt.core.application.mgt.core.util.APIUtil; +import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException; import io.entgra.device.mgt.core.application.mgt.core.exception.NotFoundException; import io.entgra.device.mgt.core.application.mgt.core.internal.DataHolder; import io.entgra.device.mgt.core.application.mgt.core.lifecycle.LifecycleStateManager; +import io.entgra.device.mgt.core.application.mgt.core.util.APIUtil; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.io.InputStream; import java.util.Map; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ReviewManagerImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ReviewManagerImpl.java index acd483fb6a..370186d647 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ReviewManagerImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/ReviewManagerImpl.java @@ -17,34 +17,30 @@ package io.entgra.device.mgt.core.application.mgt.core.impl; -import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.application.mgt.common.Rating; -import io.entgra.device.mgt.core.application.mgt.common.ReviewNode; import io.entgra.device.mgt.core.application.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.application.mgt.common.PaginationResult; +import io.entgra.device.mgt.core.application.mgt.common.Rating; +import io.entgra.device.mgt.core.application.mgt.common.ReviewNode; import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO; import io.entgra.device.mgt.core.application.mgt.common.dto.ReviewDTO; import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; -import io.entgra.device.mgt.core.application.mgt.common.exception.ReviewManagementException; import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; +import io.entgra.device.mgt.core.application.mgt.common.exception.ReviewManagementException; import io.entgra.device.mgt.core.application.mgt.common.exception.TransactionManagementException; import io.entgra.device.mgt.core.application.mgt.common.response.Review; -import io.entgra.device.mgt.core.application.mgt.common.services.*; +import io.entgra.device.mgt.core.application.mgt.common.services.ReviewManager; import io.entgra.device.mgt.core.application.mgt.common.wrapper.ReviewWrapper; import io.entgra.device.mgt.core.application.mgt.core.dao.ApplicationDAO; import io.entgra.device.mgt.core.application.mgt.core.dao.ApplicationReleaseDAO; import io.entgra.device.mgt.core.application.mgt.core.dao.ReviewDAO; import io.entgra.device.mgt.core.application.mgt.core.dao.common.ApplicationManagementDAOFactory; -import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException; -import io.entgra.device.mgt.core.application.mgt.core.exception.ForbiddenException; -import io.entgra.device.mgt.core.application.mgt.core.exception.NotFoundException; -import io.entgra.device.mgt.core.application.mgt.core.exception.ReviewManagementDAOException; +import io.entgra.device.mgt.core.application.mgt.core.exception.*; import io.entgra.device.mgt.core.application.mgt.core.util.ConnectionManagerUtil; import io.entgra.device.mgt.core.application.mgt.core.util.Constants; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.util.ArrayList; import java.util.Comparator; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/SPApplicationManagerImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/SPApplicationManagerImpl.java index f28b46daca..9799c0a6ba 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/SPApplicationManagerImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/SPApplicationManagerImpl.java @@ -18,10 +18,10 @@ package io.entgra.device.mgt.core.application.mgt.core.impl; import io.entgra.device.mgt.core.application.mgt.common.IdentityServerResponse; -import io.entgra.device.mgt.core.application.mgt.common.SPApplicationListResponse; -import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO; import io.entgra.device.mgt.core.application.mgt.common.SPApplication; +import io.entgra.device.mgt.core.application.mgt.common.SPApplicationListResponse; import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; +import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO; import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServiceProviderDTO; import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; @@ -38,18 +38,17 @@ import io.entgra.device.mgt.core.application.mgt.core.dao.common.ApplicationMana import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException; import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException; import io.entgra.device.mgt.core.application.mgt.core.exception.NotFoundException; -import io.entgra.device.mgt.core.application.mgt.core.serviceprovider.ISServiceProviderApplicationService; import io.entgra.device.mgt.core.application.mgt.core.internal.DataHolder; import io.entgra.device.mgt.core.application.mgt.core.lifecycle.LifecycleStateManager; +import io.entgra.device.mgt.core.application.mgt.core.serviceprovider.ISServiceProviderApplicationService; import io.entgra.device.mgt.core.application.mgt.core.util.APIUtil; import io.entgra.device.mgt.core.application.mgt.core.util.ApplicationManagementUtil; import io.entgra.device.mgt.core.application.mgt.core.util.ConnectionManagerUtil; +import io.entgra.device.mgt.core.device.mgt.core.common.util.HttpUtil; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.commons.validator.routines.UrlValidator; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.core.common.util.HttpUtil; import java.util.ArrayList; import java.util.List; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/SubscriptionManagerImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/SubscriptionManagerImpl.java index c6b697fd45..55f0abc80c 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/SubscriptionManagerImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/impl/SubscriptionManagerImpl.java @@ -18,54 +18,26 @@ package io.entgra.device.mgt.core.application.mgt.core.impl; import com.google.gson.Gson; -import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException; -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.httpclient.HttpException; -import org.apache.commons.httpclient.HttpMethodBase; -import org.apache.commons.httpclient.methods.PostMethod; -import org.apache.commons.httpclient.methods.StringRequestEntity; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.json.JSONArray; -import org.json.JSONObject; import io.entgra.device.mgt.core.apimgt.application.extension.dto.ApiApplicationKey; import io.entgra.device.mgt.core.apimgt.application.extension.exception.APIManagerException; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.application.mgt.common.ApplicationInstallResponse; -import io.entgra.device.mgt.core.application.mgt.common.ApplicationSubscriptionInfo; -import io.entgra.device.mgt.core.application.mgt.common.ApplicationType; -import io.entgra.device.mgt.core.application.mgt.common.DeviceSubscriptionData; -import io.entgra.device.mgt.core.application.mgt.common.DeviceTypes; -import io.entgra.device.mgt.core.application.mgt.common.ExecutionStatus; -import io.entgra.device.mgt.core.application.mgt.common.SubAction; -import io.entgra.device.mgt.core.application.mgt.common.SubscriptionType; -import io.entgra.device.mgt.core.application.mgt.common.SubscribingDeviceIdHolder; -import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; -import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationPolicyDTO; -import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO; -import io.entgra.device.mgt.core.application.mgt.common.dto.DeviceSubscriptionDTO; -import io.entgra.device.mgt.core.application.mgt.common.dto.ScheduledSubscriptionDTO; -import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; -import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; -import io.entgra.device.mgt.core.application.mgt.common.exception.LifecycleManagementException; -import io.entgra.device.mgt.core.application.mgt.common.exception.SubscriptionManagementException; -import io.entgra.device.mgt.core.application.mgt.common.exception.TransactionManagementException; +import io.entgra.device.mgt.core.application.mgt.common.*; +import io.entgra.device.mgt.core.application.mgt.common.dto.*; +import io.entgra.device.mgt.core.application.mgt.common.exception.*; import io.entgra.device.mgt.core.application.mgt.common.response.Application; import io.entgra.device.mgt.core.application.mgt.common.services.SubscriptionManager; import io.entgra.device.mgt.core.application.mgt.core.dao.ApplicationDAO; import io.entgra.device.mgt.core.application.mgt.core.dao.SubscriptionDAO; import io.entgra.device.mgt.core.application.mgt.core.dao.common.ApplicationManagementDAOFactory; import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationManagementDAOException; +import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException; import io.entgra.device.mgt.core.application.mgt.core.exception.ForbiddenException; import io.entgra.device.mgt.core.application.mgt.core.exception.NotFoundException; import io.entgra.device.mgt.core.application.mgt.core.internal.DataHolder; import io.entgra.device.mgt.core.application.mgt.core.lifecycle.LifecycleStateManager; -import io.entgra.device.mgt.core.application.mgt.core.util.APIUtil; -import io.entgra.device.mgt.core.application.mgt.core.util.ConnectionManagerUtil; -import io.entgra.device.mgt.core.application.mgt.core.util.Constants; -import io.entgra.device.mgt.core.application.mgt.core.util.HelperUtil; -import io.entgra.device.mgt.core.application.mgt.core.util.OAuthUtils; +import io.entgra.device.mgt.core.application.mgt.core.util.*; +import io.entgra.device.mgt.core.device.mgt.common.MDMAppConstants; +import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; +import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; import io.entgra.device.mgt.core.device.mgt.common.*; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.App; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.MobileAppTypes; @@ -85,6 +57,17 @@ import io.entgra.device.mgt.core.device.mgt.core.util.MDMAndroidOperationUtil; import io.entgra.device.mgt.core.device.mgt.core.util.MDMIOSOperationUtil; import io.entgra.device.mgt.core.device.mgt.core.util.MDMWindowsOperationUtil; import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.AccessTokenInfo; +import org.apache.commons.httpclient.HttpClient; +import org.apache.commons.httpclient.HttpException; +import org.apache.commons.httpclient.HttpMethodBase; +import org.apache.commons.httpclient.methods.PostMethod; +import org.apache.commons.httpclient.methods.StringRequestEntity; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.json.JSONArray; +import org.json.JSONObject; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.user.api.UserStoreException; import javax.ws.rs.core.MediaType; @@ -95,14 +78,7 @@ import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URL; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; +import java.util.*; import java.util.concurrent.atomic.AtomicBoolean; import java.util.stream.Collectors; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/internal/ApplicationManagementServiceComponent.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/internal/ApplicationManagementServiceComponent.java index ad3c01865b..5f92fe48ac 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/internal/ApplicationManagementServiceComponent.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/internal/ApplicationManagementServiceComponent.java @@ -17,65 +17,38 @@ */ package io.entgra.device.mgt.core.application.mgt.core.internal; -import io.entgra.device.mgt.core.application.mgt.common.services.SPApplicationManager; -import io.entgra.device.mgt.core.application.mgt.core.impl.AppmDataHandlerImpl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.osgi.framework.BundleContext; -import org.osgi.service.component.ComponentContext; import io.entgra.device.mgt.core.application.mgt.common.config.LifecycleState; -import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationManager; -import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationStorageManager; -import io.entgra.device.mgt.core.application.mgt.common.services.AppmDataHandler; -import io.entgra.device.mgt.core.application.mgt.common.services.ReviewManager; -import io.entgra.device.mgt.core.application.mgt.common.services.SubscriptionManager; +import io.entgra.device.mgt.core.application.mgt.common.services.*; import io.entgra.device.mgt.core.application.mgt.core.config.ConfigurationManager; import io.entgra.device.mgt.core.application.mgt.core.dao.common.ApplicationManagementDAOFactory; +import io.entgra.device.mgt.core.application.mgt.core.impl.AppmDataHandlerImpl; import io.entgra.device.mgt.core.application.mgt.core.lifecycle.LifecycleStateManager; import io.entgra.device.mgt.core.application.mgt.core.task.ScheduledAppSubscriptionTaskManager; import io.entgra.device.mgt.core.application.mgt.core.util.ApplicationManagementUtil; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.osgi.framework.BundleContext; +import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.*; import org.wso2.carbon.ndatasource.core.DataSourceService; import org.wso2.carbon.ntask.core.service.TaskService; import org.wso2.carbon.user.core.service.RealmService; import java.util.List; -/** - * @scr.component name="org.wso2.carbon.application.mgt.service" immediate="true" - * @scr.reference name="org.wso2.carbon.device.manager" - * interface="io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService" - * cardinality="1..1" - * policy="dynamic" - * bind="setDeviceManagementService" - * unbind="unsetDeviceManagementService" - * @scr.reference name="realm.service" - * immediate="true" - * interface="org.wso2.carbon.user.core.service.RealmService" - * cardinality="1..1" - * policy="dynamic" - * bind="setRealmService" - * unbind="unsetRealmService" - * @scr.reference name="datasource.service" - * interface="org.wso2.carbon.ndatasource.core.DataSourceService" - * cardinality="1..1" - * policy="dynamic" - * bind="setDataSourceService" - * unbind="unsetDataSourceService" - * @scr.reference name="app.mgt.ntask.component" - * interface="org.wso2.carbon.ntask.core.service.TaskService" - * cardinality="1..1" - * policy="dynamic" - * bind="setTaskService" - * unbind="unsetTaskService" - */ + @SuppressWarnings("unused") +@Component( + name = "io.entgra.device.mgt.core.application.mgt.core.internal.ApplicationManagementServiceComponent", + immediate = true) public class ApplicationManagementServiceComponent { private static Log log = LogFactory.getLog(ApplicationManagementServiceComponent.class); @SuppressWarnings("unused") + @Activate protected void activate(ComponentContext componentContext) { BundleContext bundleContext = componentContext.getBundleContext(); try { @@ -117,7 +90,7 @@ public class ApplicationManagementServiceComponent { bundleContext.registerService(AppmDataHandler.class.getName(), configManager, null); ScheduledAppSubscriptionTaskManager taskManager = new ScheduledAppSubscriptionTaskManager(); - taskManager.scheduleCleanupTask(); + // todo: taskManager.scheduleCleanupTask(); log.info("ApplicationManagement core bundle has been successfully initialized"); } catch (Throwable e) { @@ -126,11 +99,18 @@ public class ApplicationManagementServiceComponent { } @SuppressWarnings("unused") + @Deactivate protected void deactivate(ComponentContext componentContext) { //do nothing } @SuppressWarnings("unused") + @Reference( + name = "device.mgt.provider.service", + service = io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetDeviceManagementService") protected void setDeviceManagementService(DeviceManagementProviderService deviceManagementProviderService) { if (log.isDebugEnabled()) { log.debug("Setting ApplicationDTO Management OSGI Manager"); @@ -147,6 +127,12 @@ public class ApplicationManagementServiceComponent { } @SuppressWarnings("unused") + @Reference( + name = "realm.service", + service = org.wso2.carbon.user.core.service.RealmService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetRealmService") protected void setRealmService(RealmService realmService) { DataHolder.getInstance().setRealmService(realmService); } @@ -157,6 +143,12 @@ public class ApplicationManagementServiceComponent { } @SuppressWarnings("unused") + @Reference( + name = "datasource.service", + service = org.wso2.carbon.ndatasource.core.DataSourceService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetDataSourceService") protected void setDataSourceService(DataSourceService dataSourceService) { /*Not implemented. Not needed but to make sure the datasource service are registered, as it is needed create databases. */ @@ -169,6 +161,12 @@ public class ApplicationManagementServiceComponent { } @SuppressWarnings("unused") + @Reference( + name = "task.service", + service = org.wso2.carbon.ntask.core.service.TaskService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetTaskService") public void setTaskService(TaskService taskService) { if (log.isDebugEnabled()) { log.debug("Setting the task service to Application Management SC."); diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/internal/DataHolder.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/internal/DataHolder.java index 262a73984b..7866f73939 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/internal/DataHolder.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/internal/DataHolder.java @@ -17,12 +17,7 @@ */ package io.entgra.device.mgt.core.application.mgt.core.internal; -import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationManager; -import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationStorageManager; -import io.entgra.device.mgt.core.application.mgt.common.services.AppmDataHandler; -import io.entgra.device.mgt.core.application.mgt.common.services.SPApplicationManager; -import io.entgra.device.mgt.core.application.mgt.common.services.ReviewManager; -import io.entgra.device.mgt.core.application.mgt.common.services.SubscriptionManager; +import io.entgra.device.mgt.core.application.mgt.common.services.*; import io.entgra.device.mgt.core.application.mgt.core.lifecycle.LifecycleStateManager; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import org.wso2.carbon.ntask.core.service.TaskService; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/lifecycle/LifecycleStateManager.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/lifecycle/LifecycleStateManager.java index 58d11fd24c..e7a399144c 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/lifecycle/LifecycleStateManager.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/lifecycle/LifecycleStateManager.java @@ -17,14 +17,14 @@ package io.entgra.device.mgt.core.application.mgt.core.lifecycle; -import io.entgra.device.mgt.core.application.mgt.core.internal.DataHolder; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.application.mgt.common.exception.LifecycleManagementException; import io.entgra.device.mgt.core.application.mgt.common.config.LifecycleState; +import io.entgra.device.mgt.core.application.mgt.common.exception.LifecycleManagementException; +import io.entgra.device.mgt.core.application.mgt.core.internal.DataHolder; import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagementException; import io.entgra.device.mgt.core.device.mgt.core.permission.mgt.PermissionUtils; import io.entgra.device.mgt.core.device.mgt.core.search.mgt.Constants; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.wso2.carbon.user.api.UserRealm; import org.wso2.carbon.user.api.UserStoreException; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/serviceprovider/impl/WSO2IAMSPApplicationService.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/serviceprovider/impl/WSO2IAMSPApplicationService.java index 2144568173..9cef40ba65 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/serviceprovider/impl/WSO2IAMSPApplicationService.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/serviceprovider/impl/WSO2IAMSPApplicationService.java @@ -25,6 +25,7 @@ import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationMan import io.entgra.device.mgt.core.application.mgt.common.exception.IdentityServerManagementException; import io.entgra.device.mgt.core.application.mgt.core.serviceprovider.ISServiceProviderApplicationService; import io.entgra.device.mgt.core.application.mgt.core.util.Constants; +import io.entgra.device.mgt.core.device.mgt.core.common.util.HttpUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.http.HttpResponse; @@ -34,7 +35,7 @@ import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpRequestBase; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; -import io.entgra.device.mgt.core.device.mgt.core.common.util.HttpUtil; + import javax.ws.rs.core.HttpHeaders; import java.io.IOException; import java.util.Collections; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/task/ScheduledAppSubscriptionCleanupTask.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/task/ScheduledAppSubscriptionCleanupTask.java index 612bb1e05b..139e2af2c0 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/task/ScheduledAppSubscriptionCleanupTask.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/task/ScheduledAppSubscriptionCleanupTask.java @@ -18,12 +18,12 @@ package io.entgra.device.mgt.core.application.mgt.core.task; -import io.entgra.device.mgt.core.application.mgt.core.impl.SubscriptionManagerImpl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.application.mgt.common.exception.SubscriptionManagementException; import io.entgra.device.mgt.core.application.mgt.common.services.SubscriptionManager; +import io.entgra.device.mgt.core.application.mgt.core.impl.SubscriptionManagerImpl; import io.entgra.device.mgt.core.device.mgt.core.task.impl.RandomlyAssignedScheduleTask; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.util.Map; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/task/ScheduledAppSubscriptionTask.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/task/ScheduledAppSubscriptionTask.java index 4e295cbe9a..5ddd080549 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/task/ScheduledAppSubscriptionTask.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/task/ScheduledAppSubscriptionTask.java @@ -20,20 +20,20 @@ package io.entgra.device.mgt.core.application.mgt.core.task; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; -import io.entgra.device.mgt.core.application.mgt.core.impl.SubscriptionManagerImpl; -import io.entgra.device.mgt.core.application.mgt.core.util.Constants; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.application.mgt.common.ExecutionStatus; import io.entgra.device.mgt.core.application.mgt.common.SubscriptionType; import io.entgra.device.mgt.core.application.mgt.common.dto.ScheduledSubscriptionDTO; import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; import io.entgra.device.mgt.core.application.mgt.common.exception.SubscriptionManagementException; import io.entgra.device.mgt.core.application.mgt.common.services.SubscriptionManager; +import io.entgra.device.mgt.core.application.mgt.core.impl.SubscriptionManagerImpl; +import io.entgra.device.mgt.core.application.mgt.core.util.Constants; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.core.task.impl.RandomlyAssignedScheduleTask; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.util.List; import java.util.Map; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/task/ScheduledAppSubscriptionTaskManager.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/task/ScheduledAppSubscriptionTaskManager.java index 70f77259a4..e52357b4e2 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/task/ScheduledAppSubscriptionTaskManager.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/task/ScheduledAppSubscriptionTaskManager.java @@ -19,6 +19,12 @@ package io.entgra.device.mgt.core.application.mgt.core.task; import com.google.gson.Gson; +import io.entgra.device.mgt.core.application.mgt.common.SubAction; +import io.entgra.device.mgt.core.application.mgt.common.SubscriptionType; +import io.entgra.device.mgt.core.application.mgt.common.dto.ScheduledSubscriptionDTO; +import io.entgra.device.mgt.core.application.mgt.common.exception.SubscriptionManagementException; +import io.entgra.device.mgt.core.application.mgt.common.services.SubscriptionManager; +import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationOperationTaskException; import io.entgra.device.mgt.core.application.mgt.core.impl.SubscriptionManagerImpl; import io.entgra.device.mgt.core.application.mgt.core.internal.DataHolder; import io.entgra.device.mgt.core.application.mgt.core.util.Constants; @@ -27,24 +33,12 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.quartz.CronExpression; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.application.mgt.common.SubAction; -import io.entgra.device.mgt.core.application.mgt.common.SubscriptionType; -import io.entgra.device.mgt.core.application.mgt.common.dto.ScheduledSubscriptionDTO; -import io.entgra.device.mgt.core.application.mgt.common.exception.SubscriptionManagementException; -import io.entgra.device.mgt.core.application.mgt.common.services.SubscriptionManager; -import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationOperationTaskException; import org.wso2.carbon.ntask.common.TaskException; import org.wso2.carbon.ntask.core.TaskInfo; import org.wso2.carbon.ntask.core.TaskManager; import org.wso2.carbon.ntask.core.service.TaskService; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Properties; +import java.util.*; import java.util.stream.Collectors; public class ScheduledAppSubscriptionTaskManager { diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/APIUtil.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/APIUtil.java index a04699796a..bb95599934 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/APIUtil.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/APIUtil.java @@ -18,40 +18,33 @@ package io.entgra.device.mgt.core.application.mgt.core.util; -import io.entgra.device.mgt.core.application.mgt.common.IdentityServerResponse; -import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO; -import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServiceProviderDTO; -import io.entgra.device.mgt.core.application.mgt.common.exception.InvalidConfigurationException; -import io.entgra.device.mgt.core.application.mgt.core.config.IdentityServiceProvider; -import io.entgra.device.mgt.core.application.mgt.core.serviceprovider.ISServiceProviderApplicationService; -import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException; -import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServerErrorException; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.commons.validator.routines.UrlValidator; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.application.mgt.common.ApplicationType; +import io.entgra.device.mgt.core.application.mgt.common.ErrorResponse; +import io.entgra.device.mgt.core.application.mgt.common.IdentityServerResponse; import io.entgra.device.mgt.core.application.mgt.common.config.MDMConfig; import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO; +import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO; +import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServiceProviderDTO; import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.device.mgt.core.application.mgt.common.exception.InvalidConfigurationException; import io.entgra.device.mgt.core.application.mgt.common.response.Application; import io.entgra.device.mgt.core.application.mgt.common.response.ApplicationRelease; import io.entgra.device.mgt.core.application.mgt.common.services.*; -import io.entgra.device.mgt.core.application.mgt.common.ErrorResponse; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.CustomAppReleaseWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.CustomAppWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.EntAppReleaseWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.ApplicationWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.PublicAppReleaseWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.PublicAppWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.WebAppReleaseWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.WebAppWrapper; +import io.entgra.device.mgt.core.application.mgt.common.wrapper.*; import io.entgra.device.mgt.core.application.mgt.core.config.ConfigurationManager; +import io.entgra.device.mgt.core.application.mgt.core.config.IdentityServiceProvider; +import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException; +import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServerErrorException; import io.entgra.device.mgt.core.application.mgt.core.internal.DataHolder; +import io.entgra.device.mgt.core.application.mgt.core.serviceprovider.ISServiceProviderApplicationService; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.commons.validator.routines.UrlValidator; +import org.wso2.carbon.context.PrivilegedCarbonContext; import javax.ws.rs.core.Response; import java.util.ArrayList; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/ApplicationManagementUtil.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/ApplicationManagementUtil.java index 891b589c50..cb958904ba 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/ApplicationManagementUtil.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/ApplicationManagementUtil.java @@ -18,40 +18,25 @@ package io.entgra.device.mgt.core.application.mgt.core.util; import io.entgra.device.mgt.core.application.mgt.common.ApplicationArtifact; -import io.entgra.device.mgt.core.application.mgt.core.config.ConfigurationManager; -import io.entgra.device.mgt.core.application.mgt.core.config.Extension; -import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException; -import io.entgra.device.mgt.core.device.mgt.common.Base64File; import io.entgra.device.mgt.core.application.mgt.common.FileDataHolder; import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; -import io.entgra.device.mgt.core.application.mgt.common.exception.RequestValidatingException; -import io.entgra.device.mgt.core.application.mgt.common.services.SPApplicationManager; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.ApplicationWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.CustomAppReleaseWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.CustomAppWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.EntAppReleaseWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.PublicAppReleaseWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.PublicAppWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.WebAppReleaseWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.WebAppWrapper; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.application.mgt.common.exception.InvalidConfigurationException; -import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationManager; -import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationStorageManager; -import io.entgra.device.mgt.core.application.mgt.common.services.ReviewManager; -import io.entgra.device.mgt.core.application.mgt.common.services.SubscriptionManager; +import io.entgra.device.mgt.core.application.mgt.common.exception.RequestValidatingException; +import io.entgra.device.mgt.core.application.mgt.common.services.*; +import io.entgra.device.mgt.core.application.mgt.common.wrapper.*; +import io.entgra.device.mgt.core.application.mgt.core.config.ConfigurationManager; +import io.entgra.device.mgt.core.application.mgt.core.config.Extension; +import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException; import io.entgra.device.mgt.core.application.mgt.core.lifecycle.LifecycleStateManager; +import io.entgra.device.mgt.core.device.mgt.common.Base64File; import io.entgra.device.mgt.core.device.mgt.core.common.util.FileUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.io.InputStream; import java.lang.reflect.Constructor; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.TreeMap; +import java.util.*; /** * This DAOUtil class is responsible for making sure single instance of each Extension Manager is used throughout for diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/ApplicationMgtDatabaseCreator.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/ApplicationMgtDatabaseCreator.java index 9d7f32cf2b..611f75921e 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/ApplicationMgtDatabaseCreator.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/ApplicationMgtDatabaseCreator.java @@ -22,6 +22,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.utils.CarbonUtils; import org.wso2.carbon.utils.dbcreator.DatabaseCreator; + import java.io.File; /** diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/ArtifactsParser.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/ArtifactsParser.java index 2832db1f15..d87c09ddec 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/ArtifactsParser.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/ArtifactsParser.java @@ -22,20 +22,14 @@ import com.dd.plist.BinaryPropertyListParser; import com.dd.plist.NSDictionary; import com.dd.plist.PropertyListFormatException; import com.dd.plist.PropertyListParser; +import io.entgra.device.mgt.core.application.mgt.core.exception.ParsingException; import net.dongliu.apk.parser.ApkFile; import net.dongliu.apk.parser.bean.ApkMeta; +import org.apache.commons.io.IOUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.commons.io.IOUtils; -import io.entgra.device.mgt.core.application.mgt.core.exception.ParsingException; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; +import java.io.*; import java.nio.file.Files; import java.util.UUID; import java.util.zip.ZipEntry; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/ConnectionManagerUtil.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/ConnectionManagerUtil.java index 45aaca8725..3ae696038d 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/ConnectionManagerUtil.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/ConnectionManagerUtil.java @@ -17,16 +17,16 @@ */ package io.entgra.device.mgt.core.application.mgt.core.util; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.application.mgt.common.exception.DBConnectionException; import io.entgra.device.mgt.core.application.mgt.common.exception.IllegalTransactionStateException; import io.entgra.device.mgt.core.application.mgt.common.exception.TransactionManagementException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import java.sql.Connection; -import java.sql.SQLException; import javax.naming.InitialContext; import javax.sql.DataSource; +import java.sql.Connection; +import java.sql.SQLException; /** * ConnectionManagerUtil is responsible for handling all the datasource connections utilities. diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/DAOUtil.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/DAOUtil.java index 7e7b3e28be..a1aea929cb 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/DAOUtil.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/DAOUtil.java @@ -19,20 +19,14 @@ package io.entgra.device.mgt.core.application.mgt.core.util; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; -import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO; +import io.entgra.device.mgt.core.application.mgt.common.ExecutionStatus; +import io.entgra.device.mgt.core.application.mgt.common.SubscriptionType; +import io.entgra.device.mgt.core.application.mgt.common.dto.*; import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServerErrorException; +import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.json.JSONException; -import io.entgra.device.mgt.core.application.mgt.common.ExecutionStatus; -import io.entgra.device.mgt.core.application.mgt.common.SubscriptionType; -import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; - -import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO; -import io.entgra.device.mgt.core.application.mgt.common.dto.DeviceSubscriptionDTO; -import io.entgra.device.mgt.core.application.mgt.common.dto.ReviewDTO; -import io.entgra.device.mgt.core.application.mgt.common.dto.ScheduledSubscriptionDTO; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import java.sql.PreparedStatement; import java.sql.ResultSet; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/HelperUtil.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/HelperUtil.java index 2a9d29bec0..429fc0bc96 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/HelperUtil.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/HelperUtil.java @@ -17,11 +17,11 @@ */ package io.entgra.device.mgt.core.application.mgt.core.util; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import io.entgra.device.mgt.core.device.mgt.core.service.GroupManagementProviderService; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; -import io.entgra.device.mgt.core.device.mgt.core.service.GroupManagementProviderService; /** * Utility methods used in the Application Management. diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/OAuthUtils.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/OAuthUtils.java index c7464bea43..24ba3d4b7f 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/OAuthUtils.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/main/java/io/entgra/device/mgt/core/application/mgt/core/util/OAuthUtils.java @@ -18,17 +18,17 @@ package io.entgra.device.mgt.core.application.mgt.core.util; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.apimgt.application.extension.APIManagementProviderService; import io.entgra.device.mgt.core.apimgt.application.extension.dto.ApiApplicationKey; import io.entgra.device.mgt.core.apimgt.application.extension.exception.APIManagerException; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.application.mgt.common.dto.ApiRegistrationProfile; import io.entgra.device.mgt.core.identity.jwt.client.extension.JWTClient; import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.AccessTokenInfo; import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; import io.entgra.device.mgt.core.identity.jwt.client.extension.service.JWTClientManagerService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/ArtifactParserTest.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/ArtifactParserTest.java index a0527b3c13..4e1d388f2a 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/ArtifactParserTest.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/ArtifactParserTest.java @@ -19,11 +19,11 @@ package io.entgra.device.mgt.core.application.mgt.core; import com.dd.plist.NSDictionary; +import io.entgra.device.mgt.core.application.mgt.core.exception.ParsingException; +import io.entgra.device.mgt.core.application.mgt.core.util.ArtifactsParser; import net.dongliu.apk.parser.bean.ApkMeta; import org.testng.Assert; import org.testng.annotations.Test; -import io.entgra.device.mgt.core.application.mgt.core.exception.ParsingException; -import io.entgra.device.mgt.core.application.mgt.core.util.ArtifactsParser; import java.io.FileInputStream; import java.io.FileNotFoundException; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/BaseTestCase.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/BaseTestCase.java index ed2db17930..0e7c99a2c1 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/BaseTestCase.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/BaseTestCase.java @@ -17,13 +17,6 @@ */ package io.entgra.device.mgt.core.application.mgt.core; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.tomcat.jdbc.pool.PoolProperties; -import org.testng.annotations.BeforeSuite; -import org.w3c.dom.Document; -import org.wso2.carbon.base.MultitenantConstants; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.application.mgt.common.config.LifecycleState; import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; import io.entgra.device.mgt.core.application.mgt.core.common.DataSourceConfig; @@ -37,6 +30,13 @@ import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManag import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.MetadataManagementDAOFactory; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.tomcat.jdbc.pool.PoolProperties; +import org.testng.annotations.BeforeSuite; +import org.w3c.dom.Document; +import org.wso2.carbon.base.MultitenantConstants; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.registry.core.config.RegistryContext; import org.wso2.carbon.registry.core.exceptions.RegistryException; import org.wso2.carbon.registry.core.internal.RegistryDataHolder; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/ConfigurationTest.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/ConfigurationTest.java index 6462e498b9..bae0481c56 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/ConfigurationTest.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/ConfigurationTest.java @@ -17,11 +17,11 @@ */ package io.entgra.device.mgt.core.application.mgt.core; -import org.junit.Assert; -import org.testng.annotations.Test; +import io.entgra.device.mgt.core.application.mgt.common.config.LifecycleState; import io.entgra.device.mgt.core.application.mgt.core.config.Configuration; import io.entgra.device.mgt.core.application.mgt.core.config.ConfigurationManager; -import io.entgra.device.mgt.core.application.mgt.common.config.LifecycleState; +import org.junit.Assert; +import org.testng.annotations.Test; import java.util.List; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/InitTest.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/InitTest.java index 1e3b9005b6..71a01475ba 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/InitTest.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/InitTest.java @@ -17,9 +17,9 @@ */ package io.entgra.device.mgt.core.application.mgt.core; -import org.testng.annotations.BeforeSuite; import io.entgra.device.mgt.core.application.mgt.common.exception.InvalidConfigurationException; import io.entgra.device.mgt.core.application.mgt.core.config.ConfigurationManager; +import org.testng.annotations.BeforeSuite; import java.io.File; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/LifeCycleStateManagerTest.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/LifeCycleStateManagerTest.java index a16cd9f3fa..8b08a39b82 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/LifeCycleStateManagerTest.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/LifeCycleStateManagerTest.java @@ -17,8 +17,8 @@ */ package io.entgra.device.mgt.core.application.mgt.core; -import io.entgra.device.mgt.core.application.mgt.core.lifecycle.LifecycleStateManager; import io.entgra.device.mgt.core.application.mgt.common.config.LifecycleState; +import io.entgra.device.mgt.core.application.mgt.core.lifecycle.LifecycleStateManager; import java.util.HashMap; import java.util.List; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/LifecycleManagementTest.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/LifecycleManagementTest.java index a867c3f3ca..42759a1af5 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/LifecycleManagementTest.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/LifecycleManagementTest.java @@ -17,14 +17,14 @@ */ package io.entgra.device.mgt.core.application.mgt.core; -import org.junit.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; +import io.entgra.device.mgt.core.application.mgt.common.config.LifecycleState; import io.entgra.device.mgt.core.application.mgt.common.exception.LifecycleManagementException; import io.entgra.device.mgt.core.application.mgt.core.config.Configuration; import io.entgra.device.mgt.core.application.mgt.core.config.ConfigurationManager; import io.entgra.device.mgt.core.application.mgt.core.lifecycle.LifecycleStateManager; -import io.entgra.device.mgt.core.application.mgt.common.config.LifecycleState; +import org.junit.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; import java.util.List; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/StorageManagementUtilTest.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/StorageManagementUtilTest.java index 9d6b084a2e..4c3a6e1e3d 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/StorageManagementUtilTest.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/StorageManagementUtilTest.java @@ -18,13 +18,13 @@ package io.entgra.device.mgt.core.application.mgt.core; +import io.entgra.device.mgt.core.application.mgt.common.exception.ResourceManagementException; +import io.entgra.device.mgt.core.device.mgt.core.common.exception.StorageManagementException; +import io.entgra.device.mgt.core.device.mgt.core.common.util.StorageManagementUtil; import org.junit.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import io.entgra.device.mgt.core.application.mgt.common.exception.ResourceManagementException; -import io.entgra.device.mgt.core.device.mgt.core.common.exception.StorageManagementException; -import io.entgra.device.mgt.core.device.mgt.core.common.util.StorageManagementUtil; import java.io.File; import java.io.FileInputStream; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/dao/ApplicationManagementDAOTest.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/dao/ApplicationManagementDAOTest.java index 49b24f9509..022712963e 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/dao/ApplicationManagementDAOTest.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/dao/ApplicationManagementDAOTest.java @@ -17,11 +17,6 @@ */ package io.entgra.device.mgt.core.application.mgt.core.dao; -import junit.framework.Assert; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; import io.entgra.device.mgt.core.application.mgt.core.BaseTestCase; import io.entgra.device.mgt.core.application.mgt.core.config.ConfigurationManager; import io.entgra.device.mgt.core.application.mgt.core.dao.common.ApplicationManagementDAOFactory; @@ -32,6 +27,11 @@ import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagem import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceTypeDAO; +import junit.framework.Assert; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; public class ApplicationManagementDAOTest extends BaseTestCase { diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/management/ApplicationManagementTest.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/management/ApplicationManagementTest.java index 34ee305795..39086cc4ee 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/management/ApplicationManagementTest.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/java/io/entgra/device/mgt/core/application/mgt/core/management/ApplicationManagementTest.java @@ -21,11 +21,6 @@ import io.entgra.device.mgt.core.application.mgt.common.ApplicationArtifact; import io.entgra.device.mgt.core.application.mgt.common.ApplicationList; import io.entgra.device.mgt.core.application.mgt.common.Filter; import io.entgra.device.mgt.core.application.mgt.common.LifecycleState; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.cxf.jaxrs.ext.multipart.Attachment; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; import io.entgra.device.mgt.core.application.mgt.common.exception.RequestValidatingException; @@ -34,9 +29,9 @@ import io.entgra.device.mgt.core.application.mgt.common.response.ApplicationRele import io.entgra.device.mgt.core.application.mgt.common.response.Category; import io.entgra.device.mgt.core.application.mgt.common.response.Tag; import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationManager; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.EntAppReleaseWrapper; import io.entgra.device.mgt.core.application.mgt.common.wrapper.ApplicationUpdateWrapper; import io.entgra.device.mgt.core.application.mgt.common.wrapper.ApplicationWrapper; +import io.entgra.device.mgt.core.application.mgt.common.wrapper.EntAppReleaseWrapper; import io.entgra.device.mgt.core.application.mgt.core.BaseTestCase; import io.entgra.device.mgt.core.application.mgt.core.dao.ApplicationDAO; import io.entgra.device.mgt.core.application.mgt.core.dao.common.ApplicationManagementDAOFactory; @@ -44,12 +39,17 @@ import io.entgra.device.mgt.core.application.mgt.core.dto.ApplicationsDTO; import io.entgra.device.mgt.core.application.mgt.core.impl.ApplicationManagerImpl; import io.entgra.device.mgt.core.application.mgt.core.internal.DataHolder; import io.entgra.device.mgt.core.application.mgt.core.util.ConnectionManagerUtil; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.Base64File; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.core.common.util.FileUtil; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceTypeVersion; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; import java.io.File; import java.util.ArrayList; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml index 897e33581c..2337c777e2 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml @@ -1,4 +1,4 @@ - + org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/tasks-config.xml b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/tasks-config.xml index 0a9289da70..4f5e043a15 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/tasks-config.xml +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/tasks-config.xml @@ -1,4 +1,4 @@ - + org.json.wso2 diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/ApplicationManagementPublisherAPI.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/ApplicationManagementPublisherAPI.java index cbb23f3e48..0f55b5b8a9 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/ApplicationManagementPublisherAPI.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/ApplicationManagementPublisherAPI.java @@ -17,17 +17,6 @@ */ package io.entgra.device.mgt.core.application.mgt.publisher.api; -import io.entgra.device.mgt.core.device.mgt.common.Base64File; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; import io.entgra.device.mgt.core.application.mgt.common.ApplicationList; @@ -37,29 +26,15 @@ import io.entgra.device.mgt.core.application.mgt.common.LifecycleChanger; import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationReleaseDTO; import io.entgra.device.mgt.core.application.mgt.common.response.ApplicationRelease; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.CustomAppReleaseWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.CustomAppWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.EntAppReleaseWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.ApplicationUpdateWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.ApplicationWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.PublicAppReleaseWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.PublicAppWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.WebAppReleaseWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.WebAppWrapper; +import io.entgra.device.mgt.core.application.mgt.common.wrapper.*; +import io.entgra.device.mgt.core.device.mgt.common.Base64File; +import io.swagger.annotations.*; -import java.util.List; import javax.validation.Valid; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; +import java.util.List; /** * APIs to handle application management related tasks. diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/SPApplicationService.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/SPApplicationService.java index 23dace1a1a..a68a8ac0d3 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/SPApplicationService.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/SPApplicationService.java @@ -17,30 +17,16 @@ package io.entgra.device.mgt.core.application.mgt.publisher.api; +import io.entgra.device.mgt.core.apimgt.annotations.Scope; +import io.entgra.device.mgt.core.apimgt.annotations.Scopes; import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO; import io.entgra.device.mgt.core.application.mgt.common.wrapper.ApplicationWrapper; import io.entgra.device.mgt.core.application.mgt.common.wrapper.CustomAppWrapper; import io.entgra.device.mgt.core.application.mgt.common.wrapper.PublicAppWrapper; import io.entgra.device.mgt.core.application.mgt.common.wrapper.WebAppWrapper; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; -import io.entgra.device.mgt.core.apimgt.annotations.Scope; -import io.entgra.device.mgt.core.apimgt.annotations.Scopes; +import io.swagger.annotations.*; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/admin/ApplicationManagementPublisherAdminAPI.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/admin/ApplicationManagementPublisherAdminAPI.java index 4a79689e70..f48cee20e3 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/admin/ApplicationManagementPublisherAdminAPI.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/admin/ApplicationManagementPublisherAdminAPI.java @@ -17,29 +17,13 @@ */ package io.entgra.device.mgt.core.application.mgt.publisher.api.admin; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; import io.entgra.device.mgt.core.application.mgt.common.ApplicationList; import io.entgra.device.mgt.core.application.mgt.common.ErrorResponse; +import io.swagger.annotations.*; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/admin/ReviewManagementPublisherAdminAPI.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/admin/ReviewManagementPublisherAdminAPI.java index eb2cfc4ba7..fb35ea6893 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/admin/ReviewManagementPublisherAdminAPI.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/admin/ReviewManagementPublisherAdminAPI.java @@ -16,26 +16,13 @@ */ package io.entgra.device.mgt.core.application.mgt.publisher.api.admin; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; import io.entgra.device.mgt.core.application.mgt.common.ErrorResponse; import io.entgra.device.mgt.core.application.mgt.common.PaginationResult; +import io.swagger.annotations.*; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/impl/ApplicationManagementPublisherAPIImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/impl/ApplicationManagementPublisherAPIImpl.java index adf902a8eb..1e83e29ddb 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/impl/ApplicationManagementPublisherAPIImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/impl/ApplicationManagementPublisherAPIImpl.java @@ -16,54 +16,34 @@ */ package io.entgra.device.mgt.core.application.mgt.publisher.api.impl; -import io.entgra.device.mgt.core.application.mgt.common.ApplicationArtifact; -import io.entgra.device.mgt.core.application.mgt.common.ApplicationList; -import io.entgra.device.mgt.core.device.mgt.common.Base64File; -import io.entgra.device.mgt.core.application.mgt.common.Filter; -import io.entgra.device.mgt.core.application.mgt.common.LifecycleChanger; -import io.entgra.device.mgt.core.application.mgt.common.exception.ResourceManagementException; -import io.entgra.device.mgt.core.application.mgt.core.util.ApplicationManagementUtil; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.application.mgt.common.LifecycleState; +import io.entgra.device.mgt.core.application.mgt.common.*; +import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; import io.entgra.device.mgt.core.application.mgt.common.exception.LifecycleManagementException; import io.entgra.device.mgt.core.application.mgt.common.exception.RequestValidatingException; +import io.entgra.device.mgt.core.application.mgt.common.exception.ResourceManagementException; import io.entgra.device.mgt.core.application.mgt.common.response.Application; import io.entgra.device.mgt.core.application.mgt.common.response.ApplicationRelease; import io.entgra.device.mgt.core.application.mgt.common.response.Category; import io.entgra.device.mgt.core.application.mgt.common.response.Tag; +import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationManager; import io.entgra.device.mgt.core.application.mgt.common.services.AppmDataHandler; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.CustomAppReleaseWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.CustomAppWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.EntAppReleaseWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.ApplicationUpdateWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.ApplicationWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.PublicAppReleaseWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.PublicAppWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.WebAppReleaseWrapper; -import io.entgra.device.mgt.core.application.mgt.common.wrapper.WebAppWrapper; +import io.entgra.device.mgt.core.application.mgt.common.wrapper.*; import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException; import io.entgra.device.mgt.core.application.mgt.core.exception.ForbiddenException; +import io.entgra.device.mgt.core.application.mgt.core.exception.NotFoundException; import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServerErrorException; import io.entgra.device.mgt.core.application.mgt.core.util.APIUtil; +import io.entgra.device.mgt.core.application.mgt.core.util.ApplicationManagementUtil; import io.entgra.device.mgt.core.application.mgt.publisher.api.ApplicationManagementPublisherAPI; -import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; -import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationManager; -import io.entgra.device.mgt.core.application.mgt.core.exception.NotFoundException; +import io.entgra.device.mgt.core.device.mgt.common.Base64File; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import java.util.List; import javax.validation.Valid; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; +import java.util.List; /** * Implementation of Application Management related APIs. diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/impl/SPApplicationServiceImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/impl/SPApplicationServiceImpl.java index f75efac78b..371613fd24 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/impl/SPApplicationServiceImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/impl/SPApplicationServiceImpl.java @@ -18,8 +18,8 @@ package io.entgra.device.mgt.core.application.mgt.publisher.api.impl; import io.entgra.device.mgt.core.application.mgt.common.IdentityServerResponse; -import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO; import io.entgra.device.mgt.core.application.mgt.common.SPApplicationListResponse; +import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServerDTO; import io.entgra.device.mgt.core.application.mgt.common.dto.IdentityServiceProviderDTO; import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; import io.entgra.device.mgt.core.application.mgt.common.exception.RequestValidatingException; @@ -36,15 +36,7 @@ import io.entgra.device.mgt.core.application.mgt.publisher.api.SPApplicationServ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import javax.ws.rs.DELETE; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java index dd3b9e7d81..130f85f901 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java @@ -17,8 +17,6 @@ */ package io.entgra.device.mgt.core.application.mgt.publisher.api.impl.admin; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationManager; import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException; @@ -26,15 +24,10 @@ import io.entgra.device.mgt.core.application.mgt.core.exception.ForbiddenExcepti import io.entgra.device.mgt.core.application.mgt.core.exception.NotFoundException; import io.entgra.device.mgt.core.application.mgt.core.util.APIUtil; import io.entgra.device.mgt.core.application.mgt.publisher.api.admin.ApplicationManagementPublisherAdminAPI; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/impl/admin/ReviewManagementPublisherAdminAPIImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/impl/admin/ReviewManagementPublisherAdminAPIImpl.java index 8b980ef729..131297cf54 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/impl/admin/ReviewManagementPublisherAdminAPIImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.publisher.api/src/main/java/io/entgra/device/mgt/core/application/mgt/publisher/api/impl/admin/ReviewManagementPublisherAdminAPIImpl.java @@ -16,8 +16,6 @@ */ package io.entgra.device.mgt.core.application.mgt.publisher.api.impl.admin; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.application.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.application.mgt.common.PaginationResult; import io.entgra.device.mgt.core.application.mgt.common.Rating; @@ -27,12 +25,10 @@ import io.entgra.device.mgt.core.application.mgt.common.services.ReviewManager; import io.entgra.device.mgt.core.application.mgt.core.exception.NotFoundException; import io.entgra.device.mgt.core.application.mgt.core.util.APIUtil; import io.entgra.device.mgt.core.application.mgt.publisher.api.admin.ReviewManagementPublisherAdminAPI; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.Response; /** diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/pom.xml b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/pom.xml index f1ca183fb5..9e9184d2ab 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/pom.xml +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/pom.xml @@ -140,7 +140,6 @@ org.ops4j.pax.logging pax-logging-api provided - org.json.wso2 diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/ApplicationManagementAPI.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/ApplicationManagementAPI.java index 9adbb4b252..7e1805cb5a 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/ApplicationManagementAPI.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/ApplicationManagementAPI.java @@ -16,32 +16,16 @@ */ package io.entgra.device.mgt.core.application.mgt.store.api.services; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; +import io.entgra.device.mgt.core.application.mgt.common.ApplicationList; import io.entgra.device.mgt.core.application.mgt.common.ErrorResponse; import io.entgra.device.mgt.core.application.mgt.common.Filter; import io.entgra.device.mgt.core.application.mgt.common.dto.ApplicationDTO; -import io.entgra.device.mgt.core.application.mgt.common.ApplicationList; +import io.swagger.annotations.*; import javax.validation.Valid; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/ReviewManagementAPI.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/ReviewManagementAPI.java index e59b082ca7..0f6ae56ec9 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/ReviewManagementAPI.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/ReviewManagementAPI.java @@ -17,33 +17,16 @@ */ package io.entgra.device.mgt.core.application.mgt.store.api.services; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.Api; -import io.swagger.annotations.Info; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Tag; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; -import io.entgra.device.mgt.core.application.mgt.common.PaginationResult; import io.entgra.device.mgt.core.application.mgt.common.ErrorResponse; +import io.entgra.device.mgt.core.application.mgt.common.PaginationResult; import io.entgra.device.mgt.core.application.mgt.common.response.Review; import io.entgra.device.mgt.core.application.mgt.common.wrapper.ReviewWrapper; +import io.swagger.annotations.*; import javax.validation.Valid; -import javax.ws.rs.Path; -import javax.ws.rs.Consumes; -import javax.ws.rs.PUT; -import javax.ws.rs.GET; -import javax.ws.rs.PathParam; -import javax.ws.rs.QueryParam; -import javax.ws.rs.Produces; -import javax.ws.rs.POST; -import javax.ws.rs.DELETE; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/SubscriptionManagementAPI.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/SubscriptionManagementAPI.java index cc61aca38a..099c614446 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/SubscriptionManagementAPI.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/SubscriptionManagementAPI.java @@ -17,30 +17,15 @@ */ package io.entgra.device.mgt.core.application.mgt.store.api.services; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; import io.entgra.device.mgt.core.application.mgt.common.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; +import io.swagger.annotations.*; import javax.validation.Valid; import javax.validation.constraints.Size; -import javax.ws.rs.Path; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.PathParam; -import javax.ws.rs.GET; -import javax.ws.rs.POST; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/admin/ReviewManagementStoreAdminAPI.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/admin/ReviewManagementStoreAdminAPI.java index 43e29659b3..a010761fe8 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/admin/ReviewManagementStoreAdminAPI.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/admin/ReviewManagementStoreAdminAPI.java @@ -16,25 +16,12 @@ */ package io.entgra.device.mgt.core.application.mgt.store.api.services.admin; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; import io.entgra.device.mgt.core.application.mgt.common.ErrorResponse; +import io.swagger.annotations.*; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java index 8c1fe119e2..cff98b7ef1 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java @@ -17,29 +17,14 @@ */ package io.entgra.device.mgt.core.application.mgt.store.api.services.admin; -import io.entgra.device.mgt.core.application.mgt.store.api.beans.SubscriptionStatusBean; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; import io.entgra.device.mgt.core.application.mgt.common.ErrorResponse; +import io.entgra.device.mgt.core.application.mgt.store.api.beans.SubscriptionStatusBean; +import io.swagger.annotations.*; import javax.validation.constraints.Size; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java index be7a6db2a0..93883ca22b 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java @@ -16,8 +16,6 @@ */ package io.entgra.device.mgt.core.application.mgt.store.api.services.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.application.mgt.common.ApplicationList; import io.entgra.device.mgt.core.application.mgt.common.Filter; import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; @@ -28,14 +26,11 @@ import io.entgra.device.mgt.core.application.mgt.core.exception.NotFoundExceptio import io.entgra.device.mgt.core.application.mgt.core.exception.UnexpectedServerErrorException; import io.entgra.device.mgt.core.application.mgt.core.util.APIUtil; import io.entgra.device.mgt.core.application.mgt.store.api.services.ApplicationManagementAPI; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + import javax.validation.Valid; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java index ffbe19fca7..589a362f3a 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java @@ -17,32 +17,24 @@ */ package io.entgra.device.mgt.core.application.mgt.store.api.services.impl; -import io.swagger.annotations.ApiParam; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import io.entgra.device.mgt.core.application.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.application.mgt.common.PaginationResult; import io.entgra.device.mgt.core.application.mgt.common.Rating; +import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.device.mgt.core.application.mgt.common.exception.ReviewManagementException; import io.entgra.device.mgt.core.application.mgt.common.response.Review; import io.entgra.device.mgt.core.application.mgt.common.services.ReviewManager; import io.entgra.device.mgt.core.application.mgt.common.wrapper.ReviewWrapper; import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException; import io.entgra.device.mgt.core.application.mgt.core.exception.ForbiddenException; import io.entgra.device.mgt.core.application.mgt.core.exception.NotFoundException; -import io.entgra.device.mgt.core.application.mgt.store.api.services.ReviewManagementAPI; -import io.entgra.device.mgt.core.application.mgt.common.PaginationRequest; -import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; -import io.entgra.device.mgt.core.application.mgt.common.exception.ReviewManagementException; import io.entgra.device.mgt.core.application.mgt.core.util.APIUtil; +import io.entgra.device.mgt.core.application.mgt.store.api.services.ReviewManagementAPI; +import io.swagger.annotations.ApiParam; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.Path; -import javax.ws.rs.Consumes; -import javax.ws.rs.PathParam; -import javax.ws.rs.QueryParam; -import javax.ws.rs.PUT; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.DELETE; +import javax.ws.rs.*; import javax.ws.rs.core.Response; /** diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java index f79c108ef5..7abf085ee6 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java @@ -18,43 +18,26 @@ package io.entgra.device.mgt.core.application.mgt.store.api.services.impl; -import io.entgra.device.mgt.core.application.mgt.store.api.services.impl.util.RequestValidationUtil; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.application.mgt.common.ApplicationInstallResponse; -import io.entgra.device.mgt.core.application.mgt.common.ErrorResponse; -import io.entgra.device.mgt.core.application.mgt.common.SubAction; -import io.entgra.device.mgt.core.application.mgt.common.SubscriptionType; +import io.entgra.device.mgt.core.application.mgt.common.*; import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; import io.entgra.device.mgt.core.application.mgt.common.services.SubscriptionManager; import io.entgra.device.mgt.core.application.mgt.core.exception.ApplicationOperationTaskException; -import io.entgra.device.mgt.core.application.mgt.common.DeviceList; -import io.entgra.device.mgt.core.application.mgt.common.BasicUserInfo; -import io.entgra.device.mgt.core.application.mgt.common.BasicUserInfoList; -import io.entgra.device.mgt.core.application.mgt.common.RoleList; -import io.entgra.device.mgt.core.application.mgt.common.DeviceGroupList; import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException; import io.entgra.device.mgt.core.application.mgt.core.exception.ForbiddenException; import io.entgra.device.mgt.core.application.mgt.core.exception.NotFoundException; import io.entgra.device.mgt.core.application.mgt.core.task.ScheduledAppSubscriptionTaskManager; import io.entgra.device.mgt.core.application.mgt.core.util.APIUtil; import io.entgra.device.mgt.core.application.mgt.store.api.services.SubscriptionManagementAPI; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.MDMAppConstants; +import io.entgra.device.mgt.core.application.mgt.store.api.services.impl.util.RequestValidationUtil; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; +import io.entgra.device.mgt.core.device.mgt.common.*; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.validation.Valid; -import javax.ws.rs.Path; -import javax.ws.rs.Consumes; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.PathParam; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.POST; +import javax.ws.rs.*; import javax.ws.rs.core.Response; import java.util.List; import java.util.Properties; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java index e2ef8b8252..e5f7a7e827 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java @@ -16,20 +16,16 @@ */ package io.entgra.device.mgt.core.application.mgt.store.api.services.impl.admin; -import io.entgra.device.mgt.core.application.mgt.store.api.services.admin.ReviewManagementStoreAdminAPI; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; import io.entgra.device.mgt.core.application.mgt.common.exception.ReviewManagementException; import io.entgra.device.mgt.core.application.mgt.common.services.ReviewManager; import io.entgra.device.mgt.core.application.mgt.core.exception.NotFoundException; import io.entgra.device.mgt.core.application.mgt.core.util.APIUtil; +import io.entgra.device.mgt.core.application.mgt.store.api.services.admin.ReviewManagementStoreAdminAPI; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java index d8ded9f3b1..e3c77febd9 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java @@ -18,29 +18,22 @@ package io.entgra.device.mgt.core.application.mgt.store.api.services.impl.admin; -import io.entgra.device.mgt.core.application.mgt.common.exception.SubscriptionManagementException; -import io.entgra.device.mgt.core.application.mgt.store.api.beans.SubscriptionStatusBean; -import io.entgra.device.mgt.core.application.mgt.store.api.services.admin.SubscriptionManagementAdminAPI; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.device.mgt.core.application.mgt.common.exception.SubscriptionManagementException; import io.entgra.device.mgt.core.application.mgt.common.services.SubscriptionManager; import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException; import io.entgra.device.mgt.core.application.mgt.core.exception.NotFoundException; import io.entgra.device.mgt.core.application.mgt.core.util.APIUtil; +import io.entgra.device.mgt.core.application.mgt.store.api.beans.SubscriptionStatusBean; +import io.entgra.device.mgt.core.application.mgt.store.api.services.admin.SubscriptionManagementAdminAPI; import io.entgra.device.mgt.core.application.mgt.store.api.services.impl.util.RequestValidationUtil; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import javax.ws.rs.Consumes; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/util/RequestValidationUtil.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/util/RequestValidationUtil.java index 1168a1113d..b6453fe42b 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/util/RequestValidationUtil.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/main/java/io/entgra/device/mgt/core/application/mgt/store/api/services/impl/util/RequestValidationUtil.java @@ -18,13 +18,13 @@ */ package io.entgra.device.mgt.core.application.mgt.store.api.services.impl.util; +import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException; +import io.entgra.device.mgt.core.application.mgt.store.api.util.Constants; +import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.ActivityStatus; import org.apache.commons.lang3.EnumUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.application.mgt.core.exception.BadRequestException; -import io.entgra.device.mgt.core.application.mgt.store.api.util.Constants; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.ActivityStatus; import java.util.List; diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/test/java/io/entgra/device/mgt/core/application/mgt/store/api/services/ReviewManagementAPITest.java b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/test/java/io/entgra/device/mgt/core/application/mgt/store/api/services/ReviewManagementAPITest.java index ad640351e9..240288c8b6 100644 --- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/test/java/io/entgra/device/mgt/core/application/mgt/store/api/services/ReviewManagementAPITest.java +++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.store.api/src/test/java/io/entgra/device/mgt/core/application/mgt/store/api/services/ReviewManagementAPITest.java @@ -17,6 +17,8 @@ */ package io.entgra.device.mgt.core.application.mgt.store.api.services; +import io.entgra.device.mgt.core.application.mgt.common.services.ReviewManager; +import io.entgra.device.mgt.core.application.mgt.core.util.APIUtil; import junit.framework.TestCase; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -24,8 +26,6 @@ import org.junit.Ignore; import org.powermock.core.classloader.annotations.PowerMockIgnore; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor; -import io.entgra.device.mgt.core.application.mgt.common.services.ReviewManager; -import io.entgra.device.mgt.core.application.mgt.core.util.APIUtil; @PowerMockIgnore("javax.ws.rs.*") @SuppressStaticInitializationFor({ diff --git a/components/application-mgt/pom.xml b/components/application-mgt/pom.xml index 4badfb0349..b4772ca5cc 100644 --- a/components/application-mgt/pom.xml +++ b/components/application-mgt/pom.xml @@ -31,7 +31,7 @@ pom WSO2 Carbon - Application Management Component WSO2 Carbon - Application Management Component - http://wso2.org + https://entgra.io io.entgra.device.mgt.core.application.mgt.common @@ -50,22 +50,5 @@ ${maven.checkstyle.vesion} - - - - - - - - - - - - - - - - - diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.api/pom.xml b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.api/pom.xml index e95c4cf732..1113af91c4 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.api/pom.xml +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.api/pom.xml @@ -31,7 +31,7 @@ war WSO2 Carbon - Certificate Management API WSO2 Carbon - Certificate Management API - http://wso2.org + https://entgra.io diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.api/src/main/java/io/entgra/device/mgt/core/certificate/mgt/api/impl/CertificateMgtServiceImpl.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.api/src/main/java/io/entgra/device/mgt/core/certificate/mgt/api/impl/CertificateMgtServiceImpl.java index de82425d71..40e4590072 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.api/src/main/java/io/entgra/device/mgt/core/certificate/mgt/api/impl/CertificateMgtServiceImpl.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.api/src/main/java/io/entgra/device/mgt/core/certificate/mgt/api/impl/CertificateMgtServiceImpl.java @@ -1,14 +1,14 @@ package io.entgra.device.mgt.core.certificate.mgt.api.impl; +import io.entgra.device.mgt.core.certificate.mgt.api.CertificateMgtService; +import io.entgra.device.mgt.core.certificate.mgt.api.beans.ErrorResponse; +import io.entgra.device.mgt.core.certificate.mgt.api.exception.Message; +import io.entgra.device.mgt.core.certificate.mgt.api.exception.UnexpectedServerErrorException; +import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException; +import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator; import org.apache.commons.codec.binary.Base64; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException; -import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator; -import io.entgra.device.mgt.core.certificate.mgt.api.beans.ErrorResponse; -import io.entgra.device.mgt.core.certificate.mgt.api.exception.UnexpectedServerErrorException; -import io.entgra.device.mgt.core.certificate.mgt.api.CertificateMgtService; -import io.entgra.device.mgt.core.certificate.mgt.api.exception.Message; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/pom.xml b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/pom.xml index d55518babd..2315f7e46b 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/pom.xml +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/pom.xml @@ -31,7 +31,7 @@ war WSO2 Carbon - Admin Certificate Management API WSO2 Carbon - Admin Certificate Management API - http://wso2.org + https://entgra.io @@ -162,7 +162,6 @@ org.ops4j.pax.logging pax-logging-api provided - io.entgra.device.mgt.core diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/src/main/java/io/entgra/device/mgt/core/certificate/mgt/cert/admin/api/beans/CertificateList.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/src/main/java/io/entgra/device/mgt/core/certificate/mgt/cert/admin/api/beans/CertificateList.java index e05d11315e..03bc08e977 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/src/main/java/io/entgra/device/mgt/core/certificate/mgt/cert/admin/api/beans/CertificateList.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/src/main/java/io/entgra/device/mgt/core/certificate/mgt/cert/admin/api/beans/CertificateList.java @@ -19,8 +19,8 @@ package io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.beans; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/src/main/java/io/entgra/device/mgt/core/certificate/mgt/cert/admin/api/impl/CertificateManagementAdminServiceImpl.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/src/main/java/io/entgra/device/mgt/core/certificate/mgt/cert/admin/api/impl/CertificateManagementAdminServiceImpl.java index 9ef8e10e0d..58352def51 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/src/main/java/io/entgra/device/mgt/core/certificate/mgt/cert/admin/api/impl/CertificateManagementAdminServiceImpl.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/src/main/java/io/entgra/device/mgt/core/certificate/mgt/cert/admin/api/impl/CertificateManagementAdminServiceImpl.java @@ -44,12 +44,15 @@ import io.entgra.device.mgt.core.certificate.mgt.core.scep.SCEPManager; import io.entgra.device.mgt.core.certificate.mgt.core.scep.TenantedDeviceWrapper; import io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementService; import io.entgra.device.mgt.core.certificate.mgt.core.service.PaginationResult; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; import io.entgra.device.mgt.core.identity.jwt.client.extension.service.JWTClientManagerService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; +import javax.ws.rs.*; import javax.ws.rs.core.Response; import java.security.cert.X509Certificate; import java.util.ArrayList; diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/src/main/java/io/entgra/device/mgt/core/certificate/mgt/cert/admin/api/util/CertificateMgtAPIUtils.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/src/main/java/io/entgra/device/mgt/core/certificate/mgt/cert/admin/api/util/CertificateMgtAPIUtils.java index 823e9e992d..d5b2aca77c 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/src/main/java/io/entgra/device/mgt/core/certificate/mgt/cert/admin/api/util/CertificateMgtAPIUtils.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/src/main/java/io/entgra/device/mgt/core/certificate/mgt/cert/admin/api/util/CertificateMgtAPIUtils.java @@ -18,13 +18,13 @@ package io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.util; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.certificate.mgt.core.scep.SCEPManager; import io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementService; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.core.search.mgt.SearchManagerService; import io.entgra.device.mgt.core.identity.jwt.client.extension.service.JWTClientManagerService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import javax.ws.rs.core.MediaType; diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/src/main/java/io/entgra/device/mgt/core/certificate/mgt/cert/admin/api/util/RequestValidationUtil.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/src/main/java/io/entgra/device/mgt/core/certificate/mgt/cert/admin/api/util/RequestValidationUtil.java index ac41a7720f..c04009468f 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/src/main/java/io/entgra/device/mgt/core/certificate/mgt/cert/admin/api/util/RequestValidationUtil.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/src/main/java/io/entgra/device/mgt/core/certificate/mgt/cert/admin/api/util/RequestValidationUtil.java @@ -18,8 +18,8 @@ */ package io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.util; -import io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.beans.ErrorResponse; import io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.InputValidationException; +import io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.beans.ErrorResponse; public class RequestValidationUtil { diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/pom.xml b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/pom.xml index 668fb6352a..e8946f9a37 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/pom.xml +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/pom.xml @@ -47,13 +47,17 @@ bundle WSO2 Carbon - Certificate Management Core WSO2 Carbon - Certificate Management Core - http://wso2.org + https://entgra.io - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -70,49 +74,47 @@ io.entgra.device.mgt.core.certificate.mgt.core.util - org.osgi.framework.*;version="${imp.package.version.osgi.framework}", - org.osgi.service.*;version="${imp.package.version.osgi.service}", - org.apache.commons.logging, - org.apache.commons.collections.map, + io.entgra.device.mgt.core.certificate.mgt.core.*, + io.entgra.device.mgt.core.device.mgt.common;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.exceptions;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.config;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.config.cache;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.service;version="[5.0,6)", + io.swagger.annotations;version="[1.6,2)", + javax.cache;version="[1.0,2)", + javax.naming, + javax.naming.ldap, javax.security.auth.x500, - javax.xml.*, - javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional, - org.apache.commons.codec.binary;version="${commons-codec.wso2.osgi.version.range}", - org.bouncycastle.asn1, - org.bouncycastle.asn1.x500, - org.bouncycastle.asn1.x509, - org.bouncycastle.asn1.pkcs, - org.bouncycastle.cert; version="${bcprov.wso2.version.range}", - org.bouncycastle.cert.jcajce; version="${bcprov.wso2.version.range}", - org.bouncycastle.cms, - org.bouncycastle.jce.provider, - org.bouncycastle.operator, - org.bouncycastle.operator.jcajce, - org.bouncycastle.asn1.x500.style, - org.bouncycastle.pkcs, - org.wso2.carbon.user.core.tenant, - org.wso2.carbon.user.api, - org.wso2.carbon.user.core.service, - - org.bouncycastle.util, + javax.sql, + javax.xml.bind;version="[0.0,1)", + javax.xml.bind.annotation;version="[0.0,1)", + javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}", + org.apache.commons.codec.binary;version="[1.4,2)", + org.apache.commons.collections.map;version="[3.2,4)", + org.apache.commons.logging;version="[1.2,2)", + org.bouncycastle.asn1;version="[1.70,2)", + org.bouncycastle.asn1.pkcs;version="[1.70,2)", + org.bouncycastle.asn1.x500;version="[1.70,2)", + org.bouncycastle.asn1.x500.style;version="[1.70,2)", + org.bouncycastle.asn1.x509;version="[1.70,2)", + org.bouncycastle.cert;version="[1.70,2)", + org.bouncycastle.cert.jcajce;version="[1.70,2)", + org.bouncycastle.cms;version="[1.70,2)", + org.bouncycastle.jce.provider;version="[1.70,2)", + org.bouncycastle.operator;version="[1.70,2)", + org.bouncycastle.operator.jcajce;version="[1.70,2)", + org.bouncycastle.pkcs;version="[1.70,2)", + org.bouncycastle.util;version="[1.70,2)", org.jscep.message, - org.wso2.carbon.context, org.jscep.transaction, - org.w3c.dom, - org.xml.sax, - javax.sql, - - javax.naming, - javax.xml.bind.annotation, - javax.xml.bind, - org.wso2.carbon.utils.*, - io.entgra.device.mgt.core.device.mgt.common.*, - io.swagger.annotations.*;resolution:=optional, - io.entgra.device.mgt.core.device.mgt.core.*, - org.wso2.carbon.registry.indexing.*, - javax.cache.*, - javax.naming.ldap - + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", + org.w3c.dom,org.wso2.carbon.context;version="[4.8,5)", + org.wso2.carbon.user.api;version="[1.0,2)", + org.wso2.carbon.user.core.service;version="[4.8,5)", + org.wso2.carbon.user.core.tenant;version="[4.8,5)", + org.wso2.carbon.utils;version="[4.8,5)", + org.wso2.carbon.utils.dbcreator;version="[4.8,5)" !io.entgra.device.mgt.core.certificate.mgt.core.internal.*, @@ -140,18 +142,6 @@ jacoco-maven-plugin ${jacoco.maven.plugin.version} - - - - - - - - - - - - jacoco-initialize @@ -169,32 +159,23 @@ ${basedir}/target/coverage-reports/site - - - - - - + + org.apache.felix + org.apache.felix.scr.ds-annotations + provided + org.jacoco org.jacoco.agent ${jacoco.maven.plugin.version} runtime - - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.equinox - org.eclipse.equinox.common - org.testng testng @@ -207,7 +188,6 @@ org.wso2.carbon org.wso2.carbon.securevault - test @@ -224,18 +204,19 @@ org.ops4j.pax.logging pax-logging-api provided - org.wso2.orbit.org.bouncycastle bcprov-jdk15on + provided org.wso2.orbit.org.bouncycastle bcpkix-jdk15on + provided - org.wso2.orbit.com.google.code.jscep + io.entgra.com.google.code.jscep jscep @@ -253,10 +234,12 @@ io.entgra.device.mgt.core io.entgra.device.mgt.core.device.mgt.core + provided io.entgra.device.mgt.core io.entgra.device.mgt.core.device.mgt.common + provided io.swagger diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/cache/impl/CertificateCacheManagerImpl.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/cache/impl/CertificateCacheManagerImpl.java index 6e10cd8855..c4b0b3dc7a 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/cache/impl/CertificateCacheManagerImpl.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/cache/impl/CertificateCacheManagerImpl.java @@ -19,8 +19,8 @@ package io.entgra.device.mgt.core.certificate.mgt.core.cache.impl; -import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse; import io.entgra.device.mgt.core.certificate.mgt.core.cache.CertificateCacheManager; +import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceManagementConfig; diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/CertificateManagementDAOFactory.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/CertificateManagementDAOFactory.java index 828ff45850..8d0b02f39b 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/CertificateManagementDAOFactory.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/CertificateManagementDAOFactory.java @@ -18,6 +18,8 @@ package io.entgra.device.mgt.core.certificate.mgt.core.dao; +import io.entgra.device.mgt.core.certificate.mgt.core.config.datasource.DataSourceConfig; +import io.entgra.device.mgt.core.certificate.mgt.core.config.datasource.JNDILookupDefinition; import io.entgra.device.mgt.core.certificate.mgt.core.dao.impl.GenericCertificateDAOImpl; import io.entgra.device.mgt.core.certificate.mgt.core.dao.impl.OracleCertificateDAOImpl; import io.entgra.device.mgt.core.certificate.mgt.core.dao.impl.PostgreSQLCertificateDAOImpl; @@ -28,8 +30,6 @@ import io.entgra.device.mgt.core.certificate.mgt.core.exception.UnsupportedDatab import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagementConstants; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.certificate.mgt.core.config.datasource.DataSourceConfig; -import io.entgra.device.mgt.core.certificate.mgt.core.config.datasource.JNDILookupDefinition; import javax.sql.DataSource; import java.sql.Connection; diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/impl/AbstractCertificateDAOImpl.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/impl/AbstractCertificateDAOImpl.java index 2aeb3571f5..1295c4c9ab 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/impl/AbstractCertificateDAOImpl.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/impl/AbstractCertificateDAOImpl.java @@ -19,15 +19,15 @@ package io.entgra.device.mgt.core.certificate.mgt.core.dao.impl; import io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate; -import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse; -import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateDAO; import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOException; import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory; import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOUtil; +import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse; +import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator; import io.entgra.device.mgt.core.certificate.mgt.core.util.Serializer; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; import java.io.IOException; diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/impl/GenericCertificateDAOImpl.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/impl/GenericCertificateDAOImpl.java index 9e5a828df0..5a6008c4fc 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/impl/GenericCertificateDAOImpl.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/impl/GenericCertificateDAOImpl.java @@ -18,14 +18,14 @@ package io.entgra.device.mgt.core.certificate.mgt.core.dao.impl; -import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse; -import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOException; import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory; import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOUtil; +import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse; +import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator; import io.entgra.device.mgt.core.certificate.mgt.core.service.PaginationResult; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; import java.sql.Connection; diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/impl/OracleCertificateDAOImpl.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/impl/OracleCertificateDAOImpl.java index a919c98fa8..f06cbfef9e 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/impl/OracleCertificateDAOImpl.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/impl/OracleCertificateDAOImpl.java @@ -18,14 +18,14 @@ package io.entgra.device.mgt.core.certificate.mgt.core.dao.impl; -import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse; -import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOException; import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory; import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOUtil; +import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse; +import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator; import io.entgra.device.mgt.core.certificate.mgt.core.service.PaginationResult; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; import java.sql.Connection; diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/impl/PostgreSQLCertificateDAOImpl.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/impl/PostgreSQLCertificateDAOImpl.java index b2207301e2..aea26b5b22 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/impl/PostgreSQLCertificateDAOImpl.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/impl/PostgreSQLCertificateDAOImpl.java @@ -18,14 +18,14 @@ package io.entgra.device.mgt.core.certificate.mgt.core.dao.impl; -import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse; -import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOException; import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory; import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOUtil; +import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse; +import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator; import io.entgra.device.mgt.core.certificate.mgt.core.service.PaginationResult; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; import java.sql.Connection; diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/impl/SQLServerCertificateDAOImpl.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/impl/SQLServerCertificateDAOImpl.java index 7ec250e3c3..54023bde9f 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/impl/SQLServerCertificateDAOImpl.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/dao/impl/SQLServerCertificateDAOImpl.java @@ -18,14 +18,14 @@ package io.entgra.device.mgt.core.certificate.mgt.core.dao.impl; -import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse; -import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOException; import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory; import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOUtil; +import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse; +import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator; import io.entgra.device.mgt.core.certificate.mgt.core.service.PaginationResult; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; import java.sql.Connection; diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateGenerator.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateGenerator.java index d35f89569b..5fb6b44721 100755 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateGenerator.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateGenerator.java @@ -17,8 +17,17 @@ */ package io.entgra.device.mgt.core.certificate.mgt.core.impl; +import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateDAO; +import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOException; +import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory; +import io.entgra.device.mgt.core.certificate.mgt.core.dto.CAStatus; +import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse; +import io.entgra.device.mgt.core.certificate.mgt.core.dto.SCEPResponse; +import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException; +import io.entgra.device.mgt.core.certificate.mgt.core.exception.TransactionManagementException; import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagementConstants; import io.entgra.device.mgt.core.certificate.mgt.core.util.CommonUtil; +import io.entgra.device.mgt.core.certificate.mgt.core.util.Serializer; import org.apache.commons.codec.binary.Base64; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -46,26 +55,10 @@ import org.bouncycastle.operator.OperatorCreationException; import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder; import org.bouncycastle.pkcs.PKCS10CertificationRequest; import org.bouncycastle.util.Store; -import org.jscep.message.CertRep; -import org.jscep.message.MessageDecodingException; -import org.jscep.message.MessageEncodingException; -import org.jscep.message.PkcsPkiEnvelopeDecoder; -import org.jscep.message.PkcsPkiEnvelopeEncoder; -import org.jscep.message.PkiMessage; -import org.jscep.message.PkiMessageDecoder; -import org.jscep.message.PkiMessageEncoder; +import org.jscep.message.*; import org.jscep.transaction.FailInfo; import org.jscep.transaction.Nonce; import org.jscep.transaction.TransactionId; -import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateDAO; -import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOException; -import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory; -import io.entgra.device.mgt.core.certificate.mgt.core.dto.CAStatus; -import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse; -import io.entgra.device.mgt.core.certificate.mgt.core.dto.SCEPResponse; -import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException; -import io.entgra.device.mgt.core.certificate.mgt.core.exception.TransactionManagementException; -import io.entgra.device.mgt.core.certificate.mgt.core.util.Serializer; import org.wso2.carbon.context.PrivilegedCarbonContext; import javax.naming.InvalidNameException; @@ -77,24 +70,9 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.math.BigInteger; -import java.security.InvalidKeyException; -import java.security.KeyFactory; -import java.security.KeyPair; -import java.security.KeyPairGenerator; -import java.security.NoSuchAlgorithmException; -import java.security.NoSuchProviderException; -import java.security.PrivateKey; -import java.security.PublicKey; -import java.security.SecureRandom; -import java.security.Security; -import java.security.SignatureException; +import java.security.*; import java.security.cert.Certificate; -import java.security.cert.CertificateEncodingException; -import java.security.cert.CertificateException; -import java.security.cert.CertificateExpiredException; -import java.security.cert.CertificateFactory; -import java.security.cert.CertificateNotYetValidException; -import java.security.cert.X509Certificate; +import java.security.cert.*; import java.security.spec.InvalidKeySpecException; import java.security.spec.X509EncodedKeySpec; import java.util.*; diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/KeyStoreReader.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/KeyStoreReader.java index 986f91d78a..f8ea75ed84 100755 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/KeyStoreReader.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/KeyStoreReader.java @@ -17,8 +17,6 @@ */ package io.entgra.device.mgt.core.certificate.mgt.core.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.certificate.mgt.core.cache.CertificateCacheManager; import io.entgra.device.mgt.core.certificate.mgt.core.cache.impl.CertificateCacheManagerImpl; import io.entgra.device.mgt.core.certificate.mgt.core.config.CertificateConfigurationManager; @@ -30,12 +28,10 @@ import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse; import io.entgra.device.mgt.core.certificate.mgt.core.exception.CertificateManagementException; import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException; import io.entgra.device.mgt.core.certificate.mgt.core.util.Serializer; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; +import java.io.*; import java.security.*; import java.security.cert.Certificate; import java.security.cert.CertificateException; diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/internal/CertificateManagementServiceComponent.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/internal/CertificateManagementServiceComponent.java index bec4ce5004..956f618fb1 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/internal/CertificateManagementServiceComponent.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/internal/CertificateManagementServiceComponent.java @@ -18,37 +18,33 @@ package io.entgra.device.mgt.core.certificate.mgt.core.internal; +import io.entgra.device.mgt.core.certificate.mgt.core.config.CertificateConfigurationManager; +import io.entgra.device.mgt.core.certificate.mgt.core.config.CertificateManagementConfig; +import io.entgra.device.mgt.core.certificate.mgt.core.config.datasource.DataSourceConfig; import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory; import io.entgra.device.mgt.core.certificate.mgt.core.exception.CertificateManagementException; import io.entgra.device.mgt.core.certificate.mgt.core.scep.SCEPManager; import io.entgra.device.mgt.core.certificate.mgt.core.scep.SCEPManagerImpl; +import io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementService; +import io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementServiceImpl; import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagementConstants; import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateMgtSchemaInitializer; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleContext; import org.osgi.service.component.ComponentContext; -import io.entgra.device.mgt.core.certificate.mgt.core.config.CertificateConfigurationManager; -import io.entgra.device.mgt.core.certificate.mgt.core.config.CertificateManagementConfig; -import io.entgra.device.mgt.core.certificate.mgt.core.config.datasource.DataSourceConfig; -import io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementService; -import io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementServiceImpl; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import org.osgi.service.component.annotations.*; -/** - * @scr.component name="org.wso2.carbon.certificate.mgt" immediate="true" - * @scr.reference name="org.wso2.carbon.device.manager" - * interface="io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService" - * cardinality="1..1" - * policy="dynamic" - * bind="setDeviceManagementService" - * unbind="unsetDeviceManagementService" - */ +@Component( + name = "io.entgra.device.mgt.core.certificate.mgt.core.internal.CertificateManagementServiceComponent", + immediate = true) public class CertificateManagementServiceComponent { private static Log log = LogFactory.getLog(CertificateManagementServiceComponent.class); @SuppressWarnings("unused") + @Activate protected void activate(ComponentContext componentContext) { try { if (log.isDebugEnabled()) { @@ -86,10 +82,17 @@ public class CertificateManagementServiceComponent { } @SuppressWarnings("unused") + @Deactivate protected void deactivate(ComponentContext componentContext) { //do nothing } + @Reference( + name = "device.mgt.provider.service", + service = io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetDeviceManagementService") protected void setDeviceManagementService(DeviceManagementProviderService deviceManagerService) { if (log.isDebugEnabled()) { log.debug("Setting Device Management Service"); diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/scep/SCEPManagerImpl.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/scep/SCEPManagerImpl.java index da51bb05d4..7b3effd558 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/scep/SCEPManagerImpl.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/scep/SCEPManagerImpl.java @@ -35,15 +35,15 @@ package io.entgra.device.mgt.core.certificate.mgt.core.scep; -import org.apache.commons.collections.map.SingletonMap; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.certificate.mgt.core.internal.CertificateManagementDataHolder; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import org.apache.commons.collections.map.SingletonMap; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.core.service.RealmService; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/util/CertificateManagerUtil.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/util/CertificateManagerUtil.java index 343e0750d4..07a5646851 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/util/CertificateManagerUtil.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/util/CertificateManagerUtil.java @@ -19,15 +19,15 @@ package io.entgra.device.mgt.core.certificate.mgt.core.util; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.w3c.dom.Document; import io.entgra.device.mgt.core.certificate.mgt.core.config.CertificateConfigurationManager; import io.entgra.device.mgt.core.certificate.mgt.core.config.CertificateManagementConfig; import io.entgra.device.mgt.core.certificate.mgt.core.config.datasource.DataSourceConfig; import io.entgra.device.mgt.core.certificate.mgt.core.config.datasource.JNDILookupDefinition; import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOUtil; import io.entgra.device.mgt.core.certificate.mgt.core.exception.CertificateManagementException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.w3c.dom.Document; import javax.sql.DataSource; import javax.xml.XMLConstants; diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/util/CertificateMgtSchemaInitializer.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/util/CertificateMgtSchemaInitializer.java index 4647c3f2c9..283d6714bb 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/util/CertificateMgtSchemaInitializer.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/util/CertificateMgtSchemaInitializer.java @@ -18,9 +18,9 @@ package io.entgra.device.mgt.core.certificate.mgt.core.util; +import io.entgra.device.mgt.core.certificate.mgt.core.config.datasource.DataSourceConfig; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.certificate.mgt.core.config.datasource.DataSourceConfig; import org.wso2.carbon.utils.CarbonUtils; import org.wso2.carbon.utils.dbcreator.DatabaseCreator; diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/util/Serializer.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/util/Serializer.java index e7d31b2c97..21094417a6 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/util/Serializer.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/main/java/io/entgra/device/mgt/core/certificate/mgt/core/util/Serializer.java @@ -18,11 +18,7 @@ package io.entgra.device.mgt.core.certificate.mgt.core.util; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; +import java.io.*; /** * Serialize/deserialize a given object to and from a byte array. diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/common/BaseDeviceManagementCertificateTest.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/common/BaseDeviceManagementCertificateTest.java index 2422aaa1a7..b4cffd35df 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/common/BaseDeviceManagementCertificateTest.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/common/BaseDeviceManagementCertificateTest.java @@ -19,6 +19,10 @@ package io.entgra.device.mgt.core.certificate.mgt.core.common; import io.entgra.device.mgt.core.certificate.mgt.core.util.TestUtils; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; +import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; +import io.entgra.device.mgt.core.device.mgt.core.dao.GroupManagementDAOFactory; +import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.tomcat.jdbc.pool.PoolProperties; @@ -27,10 +31,6 @@ import org.testng.annotations.BeforeSuite; import org.w3c.dom.Document; import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; -import io.entgra.device.mgt.core.device.mgt.core.dao.GroupManagementDAOFactory; -import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; import javax.sql.DataSource; import javax.xml.bind.JAXBContext; diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateCacheManagerImplTests.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateCacheManagerImplTests.java index 86ed531b5b..bc9efe9f9a 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateCacheManagerImplTests.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateCacheManagerImplTests.java @@ -18,11 +18,11 @@ package io.entgra.device.mgt.core.certificate.mgt.core.impl; -import org.testng.Assert; -import org.testng.annotations.BeforeClass; import io.entgra.device.mgt.core.certificate.mgt.core.cache.CertificateCacheManager; import io.entgra.device.mgt.core.certificate.mgt.core.common.BaseDeviceManagementCertificateTest; import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; /** * This class tests CertificateCache manager methods diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateGeneratorNegativeTests.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateGeneratorNegativeTests.java index 0ff902a8d1..c16e680352 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateGeneratorNegativeTests.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateGeneratorNegativeTests.java @@ -17,7 +17,11 @@ */ package io.entgra.device.mgt.core.certificate.mgt.core.impl; + +import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory; +import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException; import io.entgra.device.mgt.core.certificate.mgt.core.util.CSRGenerator; +import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagementConstants; import org.bouncycastle.asn1.ASN1Encodable; import org.bouncycastle.asn1.ASN1ObjectIdentifier; import org.bouncycastle.cert.CertIOException; @@ -36,18 +40,11 @@ import org.powermock.modules.testng.PowerMockTestCase; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import org.wso2.carbon.base.MultitenantConstants; -import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory; -import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException; -import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagementConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; + import javax.sql.DataSource; import java.io.File; -import java.security.KeyPair; -import java.security.PrivateKey; -import java.security.NoSuchProviderException; -import java.security.NoSuchAlgorithmException; -import java.security.SignatureException; -import java.security.InvalidKeyException; +import java.security.*; import java.security.cert.CertificateException; import java.security.cert.X509Certificate; import java.sql.SQLException; diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateGeneratorTestSuite.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateGeneratorTestSuite.java index 837df2428f..77f1d33406 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateGeneratorTestSuite.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateGeneratorTestSuite.java @@ -1,12 +1,12 @@ package io.entgra.device.mgt.core.certificate.mgt.core.impl; +import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException; +import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagementConstants; import org.apache.commons.io.FileUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.testng.Assert; import org.testng.annotations.Test; -import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException; -import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagementConstants; import java.io.File; import java.io.IOException; diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateGeneratorTests.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateGeneratorTests.java index de9df7dbf8..2e549a8924 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateGeneratorTests.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateGeneratorTests.java @@ -18,11 +18,11 @@ */ package io.entgra.device.mgt.core.certificate.mgt.core.impl; +import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException; import junit.framework.Assert; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.testng.annotations.Test; -import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException; public class CertificateGeneratorTests { diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateManagementServiceImplNegativeTests.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateManagementServiceImplNegativeTests.java index 24b3a134ac..c5d31221bb 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateManagementServiceImplNegativeTests.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateManagementServiceImplNegativeTests.java @@ -18,6 +18,10 @@ package io.entgra.device.mgt.core.certificate.mgt.core.impl; +import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory; +import io.entgra.device.mgt.core.certificate.mgt.core.exception.CertificateManagementException; +import io.entgra.device.mgt.core.certificate.mgt.core.exception.TransactionManagementException; +import io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementServiceImpl; import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; import org.mockito.Mockito; import org.powermock.api.mockito.PowerMockito; @@ -29,10 +33,6 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.ObjectFactory; import org.testng.annotations.Test; import org.wso2.carbon.base.MultitenantConstants; -import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory; -import io.entgra.device.mgt.core.certificate.mgt.core.exception.CertificateManagementException; -import io.entgra.device.mgt.core.certificate.mgt.core.exception.TransactionManagementException; -import io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementServiceImpl; import org.wso2.carbon.context.PrivilegedCarbonContext; import javax.sql.DataSource; diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateManagementServiceImplTests.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateManagementServiceImplTests.java index 74d761f373..41acfd0cc9 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateManagementServiceImplTests.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateManagementServiceImplTests.java @@ -18,8 +18,20 @@ package io.entgra.device.mgt.core.certificate.mgt.core.impl; +import io.entgra.device.mgt.core.certificate.mgt.core.common.BaseDeviceManagementCertificateTest; +import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory; +import io.entgra.device.mgt.core.certificate.mgt.core.dto.CAStatus; +import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse; +import io.entgra.device.mgt.core.certificate.mgt.core.dto.SCEPResponse; +import io.entgra.device.mgt.core.certificate.mgt.core.exception.CertificateManagementException; +import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException; +import io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementServiceImpl; +import io.entgra.device.mgt.core.certificate.mgt.core.service.PaginationResult; import io.entgra.device.mgt.core.certificate.mgt.core.util.CSRGenerator; +import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagementConstants; import io.entgra.device.mgt.core.certificate.mgt.core.util.DummyCertificate; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; +import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; import org.apache.commons.io.FileUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -32,19 +44,8 @@ import org.bouncycastle.pkcs.PKCS10CertificationRequest; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import io.entgra.device.mgt.core.certificate.mgt.core.common.BaseDeviceManagementCertificateTest; -import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory; -import io.entgra.device.mgt.core.certificate.mgt.core.dto.CAStatus; -import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse; -import io.entgra.device.mgt.core.certificate.mgt.core.dto.SCEPResponse; -import io.entgra.device.mgt.core.certificate.mgt.core.exception.CertificateManagementException; -import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException; -import io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementServiceImpl; -import io.entgra.device.mgt.core.certificate.mgt.core.service.PaginationResult; -import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagementConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; + import java.io.ByteArrayInputStream; import java.io.File; import java.io.IOException; diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateTests.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateTests.java index 559cf905c9..cd1a122cd2 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateTests.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/impl/CertificateTests.java @@ -18,10 +18,10 @@ package io.entgra.device.mgt.core.certificate.mgt.core.impl; +import io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate; import io.entgra.device.mgt.core.certificate.mgt.core.util.DummyCertificate; import org.testng.Assert; import org.testng.annotations.Test; -import io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate; /** * This class tests the DTO for certificates diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/util/DummyCertificate.java b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/util/DummyCertificate.java index b5b8bb71b4..d6ff3d8d99 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/util/DummyCertificate.java +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/java/io/entgra/device/mgt/core/certificate/mgt/core/util/DummyCertificate.java @@ -21,17 +21,8 @@ package io.entgra.device.mgt.core.certificate.mgt.core.util; import org.bouncycastle.asn1.pkcs.PKCSObjectIdentifiers; import java.math.BigInteger; -import java.security.Principal; -import java.security.PublicKey; -import java.security.cert.CertificateEncodingException; -import java.security.cert.CertificateExpiredException; -import java.security.cert.CertificateNotYetValidException; -import java.security.cert.CertificateException; -import java.security.NoSuchAlgorithmException; -import java.security.SignatureException; -import java.security.NoSuchProviderException; -import java.security.cert.X509Certificate; -import java.security.InvalidKeyException; +import java.security.*; +import java.security.cert.*; import java.util.Date; import java.util.Set; diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml index 40b7e24343..115062646a 100644 --- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml +++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml @@ -15,7 +15,7 @@ ~ specific language governing permissions and limitations ~ under the License. --> - + org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader diff --git a/components/certificate-mgt/pom.xml b/components/certificate-mgt/pom.xml index 51691757c9..43b4fb7bc9 100644 --- a/components/certificate-mgt/pom.xml +++ b/components/certificate-mgt/pom.xml @@ -30,7 +30,7 @@ certificate-mgt pom WSO2 Carbon - Certificate Management Component - http://wso2.org + https://entgra.io io.entgra.device.mgt.core.certificate.mgt.core @@ -38,23 +38,4 @@ io.entgra.device.mgt.core.certificate.mgt.cert.admin.api - - - - - - - - - - - - - - - - - - - diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager/pom.xml index 5bd1ca25cb..a73fd62a4a 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager/pom.xml +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager/pom.xml @@ -36,13 +36,13 @@ - - org.apache.felix - maven-scr-plugin - org.apache.maven.plugins maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -56,22 +56,19 @@ IoT - User Roles Management Bundle io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager.internal + io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager.bean;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager.exception;version="[5.0,6)", + javax.xml.bind;version="[0.0,1)", + javax.xml.bind.annotation;version="[0.0,1)", + javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}", + org.apache.commons.logging;version="[1.2,2)", org.osgi.framework.*;version="${imp.package.version.osgi.framework}", org.osgi.service.*;version="${imp.package.version.osgi.service}", - org.apache.commons.logging, - org.apache.axis2.*;version="${axis2.osgi.version.range}", - org.wso2.carbon.core, - org.wso2.carbon.utils.*, - javax.xml.bind;resolution:=optional, - javax.xml.bind.annotation, - javax.xml.parsers, - org.w3c.dom, - org.wso2.carbon, - org.wso2.carbon.context, - org.wso2.carbon.user.api, - org.wso2.carbon.user.core.common, - org.wso2.carbon.user.core.service, - org.wso2.carbon.user.mgt.common + org.w3c.dom,org.wso2.carbon.context;version="[4.8,5)", + org.wso2.carbon.core;version="[4.8,5)", + org.wso2.carbon.user.api;version="[1.0,2)", + org.wso2.carbon.user.core.service;version="[4.8,5)", + org.wso2.carbon.utils;version="[4.8,5)" !io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager.internal, @@ -124,12 +121,9 @@ - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.osgi - org.eclipse.osgi.services + org.apache.felix + org.apache.felix.scr.ds-annotations + provided org.wso2.carbon @@ -139,7 +133,6 @@ org.ops4j.pax.logging pax-logging-api provided - org.wso2.carbon @@ -189,7 +182,6 @@ org.wso2.carbon org.wso2.carbon.securevault - test diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/defaultrole/manager/internal/RoleManagerServiceComponent.java b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/defaultrole/manager/internal/RoleManagerServiceComponent.java index 3ac6aa7137..5669e545d1 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/defaultrole/manager/internal/RoleManagerServiceComponent.java +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/defaultrole/manager/internal/RoleManagerServiceComponent.java @@ -20,35 +20,24 @@ package io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager.internal; import io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager.DefaultRolesConfigManager; +import io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager.IoTSStartupHandler; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleContext; import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.*; import org.wso2.carbon.core.ServerStartupObserver; -import io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager.IoTSStartupHandler; import org.wso2.carbon.user.core.service.RealmService; import org.wso2.carbon.utils.ConfigurationContextService; -/** - * @scr.component name="io.entgra.device.mgt.role.manager.RoleManagerServiceComponent" - * immediate="true" - * @scr.reference name="user.realmservice.default" - * interface="org.wso2.carbon.user.core.service.RealmService" - * cardinality="1..1" - * policy="dynamic" - * bind="setRealmService" - * unbind="unsetRealmService" - * @scr.reference name="config.context.service" - * interface="org.wso2.carbon.utils.ConfigurationContextService" - * cardinality="0..1" - * policy="dynamic" - * bind="setConfigurationContextService" - * unbind="unsetConfigurationContextService" - */ +@Component( + name = "io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager.internal.RoleManagerServiceComponent", + immediate = true) public class RoleManagerServiceComponent { private static final Log log = LogFactory.getLog(RoleManagerServiceComponent.class); + @Activate protected void activate(ComponentContext ctx) { if (log.isDebugEnabled()) { log.debug("Activating Role Management Service Component"); @@ -64,13 +53,19 @@ public class RoleManagerServiceComponent { log.error("Error occurred while activating Role Management Service Component", e); } } - + @Deactivate protected void deactivate(ComponentContext ctx) { if (log.isDebugEnabled()) { log.debug("De-activating Role Manager Service Component"); } } + @Reference( + name = "configuration.context.service", + service = org.wso2.carbon.utils.ConfigurationContextService.class, + cardinality = ReferenceCardinality.OPTIONAL, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetConfigurationContextService") protected void setConfigurationContextService(ConfigurationContextService configurationContextService) { if (log.isDebugEnabled()) { log.debug("Setting ConfigurationContextService"); @@ -91,6 +86,12 @@ public class RoleManagerServiceComponent { * * @param realmService An instance of RealmService */ + @Reference( + name = "realm.service", + service = org.wso2.carbon.user.core.service.RealmService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetRealmService") protected void setRealmService(RealmService realmService) { if (log.isDebugEnabled()) { log.debug("Setting Realm Service"); diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/pom.xml index d0b9d6f50a..5756662e73 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/pom.xml +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/pom.xml @@ -31,9 +31,14 @@ bundle WSO2 Carbon - Device Type Deployer WSO2 Carbon - Device Type Deployer Implementation - http://wso2.org + https://entgra.io + + org.apache.felix + org.apache.felix.scr.ds-annotations + provided + commons-lang.wso2 commons-lang @@ -46,14 +51,6 @@ org.wso2.carbon org.wso2.carbon.utils - - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.osgi - org.eclipse.osgi.services - commons-logging commons-logging @@ -112,8 +109,12 @@ - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -130,34 +131,29 @@ io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.* - javax.naming, - javax.sql, - javax.xml, - javax.xml.bind, - javax.xml.bind.annotation, - javax.xml.parsers; version="${javax.xml.parsers.import.pkg.version}", - org.apache.axis2.context, - org.apache.axis2.deployment.*, - org.apache.commons.lang;version="${commons-lang.wso2.osgi.version.range}", - org.apache.commons.logging, + io.entgra.device.mgt.core.device.mgt.common.spi;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.util, + io.entgra.device.mgt.core.device.mgt.extensions.device.type.template;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.extensions.device.type.template.config;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.extensions.device.type.template.config.exception;version="[5.0,6)", + javax.xml.bind;version="[0.0,1)", + javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}", + org.apache.axis2.context;version="[1.6,2)", + org.apache.axis2.deployment;version="[1.6,2)", + org.apache.axis2.deployment.repository.util;version="[1.6,2)", + org.apache.axis2.engine;version="[1.6,2)", + org.apache.commons.logging;version="[1.2,2)", org.osgi.framework.*;version="${imp.package.version.osgi.framework}", org.osgi.service.*;version="${imp.package.version.osgi.service}", - org.w3c.dom, - org.wso2.carbon.context, - io.entgra.device.mgt.core.device.mgt.common.*, - io.entgra.device.mgt.core.device.mgt.extensions.device.type.template.*, - org.wso2.carbon.registry.api, - org.wso2.carbon.registry.core, - org.wso2.carbon.registry.core.*, - org.wso2.carbon.utils.*, - javax.xml.namespace, - org.apache.commons.io, - org.wso2.carbon.application.deployer.*, - org.apache.axis2.engine, - org.wso2.carbon.ndatasource.core, + org.w3c.dom,org.wso2.carbon.application.deployer;version="[4.8,5)", + org.wso2.carbon.application.deployer.config;version="[4.8,5)", + org.wso2.carbon.application.deployer.handler;version="[4.8,5)", + org.wso2.carbon.context;version="[4.8,5)", + org.wso2.carbon.ndatasource.core;version="[4.8,5)", + org.wso2.carbon.registry.core.service;version="[1.0,2)", + org.wso2.carbon.utils;version="[4.8,5)" DeviceTypeDeployer - diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/DeviceTypeCAppDeployer.java b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/DeviceTypeCAppDeployer.java index 4ba19f7ba7..c1ff67d7cc 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/DeviceTypeCAppDeployer.java +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/DeviceTypeCAppDeployer.java @@ -18,6 +18,7 @@ */ package io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer; +import io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.util.DeviceTypePluginConstants; import org.apache.axis2.deployment.Deployer; import org.apache.axis2.deployment.DeploymentException; import org.apache.axis2.deployment.repository.util.DeploymentFileData; @@ -30,7 +31,6 @@ import org.wso2.carbon.application.deployer.CarbonApplication; import org.wso2.carbon.application.deployer.config.Artifact; import org.wso2.carbon.application.deployer.config.CappFile; import org.wso2.carbon.application.deployer.handler.AppDeploymentHandler; -import io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.util.DeviceTypePluginConstants; import java.io.File; import java.util.ArrayList; diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/DeviceTypePluginDeployer.java b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/DeviceTypePluginDeployer.java index 4331159789..94f2f81162 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/DeviceTypePluginDeployer.java +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/DeviceTypePluginDeployer.java @@ -18,6 +18,13 @@ */ package io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer; +import io.entgra.device.mgt.core.device.mgt.common.spi.DeviceManagementService; +import io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.internal.DeviceTypeManagementDataHolder; +import io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.util.DeviceTypeConfigUtil; +import io.entgra.device.mgt.core.device.mgt.extensions.device.type.template.DeviceTypeConfigIdentifier; +import io.entgra.device.mgt.core.device.mgt.extensions.device.type.template.DeviceTypeManagerService; +import io.entgra.device.mgt.core.device.mgt.extensions.device.type.template.config.DeviceTypeConfiguration; +import io.entgra.device.mgt.core.device.mgt.extensions.device.type.template.config.exception.DeviceTypeConfigurationException; import org.apache.axis2.context.ConfigurationContext; import org.apache.axis2.deployment.AbstractDeployer; import org.apache.axis2.deployment.DeploymentException; @@ -28,13 +35,6 @@ import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceRegistration; import org.w3c.dom.Document; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.spi.DeviceManagementService; -import io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.internal.DeviceTypeManagementDataHolder; -import io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.util.DeviceTypeConfigUtil; -import io.entgra.device.mgt.core.device.mgt.extensions.device.type.template.DeviceTypeConfigIdentifier; -import io.entgra.device.mgt.core.device.mgt.extensions.device.type.template.DeviceTypeManagerService; -import io.entgra.device.mgt.core.device.mgt.extensions.device.type.template.config.DeviceTypeConfiguration; -import io.entgra.device.mgt.core.device.mgt.extensions.device.type.template.config.exception.DeviceTypeConfigurationException; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/internal/DeviceTypeManagementServiceComponent.java b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/internal/DeviceTypeManagementServiceComponent.java index 5bfabb7b4c..a5a860effc 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/internal/DeviceTypeManagementServiceComponent.java +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/internal/DeviceTypeManagementServiceComponent.java @@ -21,34 +21,19 @@ package io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.int import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.service.component.ComponentContext; -import org.wso2.carbon.application.deployer.handler.AppDeploymentHandler; +import org.osgi.service.component.annotations.*; import org.wso2.carbon.ndatasource.core.DataSourceService; import org.wso2.carbon.registry.core.service.RegistryService; import org.wso2.carbon.utils.ConfigurationContextService; -/** - * @scr.component name="io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.internal.DeviceTypeManagementServiceComponent" - * immediate="true" - * @scr.reference name="config.context.service" - * interface="org.wso2.carbon.utils.ConfigurationContextService" - * cardinality="0..1" - * policy="dynamic" - * bind="setConfigurationContextService" - * unbind="unsetConfigurationContextService" - * @scr.reference name="registry.service" - * interface="org.wso2.carbon.registry.core.service.RegistryService" cardinality="0..1" - * policy="dynamic" bind="setRegistryService" unbind="unsetRegistryService" - * @scr.reference name="org.wso2.carbon.ndatasource" - * interface="org.wso2.carbon.ndatasource.core.DataSourceService" - * cardinality="1..1" - * policy="dynamic" - * bind="setDataSourceService" - * unbind="unsetDataSourceService" - */ +@Component( + name = "io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.internal.DeviceTypeManagementServiceComponent", + immediate = true) public class DeviceTypeManagementServiceComponent { private static final Log log = LogFactory.getLog(DeviceTypeManagementServiceComponent.class); + @Activate protected void activate(ComponentContext ctx) { if (log.isDebugEnabled()) { log.debug("Activating DeviceType Deployer Service Component"); @@ -56,13 +41,19 @@ public class DeviceTypeManagementServiceComponent { // ctx.getBundleContext().registerService(AppDeploymentHandler.class.getName(), new DeviceTypeCAppDeployer(), null); DeviceTypeManagementDataHolder.getInstance().setBundleContext(ctx.getBundleContext()); } - + @Deactivate protected void deactivate(ComponentContext ctx) { if (log.isDebugEnabled()) { log.debug("De-activating DeviceType Deployer Service Component"); } } + @Reference( + name = "configuration.context.service", + service = org.wso2.carbon.utils.ConfigurationContextService.class, + cardinality = ReferenceCardinality.OPTIONAL, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetConfigurationContextService") protected void setConfigurationContextService(ConfigurationContextService configurationContextService) { if (log.isDebugEnabled()) { log.debug("Setting ConfigurationContextService"); @@ -79,6 +70,12 @@ public class DeviceTypeManagementServiceComponent { DeviceTypeManagementDataHolder.getInstance().setConfigurationContextService(null); } + @Reference( + name = "registry.service", + service = org.wso2.carbon.registry.core.service.RegistryService.class, + cardinality = ReferenceCardinality.OPTIONAL, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetRegistryService") protected void setRegistryService(RegistryService registryService) { if (log.isDebugEnabled()) { log.debug("RegistryService acquired"); @@ -90,6 +87,12 @@ public class DeviceTypeManagementServiceComponent { DeviceTypeManagementDataHolder.getInstance().setRegistryService(null); } + @Reference( + name = "datasource.service", + service = org.wso2.carbon.ndatasource.core.DataSourceService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetDataSourceService") protected void setDataSourceService(DataSourceService dataSourceService) { /* This is to avoid mobile device management component getting initialized before the underlying datasources are registered */ diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/util/DeviceTypeConfigUtil.java b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/util/DeviceTypeConfigUtil.java index 68d455309b..c417c6db01 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/util/DeviceTypeConfigUtil.java +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/util/DeviceTypeConfigUtil.java @@ -18,8 +18,8 @@ */ package io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.util; -import org.w3c.dom.Document; import io.entgra.device.mgt.core.device.mgt.extensions.device.type.template.config.exception.DeviceTypeConfigurationException; +import org.w3c.dom.Document; import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder; diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/test/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/DeviceTypeCAppDeployerTest.java b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/test/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/DeviceTypeCAppDeployerTest.java index 7dcc4c8510..9fc7aae1d4 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/test/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/DeviceTypeCAppDeployerTest.java +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/test/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/DeviceTypeCAppDeployerTest.java @@ -18,7 +18,7 @@ package io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer; -import io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.DeviceTypeCAppDeployer; +import io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.util.DeviceTypePluginConstants; import org.apache.axis2.deployment.DeploymentException; import org.apache.axis2.engine.AxisConfiguration; import org.mockito.Mockito; @@ -29,8 +29,8 @@ import org.wso2.carbon.application.deployer.config.ApplicationConfiguration; import org.wso2.carbon.application.deployer.config.Artifact; import org.wso2.carbon.application.deployer.config.CappFile; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.util.DeviceTypePluginConstants; import org.wso2.carbon.registry.core.exceptions.RegistryException; + import java.io.File; import java.io.IOException; import java.lang.reflect.Field; diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/test/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/DeviceTypePluginDeployerTest.java b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/test/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/DeviceTypePluginDeployerTest.java index 9c284f63f2..b757aedb28 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/test/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/DeviceTypePluginDeployerTest.java +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/src/test/java/io/entgra/device/mgt/core/device/mgt/extensions/device/type/deployer/DeviceTypePluginDeployerTest.java @@ -18,7 +18,7 @@ package io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer; -import io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.DeviceTypePluginDeployer; +import io.entgra.device.mgt.core.device.mgt.extensions.device.type.template.DeviceTypeConfigIdentifier; import org.apache.axis2.deployment.DeploymentException; import org.apache.axis2.deployment.repository.util.DeploymentFileData; import org.junit.Assert; @@ -27,8 +27,8 @@ import org.osgi.framework.ServiceRegistration; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.extensions.device.type.template.DeviceTypeConfigIdentifier; import org.wso2.carbon.registry.core.exceptions.RegistryException; + import java.io.File; import java.io.IOException; import java.lang.reflect.Field; diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.logger/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.logger/pom.xml index 70a9a195a3..b3dfb9de7d 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.logger/pom.xml +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.logger/pom.xml @@ -38,6 +38,10 @@ org.apache.maven.plugins maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -51,7 +55,7 @@ Entgra Logger Bundle io.entgra.device.mgt.core.device.mgt.extensions.logger, - org.apache.commons.logging + org.apache.commons.logging;version="[1.2,2)" io.entgra.device.mgt.core.device.mgt.extensions.logger.* @@ -67,7 +71,6 @@ org.ops4j.pax.logging pax-logging-api provided - diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.pull.notification/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.pull.notification/pom.xml index 20a62eb833..3679e7f307 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.pull.notification/pom.xml +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.pull.notification/pom.xml @@ -31,9 +31,14 @@ bundle WSO2 Carbon - Pull Notification Provider Implementation WSO2 Carbon - Pull Notification Provider Implementation - http://wso2.org + https://entgra.io + + org.apache.felix + org.apache.felix.scr.ds-annotations + provided + io.entgra.device.mgt.core io.entgra.device.mgt.core.device.mgt.common @@ -42,14 +47,6 @@ io.entgra.device.mgt.core io.entgra.device.mgt.core.device.mgt.core - - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.osgi - org.eclipse.osgi.services - io.entgra.device.mgt.core io.entgra.device.mgt.core.policy.mgt.core @@ -64,8 +61,12 @@ - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -82,17 +83,17 @@ io.entgra.device.mgt.core.device.mgt.extensions.pull.notification.* - org.osgi.framework.*;version="${imp.package.version.osgi.framework}", - org.osgi.service.*;version="${imp.package.version.osgi.service}", - org.apache.commons.logging, - io.entgra.device.mgt.core.device.mgt.common.*, - io.entgra.device.mgt.core.device.mgt.core.service - io.entgra.device.mgt.core.policy.mgt.core.*, - io.entgra.device.mgt.core.policy.mgt.core, - com.google.gson, - io.entgra.device.mgt.core.device.mgt.core.service.*, - io.entgra.device.mgt.core.application.mgt.common.*, - io.entgra.device.mgt.core.application.mgt.common.services.* + com.google.gson;version="[2.9,3)", + io.entgra.device.mgt.core.application.mgt.common.exception;version="[5.0,6)", + io.entgra.device.mgt.core.application.mgt.common.services;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.operation.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.pull.notification;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.service;version="[5.0,6)", + io.entgra.device.mgt.core.policy.mgt.core;version="[5.0,6)", + org.apache.commons.logging;version="[1.2,2)", + org.osgi.service.*;version="${imp.package.version.osgi.service}" diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.pull.notification/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/pull/notification/PullNotificationSubscriberImpl.java b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.pull.notification/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/pull/notification/PullNotificationSubscriberImpl.java index 8d3d488c71..63f70b8804 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.pull.notification/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/pull/notification/PullNotificationSubscriberImpl.java +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.pull.notification/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/pull/notification/PullNotificationSubscriberImpl.java @@ -22,11 +22,9 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonParser; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; -import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationManager; +import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManagementException; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.ComplianceFeature; @@ -34,6 +32,8 @@ import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.PolicyComp import io.entgra.device.mgt.core.device.mgt.common.pull.notification.PullNotificationExecutionFailedException; import io.entgra.device.mgt.core.device.mgt.common.pull.notification.PullNotificationSubscriber; import io.entgra.device.mgt.core.device.mgt.extensions.pull.notification.internal.PullNotificationDataHolder; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.util.ArrayList; import java.util.List; diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.pull.notification/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/pull/notification/internal/PullNotificationServiceComponent.java b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.pull.notification/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/pull/notification/internal/PullNotificationServiceComponent.java index aa8a4cbd29..9d7515dd37 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.pull.notification/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/pull/notification/internal/PullNotificationServiceComponent.java +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.pull.notification/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/pull/notification/internal/PullNotificationServiceComponent.java @@ -18,39 +18,23 @@ */ package io.entgra.device.mgt.core.device.mgt.extensions.pull.notification.internal; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.osgi.service.component.ComponentContext; import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationManager; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.*; -/** - * @scr.component name="io.entgra.device.mgt.core.device.mgt.extensions.pull.notification.internal.PullNotificationServiceComponent" immediate="true" - * @scr.reference name="carbon.device.mgt.provider" - * interface="io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService" - * cardinality="1..1" - * policy="dynamic" - * bind="setDeviceManagementProviderService" - * unbind="unsetDeviceManagementProviderService" - * @scr.reference name="io.entgra.device.mgt.core.policy.mgt.core" - * interface="io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService" - * cardinality="1..1" - * policy="dynamic" - * bind="setPolicyManagerService" - * unbind="unsetPolicyManagerService" - * @scr.reference name="org.wso2.carbon.application.mgt.service" - * interface="io.entgra.device.mgt.core.application.mgt.common.services.ApplicationManager" - * cardinality="1..1" - * policy="dynamic" - * bind="setApplicationManagerService" - * unbind="unsetApplicationManagerService" - */ +@Component( + name = "io.entgra.device.mgt.core.device.mgt.extensions.pull.notification.internal.PullNotificationServiceComponent", + immediate = true) public class PullNotificationServiceComponent { private static final Log log = LogFactory.getLog(PullNotificationServiceComponent.class); @SuppressWarnings("unused") + @Activate protected void activate(ComponentContext componentContext) { try { //Do nothing @@ -63,11 +47,17 @@ public class PullNotificationServiceComponent { "implementation bundle", e); } } - + @Deactivate protected void deactivate(ComponentContext componentContext) { //Do nothing } + @Reference( + name = "device.mgt.provider.service", + service = io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetDeviceManagementProviderService") protected void setDeviceManagementProviderService(DeviceManagementProviderService deviceManagementProviderService) { PullNotificationDataHolder.getInstance().setDeviceManagementProviderService(deviceManagementProviderService); } @@ -76,6 +66,12 @@ public class PullNotificationServiceComponent { PullNotificationDataHolder.getInstance().setDeviceManagementProviderService(null); } + @Reference( + name = "policy.mgr.service", + service = io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetPolicyManagerService") protected void setPolicyManagerService(PolicyManagerService policyManagerService) { PullNotificationDataHolder.getInstance().setPolicyManagerService(policyManagerService); } @@ -84,6 +80,12 @@ public class PullNotificationServiceComponent { PullNotificationDataHolder.getInstance().setPolicyManagerService(null); } + @Reference( + name = "applcation.mgr", + service = io.entgra.device.mgt.core.application.mgt.common.services.ApplicationManager.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetApplicationManagerService") protected void setApplicationManagerService(ApplicationManager applicationManagerService){ PullNotificationDataHolder.getInstance().setApplicationManager(applicationManagerService); } diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm/pom.xml index 073865a700..f33258bc5a 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm/pom.xml +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm/pom.xml @@ -31,9 +31,14 @@ bundle WSO2 Carbon - FCM Based Push Notification Provider Implementation WSO2 Carbon - FCM Based Push Notification Provider Implementation - http://wso2.org + https://entgra.io + + org.apache.felix + org.apache.felix.scr.ds-annotations + provided + org.wso2.carbon.governance org.wso2.carbon.governance.api @@ -63,17 +68,9 @@ org.wso2.carbon.utils - org.wso2.orbit.org.scannotation + io.entgra.org.scannotation scannotation - - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.osgi - org.eclipse.osgi.services - org.wso2.tomcat tomcat @@ -116,8 +113,12 @@ - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -134,14 +135,14 @@ io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm.* - com.google.gson, - org.osgi.framework.*;version="${imp.package.version.osgi.framework}", - org.osgi.service.*;version="${imp.package.version.osgi.service}", - io.entgra.device.mgt.core.device.mgt.common.operation.mgt, - io.entgra.device.mgt.core.device.mgt.common.push.notification, - org.apache.commons.logging, - io.entgra.device.mgt.core.device.mgt.common.*, - io.entgra.device.mgt.core.device.mgt.core.service + com.google.gson;version="[2.9,3)", + io.entgra.device.mgt.core.device.mgt.common;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.exceptions;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.operation.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.push.notification;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.service;version="[5.0,6)", + org.apache.commons.logging;version="[1.2,2)", + org.osgi.service.*;version="${imp.package.version.osgi.service}" diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/fcm/FCMNotificationStrategy.java b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/fcm/FCMNotificationStrategy.java index 54fdc6c2f3..cda196cff7 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/fcm/FCMNotificationStrategy.java +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/fcm/FCMNotificationStrategy.java @@ -21,8 +21,6 @@ package io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provid import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.push.notification.NotificationContext; @@ -30,6 +28,8 @@ import io.entgra.device.mgt.core.device.mgt.common.push.notification.Notificatio import io.entgra.device.mgt.core.device.mgt.common.push.notification.PushNotificationConfig; import io.entgra.device.mgt.core.device.mgt.common.push.notification.PushNotificationExecutionFailedException; import io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm.internal.FCMDataHolder; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.io.IOException; import java.io.OutputStream; diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/fcm/internal/FCMPushNotificationServiceComponent.java b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/fcm/internal/FCMPushNotificationServiceComponent.java index cebc3b16d8..7b8aeb7205 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/fcm/internal/FCMPushNotificationServiceComponent.java +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/fcm/internal/FCMPushNotificationServiceComponent.java @@ -18,25 +18,21 @@ */ package io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm.internal; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.service.component.ComponentContext; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import org.osgi.service.component.annotations.*; -/** - * @scr.component name="io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm.internal.FCMPushNotificationServiceComponent" immediate="true" - * @scr.reference name="carbon.device.mgt.provider" - * interface="io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService" - * cardinality="1..1" - * policy="dynamic" - * bind="setDeviceManagementProviderService" - * unbind="unsetDeviceManagementProviderService" - */ +@Component( + name = "io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm.internal.FCMPushNotificationServiceComponent", + immediate = true) public class FCMPushNotificationServiceComponent { private static final Log log = LogFactory.getLog(FCMPushNotificationServiceComponent.class); @SuppressWarnings("unused") + @Activate protected void activate(ComponentContext componentContext) { try { //Do nothing @@ -49,11 +45,16 @@ public class FCMPushNotificationServiceComponent { "implementation bundle", e); } } - + @Deactivate protected void deactivate(ComponentContext componentContext) { //Do nothing } - + @Reference( + name = "device.mgt.provider.service", + service = io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetDeviceManagementProviderService") protected void setDeviceManagementProviderService( DeviceManagementProviderService deviceManagementProviderService) { FCMDataHolder.getInstance().setDeviceManagementProviderService(deviceManagementProviderService); diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http/pom.xml index bdad0b4425..397bb314c4 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http/pom.xml +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http/pom.xml @@ -31,9 +31,14 @@ bundle WSO2 Carbon - HTTP Based Push Notification Provider Implementation WSO2 Carbon - HTTP Based Push Notification Provider Implementation - http://wso2.org + https://entgra.io + + org.apache.felix + org.apache.felix.scr.ds-annotations + provided + org.wso2.carbon.governance org.wso2.carbon.governance.api @@ -63,17 +68,9 @@ org.wso2.carbon.utils - org.wso2.orbit.org.scannotation + io.entgra.org.scannotation scannotation - - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.osgi - org.eclipse.osgi.services - org.wso2.tomcat tomcat @@ -107,8 +104,12 @@ - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -125,18 +126,13 @@ io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http.* - org.apache.commons.logging, - org.osgi.framework.*;version="${imp.package.version.osgi.framework}", - org.osgi.service.*;version="${imp.package.version.osgi.service}", - org.wso2.carbon.context, - io.entgra.device.mgt.core.device.mgt.common.operation.mgt, - io.entgra.device.mgt.core.device.mgt.common.push.notification, - io.entgra.device.mgt.core.device.mgt.common, - io.entgra.device.mgt.core.device.mgt.core.service, - io.entgra.device.mgt.core.device.mgt.core.operation.mgt, - org.wso2.carbon.core, - com.google.gson, - org.apache.commons.httpclient.* + com.google.gson;version="[2.9,3)", + io.entgra.device.mgt.core.device.mgt.common.exceptions;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.push.notification;version="[5.0,6)", + org.apache.commons.httpclient;version="[3.1,4)", + org.apache.commons.httpclient.methods;version="[3.1,4)", + org.apache.commons.logging;version="[1.2,2)", + org.osgi.service.*;version="${imp.package.version.osgi.service}" diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/http/HTTPMessageExecutor.java b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/http/HTTPMessageExecutor.java index 75e85c901e..290f33f0ac 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/http/HTTPMessageExecutor.java +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/http/HTTPMessageExecutor.java @@ -1,6 +1,8 @@ package io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http; import com.google.gson.Gson; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.InvalidConfigurationException; +import io.entgra.device.mgt.core.device.mgt.common.push.notification.NotificationContext; import org.apache.commons.httpclient.HostConfiguration; import org.apache.commons.httpclient.HttpClient; import org.apache.commons.httpclient.methods.EntityEnclosingMethod; @@ -8,8 +10,6 @@ import org.apache.commons.httpclient.methods.PostMethod; import org.apache.commons.httpclient.methods.StringRequestEntity; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.InvalidConfigurationException; -import io.entgra.device.mgt.core.device.mgt.common.push.notification.NotificationContext; import java.net.UnknownHostException; diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/http/HTTPNotificationStrategy.java b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/http/HTTPNotificationStrategy.java index a98a2ba140..f56b71fd26 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/http/HTTPNotificationStrategy.java +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/http/HTTPNotificationStrategy.java @@ -18,15 +18,15 @@ */ package io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http; -import org.apache.commons.httpclient.HostConfiguration; -import org.apache.commons.httpclient.HttpClient; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.exceptions.InvalidConfigurationException; import io.entgra.device.mgt.core.device.mgt.common.push.notification.NotificationContext; import io.entgra.device.mgt.core.device.mgt.common.push.notification.NotificationStrategy; import io.entgra.device.mgt.core.device.mgt.common.push.notification.PushNotificationConfig; import io.entgra.device.mgt.core.device.mgt.common.push.notification.PushNotificationExecutionFailedException; +import org.apache.commons.httpclient.HostConfiguration; +import org.apache.commons.httpclient.HttpClient; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.net.MalformedURLException; import java.net.URL; diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/http/internal/HTTPPushNotificationServiceComponent.java b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/http/internal/HTTPPushNotificationServiceComponent.java index 709680378c..09e8b19321 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/http/internal/HTTPPushNotificationServiceComponent.java +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/http/internal/HTTPPushNotificationServiceComponent.java @@ -21,15 +21,17 @@ package io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provid import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.service.component.ComponentContext; - -/** - * @scr.component name="io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http.internal.HTTPPushNotificationServiceComponent" immediate="true" - */ +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +@Component( + name = "io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http.internal.HTTPPushNotificationServiceComponent", + immediate = true) public class HTTPPushNotificationServiceComponent { private static final Log log = LogFactory.getLog(HTTPPushNotificationServiceComponent.class); @SuppressWarnings("unused") + @Activate protected void activate(ComponentContext componentContext) { try { if (log.isDebugEnabled()) { diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/pom.xml index 5d72865c31..488019b9c5 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/pom.xml +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/pom.xml @@ -31,9 +31,14 @@ bundle WSO2 Carbon - MQTT Based Push Notification Provider Implementation WSO2 Carbon - MQTT Based Push Notification Provider Implementation - http://wso2.org + https://entgra.io + + org.apache.felix + org.apache.felix.scr.ds-annotations + provided + org.wso2.carbon.governance org.wso2.carbon.governance.api @@ -63,17 +68,9 @@ org.wso2.carbon.utils - org.wso2.orbit.org.scannotation + io.entgra.org.scannotation scannotation - - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.osgi - org.eclipse.osgi.services - org.wso2.tomcat tomcat @@ -129,8 +126,12 @@ - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -147,21 +148,17 @@ io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt.* - org.apache.commons.logging, - org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + io.entgra.device.mgt.core.device.mgt.common;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.exceptions;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.operation.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.push.notification;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.operation.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.service;version="[5.0,6)", + org.apache.commons.logging;version="[1.2,2)", org.osgi.service.*;version="${imp.package.version.osgi.service}", - org.wso2.carbon.context, - io.entgra.device.mgt.core.device.mgt.common.operation.mgt, - io.entgra.device.mgt.core.device.mgt.common.push.notification, - io.entgra.device.mgt.core.device.mgt.common, - io.entgra.device.mgt.core.device.mgt.common.exceptions, - io.entgra.device.mgt.core.device.mgt.core.service, - org.wso2.carbon.event.output.adapter.core, - org.wso2.carbon.event.output.adapter.core.exception, - io.entgra.device.mgt.core.device.mgt.core.operation.mgt, - org.wso2.carbon.core, - io.entgra.device.mgt.core.application.mgt.common.*, - io.entgra.device.mgt.core.application.mgt.common.services.* + org.wso2.carbon.context;version="[4.8,5)", + org.wso2.carbon.event.output.adapter.core;version="[5.3,6)", + org.wso2.carbon.event.output.adapter.core.exception;version="[5.3,6)" diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/mqtt/MQTTNotificationStrategy.java b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/mqtt/MQTTNotificationStrategy.java index 0250e5b739..0ab2001496 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/mqtt/MQTTNotificationStrategy.java +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/mqtt/MQTTNotificationStrategy.java @@ -18,22 +18,22 @@ */ package io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.exceptions.InvalidConfigurationException; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; import io.entgra.device.mgt.core.device.mgt.common.push.notification.NotificationContext; import io.entgra.device.mgt.core.device.mgt.common.push.notification.NotificationStrategy; import io.entgra.device.mgt.core.device.mgt.common.push.notification.PushNotificationConfig; import io.entgra.device.mgt.core.device.mgt.common.push.notification.PushNotificationExecutionFailedException; +import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.PolicyOperation; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.ProfileOperation; import io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt.internal.MQTTDataHolder; import io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt.internal.util.MQTTAdapterConstants; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.event.output.adapter.core.MessageType; import org.wso2.carbon.event.output.adapter.core.OutputEventAdapterConfiguration; import org.wso2.carbon.event.output.adapter.core.exception.OutputEventAdapterException; -import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.PolicyOperation; import java.util.HashMap; import java.util.List; diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/mqtt/internal/MQTTDataHolder.java b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/mqtt/internal/MQTTDataHolder.java index 66ef4a5222..31dfbb54de 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/mqtt/internal/MQTTDataHolder.java +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/mqtt/internal/MQTTDataHolder.java @@ -19,7 +19,6 @@ package io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt.internal; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; -import org.wso2.carbon.event.output.adapter.core.OutputEventAdapterConfiguration; import org.wso2.carbon.event.output.adapter.core.OutputEventAdapterService; public class MQTTDataHolder { diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/mqtt/internal/MQTTPushNotificationServiceComponent.java b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/mqtt/internal/MQTTPushNotificationServiceComponent.java index e133a420a8..e9a3c75437 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/mqtt/internal/MQTTPushNotificationServiceComponent.java +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/mqtt/internal/MQTTPushNotificationServiceComponent.java @@ -18,32 +18,22 @@ */ package io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt.internal; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.service.component.ComponentContext; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import org.osgi.service.component.annotations.*; import org.wso2.carbon.event.output.adapter.core.OutputEventAdapterService; -/** - * @scr.component name="io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt.internal.MQTTPushNotificationServiceComponent" immediate="true" - * @scr.reference name="carbon.device.mgt.provider" - * interface="io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService" - * cardinality="1..1" - * policy="dynamic" - * bind="setDeviceManagementProviderService" - * unbind="unsetDeviceManagementProviderService" - * @scr.reference name="event.output.adapter.service" - * interface="org.wso2.carbon.event.output.adapter.core.OutputEventAdapterService" - * cardinality="1..1" - * policy="dynamic" - * bind="setOutputEventAdapterService" - * unbind="unsetOutputEventAdapterService" - */ +@Component( + name = "io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt.internal.MQTTPushNotificationServiceComponent", + immediate = true) public class MQTTPushNotificationServiceComponent { private static final Log log = LogFactory.getLog(MQTTPushNotificationServiceComponent.class); @SuppressWarnings("unused") + @Activate protected void activate(ComponentContext componentContext) { try { if (log.isDebugEnabled()) { @@ -59,11 +49,17 @@ public class MQTTPushNotificationServiceComponent { "implementation bundle", e); } } - + @Deactivate protected void deactivate(ComponentContext componentContext) { //Do nothing } + @Reference( + name = "device.mgt.provider.service", + service = io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetDeviceManagementProviderService") protected void setDeviceManagementProviderService( DeviceManagementProviderService deviceManagementProviderService) { MQTTDataHolder.getInstance().setDeviceManagementProviderService(deviceManagementProviderService); @@ -74,6 +70,12 @@ public class MQTTPushNotificationServiceComponent { MQTTDataHolder.getInstance().setDeviceManagementProviderService(deviceManagementProviderService); } + @Reference( + name = "output.event.adaptor.service", + service = org.wso2.carbon.event.output.adapter.core.OutputEventAdapterService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetOutputEventAdapterService") protected void setOutputEventAdapterService(OutputEventAdapterService outputEventAdapterService){ MQTTDataHolder.getInstance().setOutputEventAdapterService(outputEventAdapterService); } diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/src/test/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/mqtt/MQTTBasedPushNotificationProviderTest.java b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/src/test/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/mqtt/MQTTBasedPushNotificationProviderTest.java index e6e741ebb0..6c70ebdd32 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/src/test/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/mqtt/MQTTBasedPushNotificationProviderTest.java +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/src/test/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/mqtt/MQTTBasedPushNotificationProviderTest.java @@ -18,15 +18,14 @@ package io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt; -import org.mockito.Mockito; -import org.testng.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.push.notification.NotificationStrategy; import io.entgra.device.mgt.core.device.mgt.common.push.notification.PushNotificationConfig; import io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt.internal.MQTTDataHolder; import io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt.internal.util.MQTTAdapterConstants; +import org.mockito.Mockito; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; import org.wso2.carbon.event.output.adapter.core.exception.OutputEventAdapterException; import org.wso2.carbon.event.output.adapter.core.internal.CarbonOutputEventAdapterService; import org.wso2.carbon.registry.core.exceptions.RegistryException; diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/src/test/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/mqtt/MQTTNotificationStrategyTest.java b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/src/test/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/mqtt/MQTTNotificationStrategyTest.java index 767c3c04aa..ab2f108577 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/src/test/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/mqtt/MQTTNotificationStrategyTest.java +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/src/test/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/mqtt/MQTTNotificationStrategyTest.java @@ -18,12 +18,8 @@ package io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt; -import org.mockito.Mockito; -import org.testng.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; +import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; import io.entgra.device.mgt.core.device.mgt.common.push.notification.NotificationContext; import io.entgra.device.mgt.core.device.mgt.common.push.notification.PushNotificationConfig; import io.entgra.device.mgt.core.device.mgt.common.push.notification.PushNotificationExecutionFailedException; @@ -31,19 +27,19 @@ import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.PolicyOperation; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.ProfileOperation; import io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt.internal.MQTTDataHolder; import io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt.internal.util.MQTTAdapterConstants; +import org.mockito.Mockito; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; import org.wso2.carbon.event.output.adapter.core.exception.OutputEventAdapterException; import org.wso2.carbon.event.output.adapter.core.internal.CarbonOutputEventAdapterService; import org.wso2.carbon.registry.core.exceptions.RegistryException; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; -import static io.entgra.device.mgt.core.device.mgt.core.operation.mgt.PolicyOperation.POLICY_OPERATION_CODE; import java.io.IOException; import java.lang.reflect.Field; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Properties; +import java.util.*; + +import static io.entgra.device.mgt.core.device.mgt.core.operation.mgt.PolicyOperation.POLICY_OPERATION_CODE; /* Unit tests for MQTTNotificationStrategy class diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp/pom.xml index c9caa1c7d0..831aff4c26 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp/pom.xml +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp/pom.xml @@ -31,9 +31,14 @@ bundle WSO2 Carbon - XMPP Based Push Notification Provider Implementation WSO2 Carbon - XMPP Based Push Notification Provider Implementation - http://wso2.org + https://entgra.io + + org.apache.felix + org.apache.felix.scr.ds-annotations + provided + org.wso2.carbon.governance org.wso2.carbon.governance.api @@ -63,17 +68,9 @@ org.wso2.carbon.utils - org.wso2.orbit.org.scannotation + io.entgra.org.scannotation scannotation - - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.osgi - org.eclipse.osgi.services - org.wso2.tomcat tomcat @@ -116,8 +113,12 @@ - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -134,17 +135,15 @@ io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp.* - org.apache.commons.logging, - org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + io.entgra.device.mgt.core.device.mgt.common;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.exceptions;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.operation.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.push.notification;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.service;version="[5.0,6)", + org.apache.commons.logging;version="[1.2,2)", org.osgi.service.*;version="${imp.package.version.osgi.service}", - org.wso2.carbon.context, - io.entgra.device.mgt.core.device.mgt.common.operation.mgt, - io.entgra.device.mgt.core.device.mgt.common.push.notification, - io.entgra.device.mgt.core.device.mgt.core.*, - org.wso2.carbon.event.output.adapter.core, - org.wso2.carbon.event.output.adapter.core.exception, - org.wso2.carbon.core, - io.entgra.device.mgt.core.device.mgt.common.* + org.wso2.carbon.event.output.adapter.core;version="[5.3,6)", + org.wso2.carbon.event.output.adapter.core.exception;version="[5.3,6)" diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/xmpp/XMPPNotificationStrategy.java b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/xmpp/XMPPNotificationStrategy.java index 71956c6f4d..485b59f465 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/xmpp/XMPPNotificationStrategy.java +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/xmpp/XMPPNotificationStrategy.java @@ -18,8 +18,6 @@ */ package io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.exceptions.InvalidConfigurationException; import io.entgra.device.mgt.core.device.mgt.common.push.notification.NotificationContext; import io.entgra.device.mgt.core.device.mgt.common.push.notification.NotificationStrategy; @@ -27,6 +25,8 @@ import io.entgra.device.mgt.core.device.mgt.common.push.notification.PushNotific import io.entgra.device.mgt.core.device.mgt.common.push.notification.PushNotificationExecutionFailedException; import io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp.internal.XMPPDataHolder; import io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp.internal.util.XMPPAdapterConstants; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.wso2.carbon.event.output.adapter.core.MessageType; import org.wso2.carbon.event.output.adapter.core.OutputEventAdapterConfiguration; import org.wso2.carbon.event.output.adapter.core.exception.OutputEventAdapterException; diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/xmpp/internal/XMPPPushNotificationServiceComponent.java b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/xmpp/internal/XMPPPushNotificationServiceComponent.java index f31aa5649e..1441907e58 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/xmpp/internal/XMPPPushNotificationServiceComponent.java +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/push/notification/provider/xmpp/internal/XMPPPushNotificationServiceComponent.java @@ -18,32 +18,22 @@ */ package io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp.internal; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.service.component.ComponentContext; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import org.osgi.service.component.annotations.*; import org.wso2.carbon.event.output.adapter.core.OutputEventAdapterService; -/** - * @scr.component name="io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm.internal.XMPPPushNotificationServiceComponent" immediate="true" - * @scr.reference name="carbon.device.mgt.provider" - * interface="io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService" - * cardinality="1..1" - * policy="dynamic" - * bind="setDeviceManagementProviderService" - * unbind="unsetDeviceManagementProviderService" - * @scr.reference name="event.output.adapter.service" - * interface="org.wso2.carbon.event.output.adapter.core.OutputEventAdapterService" - * cardinality="1..1" - * policy="dynamic" - * bind="setOutputEventAdapterService" - * unbind="unsetOutputEventAdapterService" - */ +@Component( + name = "io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp.internal.XMPPPushNotificationServiceComponent", + immediate = true) public class XMPPPushNotificationServiceComponent { private static final Log log = LogFactory.getLog(XMPPPushNotificationServiceComponent.class); @SuppressWarnings("unused") + @Activate protected void activate(ComponentContext componentContext) { try { if (log.isDebugEnabled()) { @@ -59,11 +49,17 @@ public class XMPPPushNotificationServiceComponent { "implementation bundle", e); } } - + @Deactivate protected void deactivate(ComponentContext componentContext) { //Do nothing } + @Reference( + name = "device.mgt.provider.service", + service = io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetDeviceManagementProviderService") protected void setDeviceManagementProviderService( DeviceManagementProviderService deviceManagementProviderService) { XMPPDataHolder.getInstance().setDeviceManagementProviderService(deviceManagementProviderService); @@ -74,6 +70,12 @@ public class XMPPPushNotificationServiceComponent { XMPPDataHolder.getInstance().setDeviceManagementProviderService(deviceManagementProviderService); } + @Reference( + name = "output.event.adaptor.service", + service = org.wso2.carbon.event.output.adapter.core.OutputEventAdapterService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetOutputEventAdapterService") protected void setOutputEventAdapterService(OutputEventAdapterService outputEventAdapterService){ XMPPDataHolder.getInstance().setOutputEventAdapterService(outputEventAdapterService); } diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.stateengine/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.stateengine/pom.xml index 3b8a1bbd9e..cf9c06d78c 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.stateengine/pom.xml +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.stateengine/pom.xml @@ -39,10 +39,10 @@ org.apache.maven.plugins maven-compiler-plugin - - - org.apache.felix - maven-scr-plugin + + 1.8 + 1.8 + org.apache.felix @@ -55,13 +55,13 @@ ${io.entgra.device.mgt.core.version} IoT Device Management State Engine Bundle - org.wso2.carbon.context, - org.wso2.carbon.logging, - org.apache.commons.lang, - org.wso2.carbon.user.api, - org.apache.commons.logging, - org.wso2.carbon.user.core.service, - io.entgra.device.mgt.core.device.mgt.common.* + io.entgra.device.mgt.core.device.mgt.common;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.extensions.stateengine.dto, + io.entgra.device.mgt.core.device.mgt.extensions.stateengine.exception, + org.apache.commons.logging;version="[1.2,2)", + org.wso2.carbon.context;version="[4.8,5)", + org.wso2.carbon.user.api;version="[1.0,2)", + org.wso2.carbon.user.core.service;version="[4.8,5)" io.entgra.device.mgt.core.device.mgt.extensions.stateengine.*, @@ -100,11 +100,15 @@ + + org.apache.felix + org.apache.felix.scr.ds-annotations + provided + org.ops4j.pax.logging pax-logging-api provided - com.google.code.gson diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.stateengine/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/stateengine/spi/DeviceStateMachine.java b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.stateengine/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/stateengine/spi/DeviceStateMachine.java index ce6430f2e6..b77e461f5c 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.stateengine/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/stateengine/spi/DeviceStateMachine.java +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.stateengine/src/main/java/io/entgra/device/mgt/core/device/mgt/extensions/stateengine/spi/DeviceStateMachine.java @@ -19,10 +19,10 @@ package io.entgra.device.mgt.core.device.mgt.extensions.stateengine.spi; -import io.entgra.device.mgt.core.device.mgt.extensions.stateengine.dto.StateUpdateResult; -import io.entgra.device.mgt.core.device.mgt.extensions.stateengine.exception.StateValidationException; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; +import io.entgra.device.mgt.core.device.mgt.extensions.stateengine.dto.StateUpdateResult; +import io.entgra.device.mgt.core.device.mgt.extensions.stateengine.exception.StateValidationException; public interface DeviceStateMachine { diff --git a/components/device-mgt-extensions/pom.xml b/components/device-mgt-extensions/pom.xml index 6bfd0b58f1..8cb618664d 100644 --- a/components/device-mgt-extensions/pom.xml +++ b/components/device-mgt-extensions/pom.xml @@ -31,7 +31,7 @@ pom WSO2 Carbon - Device Management Extensions WSO2 Carbon - Device Management Extensions - http://wso2.org + https://entgra.io io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/pom.xml b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/pom.xml index dd6554598e..3fda1e9898 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/pom.xml +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/pom.xml @@ -31,7 +31,7 @@ war WSO2 Carbon - Mobile Device Management API WSO2 Carbon - Mobile Device Management API - http://wso2.org + https://entgra.io @@ -151,18 +151,6 @@ spring-web provided - - org.apache.cxf.wso2 - cxf-bundle - - - - - - - - - org.apache.cxf cxf-bundle-jaxrs @@ -197,7 +185,6 @@ org.ops4j.pax.logging pax-logging-api provided - io.entgra.device.mgt.core @@ -294,10 +281,6 @@ org.slf4j slf4j-api - - org.wso2.orbit.com.fasterxml.jackson.core - jackson-core - @@ -312,10 +295,6 @@ org.slf4j slf4j-api - - org.wso2.orbit.com.fasterxml.jackson.core - jackson-core - @@ -328,29 +307,10 @@ io.entgra.device.mgt.core.apimgt.annotations provided - - org.wso2.orbit.com.fasterxml.jackson.core - jackson-annotations - org.hibernate hibernate-validator - - javax.ws.rs - javax.ws.rs-api - provided - - - javax.ws.rs - jsr311-api - provided - - - org.wso2.carbon.commons - org.wso2.carbon.application.mgt.stub - provided - org.wso2.carbon.analytics org.wso2.carbon.analytics.api @@ -377,11 +337,6 @@ ${carbon.identity.framework.version} provided - - - - - org.wso2.carbon.analytics-common org.wso2.carbon.event.receiver.stub diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/NotificationContext.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/NotificationContext.java index 80aa17f4c2..0ff3d27782 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/NotificationContext.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/NotificationContext.java @@ -19,10 +19,10 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.Notification; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; @ApiModel(value = "NotificationContext") public class NotificationContext { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/NotificationList.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/NotificationList.java index e00f91690d..ca28621f72 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/NotificationList.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/NotificationList.java @@ -19,9 +19,9 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs; import com.fasterxml.jackson.annotation.JsonProperty; +import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.Notification; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.Notification; import java.util.ArrayList; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/ActivityList.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/ActivityList.java index b3e37930f0..b125d45aa0 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/ActivityList.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/ActivityList.java @@ -20,9 +20,9 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans; import com.fasterxml.jackson.annotation.JsonProperty; import com.google.gson.Gson; +import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Activity; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Activity; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/ApplicationList.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/ApplicationList.java index 1a898ce6ab..e56d10518d 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/ApplicationList.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/ApplicationList.java @@ -19,8 +19,8 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.Application; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/ApplicationWrapper.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/ApplicationWrapper.java index f3abbc671f..3579837f37 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/ApplicationWrapper.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/ApplicationWrapper.java @@ -18,10 +18,10 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.App; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/AuthorizationRequest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/AuthorizationRequest.java index 1681d9493c..c2a335d7fa 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/AuthorizationRequest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/AuthorizationRequest.java @@ -13,9 +13,9 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans; +import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/ComplianceDeviceList.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/ComplianceDeviceList.java index f7cc01bb85..ddb2bc78fe 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/ComplianceDeviceList.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/ComplianceDeviceList.java @@ -19,8 +19,8 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.ComplianceData; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/Credential.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/Credential.java index fdb107cdfe..22de32c9a8 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/Credential.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/Credential.java @@ -17,11 +17,11 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.exception.BadRequestException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.http.HttpStatus; import org.apache.http.util.TextUtils; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.exception.BadRequestException; public class Credential { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/DeviceCompliance.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/DeviceCompliance.java index 32beb664bd..366bd4cece 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/DeviceCompliance.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/DeviceCompliance.java @@ -18,8 +18,8 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans; -import io.swagger.annotations.ApiModel; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.NonComplianceData; +import io.swagger.annotations.ApiModel; @ApiModel(value = "DeviceCompliance", description = "Device's policy compliance status") public class DeviceCompliance { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/DeviceConfig.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/DeviceConfig.java index de326c9b02..6dc18831e7 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/DeviceConfig.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/DeviceConfig.java @@ -17,10 +17,8 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans; -import io.swagger.annotations.ApiModel; import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfiguration; - -import java.util.List; +import io.swagger.annotations.ApiModel; @ApiModel(value = "DeviceConfig", description = "Device config") public class DeviceConfig { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/DeviceList.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/DeviceList.java index 7bc34f4520..ef96ad7ac4 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/DeviceList.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/DeviceList.java @@ -19,8 +19,8 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; import io.entgra.device.mgt.core.device.mgt.common.Device; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/DeviceToGroupsAssignment.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/DeviceToGroupsAssignment.java index 3f00831880..76b9cf3b2e 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/DeviceToGroupsAssignment.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/DeviceToGroupsAssignment.java @@ -19,9 +19,8 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.BasePaginatedResult; +import io.swagger.annotations.ApiModelProperty; import java.util.ArrayList; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/DeviceTypeList.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/DeviceTypeList.java index ba76322923..782b69894c 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/DeviceTypeList.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/DeviceTypeList.java @@ -20,7 +20,6 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; -import io.entgra.device.mgt.core.device.mgt.common.Device; import java.util.ArrayList; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/MetadataList.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/MetadataList.java index c1b1a4e3d5..e11a83a2fb 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/MetadataList.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/MetadataList.java @@ -18,9 +18,9 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans; import com.fasterxml.jackson.annotation.JsonProperty; +import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.Metadata; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.Metadata; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/NotificationList.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/NotificationList.java index d6016bf041..b1f3f2461e 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/NotificationList.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/NotificationList.java @@ -19,9 +19,9 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans; import com.fasterxml.jackson.annotation.JsonProperty; +import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.Notification; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.Notification; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/OperationList.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/OperationList.java index 5b239db162..c65f030d96 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/OperationList.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/OperationList.java @@ -19,8 +19,8 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans; import com.fasterxml.jackson.annotation.JsonProperty; -import io.swagger.annotations.ApiModelProperty; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; +import io.swagger.annotations.ApiModelProperty; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/OperationRequest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/OperationRequest.java index 91d482dedd..b8d21bc390 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/OperationRequest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/OperationRequest.java @@ -13,9 +13,9 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans; +import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/PermissionList.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/PermissionList.java index a2b2c3c5c6..f70130ed6c 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/PermissionList.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/PermissionList.java @@ -21,6 +21,7 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + import java.io.Serializable; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/PolicyList.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/PolicyList.java index f00d4ef566..2a914ffa50 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/PolicyList.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/PolicyList.java @@ -19,9 +19,9 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans; import com.fasterxml.jackson.annotation.JsonProperty; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/PolicyWrapper.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/PolicyWrapper.java index 501fd2c957..091293b215 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/PolicyWrapper.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/PolicyWrapper.java @@ -35,11 +35,11 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.CorrectiveAction; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.DeviceGroupWrapper; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/ProfileFeature.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/ProfileFeature.java index 5f6f829bf8..675e53c201 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/ProfileFeature.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/ProfileFeature.java @@ -19,9 +19,9 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans; import com.google.gson.Gson; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.CorrectiveAction; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.CorrectiveAction; import java.io.Serializable; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/RemoteSessionInfo.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/RemoteSessionInfo.java index 24a788d8d2..65e0eefbf1 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/RemoteSessionInfo.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/RemoteSessionInfo.java @@ -18,12 +18,8 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans; -import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; - -import java.util.List; @ApiModel(value = "RemoteSessionInfo", description = "Template of the remote session") public class RemoteSessionInfo { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/RoleInfo.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/RoleInfo.java index b67a80a9e8..c021050363 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/RoleInfo.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/RoleInfo.java @@ -22,8 +22,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import org.wso2.carbon.user.mgt.common.UIPermissionNode; -import java.util.List; - @ApiModel(value = "RoleInfo", description = "Role details including permission and the users in the roles are " + "wrapped here.") public class RoleInfo { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/analytics/AdapterConfiguration.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/analytics/AdapterConfiguration.java index ad46b9ef24..4d4b7d547e 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/analytics/AdapterConfiguration.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/analytics/AdapterConfiguration.java @@ -18,7 +18,7 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics; import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; + import java.util.List; /** diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/analytics/DeviceTypeEvent.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/analytics/DeviceTypeEvent.java index 724bd3d9d7..5d05cbbb3d 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/analytics/DeviceTypeEvent.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/analytics/DeviceTypeEvent.java @@ -20,8 +20,6 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; -import java.util.List; - /** * This hold stats data record */ diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/analytics/EventAttributeList.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/analytics/EventAttributeList.java index 8b27741ce6..f7827bfe7f 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/analytics/EventAttributeList.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/analytics/EventAttributeList.java @@ -19,8 +19,6 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.BasePaginatedResult; import java.util.ArrayList; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/analytics/EventRecords.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/analytics/EventRecords.java index 670d121bbc..0908fdece6 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/analytics/EventRecords.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/analytics/EventRecords.java @@ -18,13 +18,12 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics; import com.fasterxml.jackson.annotation.JsonProperty; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.BasePaginatedResult; import io.swagger.annotations.ApiModelProperty; -import io.entgra.device.mgt.core.device.mgt.common.Device; +import org.wso2.carbon.analytics.datasource.commons.Record; import java.util.ArrayList; import java.util.List; -import org.wso2.carbon.analytics.datasource.commons.Record; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.BasePaginatedResult; /** * This hold stats data record diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/analytics/EventStream.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/analytics/EventStream.java index 21062d5ff8..a12fa2c1cb 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/analytics/EventStream.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/beans/analytics/EventStream.java @@ -19,7 +19,6 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics; import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; import java.util.List; /** diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/exception/GlobalThrowableMapper.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/exception/GlobalThrowableMapper.java index 67df5e8bea..b465349bf0 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/exception/GlobalThrowableMapper.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/exception/GlobalThrowableMapper.java @@ -19,9 +19,9 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.exception; import com.google.gson.JsonParseException; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtUtil; import javax.naming.AuthenticationException; import javax.ws.rs.ClientErrorException; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/ActivityInfoProviderService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/ActivityInfoProviderService.java index 392e25f683..5ffc9c9956 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/ActivityInfoProviderService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/ActivityInfoProviderService.java @@ -18,35 +18,17 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.ResponseHeader; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Activity; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ActivityList; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.common.ActivityIdList; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Activity; +import io.swagger.annotations.*; -import javax.validation.Valid; import javax.validation.constraints.Size; -import javax.ws.rs.Consumes; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/AnalyticsArtifactsManagementService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/AnalyticsArtifactsManagementService.java index c95cde1ac2..524df31dda 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/AnalyticsArtifactsManagementService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/AnalyticsArtifactsManagementService.java @@ -17,7 +17,6 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api; -import io.swagger.annotations.ApiParam; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; @@ -25,25 +24,10 @@ import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.Adapter; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.EventStream; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.SiddhiExecutionPlan; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; - -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.ResponseHeader; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; +import io.swagger.annotations.*; import javax.validation.Valid; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/ConfigurationManagementService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/ConfigurationManagementService.java index e0719f7055..71d32c4e7f 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/ConfigurationManagementService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/ConfigurationManagementService.java @@ -18,24 +18,12 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Info; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Extension; -import io.swagger.annotations.Tag; -import io.swagger.annotations.Api; -import io.swagger.annotations.AuthorizationScope; -import io.swagger.annotations.Authorization; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.ResponseHeader; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfiguration; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfiguration; +import io.swagger.annotations.*; import javax.ws.rs.*; import javax.ws.rs.core.MediaType; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/DeviceAgentService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/DeviceAgentService.java index 668a21aa46..66f2fff637 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/DeviceAgentService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/DeviceAgentService.java @@ -18,35 +18,17 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.ResponseHeader; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.OperationList; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.entgra.device.mgt.core.device.mgt.common.Device; +import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; +import io.swagger.annotations.*; import javax.validation.Valid; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/DeviceEventManagementService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/DeviceEventManagementService.java index 04bbc205ef..0ec5c44c35 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/DeviceEventManagementService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/DeviceEventManagementService.java @@ -1,32 +1,14 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.ResponseHeader; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.DeviceTypeEvent; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.EventRecords; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.swagger.annotations.*; import javax.validation.Valid; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/DeviceManagementService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/DeviceManagementService.java index b049284d6a..31c0d682cb 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/DeviceManagementService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/DeviceManagementService.java @@ -36,19 +36,10 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.ResponseHeader; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.*; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; import io.entgra.device.mgt.core.device.mgt.common.Feature; @@ -60,28 +51,13 @@ import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.NonComplianceData; import io.entgra.device.mgt.core.device.mgt.common.search.PropertyMap; import io.entgra.device.mgt.core.device.mgt.common.search.SearchContext; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ApplicationList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.OperationRequest; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.OperationStatusBean; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.swagger.annotations.*; import javax.validation.Valid; import javax.validation.constraints.Size; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import java.sql.Timestamp; import java.util.List; /** diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/DeviceTypeManagementService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/DeviceTypeManagementService.java index 7458a4120e..b3d9ed0c60 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/DeviceTypeManagementService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/DeviceTypeManagementService.java @@ -36,33 +36,17 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.ResponseHeader; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfiguration; -import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceTypeList; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfiguration; +import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; +import io.swagger.annotations.*; import javax.validation.constraints.Size; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/GeoLocationBasedService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/GeoLocationBasedService.java index 4dc45420d6..09368928b7 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/GeoLocationBasedService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/GeoLocationBasedService.java @@ -18,36 +18,18 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.ResponseHeader; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; -import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.Alert; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.GeofenceWrapper; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; +import io.entgra.device.mgt.core.device.mgt.common.geo.service.Alert; +import io.swagger.annotations.*; import javax.validation.Valid; import javax.validation.constraints.Size; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/GroupManagementService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/GroupManagementService.java index 4dbd2ded10..b9b539673d 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/GroupManagementService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/GroupManagementService.java @@ -35,40 +35,17 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.ResponseHeader; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; -import org.apache.axis2.transport.http.HTTPConstants; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.*; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceGroupList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceToGroupsAssignment; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.RoleList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.swagger.annotations.*; +import org.apache.axis2.transport.http.HTTPConstants; import javax.validation.Valid; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/MetadataService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/MetadataService.java index 325499fb97..3fed77d445 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/MetadataService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/MetadataService.java @@ -18,35 +18,16 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.ResponseHeader; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; -import org.apache.axis2.transport.http.HTTPConstants; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; -import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.Metadata; -import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.WhiteLabelThemeCreateRequest; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.MetadataList; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.Metadata; +import io.swagger.annotations.*; +import org.apache.axis2.transport.http.HTTPConstants; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/NotificationManagementService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/NotificationManagementService.java index a065e87521..add01212fd 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/NotificationManagementService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/NotificationManagementService.java @@ -18,33 +18,16 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.ResponseHeader; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; -import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.Notification; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.NotificationList; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.Notification; +import io.swagger.annotations.*; import javax.validation.constraints.Size; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/PolicyManagementService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/PolicyManagementService.java index d71d154a14..f34908db6d 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/PolicyManagementService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/PolicyManagementService.java @@ -18,37 +18,19 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.ResponseHeader; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.PolicyWrapper; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.PriorityUpdatedPolicyWrapper; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ProfileFeature; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; +import io.swagger.annotations.*; import javax.validation.Valid; import javax.validation.constraints.Size; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/RemoteSessionService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/RemoteSessionService.java index eec267c7c8..753defa7ab 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/RemoteSessionService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/RemoteSessionService.java @@ -19,20 +19,10 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.ResponseHeader; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.swagger.annotations.*; import javax.validation.constraints.Size; import javax.ws.rs.GET; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/ReportManagementService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/ReportManagementService.java index d4a3582057..c8e7185753 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/ReportManagementService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/ReportManagementService.java @@ -17,37 +17,17 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api; -import com.google.gson.JsonObject; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.ResponseHeader; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.ReportManagementException; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceList; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.ReportManagementException; +import io.swagger.annotations.*; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.Context; -import javax.ws.rs.core.HttpHeaders; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import javax.ws.rs.core.UriInfo; import java.util.List; @SwaggerDefinition( diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/RoleManagementService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/RoleManagementService.java index 54d95b1bad..6d92fcbafa 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/RoleManagementService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/RoleManagementService.java @@ -18,13 +18,13 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api; -import io.swagger.annotations.*; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.RoleInfo; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.RoleList; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.swagger.annotations.*; import org.wso2.carbon.user.mgt.common.UIPermissionNode; import javax.ws.rs.*; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/UserManagementService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/UserManagementService.java index 8d460ae15c..96121cd009 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/UserManagementService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/UserManagementService.java @@ -35,45 +35,16 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api; import com.google.gson.JsonArray; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Info; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Extension; -import io.swagger.annotations.Tag; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.ResponseHeader; -import org.apache.axis2.transport.http.HTTPConstants; -import io.entgra.device.mgt.core.apimgt.annotations.Scopes; import io.entgra.device.mgt.core.apimgt.annotations.Scope; -import io.entgra.device.mgt.core.device.mgt.common.invitation.mgt.DeviceEnrollmentInvitation; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ActivityList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.BasicUserInfo; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.BasicUserInfoList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.Credential; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.EnrollmentInvitation; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.OldPasswordResetWrapper; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.PermissionList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.RoleList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.UserInfo; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.UserStoreList; +import io.entgra.device.mgt.core.apimgt.annotations.Scopes; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.*; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.entgra.device.mgt.core.device.mgt.common.invitation.mgt.DeviceEnrollmentInvitation; +import io.swagger.annotations.*; +import org.apache.axis2.transport.http.HTTPConstants; import javax.validation.Valid; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/WhiteLabelService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/WhiteLabelService.java index 17ca3eb0d6..c7de5ad12f 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/WhiteLabelService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/WhiteLabelService.java @@ -17,30 +17,17 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.ResponseHeader; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; -import io.swagger.annotations.ApiParam; -import org.apache.axis2.transport.http.HTTPConstants; + import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; -import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.Metadata; -import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.WhiteLabelThemeCreateRequest; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.PathParam; +import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.Metadata; +import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.WhiteLabelThemeCreateRequest; +import io.swagger.annotations.*; +import org.apache.axis2.transport.http.HTTPConstants; + +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/ApplicationManagementAdminService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/ApplicationManagementAdminService.java index 5f8ee0de17..1c7eb490cb 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/ApplicationManagementAdminService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/ApplicationManagementAdminService.java @@ -18,22 +18,13 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Info; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Extension; -import io.swagger.annotations.Tag; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Activity; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ApplicationWrapper; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Activity; +import io.swagger.annotations.*; import javax.ws.rs.Consumes; import javax.ws.rs.POST; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/DeviceAccessAuthorizationAdminService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/DeviceAccessAuthorizationAdminService.java index 4ea42d24e0..11f389bf92 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/DeviceAccessAuthorizationAdminService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/DeviceAccessAuthorizationAdminService.java @@ -18,21 +18,13 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; -import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAuthorizationResult; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.AuthorizationRequest; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAuthorizationResult; +import io.swagger.annotations.*; import javax.ws.rs.Consumes; import javax.ws.rs.POST; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/DeviceAnalyticsArtifactUploaderAdminService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/DeviceAnalyticsArtifactUploaderAdminService.java index 44fed757ab..e7d81017c9 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/DeviceAnalyticsArtifactUploaderAdminService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/DeviceAnalyticsArtifactUploaderAdminService.java @@ -19,17 +19,15 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin; -import io.swagger.annotations.*; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.swagger.annotations.*; -import javax.ws.rs.GET; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.PathParam; -import javax.ws.rs.QueryParam; import javax.ws.rs.core.Response; @SwaggerDefinition( diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/DeviceManagementAdminService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/DeviceManagementAdminService.java index 8eaca88ea0..d5baf66089 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/DeviceManagementAdminService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/DeviceManagementAdminService.java @@ -34,35 +34,17 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.ResponseHeader; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; -import org.apache.axis2.transport.http.HTTPConstants; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; -import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceList; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.entgra.device.mgt.core.device.mgt.common.Device; +import io.swagger.annotations.*; +import org.apache.axis2.transport.http.HTTPConstants; import javax.validation.constraints.Size; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.sql.Timestamp; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/DeviceTypeManagementAdminService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/DeviceTypeManagementAdminService.java index 81992cd340..92c2947bbd 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/DeviceTypeManagementAdminService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/DeviceTypeManagementAdminService.java @@ -35,35 +35,18 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.ResponseHeader; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfiguration; -import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceTypeList; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceTypeVersionWrapper; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfiguration; +import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; +import io.swagger.annotations.*; import javax.validation.constraints.Size; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/GroupManagementAdminService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/GroupManagementAdminService.java index 63699f268e..b6b3759db0 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/GroupManagementAdminService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/GroupManagementAdminService.java @@ -35,24 +35,14 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Info; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Extension; -import io.swagger.annotations.Tag; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.ResponseHeader; -import org.apache.axis2.transport.http.HTTPConstants; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceGroupList; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; +import io.swagger.annotations.*; +import org.apache.axis2.transport.http.HTTPConstants; import javax.validation.Valid; import javax.ws.rs.*; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/UserManagementAdminService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/UserManagementAdminService.java index c40a4c36b4..97a4d6c550 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/UserManagementAdminService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/admin/UserManagementAdminService.java @@ -18,14 +18,14 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin; -import io.swagger.annotations.*; -import org.apache.axis2.transport.http.HTTPConstants; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; -import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.PasswordResetWrapper; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.entgra.device.mgt.core.device.mgt.common.Device; +import io.swagger.annotations.*; +import org.apache.axis2.transport.http.HTTPConstants; import javax.validation.constraints.Size; import javax.ws.rs.*; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ActivityProviderServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ActivityProviderServiceImpl.java index 6c3b666343..0d1e4e266b 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ActivityProviderServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ActivityProviderServiceImpl.java @@ -19,31 +19,24 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; import com.google.gson.Gson; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.ActivityPaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Activity; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManagementException; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ActivityList; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.common.ActivityIdList; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.ActivityInfoProviderService; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import io.entgra.device.mgt.core.device.mgt.common.ActivityPaginationRequest; +import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; +import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Activity; +import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; +import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManagementException; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.wso2.carbon.user.api.UserStoreException; import javax.validation.constraints.Size; -import javax.ws.rs.Consumes; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.text.ParseException; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/AnalyticsArtifactsManagementServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/AnalyticsArtifactsManagementServiceImpl.java index a8facadc4d..ab8805ba63 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/AnalyticsArtifactsManagementServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/AnalyticsArtifactsManagementServiceImpl.java @@ -17,23 +17,18 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.Attribute; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.AdapterMappingConfiguration; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.MappingProperty; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.AdapterConfiguration; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.AdapterProperty; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.MessageFormat; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.SiddhiExecutionPlan; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.exception.ArtifactAlreadyExistsException; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.*; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.exception.BadRequestException; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.exception.ErrorDTO; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.exception.InvalidExecutionPlanException; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.exception.NotFoundException; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.exception.*; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.AnalyticsArtifactsManagementService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.Adapter; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.EventStream; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; +import org.apache.axis2.AxisFault; +import org.apache.axis2.client.Stub; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.event.processor.stub.EventProcessorAdminServiceStub; import org.wso2.carbon.event.publisher.stub.EventPublisherAdminServiceStub; import org.wso2.carbon.event.publisher.stub.types.BasicOutputAdapterPropertyDto; @@ -45,20 +40,10 @@ import org.wso2.carbon.event.receiver.stub.types.EventReceiverConfigurationDto; import org.wso2.carbon.event.stream.stub.EventStreamAdminServiceStub; import org.wso2.carbon.event.stream.stub.types.EventStreamAttributeDto; import org.wso2.carbon.event.stream.stub.types.EventStreamDefinitionDto; -import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; import org.wso2.carbon.user.api.UserStoreException; -import org.apache.axis2.AxisFault; -import org.apache.axis2.client.Stub; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - import javax.validation.Valid; -import javax.ws.rs.DELETE; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.Response; import java.rmi.RemoteException; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ConfigurationServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ConfigurationServiceImpl.java index 518a9912a1..ce976dd4c1 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ConfigurationServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ConfigurationServiceImpl.java @@ -18,22 +18,19 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationEntry; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationManagementException; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfiguration; -import io.entgra.device.mgt.core.device.mgt.core.config.ui.UIConfiguration; -import io.entgra.device.mgt.core.device.mgt.core.config.ui.UIConfigurationManager; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.ConfigurationManagementService; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import io.entgra.device.mgt.core.device.mgt.common.MDMAppConstants; +import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationEntry; +import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationManagementException; +import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfiguration; import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagerUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import javax.ws.rs.Consumes; import javax.ws.rs.GET; import javax.ws.rs.HeaderParam; import javax.ws.rs.PUT; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceAgentServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceAgentServiceImpl.java index f821641fb4..9ec42bd7e0 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceAgentServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceAgentServiceImpl.java @@ -22,10 +22,13 @@ import com.google.gson.Gson; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonParser; -import org.apache.axis2.AxisFault; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.OperationList; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.Attribute; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.AttributeType; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.EventAttributeList; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.DeviceAgentService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; @@ -38,29 +41,20 @@ import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManage import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.ComplianceFeature; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.PolicyComplianceException; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.OperationList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.Attribute; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.AttributeType; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.EventAttributeList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.DeviceAgentService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; -import org.wso2.carbon.event.stream.stub.EventStreamAdminServiceStub; -import org.wso2.carbon.event.stream.stub.types.EventStreamAttributeDto; -import org.wso2.carbon.event.stream.stub.types.EventStreamDefinitionDto; import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; import io.entgra.device.mgt.core.policy.mgt.common.PolicyAdministratorPoint; import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; +import org.apache.axis2.AxisFault; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; +import org.wso2.carbon.event.stream.stub.EventStreamAdminServiceStub; +import org.wso2.carbon.event.stream.stub.types.EventStreamAttributeDto; +import org.wso2.carbon.event.stream.stub.types.EventStreamDefinitionDto; import org.wso2.carbon.user.api.UserStoreException; import javax.validation.Valid; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.Response; import java.rmi.RemoteException; import java.util.ArrayList; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceEventManagementServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceEventManagementServiceImpl.java index 2bb854160b..c2d79f8dc1 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceEventManagementServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceEventManagementServiceImpl.java @@ -2,9 +2,15 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; import io.entgra.device.mgt.core.apimgt.analytics.extension.AnalyticsArtifactsDeployer; import io.entgra.device.mgt.core.apimgt.analytics.extension.dto.*; -import io.entgra.device.mgt.core.apimgt.analytics.extension.exception.EventReceiverDeployerException; import io.entgra.device.mgt.core.apimgt.analytics.extension.exception.EventPublisherDeployerException; +import io.entgra.device.mgt.core.apimgt.analytics.extension.exception.EventReceiverDeployerException; import io.entgra.device.mgt.core.apimgt.analytics.extension.exception.EventStreamDeployerException; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.*; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.DeviceEventManagementService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; +import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; import org.apache.axis2.AxisFault; import org.apache.axis2.client.Stub; import org.apache.commons.lang.StringUtils; @@ -14,15 +20,6 @@ import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.databridge.commons.StreamDefinition; import org.wso2.carbon.databridge.commons.exception.MalformedStreamDefinitionException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.Attribute; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.AttributeType; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.DeviceTypeEvent; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.EventAttributeList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.TransportType; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.DeviceEventManagementService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import org.wso2.carbon.event.input.adapter.core.InputEventAdapterConfiguration; import org.wso2.carbon.event.output.adapter.core.OutputEventAdapterConfiguration; import org.wso2.carbon.event.publisher.core.EventPublisherService; @@ -46,7 +43,6 @@ import org.wso2.carbon.event.stream.core.exception.EventStreamConfigurationExcep import org.wso2.carbon.event.stream.stub.EventStreamAdminServiceStub; import org.wso2.carbon.event.stream.stub.types.EventStreamAttributeDto; import org.wso2.carbon.event.stream.stub.types.EventStreamDefinitionDto; -import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; import org.wso2.carbon.user.api.UserStoreException; import javax.validation.Valid; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceManagementServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceManagementServiceImpl.java index 4e6fb4446e..556f6c494a 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceManagementServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceManagementServiceImpl.java @@ -37,25 +37,24 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; import com.google.gson.Gson; -import io.entgra.device.mgt.core.application.mgt.common.ApplicationInstallResponse; -import io.entgra.device.mgt.core.application.mgt.common.SubscriptionType; -import io.entgra.device.mgt.core.application.mgt.common.exception.SubscriptionManagementException; -import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationManager; -import io.entgra.device.mgt.core.application.mgt.common.services.SubscriptionManager; -import io.entgra.device.mgt.core.application.mgt.core.util.HelperUtil; -import org.apache.commons.httpclient.HttpStatus; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.json.JSONObject; import io.entgra.device.mgt.core.apimgt.keymgt.extension.DCRResponse; import io.entgra.device.mgt.core.apimgt.keymgt.extension.TokenRequest; import io.entgra.device.mgt.core.apimgt.keymgt.extension.TokenResponse; import io.entgra.device.mgt.core.apimgt.keymgt.extension.exception.KeyMgtException; import io.entgra.device.mgt.core.apimgt.keymgt.extension.service.KeyMgtService; import io.entgra.device.mgt.core.apimgt.keymgt.extension.service.KeyMgtServiceImpl; -import org.wso2.carbon.context.CarbonContext; -import org.wso2.carbon.context.PrivilegedCarbonContext; +import io.entgra.device.mgt.core.application.mgt.common.ApplicationInstallResponse; +import io.entgra.device.mgt.core.application.mgt.common.SubscriptionType; +import io.entgra.device.mgt.core.application.mgt.common.exception.SubscriptionManagementException; +import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationManager; +import io.entgra.device.mgt.core.application.mgt.common.services.SubscriptionManager; +import io.entgra.device.mgt.core.application.mgt.core.util.HelperUtil; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.*; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.DeviceManagementService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.InputValidationException; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import io.entgra.device.mgt.core.device.mgt.common.*; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.Application; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.ApplicationManagementException; @@ -82,7 +81,6 @@ import io.entgra.device.mgt.core.device.mgt.common.type.mgt.DeviceStatus; import io.entgra.device.mgt.core.device.mgt.core.app.mgt.ApplicationManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceManagementConfig; -import io.entgra.device.mgt.core.device.mgt.core.dao.TrackerManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.device.details.mgt.DeviceDetailsMgtException; import io.entgra.device.mgt.core.device.mgt.core.device.details.mgt.DeviceInformationManager; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; @@ -93,22 +91,19 @@ import io.entgra.device.mgt.core.device.mgt.core.search.mgt.SearchManagerService import io.entgra.device.mgt.core.device.mgt.core.search.mgt.SearchMgtException; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.service.GroupManagementProviderService; -import io.entgra.device.mgt.core.device.mgt.core.traccar.api.service.DeviceAPIClientService; -import io.entgra.device.mgt.core.device.mgt.core.traccar.common.TraccarHandlerConstants; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; -import io.entgra.device.mgt.core.device.mgt.core.util.HttpReportingUtil; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.*; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.DeviceManagementService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.InputValidationException; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import io.entgra.device.mgt.core.identity.jwt.client.extension.JWTClient; import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.AccessTokenInfo; import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; import io.entgra.device.mgt.core.identity.jwt.client.extension.service.JWTClientManagerService; import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService; +import org.apache.commons.httpclient.HttpStatus; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.CarbonContext; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.utils.multitenancy.MultitenantUtils; @@ -122,7 +117,6 @@ import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Properties; -import java.util.concurrent.ExecutionException; @Path("/devices") public class DeviceManagementServiceImpl implements DeviceManagementService { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceTypeManagementServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceTypeManagementServiceImpl.java index 696c327dce..5eeb591119 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceTypeManagementServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceTypeManagementServiceImpl.java @@ -35,31 +35,27 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceTypeNotFoundException; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.DeviceTypeManagementService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.InputValidationException; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import io.entgra.device.mgt.core.device.mgt.common.Feature; import io.entgra.device.mgt.core.device.mgt.common.FeatureManager; +import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfiguration; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceTypeNotFoundException; import io.entgra.device.mgt.core.device.mgt.common.push.notification.PushNotificationConfig; import io.entgra.device.mgt.core.device.mgt.common.type.mgt.DeviceTypeMetaDefinition; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.DeviceTypeManagementService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.InputValidationException; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.validation.constraints.Size; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.Response; import java.util.ArrayList; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GeoLocationBasedServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GeoLocationBasedServiceImpl.java index 56b30ff0a6..85c4127ab9 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GeoLocationBasedServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GeoLocationBasedServiceImpl.java @@ -22,44 +22,6 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.google.gson.Gson; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpStatus; -import org.wso2.carbon.analytics.api.AnalyticsDataAPI; -import org.wso2.carbon.analytics.api.AnalyticsDataAPIUtil; -//import org.wso2.carbon.analytics.dataservice.commons.AnalyticsDataResponse; -//import org.wso2.carbon.analytics.dataservice.commons.SearchResultEntry; -//import org.wso2.carbon.analytics.dataservice.commons.SortByField; -//import org.wso2.carbon.analytics.dataservice.commons.SortType; -//import org.wso2.carbon.analytics.datasource.commons.Record; -//import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException; -import org.wso2.carbon.context.CarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; -import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants.GeoServices; -import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; -import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; -import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAccessAuthorizationException; -import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfig; -import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfigurationException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.Alert; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.AlertAlreadyExistException; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.Event; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoCluster; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoCoordinate; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoFence; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoLocationBasedServiceException; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoLocationProviderService; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoQuery; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeofenceData; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroupConstants; -import io.entgra.device.mgt.core.device.mgt.core.geo.geoHash.geoHashStrategy.GeoHashLengthStrategy; -import io.entgra.device.mgt.core.device.mgt.core.geo.geoHash.geoHashStrategy.ZoomGeoHashLengthStrategy; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; -import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.EventAction; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.GeofenceWrapper; @@ -70,27 +32,31 @@ import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestV import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtUtil; -import org.wso2.carbon.user.api.UserStoreException; -import org.wso2.carbon.utils.multitenancy.MultitenantUtils; - -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import io.entgra.device.mgt.core.device.mgt.common.*; +import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants.GeoServices; +import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAccessAuthorizationException; +import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfig; +import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfigurationException; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; +import io.entgra.device.mgt.core.device.mgt.common.geo.service.*; +import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroupConstants; +import io.entgra.device.mgt.core.device.mgt.core.geo.geoHash.geoHashStrategy.GeoHashLengthStrategy; +import io.entgra.device.mgt.core.device.mgt.core.geo.geoHash.geoHashStrategy.ZoomGeoHashLengthStrategy; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.http.HttpStatus; +import org.wso2.carbon.analytics.api.AnalyticsDataAPI; + +import javax.ws.rs.*; import javax.ws.rs.core.Response; import java.io.IOException; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Collections; import java.util.Date; -import java.util.HashMap; import java.util.List; -import java.util.Map; /** * The api for diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GroupManagementServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GroupManagementServiceImpl.java index e6980b9900..f55d69dd94 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GroupManagementServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GroupManagementServiceImpl.java @@ -35,26 +35,6 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.CarbonConstants; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; -import io.entgra.device.mgt.core.device.mgt.common.GroupPaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceNotFoundException; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroupConstants; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceTypesOfGroups; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupAlreadyExistException; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupManagementException; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupNotExistException; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.RoleDoesNotExistException; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; -import io.entgra.device.mgt.core.device.mgt.core.service.GroupManagementProviderService; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceGroupList; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceList; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceToGroupsAssignment; @@ -62,14 +42,20 @@ import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.RoleList; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.GroupManagementService; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import io.entgra.device.mgt.core.device.mgt.common.*; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceNotFoundException; +import io.entgra.device.mgt.core.device.mgt.common.group.mgt.*; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import io.entgra.device.mgt.core.device.mgt.core.service.GroupManagementProviderService; import io.entgra.device.mgt.core.policy.mgt.common.PolicyAdministratorPoint; import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.CarbonConstants; +import org.wso2.carbon.context.PrivilegedCarbonContext; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.Path; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.Response; import java.util.ArrayList; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/MetadataServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/MetadataServiceImpl.java index 478e382f19..6ed5e8198c 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/MetadataServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/MetadataServiceImpl.java @@ -18,43 +18,28 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; -import org.apache.commons.io.IOUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.MetadataList; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.MetadataService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; import io.entgra.device.mgt.core.device.mgt.common.exceptions.MetadataKeyAlreadyExistsException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.MetadataKeyNotFoundException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.NotFoundException; -import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.Metadata; import io.entgra.device.mgt.core.device.mgt.common.exceptions.MetadataManagementException; +import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.Metadata; import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.MetadataManagementService; -import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.WhiteLabelTheme; -import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.WhiteLabelThemeCreateRequest; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.MetadataList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.MetadataService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import javax.ws.rs.*; +import javax.ws.rs.core.MediaType; +import javax.ws.rs.core.Response; import java.io.ByteArrayInputStream; import java.io.IOException; -import java.io.InputStream; import java.util.List; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; - /** * This is the service class for metadata management. */ diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/NotificationManagementServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/NotificationManagementServiceImpl.java index 6cd83dca86..3c4d010f43 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/NotificationManagementServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/NotificationManagementServiceImpl.java @@ -18,28 +18,21 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.CarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; -import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.Notification; -import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.NotificationManagementException; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.NotificationList; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.NotificationManagementService; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; +import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; +import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.Notification; +import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.NotificationManagementException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.CarbonContext; import javax.validation.constraints.Size; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/PolicyManagementServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/PolicyManagementServiceImpl.java index 05e9d39be7..52c50fefea 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/PolicyManagementServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/PolicyManagementServiceImpl.java @@ -35,30 +35,26 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAccessAuthorizationException; -import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAccessAuthorizationService; -import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.PolicyList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.PolicyWrapper; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.PriorityUpdatedPolicyWrapper; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ProfileFeature; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.*; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.PolicyManagementService; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.FilteringUtil; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtUtil; +import io.entgra.device.mgt.core.device.mgt.common.Device; +import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; +import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; +import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAccessAuthorizationException; +import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAccessAuthorizationService; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; +import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; import io.entgra.device.mgt.core.policy.mgt.common.PolicyAdministratorPoint; import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import javax.validation.Valid; import javax.ws.rs.*; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/RemoteSessionServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/RemoteSessionServiceImpl.java index b6cf1aed39..0fe485a6c8 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/RemoteSessionServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/RemoteSessionServiceImpl.java @@ -18,19 +18,15 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.RemoteSessionInfo; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.RemoteSessionService; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceManagementConfig; import io.entgra.device.mgt.core.device.mgt.core.config.remote.session.RemoteSessionConfiguration; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.RemoteSessionInfo; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.RemoteSessionService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; +import javax.ws.rs.*; import javax.ws.rs.core.Response; /** diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ReportManagementServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ReportManagementServiceImpl.java index d51813c93d..5dc0ae62d9 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ReportManagementServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ReportManagementServiceImpl.java @@ -19,30 +19,24 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; import com.google.gson.JsonObject; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceList; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.ReportManagementService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; +import io.entgra.device.mgt.core.device.mgt.common.ReportFiltersList; import io.entgra.device.mgt.core.device.mgt.common.exceptions.BadRequestException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceTypeNotFoundException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.ReportManagementException; import io.entgra.device.mgt.core.device.mgt.core.report.mgt.Constants; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceList; -import io.entgra.device.mgt.core.device.mgt.common.ReportFiltersList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.ReportManagementService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import javax.ws.rs.Consumes; -import javax.ws.rs.DefaultValue; -import javax.ws.rs.GET; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/RoleManagementServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/RoleManagementServiceImpl.java index bf457dbd96..046b49c9e6 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/RoleManagementServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/RoleManagementServiceImpl.java @@ -34,12 +34,6 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.CarbonConstants; -import org.wso2.carbon.base.MultitenantConstants; -import org.wso2.carbon.context.CarbonContext; -import org.wso2.carbon.context.RegistryType; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.RoleInfo; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.RoleList; @@ -49,6 +43,12 @@ import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestV import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.SetReferenceTransformer; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.CarbonConstants; +import org.wso2.carbon.base.MultitenantConstants; +import org.wso2.carbon.context.CarbonContext; +import org.wso2.carbon.context.RegistryType; import org.wso2.carbon.registry.api.Registry; import org.wso2.carbon.registry.core.session.UserRegistry; import org.wso2.carbon.registry.resource.services.utils.ChangeRolePermissionsUtil; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/UserManagementServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/UserManagementServiceImpl.java index f699e8c022..9a03d154dd 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/UserManagementServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/UserManagementServiceImpl.java @@ -35,16 +35,16 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; import com.google.gson.JsonArray; import com.google.gson.JsonObject; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpStatus; -import org.eclipse.wst.common.uriresolver.internal.util.URIEncoder; -import org.wso2.carbon.context.CarbonContext; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.*; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.exception.BadRequestException; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.UserManagementService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.CredentialManagementResponseBuilder; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationManagementException; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.OTPManagementException; import io.entgra.device.mgt.core.device.mgt.common.invitation.mgt.DeviceEnrollmentInvitation; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Activity; @@ -53,24 +53,13 @@ import io.entgra.device.mgt.core.device.mgt.common.spi.OTPManagementService; import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.service.EmailMetaInfo; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ActivityList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.BasicUserInfo; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.BasicUserInfoList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.BasicUserInfoWrapper; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.Credential; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.EnrollmentInvitation; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.OldPasswordResetWrapper; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.PermissionList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.RoleList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.UserInfo; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.UserStoreList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.exception.BadRequestException; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.UserManagementService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.CredentialManagementResponseBuilder; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.http.HttpStatus; +import org.eclipse.wst.common.uriresolver.internal.util.URIEncoder; +import org.wso2.carbon.context.CarbonContext; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.identity.claim.metadata.mgt.ClaimMetadataManagementAdminService; import org.wso2.carbon.identity.claim.metadata.mgt.dto.AttributeMappingDTO; import org.wso2.carbon.identity.claim.metadata.mgt.dto.ClaimPropertyDTO; @@ -78,11 +67,7 @@ import org.wso2.carbon.identity.claim.metadata.mgt.dto.LocalClaimDTO; import org.wso2.carbon.identity.claim.metadata.mgt.exception.ClaimMetadataException; import org.wso2.carbon.identity.user.store.count.UserStoreCountRetriever; import org.wso2.carbon.identity.user.store.count.exception.UserStoreCounterException; -import org.wso2.carbon.user.api.Permission; -import org.wso2.carbon.user.api.RealmConfiguration; -import org.wso2.carbon.user.api.UserRealm; -import org.wso2.carbon.user.api.UserStoreException; -import org.wso2.carbon.user.api.UserStoreManager; +import org.wso2.carbon.user.api.*; import org.wso2.carbon.user.core.UserCoreConstants; import org.wso2.carbon.user.core.service.RealmService; import org.wso2.carbon.user.mgt.UserRealmProxy; @@ -91,16 +76,7 @@ import org.wso2.carbon.user.mgt.common.UserAdminException; import org.wso2.carbon.utils.CarbonUtils; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.io.File; @@ -111,15 +87,8 @@ import java.security.SecureRandom; import java.text.ParseException; import java.text.SimpleDateFormat; import java.time.Instant; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; import java.util.Properties; -import java.util.Set; +import java.util.*; @Path("/users") @Produces(MediaType.APPLICATION_JSON) diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/WhiteLabelServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/WhiteLabelServiceImpl.java index 900176a384..0c40c47fae 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/WhiteLabelServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/WhiteLabelServiceImpl.java @@ -18,24 +18,20 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.WhiteLabelService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import io.entgra.device.mgt.core.device.mgt.common.FileResponse; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.MetadataManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.NotFoundException; import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.WhiteLabelTheme; import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.WhiteLabelThemeCreateRequest; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.WhiteLabelService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.PathParam; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; + +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.io.ByteArrayInputStream; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/ApplicationManagementAdminServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/ApplicationManagementAdminServiceImpl.java index f455e4d5d1..0ff55def7a 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/ApplicationManagementAdminServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/ApplicationManagementAdminServiceImpl.java @@ -18,23 +18,23 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.admin; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ApplicationWrapper; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin.ApplicationManagementAdminService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.Platform; +import io.entgra.device.mgt.core.device.mgt.common.app.mgt.App; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.ApplicationManagementException; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.ApplicationManager; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.UnknownApplicationTypeException; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Activity; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.UnknownApplicationTypeException; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin.ApplicationManagementAdminService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import io.entgra.device.mgt.core.device.mgt.core.util.MDMAndroidOperationUtil; import io.entgra.device.mgt.core.device.mgt.core.util.MDMIOSOperationUtil; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ApplicationWrapper; -import io.entgra.device.mgt.core.device.mgt.common.app.mgt.App; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.ws.rs.Consumes; import javax.ws.rs.POST; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/DeviceAccessAuthorizationAdminServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/DeviceAccessAuthorizationAdminServiceImpl.java index c2c7aebc04..a79c1a3b7b 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/DeviceAccessAuthorizationAdminServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/DeviceAccessAuthorizationAdminServiceImpl.java @@ -18,17 +18,17 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.admin; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.AuthorizationRequest; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin.DeviceAccessAuthorizationAdminService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAccessAuthorizationException; +import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAuthorizationResult; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAccessAuthorizationException; -import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAuthorizationResult; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.AuthorizationRequest; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin.DeviceAccessAuthorizationAdminService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import javax.ws.rs.Consumes; import javax.ws.rs.POST; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/DeviceAnalyticsArtifactUploaderAdminServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/DeviceAnalyticsArtifactUploaderAdminServiceImpl.java index 56298ce36a..b66badc40c 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/DeviceAnalyticsArtifactUploaderAdminServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/DeviceAnalyticsArtifactUploaderAdminServiceImpl.java @@ -18,6 +18,10 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.admin; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin.DeviceAnalyticsArtifactUploaderAdminService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import io.entgra.device.mgt.core.identity.jwt.client.extension.JWTClient; +import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; import org.apache.axis2.AxisFault; import org.apache.axis2.client.Options; import org.apache.axis2.client.Stub; @@ -32,23 +36,15 @@ import org.apache.commons.logging.LogFactory; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; -import org.wso2.carbon.application.mgt.stub.upload.CarbonAppUploaderStub; -import org.wso2.carbon.application.mgt.stub.upload.types.carbon.UploadedFileItem; import org.wso2.carbon.base.ServerConfiguration; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.core.util.Utils; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin.DeviceAnalyticsArtifactUploaderAdminService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; -import io.entgra.device.mgt.core.identity.jwt.client.extension.JWTClient; -import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; -import org.wso2.carbon.registry.core.exceptions.RegistryException; -import org.wso2.carbon.user.api.UserStoreException; -import org.wso2.carbon.utils.CarbonUtils; import org.wso2.carbon.event.receiver.stub.EventReceiverAdminServiceStub; import org.wso2.carbon.event.stream.stub.EventStreamAdminServiceStub; +import org.wso2.carbon.user.api.UserStoreException; +import org.wso2.carbon.utils.CarbonUtils; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; -import javax.activation.DataHandler; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManagerFactory; @@ -59,11 +55,7 @@ import javax.ws.rs.core.Response; import java.io.*; import java.nio.file.Files; import java.rmi.RemoteException; -import java.security.KeyManagementException; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.UnrecoverableKeyException; +import java.security.*; import java.security.cert.CertificateException; import java.util.ArrayList; import java.util.List; @@ -177,10 +169,11 @@ public class DeviceAnalyticsArtifactUploaderAdminServiceImpl implements DeviceAn if (streamFileList != null) { publishDynamicEventStream(type, tenantDomain, streamFileList); } - if (deployAnalyticsCapp(type, list)){ - return Response.status(Response.Status.BAD_REQUEST) - .entity("\"Error, Artifact does not exist.\"").build(); - } + //todo:analytics +// if (deployAnalyticsCapp(type, list)){ +// return Response.status(Response.Status.BAD_REQUEST) +// .entity("\"Error, Artifact does not exist.\"").build(); +// } if (receiverFileList != null) { publishDynamicEventReceivers(type, tenantDomain, receiverFileList); } @@ -202,62 +195,64 @@ public class DeviceAnalyticsArtifactUploaderAdminServiceImpl implements DeviceAn KeyManagementException | IOException | NoSuchAlgorithmException e) { log.error("Failed to access keystore for, tenantDomain: " + tenantDomain, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); - } catch (RegistryException e) { - log.error("Failed to load tenant, tenantDomain: " + tenantDomain, e); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); + //todo:analytics +// } catch (RegistryException e) { +// log.error("Failed to load tenant, tenantDomain: " + tenantDomain, e); +// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); } catch (ParseException e) { log.error("Invalid stream definition for device type" + type + " for tenant, tenantDomain: " + tenantDomain, e); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); } } - private boolean deployAnalyticsCapp(@PathParam("type") String type, List
list) throws IOException, RegistryException { - CarbonAppUploaderStub carbonAppUploaderStub = null; - try { - File directory = new File(CAR_FILE_LOCATION + File.separator + type); - if (directory.isDirectory() && directory.exists()) { - UploadedFileItem[] uploadedFileItems = loadCappFromFileSystem(type); - if (uploadedFileItems.length > 0) { - if (DEVICE_MANAGEMENT_TYPE.equals(type.toLowerCase())) { - carbonAppUploaderStub = new CarbonAppUploaderStub(Utils.replaceSystemProperty( - IOT_MGT_URL)); - Options appUploaderOptions = carbonAppUploaderStub._getServiceClient().getOptions(); - if (appUploaderOptions == null) { - appUploaderOptions = new Options(); - } - appUploaderOptions.setProperty(HTTPConstants.HTTP_HEADERS, list); - appUploaderOptions.setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER - , new Protocol(DEFAULT_HTTP_PROTOCOL, - (ProtocolSocketFactory) new SSLProtocolSocketFactory - (sslContext), Integer.parseInt(Utils.replaceSystemProperty( - IOT_MGT_PORT)))); - - carbonAppUploaderStub._getServiceClient().setOptions(appUploaderOptions); - carbonAppUploaderStub.uploadApp(uploadedFileItems); - } else { - carbonAppUploaderStub = new CarbonAppUploaderStub(Utils.replaceSystemProperty(DAS_URL)); - Options appUploaderOptions = carbonAppUploaderStub._getServiceClient().getOptions(); - if (appUploaderOptions == null) { - appUploaderOptions = new Options(); - } - appUploaderOptions.setProperty(HTTPConstants.HTTP_HEADERS, list); - appUploaderOptions.setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER - , new Protocol(DEFAULT_HTTP_PROTOCOL - , (ProtocolSocketFactory) new SSLProtocolSocketFactory(sslContext) - , Integer.parseInt(Utils.replaceSystemProperty(DAS_PORT)))); - - carbonAppUploaderStub._getServiceClient().setOptions(appUploaderOptions); - carbonAppUploaderStub.uploadApp(uploadedFileItems); - } - } - } else { - return true; - } - return false; - } finally { - cleanup(carbonAppUploaderStub); - } - } + //todo:analytics +// private boolean deployAnalyticsCapp(@PathParam("type") String type, List
list) throws IOException, RegistryException { +// CarbonAppUploaderStub carbonAppUploaderStub = null; +// try { +// File directory = new File(CAR_FILE_LOCATION + File.separator + type); +// if (directory.isDirectory() && directory.exists()) { +// UploadedFileItem[] uploadedFileItems = loadCappFromFileSystem(type); +// if (uploadedFileItems.length > 0) { +// if (DEVICE_MANAGEMENT_TYPE.equals(type.toLowerCase())) { +// carbonAppUploaderStub = new CarbonAppUploaderStub(Utils.replaceSystemProperty( +// IOT_MGT_URL)); +// Options appUploaderOptions = carbonAppUploaderStub._getServiceClient().getOptions(); +// if (appUploaderOptions == null) { +// appUploaderOptions = new Options(); +// } +// appUploaderOptions.setProperty(HTTPConstants.HTTP_HEADERS, list); +// appUploaderOptions.setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER +// , new Protocol(DEFAULT_HTTP_PROTOCOL, +// (ProtocolSocketFactory) new SSLProtocolSocketFactory +// (sslContext), Integer.parseInt(Utils.replaceSystemProperty( +// IOT_MGT_PORT)))); +// +// carbonAppUploaderStub._getServiceClient().setOptions(appUploaderOptions); +// carbonAppUploaderStub.uploadApp(uploadedFileItems); +// } else { +// carbonAppUploaderStub = new CarbonAppUploaderStub(Utils.replaceSystemProperty(DAS_URL)); +// Options appUploaderOptions = carbonAppUploaderStub._getServiceClient().getOptions(); +// if (appUploaderOptions == null) { +// appUploaderOptions = new Options(); +// } +// appUploaderOptions.setProperty(HTTPConstants.HTTP_HEADERS, list); +// appUploaderOptions.setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER +// , new Protocol(DEFAULT_HTTP_PROTOCOL +// , (ProtocolSocketFactory) new SSLProtocolSocketFactory(sslContext) +// , Integer.parseInt(Utils.replaceSystemProperty(DAS_PORT)))); +// +// carbonAppUploaderStub._getServiceClient().setOptions(appUploaderOptions); +// carbonAppUploaderStub.uploadApp(uploadedFileItems); +// } +// } +// } else { +// return true; +// } +// return false; +// } finally { +// cleanup(carbonAppUploaderStub); +// } +// } private void publishDynamicEventReceivers(String deviceType, String tenantDomain, List receiversList) throws IOException, UserStoreException, JWTClientException { @@ -407,31 +402,32 @@ public class DeviceAnalyticsArtifactUploaderAdminServiceImpl implements DeviceAn return streamList; } - private UploadedFileItem[] loadCappFromFileSystem(String deviceType) throws IOException { - - File directory = new File(CAR_FILE_LOCATION + File.separator + deviceType); - File[] carFiles = directory.listFiles(new FilenameFilter() { - @Override - public boolean accept(File dir, String name) { - return name.toLowerCase().endsWith(".car"); - } - }); - List uploadedFileItemLis = new ArrayList<>(); - if (carFiles != null) { - - for (File carFile : carFiles) { - UploadedFileItem uploadedFileItem = new UploadedFileItem(); - DataHandler param = new DataHandler(carFile.toURI().toURL()); - uploadedFileItem.setDataHandler(param); - uploadedFileItem.setFileName(carFile.getName()); - uploadedFileItem.setFileType("jar"); - uploadedFileItemLis.add(uploadedFileItem); - } - } - UploadedFileItem[] fileItems = new UploadedFileItem[uploadedFileItemLis.size()]; - fileItems = uploadedFileItemLis.toArray(fileItems); - return fileItems; - } + //todo:analytics +// private UploadedFileItem[] loadCappFromFileSystem(String deviceType) throws IOException { +// +// File directory = new File(CAR_FILE_LOCATION + File.separator + deviceType); +// File[] carFiles = directory.listFiles(new FilenameFilter() { +// @Override +// public boolean accept(File dir, String name) { +// return name.toLowerCase().endsWith(".car"); +// } +// }); +// List uploadedFileItemLis = new ArrayList<>(); +// if (carFiles != null) { +// +// for (File carFile : carFiles) { +// UploadedFileItem uploadedFileItem = new UploadedFileItem(); +// DataHandler param = new DataHandler(carFile.toURI().toURL()); +// uploadedFileItem.setDataHandler(param); +// uploadedFileItem.setFileName(carFile.getName()); +// uploadedFileItem.setFileType("jar"); +// uploadedFileItemLis.add(uploadedFileItem); +// } +// } +// UploadedFileItem[] fileItems = new UploadedFileItem[uploadedFileItemLis.size()]; +// fileItems = uploadedFileItemLis.toArray(fileItems); +// return fileItems; +// } /** * Loads the keystore. diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/DeviceManagementAdminServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/DeviceManagementAdminServiceImpl.java index 3885dab5f6..34fef0d4e5 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/DeviceManagementAdminServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/DeviceManagementAdminServiceImpl.java @@ -34,45 +34,29 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.admin; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.base.MultitenantConstants; -import org.wso2.carbon.context.CarbonContext; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; -import io.entgra.device.mgt.core.device.mgt.common.MDMAppConstants; -import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceList; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin.DeviceManagementAdminService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import io.entgra.device.mgt.core.device.mgt.common.*; import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationEntry; import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationManagementException; import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfiguration; import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService; import io.entgra.device.mgt.core.device.mgt.common.exceptions.BadRequestException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceNotFoundException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.InvalidDeviceException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.UserNotFoundException; -import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; -import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.Metadata; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.*; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin.DeviceManagementAdminService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.base.MultitenantConstants; +import org.wso2.carbon.context.CarbonContext; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.core.service.RealmService; import javax.validation.constraints.Size; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.sql.Timestamp; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/DeviceTypeManagementAdminServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/DeviceTypeManagementAdminServiceImpl.java index 5ffea17ab3..01282b6e08 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/DeviceTypeManagementAdminServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/DeviceTypeManagementAdminServiceImpl.java @@ -36,31 +36,23 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.admin; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.base.MultitenantConstants; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceTypeVersionWrapper; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin.DeviceTypeManagementAdminService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfiguration; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.spi.DeviceManagementService; import io.entgra.device.mgt.core.device.mgt.common.type.mgt.DeviceTypeMetaDefinition; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceTypeVersion; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceTypeVersionWrapper; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin.DeviceTypeManagementAdminService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.base.MultitenantConstants; +import org.wso2.carbon.context.PrivilegedCarbonContext; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.PathParam; -import javax.ws.rs.Produces; -import javax.ws.rs.core.MediaType; +import javax.ws.rs.*; import javax.ws.rs.core.Response; import java.util.List; import java.util.regex.Matcher; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/GroupManagementAdminServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/GroupManagementAdminServiceImpl.java index 6a70868825..b37fc595bf 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/GroupManagementAdminServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/GroupManagementAdminServiceImpl.java @@ -34,18 +34,18 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.admin; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceGroupList; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin.GroupManagementAdminService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import io.entgra.device.mgt.core.device.mgt.common.GroupPaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroupConstants; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupAlreadyExistException; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupManagementException; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceGroupList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin.GroupManagementAdminService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.ws.rs.DefaultValue; import javax.ws.rs.GET; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/UserManagementAdminServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/UserManagementAdminServiceImpl.java index 048321763e..9c7ef9e213 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/UserManagementAdminServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/admin/UserManagementAdminServiceImpl.java @@ -18,14 +18,14 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.admin; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.PrivacyComplianceException; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.PasswordResetWrapper; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin.UserManagementAdminService; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.CredentialManagementResponseBuilder; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.PrivacyComplianceException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.validation.constraints.Size; import javax.ws.rs.*; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/util/RequestValidationUtil.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/util/RequestValidationUtil.java index 45dfb6cc31..c4edcba02a 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/util/RequestValidationUtil.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/util/RequestValidationUtil.java @@ -20,45 +20,33 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util; import com.google.gson.Gson; import com.google.gson.JsonSyntaxException; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpStatus; -import io.entgra.device.mgt.core.device.mgt.common.Base64File; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.Feature; -import io.entgra.device.mgt.core.device.mgt.common.FeatureManager; -import io.entgra.device.mgt.core.device.mgt.common.OperationLogFilters; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.*; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.exception.BadRequestException; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import io.entgra.device.mgt.core.device.mgt.common.*; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.Application; import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfiguration; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceTypeNotFoundException; import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.Metadata; import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.WhiteLabelImageRequestPayload; +import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.WhiteLabelThemeCreateRequest; import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.Notification; import io.entgra.device.mgt.core.device.mgt.core.common.util.HttpUtil; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; -import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.WhiteLabelThemeCreateRequest; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ApplicationWrapper; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.EventConfig; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.GeofenceWrapper; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.OldPasswordResetWrapper; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.PolicyWrapper; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ProfileFeature; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.RoleInfo; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.Scope; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.exception.BadRequestException; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import io.entgra.device.mgt.core.policy.mgt.common.PolicyPayloadValidator; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.http.HttpStatus; import java.lang.reflect.InvocationTargetException; -import java.util.List; import java.util.ArrayList; -import java.util.Calendar; import java.util.Arrays; +import java.util.Calendar; +import java.util.List; public class RequestValidationUtil { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/swagger/extension/SecurityDefinitionConfigurator.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/swagger/extension/SecurityDefinitionConfigurator.java index 4dc40acc2f..550be89158 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/swagger/extension/SecurityDefinitionConfigurator.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/swagger/extension/SecurityDefinitionConfigurator.java @@ -24,11 +24,8 @@ import io.swagger.jaxrs.config.ReaderListener; import io.swagger.models.Swagger; import io.swagger.models.auth.OAuth2Definition; import io.swagger.models.auth.SecuritySchemeDefinition; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.Scope; -import java.util.ArrayList; import java.util.HashMap; -import java.util.List; import java.util.Map; @SwaggerDefinition( diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/util/CredentialManagementResponseBuilder.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/util/CredentialManagementResponseBuilder.java index 7c009c04de..2263da3e55 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/util/CredentialManagementResponseBuilder.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/util/CredentialManagementResponseBuilder.java @@ -18,13 +18,13 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.util; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.CarbonContext; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.OldPasswordResetWrapper; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.PasswordResetWrapper; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.api.UserStoreManager; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/util/DeviceMgtAPIUtils.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/util/DeviceMgtAPIUtils.java index e0c4f96771..2291df9466 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/util/DeviceMgtAPIUtils.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/util/DeviceMgtAPIUtils.java @@ -37,24 +37,12 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.util; import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationManager; import io.entgra.device.mgt.core.application.mgt.common.services.SubscriptionManager; -import org.apache.axis2.AxisFault; -import org.apache.axis2.client.Options; -import org.apache.axis2.java.security.SSLProtocolSocketFactory; -import org.apache.axis2.transport.http.HTTPConstants; -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.httpclient.Header; -import org.apache.commons.httpclient.protocol.Protocol; -import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.CarbonConstants; -import org.wso2.carbon.analytics.api.AnalyticsDataAPI; -import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceStub; -import org.wso2.carbon.authenticator.stub.AuthenticationAdminStub; -import org.wso2.carbon.base.ServerConfiguration; -import org.wso2.carbon.context.CarbonContext; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.core.util.Utils; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceTypeVersionWrapper; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.OperationStatusBean; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.EventAttributeList; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.InputValidationException; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; import io.entgra.device.mgt.core.device.mgt.common.*; import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAccessAuthorizationException; import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAccessAuthorizationService; @@ -77,7 +65,6 @@ import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; import io.entgra.device.mgt.core.device.mgt.common.report.mgt.ReportManagementService; import io.entgra.device.mgt.core.device.mgt.common.spi.DeviceTypeGeneratorService; import io.entgra.device.mgt.core.device.mgt.common.spi.OTPManagementService; -import io.entgra.device.mgt.core.device.mgt.common.spi.TraccarManagementService; import io.entgra.device.mgt.core.device.mgt.core.app.mgt.ApplicationManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.device.details.mgt.DeviceInformationManager; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceTypeVersion; @@ -87,12 +74,29 @@ import io.entgra.device.mgt.core.device.mgt.core.search.mgt.SearchManagerService import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.service.GroupManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.traccar.api.service.DeviceAPIClientService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceTypeVersionWrapper; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.OperationStatusBean; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.analytics.EventAttributeList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.InputValidationException; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; +import io.entgra.device.mgt.core.identity.jwt.client.extension.JWTClient; +import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; +import io.entgra.device.mgt.core.identity.jwt.client.extension.service.JWTClientManagerService; +import io.entgra.device.mgt.core.policy.mgt.common.PolicyMonitoringTaskException; +import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService; +import io.entgra.device.mgt.core.policy.mgt.core.task.TaskScheduleService; +import org.apache.axis2.AxisFault; +import org.apache.axis2.client.Options; +import org.apache.axis2.java.security.SSLProtocolSocketFactory; +import org.apache.axis2.transport.http.HTTPConstants; +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.httpclient.Header; +import org.apache.commons.httpclient.protocol.Protocol; +import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.CarbonConstants; +import org.wso2.carbon.analytics.api.AnalyticsDataAPI; +import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceStub; +import org.wso2.carbon.base.ServerConfiguration; +import org.wso2.carbon.context.CarbonContext; +import org.wso2.carbon.context.PrivilegedCarbonContext; +import org.wso2.carbon.core.util.Utils; import org.wso2.carbon.event.processor.stub.EventProcessorAdminServiceStub; import org.wso2.carbon.event.publisher.core.EventPublisherService; import org.wso2.carbon.event.publisher.stub.EventPublisherAdminServiceStub; @@ -101,17 +105,11 @@ import org.wso2.carbon.event.receiver.stub.EventReceiverAdminServiceStub; import org.wso2.carbon.event.stream.core.EventStreamService; import org.wso2.carbon.event.stream.stub.EventStreamAdminServiceStub; import org.wso2.carbon.identity.claim.metadata.mgt.dto.ClaimPropertyDTO; -import io.entgra.device.mgt.core.identity.jwt.client.extension.JWTClient; -import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; -import io.entgra.device.mgt.core.identity.jwt.client.extension.service.JWTClientManagerService; import org.wso2.carbon.identity.user.store.count.AbstractCountRetrieverFactory; import org.wso2.carbon.identity.user.store.count.UserStoreCountRetriever; import org.wso2.carbon.identity.user.store.count.exception.UserStoreCounterException; import org.wso2.carbon.identity.user.store.count.jdbc.JDBCCountRetrieverFactory; import org.wso2.carbon.identity.user.store.count.jdbc.internal.InternalCountRetrieverFactory; -import io.entgra.device.mgt.core.policy.mgt.common.PolicyMonitoringTaskException; -import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService; -import io.entgra.device.mgt.core.policy.mgt.core.task.TaskScheduleService; import org.wso2.carbon.registry.core.service.RegistryService; import org.wso2.carbon.user.api.*; import org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/util/DeviceMgtUtil.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/util/DeviceMgtUtil.java index 7cd79fa96e..e5b3b7b50f 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/util/DeviceMgtUtil.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/util/DeviceMgtUtil.java @@ -18,12 +18,12 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.util; -import io.entgra.device.mgt.core.device.mgt.core.config.permission.Scope; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorListItem; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ErrorResponse; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.ProfileFeature; import io.entgra.device.mgt.core.device.mgt.api.jaxrs.exception.BadRequestException; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Profile; +import io.entgra.device.mgt.core.device.mgt.core.config.permission.Scope; import javax.validation.ConstraintViolation; import java.util.ArrayList; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ActivityProviderServiceImplTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ActivityProviderServiceImplTest.java index 4909347a20..f28ba9ee1c 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ActivityProviderServiceImplTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ActivityProviderServiceImplTest.java @@ -19,6 +19,19 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.common.ActivityIdList; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.ActivityInfoProviderService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.DeviceManagementService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; +import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAccessAuthorizationService; +import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Activity; +import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManagementException; +import io.entgra.device.mgt.core.device.mgt.core.authorization.DeviceAccessAuthorizationServiceImpl; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; +import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagerUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.mockito.Mockito; @@ -32,19 +45,6 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.ObjectFactory; import org.testng.annotations.Test; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAccessAuthorizationService; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Activity; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManagementException; -import io.entgra.device.mgt.core.device.mgt.core.authorization.DeviceAccessAuthorizationServiceImpl; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.common.ActivityIdList; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.ActivityInfoProviderService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.DeviceManagementService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.RequestValidationUtil; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; -import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagerUtil; import javax.ws.rs.core.Response; import java.util.ArrayList; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ConfigurationServiceImplTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ConfigurationServiceImplTest.java index 4bd41a6738..74715f96dd 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ConfigurationServiceImplTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/ConfigurationServiceImplTest.java @@ -19,6 +19,13 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.ConfigurationManagementService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationEntry; +import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationManagementException; +import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfiguration; +import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService; +import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagerUtil; import org.mockito.Mockito; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PowerMockIgnore; @@ -29,13 +36,6 @@ import org.testng.IObjectFactory; import org.testng.annotations.BeforeClass; import org.testng.annotations.ObjectFactory; import org.testng.annotations.Test; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationEntry; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationManagementException; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfiguration; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.ConfigurationManagementService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; -import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagerUtil; import javax.ws.rs.core.Response; import java.util.ArrayList; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceAgentServiceTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceAgentServiceTest.java index ebba226d7d..e718cd6061 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceAgentServiceTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceAgentServiceTest.java @@ -17,6 +17,25 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.DeviceAgentService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin.DeviceTypeManagementAdminService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.DeviceMgtAPITestHelper; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import io.entgra.device.mgt.core.device.mgt.common.Device; +import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; +import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; +import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAccessAuthorizationException; +import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAccessAuthorizationService; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; +import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; +import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManagementException; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.PolicyComplianceException; +import io.entgra.device.mgt.core.device.mgt.core.authorization.DeviceAccessAuthorizationServiceImpl; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; +import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; +import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService; +import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerServiceImpl; import org.apache.axis2.AxisFault; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -34,28 +53,7 @@ import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.caching.impl.CacheImpl; import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; -import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAccessAuthorizationException; -import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAccessAuthorizationService; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManagementException; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.PolicyComplianceException; -import io.entgra.device.mgt.core.device.mgt.core.authorization.DeviceAccessAuthorizationServiceImpl; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.DeviceAgentService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin.DeviceTypeManagementAdminService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.DeviceMgtAPITestHelper; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import org.wso2.carbon.event.stream.stub.EventStreamAdminServiceStub; -import org.wso2.carbon.event.stream.stub.types.EventStreamAttributeDto; -import org.wso2.carbon.event.stream.stub.types.EventStreamDefinitionDto; -import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; -import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService; -import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerServiceImpl; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.utils.CarbonUtils; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceManagementServiceImplTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceManagementServiceImplTest.java index e8c03be32a..ddd1f7b76e 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceManagementServiceImplTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceManagementServiceImplTest.java @@ -36,19 +36,9 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.mockito.Mockito; -import org.powermock.api.mockito.PowerMockito; -import org.powermock.core.classloader.annotations.PowerMockIgnore; -import org.powermock.core.classloader.annotations.PrepareForTest; -import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor; -import org.testng.Assert; -import org.testng.IObjectFactory; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.ObjectFactory; -import org.testng.annotations.Test; -import org.wso2.carbon.context.CarbonContext; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.DeviceManagementService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.DeviceMgtAPITestHelper; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; @@ -70,11 +60,21 @@ import io.entgra.device.mgt.core.device.mgt.core.search.mgt.SearchMgtException; import io.entgra.device.mgt.core.device.mgt.core.search.mgt.impl.SearchManagerServiceImpl; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.DeviceManagementService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.DeviceMgtAPITestHelper; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.mockito.Mockito; +import org.powermock.api.mockito.PowerMockito; +import org.powermock.core.classloader.annotations.PowerMockIgnore; +import org.powermock.core.classloader.annotations.PrepareForTest; +import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor; +import org.testng.Assert; +import org.testng.IObjectFactory; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.ObjectFactory; +import org.testng.annotations.Test; +import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.user.core.service.RealmService; import org.wso2.carbon.utils.multitenancy.MultitenantUtils; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceTypeManagementAdminServiceTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceTypeManagementAdminServiceTest.java index bb9b80c86f..b9c1cf2f05 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceTypeManagementAdminServiceTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceTypeManagementAdminServiceTest.java @@ -35,6 +35,16 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin.DeviceTypeManagementAdminService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.admin.DeviceTypeManagementAdminServiceImpl; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.DeviceMgtAPITestHelper; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; +import io.entgra.device.mgt.core.device.mgt.common.spi.DeviceTypeGeneratorService; +import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; +import io.entgra.device.mgt.core.device.mgt.extensions.device.type.template.DeviceTypeGeneratorServiceImpl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.mockito.Mockito; @@ -50,16 +60,6 @@ import org.testng.annotations.Test; import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.common.spi.DeviceTypeGeneratorService; -import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; -import io.entgra.device.mgt.core.device.mgt.extensions.device.type.template.DeviceTypeGeneratorServiceImpl; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.admin.DeviceTypeManagementAdminService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.admin.DeviceTypeManagementAdminServiceImpl; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.DeviceMgtAPITestHelper; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import javax.ws.rs.core.Response; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceTypeManagementServiceTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceTypeManagementServiceTest.java index 33e3088c26..5e2207f275 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceTypeManagementServiceTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/DeviceTypeManagementServiceTest.java @@ -17,6 +17,14 @@ */ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.DeviceTypeManagementService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.DeviceMgtAPITestHelper; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import io.entgra.device.mgt.core.device.mgt.common.FeatureManager; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; +import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.mockito.Mockito; @@ -29,14 +37,6 @@ import org.testng.IObjectFactory; import org.testng.annotations.BeforeClass; import org.testng.annotations.ObjectFactory; import org.testng.annotations.Test; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.common.FeatureManager; -import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.DeviceTypeManagementService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl.util.DeviceMgtAPITestHelper; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import javax.ws.rs.core.Response; import java.lang.reflect.InvocationTargetException; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GeoLocationBasedServiceImplTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GeoLocationBasedServiceImplTest.java index 23c4d3c4c6..9c4862d846 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GeoLocationBasedServiceImplTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GeoLocationBasedServiceImplTest.java @@ -1,17 +1,17 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.GeoLocationBasedService; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; +import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoCluster; +import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoCoordinate; +import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoQuery; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import org.mockito.Mockito; import org.powermock.core.classloader.annotations.PowerMockIgnore; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoCluster; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoCoordinate; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoQuery; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.GeoLocationBasedService; import javax.ws.rs.core.Response; import java.util.ArrayList; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GroupManagementServiceImplTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GroupManagementServiceImplTest.java index e5feaf310f..2a8001cc53 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GroupManagementServiceImplTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GroupManagementServiceImplTest.java @@ -35,6 +35,18 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceToGroupsAssignment; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.GroupManagementService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import io.entgra.device.mgt.core.device.mgt.common.Device; +import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; +import io.entgra.device.mgt.core.device.mgt.common.GroupPaginationRequest; +import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceNotFoundException; +import io.entgra.device.mgt.core.device.mgt.common.group.mgt.*; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import io.entgra.device.mgt.core.device.mgt.core.service.GroupManagementProviderService; +import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService; import org.mockito.Mockito; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PowerMockIgnore; @@ -48,22 +60,6 @@ import org.testng.annotations.Test; import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceNotFoundException; -import io.entgra.device.mgt.core.device.mgt.common.GroupPaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupAlreadyExistException; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupManagementException; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupNotExistException; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.RoleDoesNotExistException; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; -import io.entgra.device.mgt.core.device.mgt.core.service.GroupManagementProviderService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceToGroupsAssignment; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.GroupManagementService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; -import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService; import javax.ws.rs.core.Response; import java.util.ArrayList; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/NotificationManagementServiceImplTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/NotificationManagementServiceImplTest.java index 64575c7496..06b85f2db0 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/NotificationManagementServiceImplTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/NotificationManagementServiceImplTest.java @@ -19,6 +19,11 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; +import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.Notification; +import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.NotificationManagementException; +import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.NotificationManagementService; import org.mockito.Mockito; import org.powermock.api.mockito.PowerMockito; import org.powermock.core.classloader.annotations.PowerMockIgnore; @@ -30,13 +35,9 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.ObjectFactory; import org.testng.annotations.Test; import org.wso2.carbon.context.CarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; -import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.Notification; -import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.NotificationManagementException; -import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.NotificationManagementService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.utils.multitenancy.MultitenantUtils; + import javax.ws.rs.core.Response; import java.util.ArrayList; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/UserManagementServiceImplTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/UserManagementServiceImplTest.java index 912ca09034..3ca294ac51 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/UserManagementServiceImplTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/UserManagementServiceImplTest.java @@ -36,6 +36,20 @@ package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.BasicUserInfo; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.EnrollmentInvitation; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.UserInfo; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.UserManagementService; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; +import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; +import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationManagementException; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.OTPManagementException; +import io.entgra.device.mgt.core.device.mgt.common.invitation.mgt.DeviceEnrollmentInvitation; +import io.entgra.device.mgt.core.device.mgt.common.spi.OTPManagementService; +import io.entgra.device.mgt.core.device.mgt.core.otp.mgt.service.OTPManagementServiceImpl; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; import org.mockito.Mockito; import org.mockito.invocation.InvocationOnMock; import org.mockito.stubbing.Answer; @@ -49,20 +63,6 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.ObjectFactory; import org.testng.annotations.Test; import org.wso2.carbon.context.CarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationManagementException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.OTPManagementException; -import io.entgra.device.mgt.core.device.mgt.common.invitation.mgt.DeviceEnrollmentInvitation; -import io.entgra.device.mgt.core.device.mgt.common.spi.OTPManagementService; -import io.entgra.device.mgt.core.device.mgt.core.otp.mgt.service.OTPManagementServiceImpl; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.BasicUserInfo; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.EnrollmentInvitation; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.UserInfo; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.api.UserManagementService; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants; -import io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils; import org.wso2.carbon.user.api.RealmConfiguration; import org.wso2.carbon.user.api.UserRealm; import org.wso2.carbon.user.api.UserStoreException; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/pom.xml b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/pom.xml index 253f7c86bb..fe45ed706d 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/pom.xml +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/pom.xml @@ -30,10 +30,18 @@ bundle WSO2 Carbon - Device Management Commons WSO2 Carbon - Device Management Commons - http://wso2.org + https://entgra.io + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + org.apache.felix maven-bundle-plugin @@ -48,10 +56,28 @@ io.entgra.device.mgt.core.device.mgt.common.* - javax.xml.bind.annotation; version="${javax.xml.bind.imp.pkg.version}", - com.fasterxml.jackson.annotation;version="${jackson-annotations.version}", - io.swagger.annotations; version="${swagger.annotations.version}"; resolution:=optional, - com.google.gson + com.fasterxml.jackson.annotation;version="[2.9,3)", + com.google.gson;version="[2.9,3)", + io.entgra.device.mgt.core.device.mgt.common, + io.entgra.device.mgt.core.device.mgt.common.app.mgt, + io.entgra.device.mgt.core.device.mgt.common.configuration.mgt, + io.entgra.device.mgt.core.device.mgt.common.device.details, + io.entgra.device.mgt.core.device.mgt.common.event.config, + io.entgra.device.mgt.core.device.mgt.common.exceptions, + io.entgra.device.mgt.core.device.mgt.common.general, + io.entgra.device.mgt.core.device.mgt.common.group.mgt, + io.entgra.device.mgt.core.device.mgt.common.invitation.mgt, + io.entgra.device.mgt.core.device.mgt.common.license.mgt, + io.entgra.device.mgt.core.device.mgt.common.metadata.mgt, + io.entgra.device.mgt.core.device.mgt.common.operation.mgt, + io.entgra.device.mgt.core.device.mgt.common.otp.mgt.dto, + io.entgra.device.mgt.core.device.mgt.common.policy.mgt, + io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor, + io.entgra.device.mgt.core.device.mgt.common.pull.notification, + io.entgra.device.mgt.core.device.mgt.common.push.notification, + io.entgra.device.mgt.core.device.mgt.common.type.mgt, + io.swagger.annotations;version="[1.6,2)", + javax.xml.bind.annotation;version="[0.0,1)" diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/Billing.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/Billing.java index 14a25af7bf..ed77fd3cde 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/Billing.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/Billing.java @@ -20,6 +20,7 @@ package io.entgra.device.mgt.core.device.mgt.common; import com.google.gson.Gson; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + import java.io.Serializable; @ApiModel(value = "Billing", description = "This class carries all information related to a device billing.") diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/BillingResponse.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/BillingResponse.java index 793c922f3f..49fc387cfb 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/BillingResponse.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/BillingResponse.java @@ -20,6 +20,7 @@ package io.entgra.device.mgt.core.device.mgt.common; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; + import java.io.Serializable; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/Device.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/Device.java index eeb0ea3a91..c9fd0fbb91 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/Device.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/Device.java @@ -17,14 +17,14 @@ */ package io.entgra.device.mgt.core.device.mgt.common; -import com.google.gson.Gson; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.gson.Gson; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.Application; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceInfo; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceLocationHistorySnapshotWrapper; import io.entgra.device.mgt.core.device.mgt.common.type.mgt.DeviceStatus; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import java.util.ArrayList; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/DeviceBilling.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/DeviceBilling.java index 5e735e0a44..1373cae427 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/DeviceBilling.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/DeviceBilling.java @@ -18,10 +18,10 @@ package io.entgra.device.mgt.core.device.mgt.common; import com.google.gson.Gson; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceInfo; import io.entgra.device.mgt.core.device.mgt.common.type.mgt.DeviceStatus; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import java.util.ArrayList; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/EnrolmentInfo.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/EnrolmentInfo.java index c946f3d01b..e17cedd4aa 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/EnrolmentInfo.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/EnrolmentInfo.java @@ -22,7 +22,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; -import java.math.BigInteger; @ApiModel(value = "EnrolmentInfo", description = "This class carries all information related to a devices enrollment" + " status.") diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/PaginationRequest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/PaginationRequest.java index 0246b9fe95..50d6bf1bed 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/PaginationRequest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/PaginationRequest.java @@ -18,11 +18,7 @@ package io.entgra.device.mgt.core.device.mgt.common; -import java.util.ArrayList; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * This class holds required parameters for a querying a paginated device response. diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/device/details/DeviceDetailsWrapper.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/device/details/DeviceDetailsWrapper.java index cacdfb79a1..128bc94e92 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/device/details/DeviceDetailsWrapper.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/device/details/DeviceDetailsWrapper.java @@ -23,7 +23,6 @@ import io.entgra.device.mgt.core.device.mgt.common.app.mgt.Application; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; import java.util.List; -import java.util.Map; public class DeviceDetailsWrapper { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/device/details/DeviceLocation.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/device/details/DeviceLocation.java index 3abe6fd732..440e89080b 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/device/details/DeviceLocation.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/device/details/DeviceLocation.java @@ -19,9 +19,9 @@ package io.entgra.device.mgt.core.device.mgt.common.device.details; +import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import java.io.Serializable; import java.util.Date; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/geo/service/Alert.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/geo/service/Alert.java index 09c7f0ef86..8ecab38b29 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/geo/service/Alert.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/geo/service/Alert.java @@ -18,11 +18,7 @@ */ package io.entgra.device.mgt.core.device.mgt.common.geo.service; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.*; /** * The Class Alert Bean. diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/geo/service/Event.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/geo/service/Event.java index ecba5fca2c..848f46b007 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/geo/service/Event.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/geo/service/Event.java @@ -19,11 +19,7 @@ package io.entgra.device.mgt.core.device.mgt.common.geo.service; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.*; import java.util.ArrayList; import java.util.List; import java.util.Map; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/geo/service/GeoLocationProviderService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/geo/service/GeoLocationProviderService.java index 3ec6d96ded..c50d57e866 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/geo/service/GeoLocationProviderService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/geo/service/GeoLocationProviderService.java @@ -20,11 +20,9 @@ package io.entgra.device.mgt.core.device.mgt.common.geo.service; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfig; import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfigurationException; -import java.util.ArrayList; import java.util.List; /** diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/geo/service/GeofenceData.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/geo/service/GeofenceData.java index a027bff017..c18aeeeb71 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/geo/service/GeofenceData.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/geo/service/GeofenceData.java @@ -19,7 +19,6 @@ package io.entgra.device.mgt.core.device.mgt.common.geo.service; import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfig; -import io.entgra.device.mgt.core.device.mgt.common.event.config.EventMetaData; import java.util.List; import java.util.Map; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/group/mgt/GroupUser.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/group/mgt/GroupUser.java index e8619ab1d1..00121f9667 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/group/mgt/GroupUser.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/group/mgt/GroupUser.java @@ -21,8 +21,6 @@ package io.entgra.device.mgt.core.device.mgt.common.group.mgt; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; import java.io.Serializable; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/metadata/mgt/MetadataManagementService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/metadata/mgt/MetadataManagementService.java index f11c6f7476..f040cc7db4 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/metadata/mgt/MetadataManagementService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/metadata/mgt/MetadataManagementService.java @@ -23,6 +23,7 @@ import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; import io.entgra.device.mgt.core.device.mgt.common.exceptions.MetadataKeyAlreadyExistsException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.MetadataKeyNotFoundException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.MetadataManagementException; + import java.util.List; /** diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/operation/mgt/ActivityStatus.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/operation/mgt/ActivityStatus.java index 81439108ef..a392646959 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/operation/mgt/ActivityStatus.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/operation/mgt/ActivityStatus.java @@ -20,9 +20,9 @@ package io.entgra.device.mgt.core.device.mgt.common.operation.mgt; import com.fasterxml.jackson.annotation.JsonProperty; +import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/operation/mgt/OperationManager.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/operation/mgt/OperationManager.java index be8109bfea..8bcd82e4f8 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/operation/mgt/OperationManager.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/operation/mgt/OperationManager.java @@ -17,12 +17,7 @@ */ package io.entgra.device.mgt.core.device.mgt.common.operation.mgt; -import io.entgra.device.mgt.core.device.mgt.common.ActivityPaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.DynamicTaskContext; -import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; +import io.entgra.device.mgt.core.device.mgt.common.*; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.InvalidDeviceException; import io.entgra.device.mgt.core.device.mgt.common.push.notification.NotificationStrategy; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/policy/mgt/Policy.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/policy/mgt/Policy.java index 05d442ca99..6938374570 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/policy/mgt/Policy.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/policy/mgt/Policy.java @@ -34,9 +34,9 @@ */ package io.entgra.device.mgt.core.device.mgt.common.policy.mgt; +import io.entgra.device.mgt.core.device.mgt.common.Device; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import io.entgra.device.mgt.core.device.mgt.common.Device; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/policy/mgt/ui/Modal.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/policy/mgt/ui/Modal.java index 808375f890..e446e348c3 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/policy/mgt/ui/Modal.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/policy/mgt/ui/Modal.java @@ -17,7 +17,6 @@ package io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ui; -import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/policy/mgt/ui/SearchInput.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/policy/mgt/ui/SearchInput.java index e632b43747..4a7386ca60 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/policy/mgt/ui/SearchInput.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/policy/mgt/ui/SearchInput.java @@ -18,9 +18,7 @@ package io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ui; import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlRootElement; -import java.util.List; @XmlRootElement(name = "SearchInput") public class SearchInput { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/report/mgt/ReportManagementService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/report/mgt/ReportManagementService.java index 67cd7e28a5..854c2be62e 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/report/mgt/ReportManagementService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/report/mgt/ReportManagementService.java @@ -20,7 +20,6 @@ package io.entgra.device.mgt.core.device.mgt.common.report.mgt; import com.google.gson.JsonObject; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; -import io.entgra.device.mgt.core.device.mgt.common.app.mgt.ApplicationManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.BadRequestException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceTypeNotFoundException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.ReportManagementException; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/type/mgt/DeviceTypeMetaDefinition.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/type/mgt/DeviceTypeMetaDefinition.java index ed5832eab8..0bd4da11e0 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/type/mgt/DeviceTypeMetaDefinition.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/src/main/java/io/entgra/device/mgt/core/device/mgt/common/type/mgt/DeviceTypeMetaDefinition.java @@ -5,7 +5,6 @@ import io.entgra.device.mgt.core.device.mgt.common.InitialOperationConfig; import io.entgra.device.mgt.core.device.mgt.common.license.mgt.License; import io.entgra.device.mgt.core.device.mgt.common.push.notification.PushNotificationConfig; -import java.util.ArrayList; import java.util.List; public class DeviceTypeMetaDefinition { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/pom.xml b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/pom.xml index c011c1acaf..cf1b04bf1f 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/pom.xml +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/pom.xml @@ -189,6 +189,11 @@ + + io.entgra.device.mgt.core + io.entgra.device.mgt.core.device.mgt.common + provided + io.swagger swagger-annotations diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/src/main/java/io/entgra/device/mgt/core/device/mgt/config/api/ApiOriginFilter.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/src/main/java/io/entgra/device/mgt/core/device/mgt/config/api/ApiOriginFilter.java index 4674930bfc..1f5cb82bda 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/src/main/java/io/entgra/device/mgt/core/device/mgt/config/api/ApiOriginFilter.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/src/main/java/io/entgra/device/mgt/core/device/mgt/config/api/ApiOriginFilter.java @@ -19,12 +19,7 @@ package io.entgra.device.mgt.core.device.mgt.config.api; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import javax.servlet.*; import javax.servlet.http.HttpServletResponse; import java.io.IOException; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/src/main/java/io/entgra/device/mgt/core/device/mgt/config/api/common/GsonMessageBodyHandler.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/src/main/java/io/entgra/device/mgt/core/device/mgt/config/api/common/GsonMessageBodyHandler.java index 64e31780da..61d0355eee 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/src/main/java/io/entgra/device/mgt/core/device/mgt/config/api/common/GsonMessageBodyHandler.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/src/main/java/io/entgra/device/mgt/core/device/mgt/config/api/common/GsonMessageBodyHandler.java @@ -29,11 +29,7 @@ import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.ext.MessageBodyReader; import javax.ws.rs.ext.MessageBodyWriter; import javax.ws.rs.ext.Provider; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.OutputStreamWriter; +import java.io.*; import java.lang.annotation.Annotation; import java.lang.reflect.Type; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/src/main/java/io/entgra/device/mgt/core/device/mgt/config/api/service/DeviceManagementConfigService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/src/main/java/io/entgra/device/mgt/core/device/mgt/config/api/service/DeviceManagementConfigService.java index d295300bc3..a1716ffcb6 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/src/main/java/io/entgra/device/mgt/core/device/mgt/config/api/service/DeviceManagementConfigService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/src/main/java/io/entgra/device/mgt/core/device/mgt/config/api/service/DeviceManagementConfigService.java @@ -18,32 +18,15 @@ package io.entgra.device.mgt.core.device.mgt.config.api.service; -import io.entgra.device.mgt.core.device.mgt.common.DeviceTransferRequest; -import io.entgra.device.mgt.core.device.mgt.config.api.beans.ErrorResponse; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.ResponseHeader; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; +import io.entgra.device.mgt.core.device.mgt.common.DeviceTransferRequest; import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.DeviceConfiguration; import io.entgra.device.mgt.core.device.mgt.common.general.TenantDetail; +import io.entgra.device.mgt.core.device.mgt.config.api.beans.ErrorResponse; +import io.swagger.annotations.*; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/src/main/java/io/entgra/device/mgt/core/device/mgt/config/api/service/impl/DeviceManagementConfigServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/src/main/java/io/entgra/device/mgt/core/device/mgt/config/api/service/impl/DeviceManagementConfigServiceImpl.java index dfb94ed0f8..058578bf2f 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/src/main/java/io/entgra/device/mgt/core/device/mgt/config/api/service/impl/DeviceManagementConfigServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/src/main/java/io/entgra/device/mgt/core/device/mgt/config/api/service/impl/DeviceManagementConfigServiceImpl.java @@ -21,13 +21,6 @@ import com.fasterxml.jackson.core.JsonParseException; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JsonMappingException; import com.fasterxml.jackson.databind.ObjectMapper; -import io.entgra.device.mgt.core.device.mgt.config.api.beans.ErrorResponse; -import io.entgra.device.mgt.core.device.mgt.config.api.service.DeviceManagementConfigService; -import io.entgra.device.mgt.core.device.mgt.config.api.util.DeviceMgtAPIUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.base.MultitenantConstants; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.AppRegistrationCredentials; import io.entgra.device.mgt.core.device.mgt.common.ApplicationRegistrationException; import io.entgra.device.mgt.core.device.mgt.common.DeviceTransferRequest; @@ -37,6 +30,9 @@ import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementEx import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceNotFoundException; import io.entgra.device.mgt.core.device.mgt.common.general.TenantDetail; import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagementException; +import io.entgra.device.mgt.core.device.mgt.config.api.beans.ErrorResponse; +import io.entgra.device.mgt.core.device.mgt.config.api.service.DeviceManagementConfigService; +import io.entgra.device.mgt.core.device.mgt.config.api.util.DeviceMgtAPIUtils; import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceManagementConfig; @@ -48,18 +44,15 @@ import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProvide import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.AccessTokenInfo; import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.base.MultitenantConstants; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.user.api.Tenant; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.core.service.RealmService; -import javax.ws.rs.Consumes; -import javax.ws.rs.GET; -import javax.ws.rs.HeaderParam; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; +import javax.ws.rs.*; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.io.IOException; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/src/main/java/io/entgra/device/mgt/core/device/mgt/config/api/util/DeviceMgtAPIUtils.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/src/main/java/io/entgra/device/mgt/core/device/mgt/config/api/util/DeviceMgtAPIUtils.java index 1e71c48560..62ad7dc997 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/src/main/java/io/entgra/device/mgt/core/device/mgt/config/api/util/DeviceMgtAPIUtils.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/src/main/java/io/entgra/device/mgt/core/device/mgt/config/api/util/DeviceMgtAPIUtils.java @@ -18,10 +18,10 @@ package io.entgra.device.mgt.core.device.mgt.config.api.util; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import org.wso2.carbon.user.core.service.RealmService; /** diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/pom.xml b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/pom.xml index 8d473781ab..6f750346d4 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/pom.xml +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/pom.xml @@ -31,14 +31,10 @@ bundle WSO2 Carbon - Device Management Core WSO2 Carbon - Device Management Core - http://wso2.org + https://entgra.io - - org.apache.felix - maven-scr-plugin - org.jacoco jacoco-maven-plugin @@ -65,6 +61,14 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + org.apache.felix maven-bundle-plugin @@ -77,45 +81,194 @@ Device Management Core Bundle io.entgra.device.mgt.core.device.mgt.core.internal - org.apache.axis2.*;version="${axis2.osgi.version.range}", + com.fasterxml.jackson.databind;version="[2.13,3)", + com.google.common.collect;version="[31.0,32)", + com.google.common.reflect;version="[31.0,32)", + com.google.gson;version="[2.9,3)", + com.google.gson.reflect;version="[2.9,3)", + io.entgra.device.mgt.core.apimgt.annotations;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.app.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.app.mgt.android;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.app.mgt.ios;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.app.mgt.windows;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.authorization;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.configuration.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.cost.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.device.details;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.enrollment.notification;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.event.config;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.exceptions;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.general;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.geo.service;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.group.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.invitation.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.license.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.metadata.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.notification.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.operation.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.otp.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.otp.mgt.dto;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.permission.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.policy.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.pull.notification;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.push.notification;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.report.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.roles.config;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.search;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.spi;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.type.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.app.mgt.config, + io.entgra.device.mgt.core.device.mgt.core.archival, + io.entgra.device.mgt.core.device.mgt.core.archival.dao, + io.entgra.device.mgt.core.device.mgt.core.archival.dao.impl, + io.entgra.device.mgt.core.device.mgt.core.cache, + io.entgra.device.mgt.core.device.mgt.core.cache.impl, + io.entgra.device.mgt.core.device.mgt.core.common.exception, + io.entgra.device.mgt.core.device.mgt.core.common.util, + io.entgra.device.mgt.core.device.mgt.core.config, + io.entgra.device.mgt.core.device.mgt.core.config.analytics, + io.entgra.device.mgt.core.device.mgt.core.config.analytics.operation, + io.entgra.device.mgt.core.device.mgt.core.config.archival, + io.entgra.device.mgt.core.device.mgt.core.config.cache, + io.entgra.device.mgt.core.device.mgt.core.config.datasource, + io.entgra.device.mgt.core.device.mgt.core.config.enrollment.guide, + io.entgra.device.mgt.core.device.mgt.core.config.geo.location, + io.entgra.device.mgt.core.device.mgt.core.config.identity, + io.entgra.device.mgt.core.device.mgt.core.config.keymanager, + io.entgra.device.mgt.core.device.mgt.core.config.license, + io.entgra.device.mgt.core.device.mgt.core.config.metadata.mgt, + io.entgra.device.mgt.core.device.mgt.core.config.metadata.mgt.whitelabel, + io.entgra.device.mgt.core.device.mgt.core.config.operation.timeout, + io.entgra.device.mgt.core.device.mgt.core.config.pagination, + io.entgra.device.mgt.core.device.mgt.core.config.permission, + io.entgra.device.mgt.core.device.mgt.core.config.policy, + io.entgra.device.mgt.core.device.mgt.core.config.pull.notification, + io.entgra.device.mgt.core.device.mgt.core.config.push.notification, + io.entgra.device.mgt.core.device.mgt.core.config.remote.session, + io.entgra.device.mgt.core.device.mgt.core.config.status.task, + io.entgra.device.mgt.core.device.mgt.core.config.task, + io.entgra.device.mgt.core.device.mgt.core.config.tenant, + io.entgra.device.mgt.core.device.mgt.core.config.ui, + io.entgra.device.mgt.core.device.mgt.core.dao, + io.entgra.device.mgt.core.device.mgt.core.dao.impl, + io.entgra.device.mgt.core.device.mgt.core.dao.impl.device, + io.entgra.device.mgt.core.device.mgt.core.dao.impl.enrolment, + io.entgra.device.mgt.core.device.mgt.core.dao.impl.event, + io.entgra.device.mgt.core.device.mgt.core.dao.impl.geofence, + io.entgra.device.mgt.core.device.mgt.core.dao.impl.group, + io.entgra.device.mgt.core.device.mgt.core.dao.impl.tracker, + io.entgra.device.mgt.core.device.mgt.core.device.details.mgt, + io.entgra.device.mgt.core.device.mgt.core.device.details.mgt.dao, + io.entgra.device.mgt.core.device.mgt.core.device.details.mgt.dao.impl, + io.entgra.device.mgt.core.device.mgt.core.dto, + io.entgra.device.mgt.core.device.mgt.core.dto.event.config, + io.entgra.device.mgt.core.device.mgt.core.dto.operation.mgt, + io.entgra.device.mgt.core.device.mgt.core.geo.geoHash, + io.entgra.device.mgt.core.device.mgt.core.geo.task, + io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao, + io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.impl, + io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.util, + io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.util, + io.entgra.device.mgt.core.device.mgt.core.notification.mgt.dao, + io.entgra.device.mgt.core.device.mgt.core.notification.mgt.dao.impl, + io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao, + io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.impl, + io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.impl.operation, + io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.util, + io.entgra.device.mgt.core.device.mgt.core.operation.mgt.util, + io.entgra.device.mgt.core.device.mgt.core.operation.timeout.task, + io.entgra.device.mgt.core.device.mgt.core.otp.mgt.dao, + io.entgra.device.mgt.core.device.mgt.core.otp.mgt.dao.impl, + io.entgra.device.mgt.core.device.mgt.core.otp.mgt.exception, + io.entgra.device.mgt.core.device.mgt.core.otp.mgt.util, + io.entgra.device.mgt.core.device.mgt.core.privacy, + io.entgra.device.mgt.core.device.mgt.core.privacy.dao, + io.entgra.device.mgt.core.device.mgt.core.privacy.dao.impl, + io.entgra.device.mgt.core.device.mgt.core.report.mgt, + io.entgra.device.mgt.core.device.mgt.core.report.mgt.config, + io.entgra.device.mgt.core.device.mgt.core.search.mgt, + io.entgra.device.mgt.core.device.mgt.core.search.mgt.dao, + io.entgra.device.mgt.core.device.mgt.core.status.task, + io.entgra.device.mgt.core.device.mgt.core.task, + io.entgra.device.mgt.core.device.mgt.core.traccar.api.service, + io.entgra.device.mgt.core.device.mgt.core.traccar.api.service.impl, + io.entgra.device.mgt.core.device.mgt.core.traccar.common.beans, + io.entgra.device.mgt.core.device.mgt.core.traccar.common.config, + io.entgra.device.mgt.core.device.mgt.core.traccar.common.util, + io.entgra.device.mgt.core.device.mgt.core.traccar.core.config, + io.entgra.device.mgt.core.device.mgt.extensions.logger.spi;version="[5.0,6)", + io.entgra.device.mgt.core.identity.jwt.client.extension;version="[5.0,6)", + io.entgra.device.mgt.core.identity.jwt.client.extension.dto;version="[5.0,6)", + io.entgra.device.mgt.core.identity.jwt.client.extension.exception;version="[5.0,6)", + io.entgra.device.mgt.core.identity.jwt.client.extension.service;version="[5.0,6)", + io.entgra.device.mgt.core.notification.logger;version="[5.0,6)", + io.entgra.device.mgt.core.notification.logger.impl;version="[5.0,6)", + io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.exception;version="[5.0,6)", + io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service;version="[5.0,6)", + io.entgra.device.mgt.core.transport.mgt.email.sender.core;version="[5.0,6)", + io.entgra.device.mgt.core.transport.mgt.email.sender.core.service;version="[5.0,6)", + io.swagger.annotations;version="[1.6,2)",javax.cache;version="[1.0,2)", + javax.naming,javax.net.ssl,javax.servlet;version="[2.6,3)", + javax.sql,javax.ws.rs,javax.xml.bind;version="[0.0,1)", + javax.xml.bind.annotation;version="[0.0,1)", + javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}", + javax.xml.stream;version="[1.0,2)", + okhttp3, + org.apache.axis2;version="[1.6,2)", + org.apache.axis2.client;version="[1.6,2)", + org.apache.axis2.context;version="[1.6,2)", + org.apache.axis2.java.security;version="[1.6,2)", + org.apache.axis2.transport.http;version="[1.6,2)", + org.apache.catalina;version="${catalina.version.range}", + org.apache.catalina.core;version="${catalina.version.range}", + org.apache.commons.codec.binary;version="[1.4,2)", + org.apache.commons.collections.map;version="[3.2,4)", + org.apache.commons.httpclient;version="[3.1,4)", + org.apache.commons.httpclient.protocol;version="[3.1,4)", + org.apache.commons.io;version="[2.0,3)", + org.apache.commons.lang;version="[2.6,3)", + org.apache.commons.lang3;version="[3.1,4)", + org.apache.commons.logging;version="[1.2,2)", + org.apache.commons.validator.routines;version="[1.7,2)", + org.apache.http;version="[4.4,5)", + org.apache.http.client.methods;version="[4.3,5)", + org.apache.http.entity;version="[4.4,5)", + org.apache.http.impl.client;version="[4.3,5)", + org.apache.http.util;version="[4.4,5)", + org.apache.solr.common;version="[8.11,9)", + org.json;version="[3.0,4)", org.osgi.framework.*;version="${imp.package.version.osgi.framework}", org.osgi.service.*;version="${imp.package.version.osgi.service}", - org.apache.commons.logging, - javax.naming, - javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional, - javax.servlet.*, - org.xml.sax, - javax.sql.*, - org.wso2.carbon.context, - org.wso2.carbon.core, - org.wso2.carbon.utils.*, - io.entgra.device.mgt.core.device.mgt.common.*, - org.wso2.carbon.user.api, - org.wso2.carbon.user.core.*, - org.wso2.carbon.registry.core.service, + org.scannotation;version="[1.0,2)", + org.scannotation.archiveiterator;version="[1.0,2)", + org.w3c.dom, + org.wso2.carbon.base, + + + org.wso2.carbon.context;version="[4.8,5)", + org.wso2.carbon.core;version="[4.8,5)", + org.wso2.carbon.core.util;version="[4.8,5)", + org.wso2.carbon.event.processor.stub;version="[2.3,3)", + org.wso2.carbon.event.processor.stub.types;version="[2.3,3)", + org.wso2.carbon.ndatasource.core;version="[4.8,5)", + org.wso2.carbon.ntask.common, + org.wso2.carbon.ntask.core, + org.wso2.carbon.ntask.core.service, + org.wso2.carbon.registry.api, org.wso2.carbon.registry.core, org.wso2.carbon.registry.core.exceptions, + org.wso2.carbon.registry.core.service, org.wso2.carbon.registry.core.session, - org.wso2.carbon.registry.api, - org.w3c.dom, - org.wso2.carbon.identity.oauth.stub, - org.wso2.carbon.identity.oauth.stub.dto, - org.wso2.carbon.ndatasource.core, - org.wso2.carbon.ntask.core.*, - org.wso2.carbon.ntask.common, - io.entgra.device.mgt.core.task.mgt.common.*, - org.apache.commons.collections;version="${commons-collections.version.range}", - io.entgra.device.mgt.core.email.sender.*, - io.swagger.annotations.*;resolution:=optional, - org.wso2.carbon, - org.wso2.carbon.base, - org.scannotation.*, - org.wso2.carbon.event.processor.stub, - io.entgra.device.mgt.core.identity.jwt.client.extension.service, - org.apache.commons.codec.binary, - io.entgra.device.mgt.core.server.bootup.heartbeat.beacon, - io.entgra.device.mgt.core.device.mgt.extensions.logger.*, - io.entgra.device.mgt.core.notification.logger.* + org.wso2.carbon.stratos.common.beans;version="[4.7,5)", + org.wso2.carbon.stratos.common.util;version="[4.7,5)", + org.wso2.carbon.tenant.mgt.services, + org.wso2.carbon.user.api, + org.wso2.carbon.user.core.config;version="[4.8,5)", + org.wso2.carbon.user.core.service;version="[4.8,5)", + org.wso2.carbon.user.core.tenant;version="[4.8,5)", + org.wso2.carbon.utils;version="[4.8,5)", + org.wso2.carbon.utils.dbcreator;version="[4.8,5)" !io.entgra.device.mgt.core.device.mgt.core.internal, @@ -149,15 +302,12 @@ - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.osgi - org.eclipse.osgi.services + org.apache.felix + org.apache.felix.scr.ds-annotations + provided - org.wso2.orbit.org.scannotation + io.entgra.org.scannotation scannotation @@ -212,10 +362,12 @@ org.wso2.carbon org.wso2.carbon.registry.api + provided org.wso2.carbon org.wso2.carbon.registry.core + provided org.apache.tomcat.wso2 @@ -237,14 +389,6 @@ org.apache.ws.commons.axiom.wso2 axiom - org.apache.axis2.wso2 axis2 @@ -325,6 +469,7 @@ org.javassist javassist + provided org.powermock @@ -362,6 +507,7 @@ io.entgra.device.mgt.core io.entgra.device.mgt.core.notification.logger + provided diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/DeviceManagementPluginRepository.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/DeviceManagementPluginRepository.java index 3a5fa2d6f7..a6155ccc8c 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/DeviceManagementPluginRepository.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/DeviceManagementPluginRepository.java @@ -18,14 +18,11 @@ package io.entgra.device.mgt.core.device.mgt.core; import com.google.gson.Gson; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.DeviceStatusTaskPluginConfig; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.InvalidConfigurationException; import io.entgra.device.mgt.core.device.mgt.common.OperationMonitoringTaskConfig; import io.entgra.device.mgt.core.device.mgt.common.ProvisioningConfig; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.InvalidConfigurationException; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManager; import io.entgra.device.mgt.core.device.mgt.common.pull.notification.PullNotificationSubscriber; import io.entgra.device.mgt.core.device.mgt.common.push.notification.NotificationStrategy; @@ -49,6 +46,9 @@ import io.entgra.device.mgt.core.device.mgt.core.status.task.impl.DeviceStatusTa import io.entgra.device.mgt.core.device.mgt.core.task.DeviceMgtTaskException; import io.entgra.device.mgt.core.device.mgt.core.task.DeviceTaskManagerService; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.util.Collections; import java.util.HashMap; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/app/mgt/ApplicationManagerProviderServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/app/mgt/ApplicationManagerProviderServiceImpl.java index ebf7dc443e..627aecf659 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/app/mgt/ApplicationManagerProviderServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/app/mgt/ApplicationManagerProviderServiceImpl.java @@ -19,18 +19,14 @@ package io.entgra.device.mgt.core.device.mgt.core.app.mgt; import com.google.gson.Gson; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.CarbonContext; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; +import io.entgra.device.mgt.core.device.mgt.common.app.mgt.Application; +import io.entgra.device.mgt.core.device.mgt.common.app.mgt.ApplicationManagementException; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceDetailsWrapper; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.InvalidDeviceException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; -import io.entgra.device.mgt.core.device.mgt.common.app.mgt.Application; -import io.entgra.device.mgt.core.device.mgt.common.app.mgt.ApplicationManagementException; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Activity; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManagementException; @@ -41,6 +37,10 @@ import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOExceptio import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; import io.entgra.device.mgt.core.device.mgt.core.util.HttpReportingUtil; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.CarbonContext; import java.sql.SQLException; import java.util.ArrayList; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/app/mgt/config/AppManagementConfigurationManager.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/app/mgt/config/AppManagementConfigurationManager.java index 5c755616ef..130a629789 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/app/mgt/config/AppManagementConfigurationManager.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/app/mgt/config/AppManagementConfigurationManager.java @@ -18,9 +18,9 @@ package io.entgra.device.mgt.core.device.mgt.core.app.mgt.config; -import org.w3c.dom.Document; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.ApplicationManagementException; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; +import org.w3c.dom.Document; import org.wso2.carbon.utils.CarbonUtils; import javax.xml.bind.JAXBContext; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/app/mgt/oauth/ServiceAuthenticator.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/app/mgt/oauth/ServiceAuthenticator.java index cb3b519158..301d1b1634 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/app/mgt/oauth/ServiceAuthenticator.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/app/mgt/oauth/ServiceAuthenticator.java @@ -18,10 +18,10 @@ package io.entgra.device.mgt.core.device.mgt.core.app.mgt.oauth; +import io.entgra.device.mgt.core.device.mgt.common.app.mgt.ApplicationManagementException; import org.apache.axis2.client.Options; import org.apache.axis2.client.ServiceClient; import org.apache.axis2.transport.http.HttpTransportProperties; -import io.entgra.device.mgt.core.device.mgt.common.app.mgt.ApplicationManagementException; /** * Authenticate a given service client. diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/archival/ArchivalServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/archival/ArchivalServiceImpl.java index d78e08efb6..db6be2f8f1 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/archival/ArchivalServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/archival/ArchivalServiceImpl.java @@ -18,15 +18,11 @@ package io.entgra.device.mgt.core.device.mgt.core.archival; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; -import io.entgra.device.mgt.core.device.mgt.core.archival.dao.ArchivalDAO; -import io.entgra.device.mgt.core.device.mgt.core.archival.dao.ArchivalDAOException; -import io.entgra.device.mgt.core.device.mgt.core.archival.dao.ArchivalDestinationDAOFactory; -import io.entgra.device.mgt.core.device.mgt.core.archival.dao.ArchivalSourceDAOFactory; -import io.entgra.device.mgt.core.device.mgt.core.archival.dao.DataDeletionDAO; +import io.entgra.device.mgt.core.device.mgt.core.archival.dao.*; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.SQLException; import java.sql.Timestamp; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/archival/dao/ArchivalDestinationDAOFactory.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/archival/dao/ArchivalDestinationDAOFactory.java index 0cd663e001..f1fb05d2eb 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/archival/dao/ArchivalDestinationDAOFactory.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/archival/dao/ArchivalDestinationDAOFactory.java @@ -18,8 +18,6 @@ package io.entgra.device.mgt.core.device.mgt.core.archival.dao; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.exceptions.IllegalTransactionStateException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; import io.entgra.device.mgt.core.device.mgt.core.archival.dao.impl.DataDeletionDAOImpl; @@ -28,6 +26,8 @@ import io.entgra.device.mgt.core.device.mgt.core.config.datasource.DataSourceCon import io.entgra.device.mgt.core.device.mgt.core.config.datasource.JNDILookupDefinition; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOFactory; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.sql.DataSource; import java.sql.Connection; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/archival/dao/ArchivalSourceDAOFactory.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/archival/dao/ArchivalSourceDAOFactory.java index 4d5c9b96cd..d06ce8a411 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/archival/dao/ArchivalSourceDAOFactory.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/archival/dao/ArchivalSourceDAOFactory.java @@ -18,8 +18,6 @@ package io.entgra.device.mgt.core.device.mgt.core.archival.dao; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.exceptions.IllegalTransactionStateException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; import io.entgra.device.mgt.core.device.mgt.core.archival.dao.impl.ArchivalDAOImpl; @@ -29,6 +27,8 @@ import io.entgra.device.mgt.core.device.mgt.core.config.datasource.DataSourceCon import io.entgra.device.mgt.core.device.mgt.core.config.datasource.JNDILookupDefinition; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOFactory; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.sql.DataSource; import java.sql.Connection; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/archival/dao/impl/ArchivalDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/archival/dao/impl/ArchivalDAOImpl.java index e4b6aac52c..54a20b8670 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/archival/dao/impl/ArchivalDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/archival/dao/impl/ArchivalDAOImpl.java @@ -18,21 +18,12 @@ package io.entgra.device.mgt.core.device.mgt.core.archival.dao.impl; +import io.entgra.device.mgt.core.device.mgt.core.archival.dao.*; +import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.core.archival.dao.ArchivalDAO; -import io.entgra.device.mgt.core.device.mgt.core.archival.dao.ArchivalDAOException; -import io.entgra.device.mgt.core.device.mgt.core.archival.dao.ArchivalDAOUtil; -import io.entgra.device.mgt.core.device.mgt.core.archival.dao.ArchivalDestinationDAOFactory; -import io.entgra.device.mgt.core.device.mgt.core.archival.dao.ArchivalSourceDAOFactory; -import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.sql.Timestamp; +import java.sql.*; import java.util.ArrayList; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/archival/dao/impl/DataDeletionDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/archival/dao/impl/DataDeletionDAOImpl.java index 324d7a316f..ffc7841b5b 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/archival/dao/impl/DataDeletionDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/archival/dao/impl/DataDeletionDAOImpl.java @@ -18,13 +18,13 @@ package io.entgra.device.mgt.core.device.mgt.core.archival.dao.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.core.archival.dao.ArchivalDAOException; import io.entgra.device.mgt.core.device.mgt.core.archival.dao.ArchivalDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.archival.dao.ArchivalDestinationDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.archival.dao.DataDeletionDAO; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/authorization/DeviceAccessAuthorizationServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/authorization/DeviceAccessAuthorizationServiceImpl.java index 0bbcab246d..2aec915d1e 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/authorization/DeviceAccessAuthorizationServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/authorization/DeviceAccessAuthorizationServiceImpl.java @@ -18,23 +18,24 @@ package io.entgra.device.mgt.core.device.mgt.core.authorization; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.CarbonConstants; -import org.wso2.carbon.context.CarbonContext; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAccessAuthorizationException; import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAccessAuthorizationService; import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAuthorizationResult; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupManagementException; import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.Permission; import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagementException; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; import io.entgra.device.mgt.core.device.mgt.core.permission.mgt.PermissionUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.CarbonConstants; +import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.user.api.UserRealm; import org.wso2.carbon.user.api.UserStoreException; + import java.util.Iterator; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/cache/DeviceCacheManager.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/cache/DeviceCacheManager.java index b65f4a5221..692ba65f91 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/cache/DeviceCacheManager.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/cache/DeviceCacheManager.java @@ -18,8 +18,8 @@ package io.entgra.device.mgt.core.device.mgt.core.cache; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.Device; +import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/cache/impl/BillingCacheManagerImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/cache/impl/BillingCacheManagerImpl.java index 068b28c935..8db28e6bd7 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/cache/impl/BillingCacheManagerImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/cache/impl/BillingCacheManagerImpl.java @@ -18,13 +18,13 @@ package io.entgra.device.mgt.core.device.mgt.core.cache.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.core.cache.BillingCacheKey; import io.entgra.device.mgt.core.device.mgt.core.cache.BillingCacheManager; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.cache.Cache; import java.sql.Timestamp; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/cache/impl/DeviceCacheManagerImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/cache/impl/DeviceCacheManagerImpl.java index 6243e617cc..2e37edd95d 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/cache/impl/DeviceCacheManagerImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/cache/impl/DeviceCacheManagerImpl.java @@ -18,13 +18,13 @@ package io.entgra.device.mgt.core.device.mgt.core.cache.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.core.cache.DeviceCacheKey; import io.entgra.device.mgt.core.device.mgt.core.cache.DeviceCacheManager; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.cache.Cache; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/common/util/FileUtil.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/common/util/FileUtil.java index 04ba70443c..d645141d38 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/common/util/FileUtil.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/common/util/FileUtil.java @@ -18,8 +18,8 @@ package io.entgra.device.mgt.core.device.mgt.core.common.util; -import org.apache.commons.io.FileUtils; import io.entgra.device.mgt.core.device.mgt.common.Base64File; +import org.apache.commons.io.FileUtils; import java.io.ByteArrayInputStream; import java.io.File; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/common/util/HttpUtil.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/common/util/HttpUtil.java index 919e86a9fd..1a96c9d9d1 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/common/util/HttpUtil.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/common/util/HttpUtil.java @@ -17,13 +17,14 @@ */ package io.entgra.device.mgt.core.device.mgt.core.common.util; +import io.entgra.device.mgt.core.device.mgt.core.common.Constants; import org.apache.commons.codec.binary.Base64; import org.apache.commons.lang.StringUtils; import org.apache.commons.validator.routines.UrlValidator; import org.apache.http.HttpResponse; import org.apache.http.entity.ContentType; import org.apache.http.util.EntityUtils; -import io.entgra.device.mgt.core.device.mgt.core.common.Constants; + import java.io.IOException; import java.net.URI; import java.util.ArrayList; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/common/util/StorageManagementUtil.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/common/util/StorageManagementUtil.java index 09f4600281..16b4e42bad 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/common/util/StorageManagementUtil.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/common/util/StorageManagementUtil.java @@ -18,18 +18,12 @@ package io.entgra.device.mgt.core.device.mgt.core.common.util; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.Base64File; import io.entgra.device.mgt.core.device.mgt.core.common.exception.StorageManagementException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; +import java.io.*; import java.nio.file.Files; /** diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/DeviceConfigurationManager.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/DeviceConfigurationManager.java index ee8c992cdc..ffabb2ec4a 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/DeviceConfigurationManager.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/DeviceConfigurationManager.java @@ -18,10 +18,10 @@ package io.entgra.device.mgt.core.device.mgt.core.config; -import org.w3c.dom.Document; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; +import org.w3c.dom.Document; import org.wso2.carbon.utils.CarbonUtils; import javax.xml.bind.JAXBContext; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/DeviceManagementConfig.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/DeviceManagementConfig.java index 51c07e05c4..8841ac31ce 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/DeviceManagementConfig.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/DeviceManagementConfig.java @@ -26,12 +26,11 @@ import io.entgra.device.mgt.core.device.mgt.core.config.cache.CertificateCacheCo import io.entgra.device.mgt.core.device.mgt.core.config.cache.DeviceCacheConfiguration; import io.entgra.device.mgt.core.device.mgt.core.config.cache.GeoFenceCacheConfiguration; import io.entgra.device.mgt.core.device.mgt.core.config.enrollment.guide.EnrollmentGuideConfiguration; -import io.entgra.device.mgt.core.device.mgt.core.config.operation.timeout.OperationTimeoutConfiguration; -import io.entgra.device.mgt.core.device.mgt.core.config.metadata.mgt.MetaDataConfiguration; -import io.entgra.device.mgt.core.device.mgt.core.event.config.EventOperationTaskConfiguration; import io.entgra.device.mgt.core.device.mgt.core.config.geo.location.GeoLocationConfiguration; import io.entgra.device.mgt.core.device.mgt.core.config.identity.IdentityConfigurations; import io.entgra.device.mgt.core.device.mgt.core.config.keymanager.KeyManagerConfigurations; +import io.entgra.device.mgt.core.device.mgt.core.config.metadata.mgt.MetaDataConfiguration; +import io.entgra.device.mgt.core.device.mgt.core.config.operation.timeout.OperationTimeoutConfiguration; import io.entgra.device.mgt.core.device.mgt.core.config.pagination.PaginationConfiguration; import io.entgra.device.mgt.core.device.mgt.core.config.policy.PolicyConfiguration; import io.entgra.device.mgt.core.device.mgt.core.config.pull.notification.PullNotificationConfiguration; @@ -39,6 +38,7 @@ import io.entgra.device.mgt.core.device.mgt.core.config.push.notification.PushNo import io.entgra.device.mgt.core.device.mgt.core.config.remote.session.RemoteSessionConfiguration; import io.entgra.device.mgt.core.device.mgt.core.config.status.task.DeviceStatusTaskConfig; import io.entgra.device.mgt.core.device.mgt.core.config.task.TaskConfiguration; +import io.entgra.device.mgt.core.device.mgt.core.event.config.EventOperationTaskConfiguration; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/license/LicenseConfigurationManager.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/license/LicenseConfigurationManager.java index b7cf1ff6fc..9bbfef6cdd 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/license/LicenseConfigurationManager.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/license/LicenseConfigurationManager.java @@ -20,10 +20,10 @@ package io.entgra.device.mgt.core.device.mgt.core.config.license; -import org.w3c.dom.Document; -import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.common.license.mgt.LicenseManagementException; +import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; +import org.w3c.dom.Document; import org.wso2.carbon.utils.CarbonUtils; import javax.xml.bind.JAXBContext; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/permission/AnnotationProcessor.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/permission/AnnotationProcessor.java index 6fd15af267..a79316c762 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/permission/AnnotationProcessor.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/permission/AnnotationProcessor.java @@ -19,22 +19,14 @@ package io.entgra.device.mgt.core.device.mgt.core.config.permission; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; +import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.Permission; import io.swagger.annotations.SwaggerDefinition; import org.apache.catalina.core.StandardContext; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.Permission; import javax.servlet.ServletContext; -import javax.ws.rs.Consumes; -import javax.ws.rs.DELETE; -import javax.ws.rs.GET; -import javax.ws.rs.HttpMethod; -import javax.ws.rs.OPTIONS; -import javax.ws.rs.POST; -import javax.ws.rs.PUT; -import javax.ws.rs.Path; -import javax.ws.rs.Produces; +import javax.ws.rs.*; import java.io.File; import java.io.IOException; import java.lang.annotation.Annotation; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/permission/lifecycle/WebAppDeploymentLifecycleListener.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/permission/lifecycle/WebAppDeploymentLifecycleListener.java index 56163440b8..7fb91b1d95 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/permission/lifecycle/WebAppDeploymentLifecycleListener.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/permission/lifecycle/WebAppDeploymentLifecycleListener.java @@ -18,17 +18,17 @@ package io.entgra.device.mgt.core.device.mgt.core.config.permission.lifecycle; +import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.Permission; +import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagementException; +import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagerService; +import io.entgra.device.mgt.core.device.mgt.core.config.permission.AnnotationProcessor; +import io.entgra.device.mgt.core.device.mgt.core.permission.mgt.PermissionManagerServiceImpl; import org.apache.catalina.Lifecycle; import org.apache.catalina.LifecycleEvent; import org.apache.catalina.LifecycleListener; import org.apache.catalina.core.StandardContext; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.Permission; -import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagementException; -import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagerService; -import io.entgra.device.mgt.core.device.mgt.core.config.permission.AnnotationProcessor; -import io.entgra.device.mgt.core.device.mgt.core.permission.mgt.PermissionManagerServiceImpl; import javax.servlet.ServletContext; import java.io.IOException; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/tenant/PlatformConfigurationManagementServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/tenant/PlatformConfigurationManagementServiceImpl.java index 64e44bfd64..d26974a835 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/tenant/PlatformConfigurationManagementServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/tenant/PlatformConfigurationManagementServiceImpl.java @@ -17,15 +17,15 @@ */ package io.entgra.device.mgt.core.device.mgt.core.config.tenant; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationManagementException; import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfiguration; import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService; import io.entgra.device.mgt.core.device.mgt.core.config.ConfigurationManagerConstants; import io.entgra.device.mgt.core.device.mgt.core.config.util.ConfigurationManagerUtil; -import org.wso2.carbon.registry.api.Resource; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.wso2.carbon.registry.api.RegistryException; +import org.wso2.carbon.registry.api.Resource; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/ui/UIConfigurationManager.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/ui/UIConfigurationManager.java index e717786b59..a9becf6019 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/ui/UIConfigurationManager.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/ui/UIConfigurationManager.java @@ -18,12 +18,12 @@ package io.entgra.device.mgt.core.device.mgt.core.config.ui; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.w3c.dom.Document; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.w3c.dom.Document; import org.wso2.carbon.utils.CarbonUtils; import javax.xml.bind.JAXBContext; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/util/ConfigurationManagerUtil.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/util/ConfigurationManagerUtil.java index b65515fac3..4cd83fa064 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/util/ConfigurationManagerUtil.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/util/ConfigurationManagerUtil.java @@ -17,9 +17,9 @@ */ package io.entgra.device.mgt.core.device.mgt.core.config.util; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationManagementException; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.registry.api.RegistryException; import org.wso2.carbon.registry.api.Resource; import org.wso2.carbon.registry.core.Registry; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/ApplicationDAO.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/ApplicationDAO.java index 626b05538a..55a513feca 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/ApplicationDAO.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/ApplicationDAO.java @@ -19,7 +19,6 @@ package io.entgra.device.mgt.core.device.mgt.core.dao; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.Application; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/DeviceDAO.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/DeviceDAO.java index 8ba7d64412..a1e2792bea 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/DeviceDAO.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/DeviceDAO.java @@ -35,16 +35,16 @@ package io.entgra.device.mgt.core.device.mgt.core.dao; -import org.apache.commons.collections.map.SingletonMap; import io.entgra.device.mgt.core.device.mgt.common.*; import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo.Status; import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.DevicePropertyInfo; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceData; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceLocationHistorySnapshot; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceMonitoringData; +import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoCluster; import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoQuery; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoCluster; +import org.apache.commons.collections.map.SingletonMap; import java.sql.SQLException; import java.sql.Timestamp; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/DeviceManagementDAOFactory.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/DeviceManagementDAOFactory.java index 700b289a4b..0726bd6d18 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/DeviceManagementDAOFactory.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/DeviceManagementDAOFactory.java @@ -18,15 +18,15 @@ package io.entgra.device.mgt.core.device.mgt.core.dao; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.common.exceptions.IllegalTransactionStateException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.UnsupportedDatabaseEngineException; import io.entgra.device.mgt.core.device.mgt.core.config.datasource.DataSourceConfig; import io.entgra.device.mgt.core.device.mgt.core.config.datasource.JNDILookupDefinition; -import io.entgra.device.mgt.core.device.mgt.core.dao.impl.*; +import io.entgra.device.mgt.core.device.mgt.core.dao.impl.ApplicationDAOImpl; +import io.entgra.device.mgt.core.device.mgt.core.dao.impl.DeviceStatusDAOImpl; +import io.entgra.device.mgt.core.device.mgt.core.dao.impl.DeviceTypeDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.device.GenericDeviceDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.device.OracleDeviceDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.device.PostgreSQLDeviceDAOImpl; @@ -39,6 +39,8 @@ import io.entgra.device.mgt.core.device.mgt.core.device.details.mgt.dao.DeviceDe import io.entgra.device.mgt.core.device.mgt.core.device.details.mgt.dao.impl.DeviceDetailsDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.privacy.dao.PrivacyComplianceDAO; import io.entgra.device.mgt.core.device.mgt.core.privacy.dao.impl.PrivacyComplianceDAOImpl; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.sql.DataSource; import java.sql.Connection; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/DeviceStatusDAO.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/DeviceStatusDAO.java index bd278a5c67..58c6b6062e 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/DeviceStatusDAO.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/DeviceStatusDAO.java @@ -18,9 +18,6 @@ */ package io.entgra.device.mgt.core.device.mgt.core.dao; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; -import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo.Status; import io.entgra.device.mgt.core.device.mgt.common.type.mgt.DeviceStatus; import java.util.Date; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/EnrollmentDAO.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/EnrollmentDAO.java index 67101585de..fb2f071aaf 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/EnrollmentDAO.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/EnrollmentDAO.java @@ -22,7 +22,6 @@ import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo.Status; -import java.sql.Timestamp; import java.util.List; public interface EnrollmentDAO { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/EventConfigDAO.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/EventConfigDAO.java index 2776ffe10f..31d09e55b9 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/EventConfigDAO.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/EventConfigDAO.java @@ -21,7 +21,6 @@ package io.entgra.device.mgt.core.device.mgt.core.dao; import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfig; import java.util.List; -import java.util.Map; public interface EventConfigDAO { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/EventManagementDAOFactory.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/EventManagementDAOFactory.java index 8640c3bef8..e71db748e6 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/EventManagementDAOFactory.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/EventManagementDAOFactory.java @@ -18,20 +18,19 @@ package io.entgra.device.mgt.core.device.mgt.core.dao; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.common.exceptions.IllegalTransactionStateException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.UnsupportedDatabaseEngineException; import io.entgra.device.mgt.core.device.mgt.core.config.datasource.DataSourceConfig; import io.entgra.device.mgt.core.device.mgt.core.config.datasource.JNDILookupDefinition; -import io.entgra.device.mgt.core.device.mgt.core.dao.impl.*; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.event.GenericEventConfigDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.event.H2EventConfigDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.geofence.GenericGeofenceDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.geofence.SQLServerGeofenceDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.sql.DataSource; import java.sql.Connection; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/GroupDAO.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/GroupDAO.java index 96e056c262..e32f0b96c0 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/GroupDAO.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/GroupDAO.java @@ -38,7 +38,6 @@ package io.entgra.device.mgt.core.device.mgt.core.dao; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.GroupPaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.ReportManagementException; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/GroupManagementDAOFactory.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/GroupManagementDAOFactory.java index 3e629e45c1..10817ccfdf 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/GroupManagementDAOFactory.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/GroupManagementDAOFactory.java @@ -18,8 +18,6 @@ package io.entgra.device.mgt.core.device.mgt.core.dao; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.common.exceptions.IllegalTransactionStateException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; @@ -31,6 +29,8 @@ import io.entgra.device.mgt.core.device.mgt.core.dao.impl.group.OracleGroupDAOIm import io.entgra.device.mgt.core.device.mgt.core.dao.impl.group.PostgreSQLGroupDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.group.SQLServerGroupDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.dao.util.GroupManagementDAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.sql.DataSource; import java.sql.Connection; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/TrackerManagementDAOFactory.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/TrackerManagementDAOFactory.java index ebf658e9b6..152c1ea959 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/TrackerManagementDAOFactory.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/TrackerManagementDAOFactory.java @@ -18,8 +18,6 @@ package io.entgra.device.mgt.core.device.mgt.core.dao; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.common.exceptions.IllegalTransactionStateException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; @@ -28,6 +26,8 @@ import io.entgra.device.mgt.core.device.mgt.core.config.datasource.DataSourceCon import io.entgra.device.mgt.core.device.mgt.core.config.datasource.JNDILookupDefinition; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.tracker.TrackerDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.sql.DataSource; import java.sql.Connection; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java index 072cb742b1..b806b2eb69 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractDeviceDAOImpl.java @@ -36,9 +36,6 @@ package io.entgra.device.mgt.core.device.mgt.core.dao.impl; -import org.apache.commons.collections.map.SingletonMap; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; @@ -48,28 +45,21 @@ import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.DevicePrope import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceData; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceLocationHistorySnapshot; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceMonitoringData; +import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoCluster; +import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoCoordinate; import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoQuery; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceDAO; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoCluster; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoCoordinate; +import org.apache.commons.collections.map.SingletonMap; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.LogFactory; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; +import java.sql.*; import java.util.Date; -import java.util.List; -import java.util.Map; -import java.util.StringJoiner; +import java.util.*; public abstract class AbstractDeviceDAOImpl implements DeviceDAO { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractEnrollmentDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractEnrollmentDAOImpl.java index dd1241c505..e707113d1f 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractEnrollmentDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractEnrollmentDAOImpl.java @@ -18,7 +18,6 @@ */ package io.entgra.device.mgt.core.device.mgt.core.dao.impl; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; @@ -26,13 +25,9 @@ import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOExceptio import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.EnrollmentDAO; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; +import org.wso2.carbon.context.PrivilegedCarbonContext; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.sql.Timestamp; +import java.sql.*; import java.util.ArrayList; import java.util.Date; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractEventConfigDAO.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractEventConfigDAO.java index f6fb072b2e..1d7655d8d6 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractEventConfigDAO.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractEventConfigDAO.java @@ -18,24 +18,20 @@ package io.entgra.device.mgt.core.device.mgt.core.dao.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfig; -import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.EventConfigDAO; import io.entgra.device.mgt.core.device.mgt.core.dao.EventManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.dao.EventManagementDAOFactory; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; -import java.sql.Timestamp; import java.util.ArrayList; import java.util.Collections; -import java.util.HashMap; import java.util.List; -import java.util.Map; public abstract class AbstractEventConfigDAO implements EventConfigDAO { private static final Log log = LogFactory.getLog(AbstractEventConfigDAO.class); diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractGeofenceDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractGeofenceDAOImpl.java index 28a59fd391..630d55a012 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractGeofenceDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractGeofenceDAOImpl.java @@ -18,8 +18,6 @@ package io.entgra.device.mgt.core.device.mgt.core.dao.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfig; @@ -28,21 +26,12 @@ import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOExceptio import io.entgra.device.mgt.core.device.mgt.core.dao.EventManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.GeofenceDAO; import io.entgra.device.mgt.core.device.mgt.core.dto.event.config.GeoFenceGroupMap; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Collections; +import java.sql.*; import java.util.Date; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; public abstract class AbstractGeofenceDAOImpl implements GeofenceDAO { private static final Log log = LogFactory.getLog(AbstractGeofenceDAOImpl.class); diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractGroupDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractGroupDAOImpl.java index f1da6e3269..115ad8a7bb 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractGroupDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/AbstractGroupDAOImpl.java @@ -35,9 +35,6 @@ package io.entgra.device.mgt.core.device.mgt.core.dao.impl; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.GroupPaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; @@ -47,16 +44,15 @@ import io.entgra.device.mgt.core.device.mgt.core.dao.GroupManagementDAOException import io.entgra.device.mgt.core.device.mgt.core.dao.GroupManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.dao.util.GroupManagementDAOUtil; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.StringJoiner; +import java.util.*; /** * This class represents implementation of GroupDAO diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/ApplicationDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/ApplicationDAOImpl.java index c4f1d7a6db..a85dc0fe0a 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/ApplicationDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/ApplicationDAOImpl.java @@ -18,15 +18,14 @@ */ package io.entgra.device.mgt.core.device.mgt.core.dao.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.Application; import io.entgra.device.mgt.core.device.mgt.core.dao.ApplicationDAO; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; - +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.io.ByteArrayInputStream; import java.io.IOException; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/DeviceStatusDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/DeviceStatusDAOImpl.java index d80bc78022..df91913cb6 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/DeviceStatusDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/DeviceStatusDAOImpl.java @@ -5,7 +5,6 @@ import io.entgra.device.mgt.core.device.mgt.common.type.mgt.DeviceStatus; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceStatusDAO; -import io.entgra.device.mgt.core.device.mgt.core.dao.EnrollmentDAO; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; import java.sql.*; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/DeviceTypeDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/DeviceTypeDAOImpl.java index 77abcbe484..4c0625f056 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/DeviceTypeDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/DeviceTypeDAOImpl.java @@ -35,9 +35,6 @@ package io.entgra.device.mgt.core.device.mgt.core.dao.impl; import com.google.gson.Gson; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.type.mgt.DeviceTypeMetaDefinition; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOException; @@ -46,19 +43,11 @@ import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceTypeDAO; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceTypeVersion; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; - -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.io.PrintWriter; -import java.nio.file.Files; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import java.sql.*; import java.util.ArrayList; import java.util.Date; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java index 400bb8c3f3..6d247250e7 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/GenericDeviceDAOImpl.java @@ -18,25 +18,17 @@ package io.entgra.device.mgt.core.device.mgt.core.dao.impl.device; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.Count; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; -import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; -import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; +import io.entgra.device.mgt.core.device.mgt.common.*; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceInfo; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.AbstractDeviceDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.report.mgt.Constants; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; +import java.sql.*; import java.util.ArrayList; import java.util.Date; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/OracleDeviceDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/OracleDeviceDAOImpl.java index 1da26e841c..849babdb8b 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/OracleDeviceDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/OracleDeviceDAOImpl.java @@ -18,12 +18,8 @@ package io.entgra.device.mgt.core.device.mgt.core.dao.impl.device; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.Count; import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceBilling; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceInfo; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOException; @@ -31,13 +27,11 @@ import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.AbstractDeviceDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.report.mgt.Constants; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; +import java.sql.*; import java.util.ArrayList; import java.util.Date; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/PostgreSQLDeviceDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/PostgreSQLDeviceDAOImpl.java index 7b72d1edf3..f5ee804bf4 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/PostgreSQLDeviceDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/PostgreSQLDeviceDAOImpl.java @@ -18,12 +18,8 @@ package io.entgra.device.mgt.core.device.mgt.core.dao.impl.device; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.Count; import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceBilling; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceInfo; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOException; @@ -31,12 +27,10 @@ import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.AbstractDeviceDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.report.mgt.Constants; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; +import java.sql.*; import java.util.ArrayList; import java.util.Date; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/SQLServerDeviceDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/SQLServerDeviceDAOImpl.java index 3d695e0670..ce8fd9e9db 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/SQLServerDeviceDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/device/SQLServerDeviceDAOImpl.java @@ -18,27 +18,20 @@ package io.entgra.device.mgt.core.device.mgt.core.dao.impl.device; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.Count; import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceBilling; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceInfo; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.AbstractDeviceDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoCluster; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoCoordinate; import io.entgra.device.mgt.core.device.mgt.core.report.mgt.Constants; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; +import java.sql.*; import java.util.ArrayList; import java.util.Date; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/enrolment/GenericEnrollmentDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/enrolment/GenericEnrollmentDAOImpl.java index 09f27ca257..4a1415f2f7 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/enrolment/GenericEnrollmentDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/enrolment/GenericEnrollmentDAOImpl.java @@ -18,7 +18,6 @@ */ package io.entgra.device.mgt.core.device.mgt.core.dao.impl.enrolment; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; @@ -26,6 +25,7 @@ import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOExceptio import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.AbstractEnrollmentDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.sql.*; import java.util.ArrayList; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/enrolment/SQLServerEnrollmentDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/enrolment/SQLServerEnrollmentDAOImpl.java index 0bc07bfa55..a4b0b3874f 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/enrolment/SQLServerEnrollmentDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/enrolment/SQLServerEnrollmentDAOImpl.java @@ -18,7 +18,6 @@ */ package io.entgra.device.mgt.core.device.mgt.core.dao.impl.enrolment; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; @@ -26,6 +25,8 @@ import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOExceptio import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.AbstractEnrollmentDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; +import org.wso2.carbon.context.PrivilegedCarbonContext; + import java.sql.*; import java.util.ArrayList; import java.util.Date; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/event/GenericEventConfigDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/event/GenericEventConfigDAOImpl.java index 3f3b0fad60..04131e40b8 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/event/GenericEventConfigDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/event/GenericEventConfigDAOImpl.java @@ -18,19 +18,14 @@ package io.entgra.device.mgt.core.device.mgt.core.dao.impl.event; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfig; import io.entgra.device.mgt.core.device.mgt.core.dao.EventManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.dao.EventManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.AbstractEventConfigDAO; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.sql.Timestamp; +import java.sql.*; import java.util.ArrayList; import java.util.Date; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/event/H2EventConfigDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/event/H2EventConfigDAOImpl.java index 3b89c9d0f1..1afce08917 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/event/H2EventConfigDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/event/H2EventConfigDAOImpl.java @@ -18,20 +18,14 @@ package io.entgra.device.mgt.core.device.mgt.core.dao.impl.event; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfig; -import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.EventManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.dao.EventManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.AbstractEventConfigDAO; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.sql.Timestamp; +import java.sql.*; import java.util.ArrayList; import java.util.Date; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/geofence/GenericGeofenceDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/geofence/GenericGeofenceDAOImpl.java index cc1f6349d6..6b84531dea 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/geofence/GenericGeofenceDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/geofence/GenericGeofenceDAOImpl.java @@ -18,17 +18,16 @@ package io.entgra.device.mgt.core.device.mgt.core.dao.impl.geofence; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfig; import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeofenceData; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.dao.EventManagementDAOFactory; -import io.entgra.device.mgt.core.device.mgt.core.dao.GeofenceDAO; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.AbstractGeofenceDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.dto.event.config.GeoFenceGroupMap; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.*; import java.util.Date; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/geofence/SQLServerGeofenceDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/geofence/SQLServerGeofenceDAOImpl.java index 0fdb37441b..7d4d74221f 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/geofence/SQLServerGeofenceDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/geofence/SQLServerGeofenceDAOImpl.java @@ -18,21 +18,21 @@ package io.entgra.device.mgt.core.device.mgt.core.dao.impl.geofence; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfig; import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeofenceData; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.dao.EventManagementDAOFactory; -import io.entgra.device.mgt.core.device.mgt.core.dao.GeofenceDAO; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.AbstractGeofenceDAOImpl; -import io.entgra.device.mgt.core.device.mgt.core.dto.event.config.GeoFenceGroupMap; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import java.sql.*; -import java.util.Date; -import java.util.*; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.util.ArrayList; +import java.util.List; public class SQLServerGeofenceDAOImpl extends AbstractGeofenceDAOImpl { private static final Log log = LogFactory.getLog(SQLServerGeofenceDAOImpl.class); diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/group/OracleGroupDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/group/OracleGroupDAOImpl.java index eec782e874..fcfdacdb51 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/group/OracleGroupDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/group/OracleGroupDAOImpl.java @@ -35,7 +35,6 @@ package io.entgra.device.mgt.core.device.mgt.core.dao.impl.group; -import org.apache.commons.lang.StringUtils; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.GroupPaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; @@ -44,6 +43,7 @@ import io.entgra.device.mgt.core.device.mgt.core.dao.GroupManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.AbstractGroupDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.dao.util.GroupManagementDAOUtil; +import org.apache.commons.lang.StringUtils; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/group/PostgreSQLGroupDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/group/PostgreSQLGroupDAOImpl.java index 128fcf0fb9..d1df92f20a 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/group/PostgreSQLGroupDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/group/PostgreSQLGroupDAOImpl.java @@ -35,7 +35,6 @@ package io.entgra.device.mgt.core.device.mgt.core.dao.impl.group; -import org.apache.solr.common.StringUtils; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; import io.entgra.device.mgt.core.device.mgt.core.dao.GroupManagementDAOException; @@ -43,6 +42,7 @@ import io.entgra.device.mgt.core.device.mgt.core.dao.GroupManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.AbstractGroupDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.dao.util.GroupManagementDAOUtil; +import org.apache.solr.common.StringUtils; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/group/SQLServerGroupDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/group/SQLServerGroupDAOImpl.java index 22d249103f..37db6d2e21 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/group/SQLServerGroupDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/group/SQLServerGroupDAOImpl.java @@ -35,7 +35,6 @@ package io.entgra.device.mgt.core.device.mgt.core.dao.impl.group; -import org.apache.commons.lang.StringUtils; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.GroupPaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; @@ -44,6 +43,7 @@ import io.entgra.device.mgt.core.device.mgt.core.dao.GroupManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.impl.AbstractGroupDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.dao.util.GroupManagementDAOUtil; +import org.apache.commons.lang.StringUtils; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/tracker/TrackerDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/tracker/TrackerDAOImpl.java index 915ef7073e..fced5f2149 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/tracker/TrackerDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/impl/tracker/TrackerDAOImpl.java @@ -18,18 +18,16 @@ package io.entgra.device.mgt.core.device.mgt.core.dao.impl.tracker; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.TrackerDeviceInfo; import io.entgra.device.mgt.core.device.mgt.common.TrackerGroupInfo; import io.entgra.device.mgt.core.device.mgt.common.TrackerPermissionInfo; -import io.entgra.device.mgt.core.device.mgt.core.dao.TrackerManagementDAOFactory; -import io.entgra.device.mgt.core.device.mgt.core.dao.TrackerManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.dao.TrackerDAO; -import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; +import io.entgra.device.mgt.core.device.mgt.core.dao.TrackerManagementDAOException; +import io.entgra.device.mgt.core.device.mgt.core.dao.TrackerManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.util.TrackerManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.traccar.common.TraccarHandlerConstants; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/util/DeviceManagementDAOUtil.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/util/DeviceManagementDAOUtil.java index 0b5281352d..e357af55e1 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/util/DeviceManagementDAOUtil.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/util/DeviceManagementDAOUtil.java @@ -17,34 +17,32 @@ */ package io.entgra.device.mgt.core.device.mgt.core.dao.util; -import java.sql.*; -import java.time.Instant; -import java.time.LocalDateTime; -import java.time.ZoneId; -import java.util.*; -import java.util.Date; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.el.lang.ELSupport; -import org.wso2.carbon.context.CarbonContext; import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceBilling; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceInfo; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceLocationHistorySnapshot; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceMonitoringData; -import io.entgra.device.mgt.core.device.mgt.common.type.mgt.DeviceStatus; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.core.tenant.TenantManager; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; import javax.naming.InitialContext; import javax.sql.DataSource; +import java.sql.*; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.util.Date; +import java.util.HashMap; +import java.util.Hashtable; +import java.util.Map; public final class DeviceManagementDAOUtil { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/util/GroupManagementDAOUtil.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/util/GroupManagementDAOUtil.java index 9be9b835a8..82ab942c78 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/util/GroupManagementDAOUtil.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/util/GroupManagementDAOUtil.java @@ -34,9 +34,9 @@ package io.entgra.device.mgt.core.device.mgt.core.dao.util; +import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; import javax.naming.InitialContext; import javax.sql.DataSource; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/util/TrackerManagementDAOUtil.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/util/TrackerManagementDAOUtil.java index 62f0c33257..fc2981c0c0 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/util/TrackerManagementDAOUtil.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dao/util/TrackerManagementDAOUtil.java @@ -17,12 +17,12 @@ package io.entgra.device.mgt.core.device.mgt.core.dao.util; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.TrackerDeviceInfo; import io.entgra.device.mgt.core.device.mgt.common.TrackerGroupInfo; import io.entgra.device.mgt.core.device.mgt.common.TrackerPermissionInfo; import io.entgra.device.mgt.core.device.mgt.core.dao.TrackerManagementDAOException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.naming.InitialContext; import javax.sql.DataSource; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/DeviceInformationManager.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/DeviceInformationManager.java index 177c674bb8..993bdec9dd 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/DeviceInformationManager.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/DeviceInformationManager.java @@ -21,10 +21,8 @@ package io.entgra.device.mgt.core.device.mgt.core.device.details.mgt; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceInfo; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceLocation; -import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOException; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/dao/DeviceDetailsDAO.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/dao/DeviceDetailsDAO.java index a09936c510..75747a31d8 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/dao/DeviceDetailsDAO.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/dao/DeviceDetailsDAO.java @@ -20,7 +20,6 @@ package io.entgra.device.mgt.core.device.mgt.core.device.details.mgt.dao; import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceInfo; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceLocation; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java index 60eaf9e3e3..09f23217cb 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java @@ -19,18 +19,17 @@ package io.entgra.device.mgt.core.device.mgt.core.device.details.mgt.dao.impl; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceInfo; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceLocation; -import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.device.details.mgt.dao.DeviceDetailsDAO; import io.entgra.device.mgt.core.device.mgt.core.device.details.mgt.dao.DeviceDetailsMgtDAOException; import io.entgra.device.mgt.core.device.mgt.core.geo.geoHash.GeoHashGenerator; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java index edd656c6f4..12e6609f02 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java @@ -18,10 +18,6 @@ package io.entgra.device.mgt.core.device.mgt.core.device.details.mgt.impl; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.CarbonContext; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceDetailsWrapper; @@ -45,15 +41,14 @@ import io.entgra.device.mgt.core.device.mgt.core.report.mgt.Constants; import io.entgra.device.mgt.core.device.mgt.core.service.GroupManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; import io.entgra.device.mgt.core.device.mgt.core.util.HttpReportingUtil; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.user.api.UserStoreException; import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ExecutionException; +import java.util.*; public class DeviceInformationManagerImpl implements DeviceInformationManager { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dto/DeviceType.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dto/DeviceType.java index 1ca01a8bd4..f1c5fc2d17 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dto/DeviceType.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/dto/DeviceType.java @@ -18,9 +18,9 @@ package io.entgra.device.mgt.core.device.mgt.core.dto; +import io.entgra.device.mgt.core.device.mgt.common.type.mgt.DeviceTypeMetaDefinition; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import io.entgra.device.mgt.core.device.mgt.common.type.mgt.DeviceTypeMetaDefinition; import java.io.Serializable; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/event/config/EventConfigurationProviderServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/event/config/EventConfigurationProviderServiceImpl.java index 186dc0bfd7..e4a3a8b21a 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/event/config/EventConfigurationProviderServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/event/config/EventConfigurationProviderServiceImpl.java @@ -19,27 +19,23 @@ package io.entgra.device.mgt.core.device.mgt.core.event.config; import com.google.common.collect.Lists; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfig; import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfigurationException; import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfigurationProviderService; import io.entgra.device.mgt.core.device.mgt.common.event.config.EventMetaData; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; -import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; -import io.entgra.device.mgt.core.device.mgt.core.dao.*; +import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOException; +import io.entgra.device.mgt.core.device.mgt.core.dao.EventConfigDAO; +import io.entgra.device.mgt.core.device.mgt.core.dao.EventManagementDAOException; +import io.entgra.device.mgt.core.device.mgt.core.dao.EventManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.geo.task.GeoFenceEventOperationManager; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; +import java.util.*; public class EventConfigurationProviderServiceImpl implements EventConfigurationProviderService { private static final Log log = LogFactory.getLog(EventConfigurationProviderServiceImpl.class); diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/event/config/EventOperationExecutor.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/event/config/EventOperationExecutor.java index 5f261e48cb..517399ab95 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/event/config/EventOperationExecutor.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/event/config/EventOperationExecutor.java @@ -19,17 +19,10 @@ package io.entgra.device.mgt.core.device.mgt.core.event.config; import com.google.gson.Gson; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; -import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfig; -import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfigurationException; -import io.entgra.device.mgt.core.device.mgt.common.event.config.EventMetaData; -import io.entgra.device.mgt.core.device.mgt.common.event.config.EventOperation; -import io.entgra.device.mgt.core.device.mgt.common.event.config.EventRevokeOperation; +import io.entgra.device.mgt.core.device.mgt.common.event.config.*; import io.entgra.device.mgt.core.device.mgt.common.exceptions.InvalidDeviceException; import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoFenceEventMeta; import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoLocationBasedServiceException; @@ -43,12 +36,11 @@ import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.OperationMgtConst import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.ProfileOperation; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.service.GroupManagementProviderService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.List; -import java.util.Set; +import java.util.*; /** * Event create/revoke operation creation task. diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/event/config/GroupAssignmentEventOperationExecutor.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/event/config/GroupAssignmentEventOperationExecutor.java index 2aacb72801..4f207988f8 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/event/config/GroupAssignmentEventOperationExecutor.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/event/config/GroupAssignmentEventOperationExecutor.java @@ -19,9 +19,6 @@ package io.entgra.device.mgt.core.device.mgt.core.event.config; import com.google.gson.Gson; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfigurationException; @@ -40,6 +37,9 @@ import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHo import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.OperationMgtConstants; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.ProfileOperation; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.util.ArrayList; import java.util.Arrays; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/geo/service/GeoLocationProviderServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/geo/service/GeoLocationProviderServiceImpl.java index 88f0bb102c..22ccd060c2 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/geo/service/GeoLocationProviderServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/geo/service/GeoLocationProviderServiceImpl.java @@ -20,21 +20,6 @@ package io.entgra.device.mgt.core.device.mgt.core.geo.service; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; -import org.apache.axis2.AxisFault; -import org.apache.axis2.client.Options; -import org.apache.axis2.client.Stub; -import org.apache.axis2.java.security.SSLProtocolSocketFactory; -import org.apache.axis2.transport.http.HTTPConstants; -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.httpclient.Header; -import org.apache.commons.httpclient.protocol.Protocol; -import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; -import org.apache.commons.io.IOUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.base.ServerConfiguration; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.core.util.Utils; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants.GeoServices; @@ -43,13 +28,7 @@ import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfig; import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfigurationException; import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfigurationProviderService; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.Alert; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.AlertAlreadyExistException; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoFence; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoFenceEventMeta; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoLocationBasedServiceException; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoLocationProviderService; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeofenceData; +import io.entgra.device.mgt.core.device.mgt.common.geo.service.*; import io.entgra.device.mgt.core.device.mgt.core.cache.impl.GeoCacheManagerImpl; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; @@ -59,11 +38,26 @@ import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUti import io.entgra.device.mgt.core.device.mgt.core.dto.event.config.GeoFenceGroupMap; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.OperationMgtConstants; -import org.wso2.carbon.event.processor.stub.EventProcessorAdminServiceStub; -import org.wso2.carbon.event.processor.stub.types.ExecutionPlanConfigurationDto; import io.entgra.device.mgt.core.identity.jwt.client.extension.JWTClient; import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; import io.entgra.device.mgt.core.identity.jwt.client.extension.service.JWTClientManagerService; +import org.apache.axis2.AxisFault; +import org.apache.axis2.client.Options; +import org.apache.axis2.client.Stub; +import org.apache.axis2.java.security.SSLProtocolSocketFactory; +import org.apache.axis2.transport.http.HTTPConstants; +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.httpclient.Header; +import org.apache.commons.httpclient.protocol.Protocol; +import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; +import org.apache.commons.io.IOUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.base.ServerConfiguration; +import org.wso2.carbon.context.PrivilegedCarbonContext; +import org.wso2.carbon.core.util.Utils; +import org.wso2.carbon.event.processor.stub.EventProcessorAdminServiceStub; +import org.wso2.carbon.event.processor.stub.types.ExecutionPlanConfigurationDto; import org.wso2.carbon.registry.api.Registry; import org.wso2.carbon.registry.api.RegistryException; import org.wso2.carbon.registry.api.Resource; @@ -78,20 +72,10 @@ import java.io.InputStream; import java.io.StringWriter; import java.lang.reflect.Type; import java.nio.charset.StandardCharsets; -import java.security.KeyManagementException; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.UnrecoverableKeyException; +import java.security.*; import java.security.cert.CertificateException; import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; +import java.util.*; import static io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants.GeoServices.DAS_PORT; import static io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants.GeoServices.DEFAULT_HTTP_PROTOCOL; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/geo/task/GeoFenceEventOperationManager.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/geo/task/GeoFenceEventOperationManager.java index e31bfedb3a..a360c60532 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/geo/task/GeoFenceEventOperationManager.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/geo/task/GeoFenceEventOperationManager.java @@ -18,14 +18,14 @@ package io.entgra.device.mgt.core.device.mgt.core.geo.task; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.common.event.config.EventMetaData; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; import io.entgra.device.mgt.core.device.mgt.core.event.config.EventOperationExecutor; import io.entgra.device.mgt.core.device.mgt.core.event.config.GroupAssignmentEventOperationExecutor; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/ActivityDataPurgingServiceComponent.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/ActivityDataPurgingServiceComponent.java index fa7fcd7da9..edc1890188 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/ActivityDataPurgingServiceComponent.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/ActivityDataPurgingServiceComponent.java @@ -18,9 +18,6 @@ package io.entgra.device.mgt.core.device.mgt.core.internal; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.osgi.service.component.ComponentContext; import io.entgra.device.mgt.core.device.mgt.core.archival.dao.ArchivalDestinationDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.archival.dao.ArchivalSourceDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; @@ -29,26 +26,19 @@ import io.entgra.device.mgt.core.device.mgt.core.config.datasource.DataSourceCon import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.task.ArchivalTaskManager; import io.entgra.device.mgt.core.device.mgt.core.task.impl.ArchivalTaskManagerImpl; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.*; import org.wso2.carbon.ntask.core.service.TaskService; -/** - * @scr.component name="org.wso2.carbon.activity.data.archival" immediate="true" - * @scr.reference name="device.ntask.component" - * interface="org.wso2.carbon.ntask.core.service.TaskService" - * cardinality="1..1" - * policy="dynamic" - * bind="setTaskService" - * unbind="unsetTaskService" - * @scr.reference name="org.wso2.carbon.device.manager" - * interface="io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService" - * cardinality="1..1" - * policy="dynamic" - * bind="setDeviceManagementService" - * unbind="unsetDeviceManagementService" - */ +@Component( + name = "io.entgra.device.mgt.core.device.mgt.core.internal.ActivityDataPurgingServiceComponent", + immediate = true) public class ActivityDataPurgingServiceComponent { private static Log log = LogFactory.getLog(ActivityDataPurgingServiceComponent.class); + @Activate protected void activate(ComponentContext componentContext) { try { if (log.isDebugEnabled()) { @@ -99,6 +89,12 @@ public class ActivityDataPurgingServiceComponent { } } + @Reference( + name = "task.service", + service = org.wso2.carbon.ntask.core.service.TaskService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetTaskService") protected void setTaskService(TaskService taskService) { if (log.isDebugEnabled()) { log.debug("Setting the task service."); @@ -113,6 +109,12 @@ public class ActivityDataPurgingServiceComponent { DeviceManagementDataHolder.getInstance().setTaskService(null); } + @Reference( + name = "device.mgt.provider.service", + service = io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetDeviceManagementService") protected void setDeviceManagementService(DeviceManagementProviderService deviceManagementService){ } @@ -122,6 +124,7 @@ public class ActivityDataPurgingServiceComponent { } @SuppressWarnings("unused") + @Deactivate protected void deactivate(ComponentContext componentContext) { } diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceManagementDataHolder.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceManagementDataHolder.java index f9bed42c54..d3f17865ae 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceManagementDataHolder.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceManagementDataHolder.java @@ -18,8 +18,6 @@ package io.entgra.device.mgt.core.device.mgt.core.internal; -import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBeatManagementService; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.DeviceStatusTaskPluginConfig; import io.entgra.device.mgt.core.device.mgt.common.OperationMonitoringTaskConfig; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.ApplicationManager; @@ -46,7 +44,9 @@ import io.entgra.device.mgt.core.device.mgt.core.service.GroupManagementProvider import io.entgra.device.mgt.core.device.mgt.core.status.task.DeviceStatusTaskManagerService; import io.entgra.device.mgt.core.device.mgt.core.task.DeviceTaskManagerService; import io.entgra.device.mgt.core.device.mgt.core.traccar.api.service.DeviceAPIClientService; +import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBeatManagementService; import io.entgra.device.mgt.core.transport.mgt.email.sender.core.service.EmailSenderService; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.ntask.core.service.TaskService; import org.wso2.carbon.registry.core.service.RegistryService; import org.wso2.carbon.user.core.service.RealmService; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceManagementServiceComponent.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceManagementServiceComponent.java index a95d8b2bc0..eca29df3ac 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceManagementServiceComponent.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceManagementServiceComponent.java @@ -17,13 +17,6 @@ */ package io.entgra.device.mgt.core.device.mgt.core.internal; -import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBeatManagementService; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.osgi.framework.BundleContext; -import org.osgi.service.component.ComponentContext; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.core.ServerStartupObserver; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.ApplicationManagementException; import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAccessAuthorizationService; import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService; @@ -86,7 +79,15 @@ import io.entgra.device.mgt.core.device.mgt.core.traccar.api.service.DeviceAPICl import io.entgra.device.mgt.core.device.mgt.core.traccar.api.service.impl.DeviceAPIClientServiceImpl; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagementSchemaInitializer; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; +import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBeatManagementService; import io.entgra.device.mgt.core.transport.mgt.email.sender.core.service.EmailSenderService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.osgi.framework.BundleContext; +import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.*; +import org.wso2.carbon.context.PrivilegedCarbonContext; +import org.wso2.carbon.core.ServerStartupObserver; import org.wso2.carbon.ndatasource.core.DataSourceService; import org.wso2.carbon.registry.core.service.RegistryService; import org.wso2.carbon.user.core.service.RealmService; @@ -100,57 +101,9 @@ import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; -/** - * @scr.component name="org.wso2.carbon.device.manager" immediate="true" - * @scr.reference name="user.realmservice.default" - * interface="org.wso2.carbon.user.core.service.RealmService" - * cardinality="1..1" - * policy="dynamic" - * bind="setRealmService" - * unbind="unsetRealmService" - * @scr.reference name="device.manager.service" - * interface="io.entgra.device.mgt.core.device.mgt.common.spi.DeviceManagementService" - * cardinality="0..n" - * policy="dynamic" - * bind="setDeviceManagementService" - * unbind="unsetDeviceManagementService" - * @scr.reference name="registry.service" - * interface="org.wso2.carbon.registry.core.service.RegistryService" - * cardinality="1..1" - * policy="dynamic" - * bind="setRegistryService" - * unbind="unsetRegistryService" - * @scr.reference name="org.wso2.carbon.ndatasource" - * interface="org.wso2.carbon.ndatasource.core.DataSourceService" - * cardinality="1..1" - * policy="dynamic" - * bind="setDataSourceService" - * unbind="unsetDataSourceService" - * @scr.reference name="config.context.service" - * interface="org.wso2.carbon.utils.ConfigurationContextService" - * cardinality="0..1" - * policy="dynamic" - * bind="setConfigurationContextService" - * unbind="unsetConfigurationContextService" - * @scr.reference name="email.sender.service" - * interface="io.entgra.device.mgt.core.transport.mgt.email.sender.core.service.EmailSenderService" - * cardinality="0..1" - * policy="dynamic" - * bind="setEmailSenderService" - * unbind="unsetEmailSenderService" - * @scr.reference name="device.type.generator.service" - * interface="io.entgra.device.mgt.core.device.mgt.common.spi.DeviceTypeGeneratorService" - * cardinality="0..1" - * policy="dynamic" - * bind="setDeviceTypeGeneratorService" - * unbind="unsetDeviceTypeGeneratorService" - * @scr.reference name="entgra.heart.beat.service" - * interface="io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBeatManagementService" - * cardinality="0..1" - * policy="dynamic" - * bind="setHeartBeatService" - * unbind="unsetHeartBeatService" - */ +@Component( + name = "io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementServiceComponent", + immediate = true) public class DeviceManagementServiceComponent { private static final Object LOCK = new Object(); @@ -179,6 +132,7 @@ public class DeviceManagementServiceComponent { } @SuppressWarnings("unused") + @Activate protected void activate(ComponentContext componentContext) { try { if (log.isDebugEnabled()) { @@ -278,6 +232,7 @@ public class DeviceManagementServiceComponent { } @SuppressWarnings("unused") + @Deactivate protected void deactivate(ComponentContext componentContext) { //do nothing } @@ -442,6 +397,12 @@ public class DeviceManagementServiceComponent { * * @param deviceManagementService An instance of DeviceManagementService */ + @Reference( + name = "device.mgt.service", + service = io.entgra.device.mgt.core.device.mgt.common.spi.DeviceManagementService.class, + cardinality = ReferenceCardinality.MULTIPLE, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetDeviceManagementService") protected void setDeviceManagementService(DeviceManagementService deviceManagementService) { try { if (log.isDebugEnabled()) { @@ -482,6 +443,12 @@ public class DeviceManagementServiceComponent { * * @param realmService An instance of RealmService */ + @Reference( + name = "realm.service", + service = org.wso2.carbon.user.core.service.RealmService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetRealmService") protected void setRealmService(RealmService realmService) { if (log.isDebugEnabled()) { log.debug("Setting Realm Service"); @@ -506,6 +473,12 @@ public class DeviceManagementServiceComponent { * * @param registryService An instance of RegistryService */ + @Reference( + name = "registry.service", + service = org.wso2.carbon.registry.core.service.RegistryService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetRegistryService") protected void setRegistryService(RegistryService registryService) { if (log.isDebugEnabled()) { log.debug("Setting Registry Service"); @@ -530,6 +503,12 @@ public class DeviceManagementServiceComponent { * * @param heartBeatService An instance of HeartBeatManagementService */ + @Reference( + name = "heart.beat.service", + service = io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBeatManagementService.class, + cardinality = ReferenceCardinality.OPTIONAL, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetHeartBeatService") protected void setHeartBeatService(HeartBeatManagementService heartBeatService) { if (log.isDebugEnabled()) { log.debug("Setting Heart Beat Service"); @@ -547,6 +526,12 @@ public class DeviceManagementServiceComponent { DeviceManagementDataHolder.getInstance().setHeartBeatService(null); } + @Reference( + name = "datasource.service", + service = org.wso2.carbon.ndatasource.core.DataSourceService.class, + cardinality = ReferenceCardinality.OPTIONAL, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetDataSourceService") protected void setDataSourceService(DataSourceService dataSourceService) { /* This is to avoid mobile device management component getting initialized before the underlying datasources are registered */ @@ -559,6 +544,12 @@ public class DeviceManagementServiceComponent { //do nothing } + @Reference( + name = "configuration.context.service", + service = org.wso2.carbon.utils.ConfigurationContextService.class, + cardinality = ReferenceCardinality.OPTIONAL, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetConfigurationContextService") protected void setConfigurationContextService(ConfigurationContextService configurationContextService) { if (log.isDebugEnabled()) { log.debug("Setting ConfigurationContextService"); @@ -573,6 +564,12 @@ public class DeviceManagementServiceComponent { DeviceManagementDataHolder.getInstance().setConfigurationContextService(null); } + @Reference( + name = "email.sender.service", + service = io.entgra.device.mgt.core.transport.mgt.email.sender.core.service.EmailSenderService.class, + cardinality = ReferenceCardinality.OPTIONAL, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetEmailSenderService") protected void setEmailSenderService(EmailSenderService emailSenderService) { if (log.isDebugEnabled()) { log.debug("Setting Email Sender Service"); @@ -588,6 +585,12 @@ public class DeviceManagementServiceComponent { } + @Reference( + name = "device.task.service", + service = io.entgra.device.mgt.core.device.mgt.core.task.DeviceTaskManagerService.class, + cardinality = ReferenceCardinality.OPTIONAL, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetDeviceTaskManagerService") protected void setDeviceTaskManagerService(DeviceTaskManagerService deviceTaskManagerService) { if (log.isDebugEnabled()) { } @@ -605,6 +608,12 @@ public class DeviceManagementServiceComponent { * * @param deviceTypeGeneratorService An Instance of DeviceTypeGeneratorService */ + @Reference( + name = "device.type.generator.service", + service = io.entgra.device.mgt.core.device.mgt.common.spi.DeviceTypeGeneratorService.class, + cardinality = ReferenceCardinality.OPTIONAL, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetDeviceTypeGeneratorService") protected void setDeviceTypeGeneratorService(DeviceTypeGeneratorService deviceTypeGeneratorService) { if (log.isDebugEnabled()) { log.debug("Un setting Device DeviceTypeGeneratorService"); diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceTaskManagerServiceComponent.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceTaskManagerServiceComponent.java index 4d5c1e1d62..ea92f06679 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceTaskManagerServiceComponent.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceTaskManagerServiceComponent.java @@ -18,10 +18,6 @@ package io.entgra.device.mgt.core.device.mgt.core.internal; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.osgi.framework.BundleContext; -import org.osgi.service.component.ComponentContext; import io.entgra.device.mgt.core.device.mgt.common.DeviceStatusTaskPluginConfig; import io.entgra.device.mgt.core.device.mgt.common.OperationMonitoringTaskConfig; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; @@ -38,20 +34,17 @@ import io.entgra.device.mgt.core.device.mgt.core.status.task.impl.DeviceStatusTa import io.entgra.device.mgt.core.device.mgt.core.task.DeviceMgtTaskException; import io.entgra.device.mgt.core.device.mgt.core.task.DeviceTaskManagerService; import io.entgra.device.mgt.core.device.mgt.core.task.impl.DeviceTaskManagerServiceImpl; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.osgi.framework.BundleContext; +import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.*; import org.wso2.carbon.ntask.core.service.TaskService; import java.util.Map; - -/** - * @scr.component name="org.wso2.carbon.device.task.manager" immediate="true" - * @scr.reference name="device.ntask.component" - * interface="org.wso2.carbon.ntask.core.service.TaskService" - * cardinality="1..1" - * policy="dynamic" - * bind="setTaskService" - * unbind="unsetTaskService" - */ - +@Component( + name = "io.entgra.device.mgt.core.device.mgt.core.internal.DeviceTaskManagerServiceComponent", + immediate = true) @SuppressWarnings("unused") public class DeviceTaskManagerServiceComponent { @@ -59,6 +52,7 @@ public class DeviceTaskManagerServiceComponent { private DeviceManagementConfig deviceManagementConfig; @SuppressWarnings("unused") + @Activate protected void activate(ComponentContext componentContext) { try { if (log.isDebugEnabled()) { @@ -133,6 +127,7 @@ public class DeviceTaskManagerServiceComponent { } @SuppressWarnings("unused") + @Deactivate protected void deactivate(ComponentContext componentContext) { try { stopOperationMonitoringTask(); @@ -192,6 +187,12 @@ public class DeviceTaskManagerServiceComponent { } } + @Reference( + name = "task.service", + service = org.wso2.carbon.ntask.core.service.TaskService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetTaskService") protected void setTaskService(TaskService taskService) { if (log.isDebugEnabled()) { log.debug("Setting the task service."); diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/TenantCreateObserver.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/TenantCreateObserver.java index b6dddef4f2..a86cac3b5a 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/TenantCreateObserver.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/TenantCreateObserver.java @@ -17,17 +17,13 @@ */ package io.entgra.device.mgt.core.device.mgt.core.internal; +import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants; +import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants.User; import org.apache.axis2.context.ConfigurationContext; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants; -import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants.User; -import org.wso2.carbon.user.api.AuthorizationManager; -import org.wso2.carbon.user.api.Permission; -import org.wso2.carbon.user.api.UserRealm; -import org.wso2.carbon.user.api.UserStoreException; -import org.wso2.carbon.user.api.UserStoreManager; +import org.wso2.carbon.user.api.*; import org.wso2.carbon.utils.AbstractAxis2ConfigurationContextObserver; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/UserRoleCreateObserver.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/UserRoleCreateObserver.java index 1ec82618cf..9c309fb518 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/UserRoleCreateObserver.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/UserRoleCreateObserver.java @@ -17,10 +17,10 @@ */ package io.entgra.device.mgt.core.device.mgt.core.internal; +import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.core.ServerStartupObserver; -import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants; import org.wso2.carbon.user.api.AuthorizationManager; import org.wso2.carbon.user.api.Permission; import org.wso2.carbon.user.api.UserStoreException; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/MetadataManagementServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/MetadataManagementServiceImpl.java index 98e3b07723..1638763620 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/MetadataManagementServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/MetadataManagementServiceImpl.java @@ -18,10 +18,6 @@ package io.entgra.device.mgt.core.device.mgt.core.metadata.mgt; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.base.MultitenantConstants; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; import io.entgra.device.mgt.core.device.mgt.common.exceptions.MetadataKeyAlreadyExistsException; @@ -34,6 +30,11 @@ import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.MetadataDAO; import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.MetadataManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.MetadataManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.base.MultitenantConstants; +import org.wso2.carbon.context.PrivilegedCarbonContext; + import java.sql.SQLException; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/WhiteLabelManagementServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/WhiteLabelManagementServiceImpl.java index 30419351e1..7a1fcb470a 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/WhiteLabelManagementServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/WhiteLabelManagementServiceImpl.java @@ -19,26 +19,13 @@ package io.entgra.device.mgt.core.device.mgt.core.metadata.mgt; import com.google.gson.Gson; -import org.apache.commons.io.IOUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpResponse; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.Base64File; import io.entgra.device.mgt.core.device.mgt.common.FileResponse; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.MetadataManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.NotFoundException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; -import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.Metadata; -import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.WhiteLabelImage; -import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.WhiteLabelImageRequestPayload; -import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.WhiteLabelManagementService; -import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.WhiteLabelTheme; -import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.WhiteLabelThemeCreateRequest; +import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.*; import io.entgra.device.mgt.core.device.mgt.core.common.util.HttpUtil; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; import io.entgra.device.mgt.core.device.mgt.core.config.metadata.mgt.MetaDataConfiguration; @@ -50,6 +37,14 @@ import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.MetadataManage import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.util.MetadataConstants; import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.util.WhiteLabelStorageUtil; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; +import org.apache.commons.io.IOUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.io.File; import java.io.IOException; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/MetadataManagementDAOFactory.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/MetadataManagementDAOFactory.java index 4fb2a99137..e3d3675b64 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/MetadataManagementDAOFactory.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/MetadataManagementDAOFactory.java @@ -18,8 +18,6 @@ package io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.common.exceptions.IllegalTransactionStateException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; @@ -30,12 +28,14 @@ import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUti import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.impl.GenericMetadataDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.impl.OracleMetadataDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.impl.SQLServerMetadataDAOImpl; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import javax.sql.DataSource; import java.sql.Connection; import java.sql.SQLException; import java.util.Hashtable; import java.util.List; -import javax.sql.DataSource; /** * DAO factory class to be used in MetadataManagement related functionalities. diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/impl/AbstractMetadataDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/impl/AbstractMetadataDAOImpl.java index 459a9d6478..00e19a6a80 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/impl/AbstractMetadataDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/impl/AbstractMetadataDAOImpl.java @@ -18,19 +18,15 @@ package io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.Metadata; import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.MetadataDAO; import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.MetadataManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.MetadataManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.util.MetadataDAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; +import java.sql.*; /** * Implementation of MetadataDAO which includes the methods to do CRUD operations on metadata. diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/impl/GenericMetadataDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/impl/GenericMetadataDAOImpl.java index c90cdac7bb..a00a770b7e 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/impl/GenericMetadataDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/impl/GenericMetadataDAOImpl.java @@ -18,13 +18,13 @@ package io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.Metadata; import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.MetadataManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.MetadataManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.util.MetadataDAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/impl/OracleMetadataDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/impl/OracleMetadataDAOImpl.java index 6215d1e5af..6f36d68451 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/impl/OracleMetadataDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/impl/OracleMetadataDAOImpl.java @@ -18,13 +18,13 @@ package io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.Metadata; import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.MetadataManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.MetadataManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.util.MetadataDAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/impl/SQLServerMetadataDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/impl/SQLServerMetadataDAOImpl.java index 329748b5d9..57bf4ea481 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/impl/SQLServerMetadataDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/impl/SQLServerMetadataDAOImpl.java @@ -18,13 +18,13 @@ package io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.Metadata; import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.MetadataManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.MetadataManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.util.MetadataDAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/util/MetadataDAOUtil.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/util/MetadataDAOUtil.java index 1e966bed5a..385a5d9362 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/util/MetadataDAOUtil.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/dao/util/MetadataDAOUtil.java @@ -18,9 +18,9 @@ package io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.dao.util; +import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.Metadata; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.Metadata; import java.sql.ResultSet; import java.sql.SQLException; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/util/WhiteLabelStorageUtil.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/util/WhiteLabelStorageUtil.java index 841acae516..8ed691dd69 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/util/WhiteLabelStorageUtil.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/metadata/mgt/util/WhiteLabelStorageUtil.java @@ -17,10 +17,6 @@ package io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.util; -import org.apache.commons.io.IOUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.Base64File; import io.entgra.device.mgt.core.device.mgt.common.FileResponse; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; @@ -33,6 +29,9 @@ import io.entgra.device.mgt.core.device.mgt.core.common.util.StorageManagementUt import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; import io.entgra.device.mgt.core.device.mgt.core.config.metadata.mgt.MetaDataConfiguration; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; +import org.apache.commons.io.IOUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.io.File; import java.io.IOException; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/NotificationManagementServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/NotificationManagementServiceImpl.java index 3e98cf9715..0552d6007c 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/NotificationManagementServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/NotificationManagementServiceImpl.java @@ -18,15 +18,12 @@ package io.entgra.device.mgt.core.device.mgt.core.notification.mgt; -import io.entgra.device.mgt.core.device.mgt.extensions.logger.spi.EntgraLogger; -import io.entgra.device.mgt.core.notification.logger.DeviceLogContext; -import io.entgra.device.mgt.core.notification.logger.impl.EntgraDeviceLoggerImpl; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.EntityDoesNotExistException; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.EntityDoesNotExistException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.Notification; import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.NotificationManagementException; @@ -36,6 +33,9 @@ import io.entgra.device.mgt.core.device.mgt.core.notification.mgt.dao.Notificati import io.entgra.device.mgt.core.device.mgt.core.notification.mgt.dao.NotificationManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.notification.mgt.dao.util.NotificationDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; +import io.entgra.device.mgt.core.device.mgt.extensions.logger.spi.EntgraLogger; +import io.entgra.device.mgt.core.notification.logger.DeviceLogContext; +import io.entgra.device.mgt.core.notification.logger.impl.EntgraDeviceLoggerImpl; import java.sql.SQLException; import java.util.ArrayList; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/dao/NotificationManagementDAOFactory.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/dao/NotificationManagementDAOFactory.java index e95cec27b0..6fd5f53775 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/dao/NotificationManagementDAOFactory.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/dao/NotificationManagementDAOFactory.java @@ -18,16 +18,19 @@ package io.entgra.device.mgt.core.device.mgt.core.notification.mgt.dao; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.common.exceptions.IllegalTransactionStateException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.UnsupportedDatabaseEngineException; import io.entgra.device.mgt.core.device.mgt.core.config.datasource.DataSourceConfig; import io.entgra.device.mgt.core.device.mgt.core.config.datasource.JNDILookupDefinition; -import io.entgra.device.mgt.core.device.mgt.core.notification.mgt.dao.impl.*; +import io.entgra.device.mgt.core.device.mgt.core.notification.mgt.dao.impl.GenericNotificationDAOImpl; +import io.entgra.device.mgt.core.device.mgt.core.notification.mgt.dao.impl.OracleNotificationDAOImpl; +import io.entgra.device.mgt.core.device.mgt.core.notification.mgt.dao.impl.PostgreSQLNotificationDAOImpl; +import io.entgra.device.mgt.core.device.mgt.core.notification.mgt.dao.impl.SQLServerNotificationDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.notification.mgt.dao.util.NotificationDAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.sql.DataSource; import java.sql.Connection; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/dao/impl/AbstractNotificationDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/dao/impl/AbstractNotificationDAOImpl.java index 0b4a156518..e3c64eb6e6 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/dao/impl/AbstractNotificationDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/dao/impl/AbstractNotificationDAOImpl.java @@ -24,12 +24,7 @@ import io.entgra.device.mgt.core.device.mgt.core.notification.mgt.dao.Notificati import io.entgra.device.mgt.core.device.mgt.core.notification.mgt.dao.NotificationManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.notification.mgt.dao.util.NotificationDAOUtil; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.sql.Timestamp; +import java.sql.*; import java.util.ArrayList; import java.util.Date; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/dao/impl/OracleNotificationDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/dao/impl/OracleNotificationDAOImpl.java index 20c8019642..eaf6b26936 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/dao/impl/OracleNotificationDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/dao/impl/OracleNotificationDAOImpl.java @@ -24,11 +24,7 @@ import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.Notification import io.entgra.device.mgt.core.device.mgt.core.notification.mgt.dao.NotificationManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.notification.mgt.dao.util.NotificationDAOUtil; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; +import java.sql.*; import java.util.ArrayList; import java.util.Date; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/dao/util/NotificationDAOUtil.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/dao/util/NotificationDAOUtil.java index fcd5cbb728..a748ed1683 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/dao/util/NotificationDAOUtil.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/dao/util/NotificationDAOUtil.java @@ -18,12 +18,12 @@ package io.entgra.device.mgt.core.device.mgt.core.notification.mgt.dao.util; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.CarbonContext; import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.Notification; import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.NotificationManagementException; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.core.tenant.TenantManager; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/OperationManagerImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/OperationManagerImpl.java index 1612c4db8f..ae2e0c6526 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/OperationManagerImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/OperationManagerImpl.java @@ -18,36 +18,14 @@ package io.entgra.device.mgt.core.device.mgt.core.operation.mgt; -import com.google.gson.Gson; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.CarbonContext; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.ActivityPaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.DynamicTaskContext; -import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; -import io.entgra.device.mgt.core.device.mgt.common.MonitoringOperation; -import io.entgra.device.mgt.core.device.mgt.common.OperationMonitoringTaskConfig; -import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; +import io.entgra.device.mgt.core.device.mgt.common.*; import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAccessAuthorizationException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.InvalidDeviceException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroupConstants; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Activity; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.ActivityStatus; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManagementException; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManager; -import io.entgra.device.mgt.core.device.mgt.common.push.notification.NotificationContext; -import io.entgra.device.mgt.core.device.mgt.common.push.notification.NotificationStrategy; -import io.entgra.device.mgt.core.device.mgt.common.push.notification.PushNotificationConfig; -import io.entgra.device.mgt.core.device.mgt.common.push.notification.PushNotificationExecutionFailedException; -import io.entgra.device.mgt.core.device.mgt.common.push.notification.PushNotificationProvider; +import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.*; +import io.entgra.device.mgt.core.device.mgt.common.push.notification.*; import io.entgra.device.mgt.core.device.mgt.common.spi.DeviceManagementService; import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.core.cache.impl.DeviceCacheManagerImpl; @@ -69,16 +47,15 @@ import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProvide import io.entgra.device.mgt.core.device.mgt.core.task.DeviceTaskManager; import io.entgra.device.mgt.core.device.mgt.core.task.impl.DeviceTaskManagerImpl; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.CarbonContext; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.sql.SQLException; import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Calendar; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.Executors; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/OperationManagerRepository.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/OperationManagerRepository.java index e8139ab7d0..a2993bab4e 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/OperationManagerRepository.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/OperationManagerRepository.java @@ -18,8 +18,8 @@ */ package io.entgra.device.mgt.core.device.mgt.core.operation.mgt; -import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceTypeServiceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManager; +import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceTypeServiceIdentifier; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/OperationManagementDAOFactory.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/OperationManagementDAOFactory.java index 423578e591..fe37df535c 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/OperationManagementDAOFactory.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/OperationManagementDAOFactory.java @@ -18,8 +18,6 @@ package io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.common.exceptions.IllegalTransactionStateException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; @@ -32,6 +30,8 @@ import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.impl.operatio import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.impl.operation.OracleOperationDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.impl.operation.PostgreSQLOperationDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.impl.operation.SQLServerOperationDAOImpl; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.sql.DataSource; import java.sql.Connection; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/CommandOperationDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/CommandOperationDAOImpl.java index a5fdb56b69..c2e1de76c5 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/CommandOperationDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/CommandOperationDAOImpl.java @@ -18,22 +18,20 @@ package io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.dto.operation.mgt.CommandOperation; import io.entgra.device.mgt.core.device.mgt.core.dto.operation.mgt.Operation; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; -import java.sql.Timestamp; import java.util.ArrayList; -import java.util.Date; import java.util.List; public class CommandOperationDAOImpl extends GenericOperationDAOImpl { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/ConfigOperationDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/ConfigOperationDAOImpl.java index f53f3fe8c7..c65a2c4f35 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/ConfigOperationDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/ConfigOperationDAOImpl.java @@ -19,21 +19,19 @@ package io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.dto.operation.mgt.ConfigOperation; import io.entgra.device.mgt.core.device.mgt.core.dto.operation.mgt.Operation; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import java.io.*; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.sql.*; import java.util.ArrayList; import java.util.Date; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/ConfigOperationMSSQLDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/ConfigOperationMSSQLDAOImpl.java index 813d02bbe9..0b274ac0fe 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/ConfigOperationMSSQLDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/ConfigOperationMSSQLDAOImpl.java @@ -19,25 +19,16 @@ package io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.dto.operation.mgt.ConfigOperation; import io.entgra.device.mgt.core.device.mgt.core.dto.operation.mgt.Operation; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOFactory; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; +import java.io.*; +import java.sql.*; import java.util.ArrayList; import java.util.Date; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/ConfigOperationPostgresDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/ConfigOperationPostgresDAOImpl.java index c2e95bc2c7..af06d9d1c9 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/ConfigOperationPostgresDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/ConfigOperationPostgresDAOImpl.java @@ -19,25 +19,16 @@ package io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.core.dto.operation.mgt.ConfigOperation; import io.entgra.device.mgt.core.device.mgt.core.dto.operation.mgt.Operation; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.ObjectInputStream; -import java.io.ObjectOutputStream; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; +import java.io.*; +import java.sql.*; import java.util.ArrayList; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java index 0de459b782..70fd0d707a 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/GenericOperationDAOImpl.java @@ -17,9 +17,6 @@ */ package io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.ActivityPaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; @@ -37,23 +34,18 @@ import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationMana import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.util.OperationDAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectOutputStream; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; +import java.sql.*; import java.text.DateFormat; import java.text.SimpleDateFormat; -import java.util.ArrayList; import java.util.Date; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; +import java.util.*; import java.util.stream.Collectors; import java.util.stream.IntStream; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/OperationMappingDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/OperationMappingDAOImpl.java index f61fa5ccb1..8fe711a464 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/OperationMappingDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/OperationMappingDAOImpl.java @@ -18,10 +18,7 @@ */ package io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; import io.entgra.device.mgt.core.device.mgt.core.dto.operation.mgt.Operation; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.OperationEnrolmentMapping; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.OperationMapping; @@ -29,15 +26,14 @@ import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationMana import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationMappingDAO; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; public class OperationMappingDAOImpl implements OperationMappingDAO { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/PolicyOperationDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/PolicyOperationDAOImpl.java index e0693c2f8b..ee2b80f6bd 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/PolicyOperationDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/PolicyOperationDAOImpl.java @@ -18,14 +18,14 @@ */ package io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.dto.operation.mgt.Operation; import io.entgra.device.mgt.core.device.mgt.core.dto.operation.mgt.PolicyOperation; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.io.*; import java.sql.*; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java index d50e068f9f..945f57054d 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/ProfileOperationDAOImpl.java @@ -18,19 +18,18 @@ */ package io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.dto.operation.mgt.Operation; import io.entgra.device.mgt.core.device.mgt.core.dto.operation.mgt.ProfileOperation; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.io.*; import java.sql.*; import java.util.ArrayList; -import java.util.Date; import java.util.List; public class ProfileOperationDAOImpl extends GenericOperationDAOImpl { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/operation/MySQLOperationDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/operation/MySQLOperationDAOImpl.java index 9859e468d6..fa606cab3e 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/operation/MySQLOperationDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/operation/MySQLOperationDAOImpl.java @@ -18,9 +18,6 @@ package io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.impl.operation; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Activity; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.ActivityHolder; @@ -31,6 +28,9 @@ import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationMana import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.impl.GenericOperationDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.util.OperationDAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/operation/OracleOperationDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/operation/OracleOperationDAOImpl.java index 33d455bbbc..dbde7931fd 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/operation/OracleOperationDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/operation/OracleOperationDAOImpl.java @@ -18,9 +18,6 @@ package io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.impl.operation; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Activity; @@ -32,6 +29,9 @@ import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationMana import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.impl.GenericOperationDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.util.OperationDAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.sql.Connection; import java.sql.PreparedStatement; @@ -39,11 +39,7 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.text.DateFormat; import java.text.SimpleDateFormat; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.ArrayList; -import java.util.LinkedList; +import java.util.*; /** * This class holds the implementation of OperationDAO which can be used to support Oracle db syntax. diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/operation/PostgreSQLOperationDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/operation/PostgreSQLOperationDAOImpl.java index e2debfad6f..b9bf13e8bf 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/operation/PostgreSQLOperationDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/operation/PostgreSQLOperationDAOImpl.java @@ -27,16 +27,12 @@ import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationMana import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.impl.GenericOperationDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.util.OperationDAOUtil; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; +import java.sql.*; import java.text.DateFormat; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Date; import java.util.List; -import java.util.ArrayList; /** * This class holds the implementation of OperationDAO which can be used to support PostgreSQL db syntax. diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/operation/SQLServerOperationDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/operation/SQLServerOperationDAOImpl.java index 6de5008fc8..a3edb87305 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/operation/SQLServerOperationDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/impl/operation/SQLServerOperationDAOImpl.java @@ -35,15 +35,10 @@ package io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.impl.operation; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Activity; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.ActivityHolder; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.ActivityStatus; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationResponse; import io.entgra.device.mgt.core.device.mgt.core.dto.operation.mgt.Operation; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.OperationMapping; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOException; @@ -51,19 +46,14 @@ import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationMana import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.impl.GenericOperationDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.util.OperationDAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; +import java.sql.*; import java.text.DateFormat; import java.text.SimpleDateFormat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; +import java.util.*; /** * This class holds the implementation of OperationDAO which can be used to support SQLServer db syntax. diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/util/OperationDAOUtil.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/util/OperationDAOUtil.java index 5d6d192d65..09d6007cf2 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/util/OperationDAOUtil.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/mgt/dao/util/OperationDAOUtil.java @@ -18,21 +18,14 @@ */ package io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.util; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Activity; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.ActivityHolder; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.ActivityMapper; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.ActivityStatus; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationResponse; +import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.*; import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants; -import io.entgra.device.mgt.core.device.mgt.core.dto.operation.mgt.CommandOperation; -import io.entgra.device.mgt.core.device.mgt.core.dto.operation.mgt.ConfigOperation; import io.entgra.device.mgt.core.device.mgt.core.dto.operation.mgt.Operation; -import io.entgra.device.mgt.core.device.mgt.core.dto.operation.mgt.PolicyOperation; -import io.entgra.device.mgt.core.device.mgt.core.dto.operation.mgt.ProfileOperation; +import io.entgra.device.mgt.core.device.mgt.core.dto.operation.mgt.*; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.io.ByteArrayInputStream; import java.io.IOException; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/timeout/task/impl/OperationTimeoutTask.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/timeout/task/impl/OperationTimeoutTask.java index 0351647824..19b21ab68a 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/timeout/task/impl/OperationTimeoutTask.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/timeout/task/impl/OperationTimeoutTask.java @@ -18,8 +18,6 @@ package io.entgra.device.mgt.core.device.mgt.core.operation.timeout.task.impl; import com.google.gson.Gson; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Activity; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.ActivityStatus; @@ -29,6 +27,8 @@ import io.entgra.device.mgt.core.device.mgt.core.config.operation.timeout.Operat import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; import io.entgra.device.mgt.core.device.mgt.core.task.impl.DynamicPartitionedScheduleTask; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.util.ArrayList; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/timeout/task/impl/OperationTimeoutTaskManagerServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/timeout/task/impl/OperationTimeoutTaskManagerServiceImpl.java index 90e45395d3..8414f44a3b 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/timeout/task/impl/OperationTimeoutTaskManagerServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/operation/timeout/task/impl/OperationTimeoutTaskManagerServiceImpl.java @@ -18,13 +18,13 @@ package io.entgra.device.mgt.core.device.mgt.core.operation.timeout.task.impl; import com.google.gson.Gson; -import org.apache.commons.lang3.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.core.config.operation.timeout.OperationTimeout; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; import io.entgra.device.mgt.core.device.mgt.core.operation.timeout.task.OperationTimeoutTaskException; import io.entgra.device.mgt.core.device.mgt.core.operation.timeout.task.OperationTimeoutTaskManagerService; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.wso2.carbon.ntask.common.TaskException; import org.wso2.carbon.ntask.core.TaskInfo; import org.wso2.carbon.ntask.core.TaskManager; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/otp/mgt/dao/OTPManagementDAOFactory.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/otp/mgt/dao/OTPManagementDAOFactory.java index 9d0e804274..c8314ec97d 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/otp/mgt/dao/OTPManagementDAOFactory.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/otp/mgt/dao/OTPManagementDAOFactory.java @@ -17,8 +17,6 @@ */ package io.entgra.device.mgt.core.device.mgt.core.otp.mgt.dao; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.common.exceptions.UnsupportedDatabaseEngineException; import io.entgra.device.mgt.core.device.mgt.core.otp.mgt.dao.impl.GenericOTPManagementDAOImpl; @@ -26,6 +24,8 @@ import io.entgra.device.mgt.core.device.mgt.core.otp.mgt.dao.impl.OracleOTPManag import io.entgra.device.mgt.core.device.mgt.core.otp.mgt.dao.impl.PostgreSQLOTPManagementDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.otp.mgt.dao.impl.SQLServerOTPManagementDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.otp.mgt.util.ConnectionManagerUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.sql.DataSource; import java.sql.Connection; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/otp/mgt/dao/impl/GenericOTPManagementDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/otp/mgt/dao/impl/GenericOTPManagementDAOImpl.java index 27c85d9fdb..2d22d2a114 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/otp/mgt/dao/impl/GenericOTPManagementDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/otp/mgt/dao/impl/GenericOTPManagementDAOImpl.java @@ -17,20 +17,15 @@ package io.entgra.device.mgt.core.device.mgt.core.otp.mgt.dao.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DBConnectionException; import io.entgra.device.mgt.core.device.mgt.common.otp.mgt.dto.OneTimePinDTO; import io.entgra.device.mgt.core.device.mgt.core.otp.mgt.dao.AbstractDAOImpl; import io.entgra.device.mgt.core.device.mgt.core.otp.mgt.dao.OTPManagementDAO; import io.entgra.device.mgt.core.device.mgt.core.otp.mgt.exception.OTPManagementDAOException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.sql.Timestamp; +import java.sql.*; import java.util.Calendar; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/otp/mgt/service/OTPManagementServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/otp/mgt/service/OTPManagementServiceImpl.java index 5fc3f3de83..2f360e0aff 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/otp/mgt/service/OTPManagementServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/otp/mgt/service/OTPManagementServiceImpl.java @@ -17,16 +17,8 @@ package io.entgra.device.mgt.core.device.mgt.core.otp.mgt.service; import com.google.gson.Gson; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.CarbonContext; import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationManagementException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.BadRequestException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DBConnectionException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.OTPManagementException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.*; import io.entgra.device.mgt.core.device.mgt.common.invitation.mgt.DeviceEnrollmentInvitation; import io.entgra.device.mgt.core.device.mgt.common.invitation.mgt.DeviceEnrollmentInvitationDetails; import io.entgra.device.mgt.core.device.mgt.common.invitation.mgt.DeviceEnrollmentType; @@ -42,17 +34,15 @@ import io.entgra.device.mgt.core.device.mgt.core.otp.mgt.util.ConnectionManagerU import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.service.EmailMetaInfo; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.user.api.Tenant; import org.wso2.carbon.user.api.UserStoreException; import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collections; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.UUID; +import java.util.*; public class OTPManagementServiceImpl implements OTPManagementService { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/otp/mgt/util/ConnectionManagerUtil.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/otp/mgt/util/ConnectionManagerUtil.java index 7af805b7ea..3f694e28d9 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/otp/mgt/util/ConnectionManagerUtil.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/otp/mgt/util/ConnectionManagerUtil.java @@ -17,11 +17,11 @@ */ package io.entgra.device.mgt.core.device.mgt.core.otp.mgt.util; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DBConnectionException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.IllegalTransactionStateException; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.naming.InitialContext; import javax.sql.DataSource; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/permission/mgt/PermissionNode.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/permission/mgt/PermissionNode.java index d2f11b331c..18715f729b 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/permission/mgt/PermissionNode.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/permission/mgt/PermissionNode.java @@ -20,11 +20,7 @@ package io.entgra.device.mgt.core.device.mgt.core.permission.mgt; import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.Permission; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * This class represents the node of a permission tree. diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/permission/mgt/PermissionTree.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/permission/mgt/PermissionTree.java index 0fe785588b..1633db2ece 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/permission/mgt/PermissionTree.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/permission/mgt/PermissionTree.java @@ -18,9 +18,9 @@ package io.entgra.device.mgt.core.device.mgt.core.permission.mgt; +import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.Permission; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.Permission; import java.util.StringTokenizer; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/permission/mgt/PermissionUtils.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/permission/mgt/PermissionUtils.java index fc79156fa7..21c1cc3470 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/permission/mgt/PermissionUtils.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/permission/mgt/PermissionUtils.java @@ -18,11 +18,11 @@ package io.entgra.device.mgt.core.device.mgt.core.permission.mgt; -import org.w3c.dom.Document; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.Permission; import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagementException; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; +import org.w3c.dom.Document; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.registry.api.RegistryException; import org.wso2.carbon.registry.api.Resource; import org.wso2.carbon.registry.core.Registry; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/privacy/dao/impl/PrivacyComplianceDAOImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/privacy/dao/impl/PrivacyComplianceDAOImpl.java index d60c9a6d0f..a899e8ad3e 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/privacy/dao/impl/PrivacyComplianceDAOImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/privacy/dao/impl/PrivacyComplianceDAOImpl.java @@ -19,13 +19,13 @@ package io.entgra.device.mgt.core.device.mgt.core.privacy.dao.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.privacy.dao.PrivacyComplianceDAO; import io.entgra.device.mgt.core.device.mgt.core.privacy.dao.PrivacyComplianceDAOException; import io.entgra.device.mgt.core.device.mgt.core.privacy.impl.DeviceEnrollmentMapping; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/privacy/impl/PrivacyComplianceProviderImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/privacy/impl/PrivacyComplianceProviderImpl.java index a622fc074b..a8da47019c 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/privacy/impl/PrivacyComplianceProviderImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/privacy/impl/PrivacyComplianceProviderImpl.java @@ -19,9 +19,6 @@ package io.entgra.device.mgt.core.device.mgt.core.privacy.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; @@ -32,6 +29,9 @@ import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHo import io.entgra.device.mgt.core.device.mgt.core.privacy.PrivacyComplianceProvider; import io.entgra.device.mgt.core.device.mgt.core.privacy.dao.PrivacyComplianceDAO; import io.entgra.device.mgt.core.device.mgt.core.privacy.dao.PrivacyComplianceDAOException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.util.ArrayList; import java.util.HashMap; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/push/notification/mgt/PushNotificationConfigRepository.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/push/notification/mgt/PushNotificationConfigRepository.java index ef0946a484..8279fda4ad 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/push/notification/mgt/PushNotificationConfigRepository.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/push/notification/mgt/PushNotificationConfigRepository.java @@ -18,8 +18,8 @@ */ package io.entgra.device.mgt.core.device.mgt.core.push.notification.mgt; -import org.wso2.carbon.context.CarbonContext; import io.entgra.device.mgt.core.device.mgt.common.push.notification.PushNotificationConfig; +import org.wso2.carbon.context.CarbonContext; import java.util.HashMap; import java.util.Map; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/push/notification/mgt/PushNotificationProviderRepository.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/push/notification/mgt/PushNotificationProviderRepository.java index 17484496db..13f11237f9 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/push/notification/mgt/PushNotificationProviderRepository.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/push/notification/mgt/PushNotificationProviderRepository.java @@ -18,9 +18,9 @@ */ package io.entgra.device.mgt.core.device.mgt.core.push.notification.mgt; +import io.entgra.device.mgt.core.device.mgt.common.push.notification.PushNotificationProvider; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.push.notification.PushNotificationProvider; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/push/notification/mgt/task/PushNotificationSchedulerTask.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/push/notification/mgt/task/PushNotificationSchedulerTask.java index b0e7ef8d5d..bf4a3afcf5 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/push/notification/mgt/task/PushNotificationSchedulerTask.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/push/notification/mgt/task/PushNotificationSchedulerTask.java @@ -17,9 +17,6 @@ */ package io.entgra.device.mgt.core.device.mgt.core.push.notification.mgt.task; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManagementException; @@ -35,6 +32,9 @@ import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationMana import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationMappingDAO; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.util.HashMap; import java.util.LinkedList; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/report/mgt/ReportManagementServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/report/mgt/ReportManagementServiceImpl.java index de85e8dc7f..45c073be3e 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/report/mgt/ReportManagementServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/report/mgt/ReportManagementServiceImpl.java @@ -18,34 +18,29 @@ package io.entgra.device.mgt.core.device.mgt.core.report.mgt; import com.google.gson.JsonObject; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.Count; import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.BadRequestException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.BadRequestException; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceTypeNotFoundException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.ReportManagementException; import io.entgra.device.mgt.core.device.mgt.common.report.mgt.ReportManagementService; -import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceDAO; -import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOException; -import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; -import io.entgra.device.mgt.core.device.mgt.core.dao.GroupDAO; -import io.entgra.device.mgt.core.device.mgt.core.dao.GroupManagementDAOException; -import io.entgra.device.mgt.core.device.mgt.core.dao.GroupManagementDAOFactory; +import io.entgra.device.mgt.core.device.mgt.core.dao.*; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.SQLException; import java.text.ParseException; import java.text.SimpleDateFormat; +import java.util.Calendar; import java.util.Date; import java.util.List; -import java.util.Calendar; import java.util.concurrent.TimeUnit; /** diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/report/mgt/config/ReportMgtConfigurationManager.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/report/mgt/config/ReportMgtConfigurationManager.java index 7da7b7fa81..df867e9e04 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/report/mgt/config/ReportMgtConfigurationManager.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/report/mgt/config/ReportMgtConfigurationManager.java @@ -17,11 +17,11 @@ */ package io.entgra.device.mgt.core.device.mgt.core.report.mgt.config; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.exceptions.InvalidConfigurationException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.ReportManagementException; import io.entgra.device.mgt.core.device.mgt.core.report.mgt.Constants; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.xml.bind.JAXBContext; import javax.xml.bind.Unmarshaller; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/report/mgt/dao/common/ReportMgtConnectionManager.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/report/mgt/dao/common/ReportMgtConnectionManager.java index 8cba2a8b4b..78fb3aa524 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/report/mgt/dao/common/ReportMgtConnectionManager.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/report/mgt/dao/common/ReportMgtConnectionManager.java @@ -17,11 +17,11 @@ */ package io.entgra.device.mgt.core.device.mgt.core.report.mgt.dao.common; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DBConnectionException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.IllegalTransactionStateException; import io.entgra.device.mgt.core.device.mgt.core.report.mgt.config.ReportMgtConfigurationManager; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.naming.InitialContext; import javax.sql.DataSource; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/search/mgt/impl/ProcessorImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/search/mgt/impl/ProcessorImpl.java index 0b86efddbe..09ce7c90b7 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/search/mgt/impl/ProcessorImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/search/mgt/impl/ProcessorImpl.java @@ -19,9 +19,6 @@ package io.entgra.device.mgt.core.device.mgt.core.search.mgt.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.CarbonContext; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; @@ -33,21 +30,13 @@ import io.entgra.device.mgt.core.device.mgt.core.dao.ApplicationDAO; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; -import io.entgra.device.mgt.core.device.mgt.core.search.mgt.Constants; -import io.entgra.device.mgt.core.device.mgt.core.search.mgt.InvalidOperatorException; -import io.entgra.device.mgt.core.device.mgt.core.search.mgt.Processor; -import io.entgra.device.mgt.core.device.mgt.core.search.mgt.QueryBuilder; -import io.entgra.device.mgt.core.device.mgt.core.search.mgt.QueryHolder; -import io.entgra.device.mgt.core.device.mgt.core.search.mgt.ResultSetAggregator; -import io.entgra.device.mgt.core.device.mgt.core.search.mgt.SearchMgtException; -import io.entgra.device.mgt.core.device.mgt.core.search.mgt.ValueType; +import io.entgra.device.mgt.core.device.mgt.core.search.mgt.*; import io.entgra.device.mgt.core.device.mgt.core.search.mgt.dao.SearchDAOException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.CarbonContext; -import java.sql.Array; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; +import java.sql.*; import java.util.ArrayList; import java.util.HashMap; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/search/mgt/impl/QueryBuilderImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/search/mgt/impl/QueryBuilderImpl.java index d07767d546..031866a4b3 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/search/mgt/impl/QueryBuilderImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/search/mgt/impl/QueryBuilderImpl.java @@ -19,15 +19,11 @@ package io.entgra.device.mgt.core.device.mgt.core.search.mgt.impl; +import io.entgra.device.mgt.core.device.mgt.common.search.Condition; +import io.entgra.device.mgt.core.device.mgt.core.search.mgt.*; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.search.Condition; -import io.entgra.device.mgt.core.device.mgt.core.search.mgt.Constants; -import io.entgra.device.mgt.core.device.mgt.core.search.mgt.InvalidOperatorException; -import io.entgra.device.mgt.core.device.mgt.core.search.mgt.QueryBuilder; -import io.entgra.device.mgt.core.device.mgt.core.search.mgt.QueryHolder; -import io.entgra.device.mgt.core.device.mgt.core.search.mgt.ValueType; import java.util.ArrayList; import java.util.HashMap; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/search/mgt/impl/ResultSetAggregatorImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/search/mgt/impl/ResultSetAggregatorImpl.java index 59a7f5e6b9..bcc10946b6 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/search/mgt/impl/ResultSetAggregatorImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/search/mgt/impl/ResultSetAggregatorImpl.java @@ -19,14 +19,14 @@ package io.entgra.device.mgt.core.device.mgt.core.search.mgt.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; import io.entgra.device.mgt.core.device.mgt.core.permission.mgt.PermissionUtils; import io.entgra.device.mgt.core.device.mgt.core.search.mgt.Constants; import io.entgra.device.mgt.core.device.mgt.core.search.mgt.ResultSetAggregator; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.user.api.UserRealm; import org.wso2.carbon.user.api.UserStoreException; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderService.java index ca1dccbd0d..0133f8f5f3 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderService.java @@ -35,22 +35,13 @@ package io.entgra.device.mgt.core.device.mgt.core.service; -import org.apache.commons.collections.map.SingletonMap; import io.entgra.device.mgt.core.device.mgt.common.*; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.ApplicationManagementException; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.AmbiguousConfigurationException; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationManagementException; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.DeviceConfiguration; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfiguration; +import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.*; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceData; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationEntry; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceLocationHistorySnapshot; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceNotFoundException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceTypeNotFoundException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.InvalidDeviceException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.UnauthorizedDeviceAccessException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.UserNotFoundException; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.*; +import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoCluster; import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoQuery; import io.entgra.device.mgt.core.device.mgt.common.invitation.mgt.DeviceEnrollmentInvitationDetails; import io.entgra.device.mgt.core.device.mgt.common.license.mgt.License; @@ -65,11 +56,10 @@ import io.entgra.device.mgt.core.device.mgt.common.type.mgt.DeviceStatus; import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceTypeVersion; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoCluster; +import org.apache.commons.collections.map.SingletonMap; import java.sql.SQLException; import java.sql.Timestamp; -import java.util.Collection; import java.util.Date; import java.util.List; import java.util.Map; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderServiceImpl.java index 6370502e81..c7596a03cc 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderServiceImpl.java @@ -37,50 +37,10 @@ package io.entgra.device.mgt.core.device.mgt.core.service; import com.google.common.reflect.TypeToken; import com.google.gson.Gson; -import org.apache.commons.collections.map.SingletonMap; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpResponse; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.ContentType; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.protocol.HTTP; -import org.wso2.carbon.CarbonConstants; -import org.wso2.carbon.context.CarbonContext; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.ActivityPaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.Billing; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceEnrollmentInfoNotification; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.DeviceManager; -import io.entgra.device.mgt.core.device.mgt.common.DeviceNotification; -import io.entgra.device.mgt.core.device.mgt.common.DevicePropertyNotification; -import io.entgra.device.mgt.core.device.mgt.common.DeviceTransferRequest; -import io.entgra.device.mgt.core.device.mgt.common.DynamicTaskContext; -import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; -import io.entgra.device.mgt.core.device.mgt.common.FeatureManager; -import io.entgra.device.mgt.core.device.mgt.common.InitialOperationConfig; -import io.entgra.device.mgt.core.device.mgt.common.MonitoringOperation; -import io.entgra.device.mgt.core.device.mgt.common.OperationMonitoringTaskConfig; -import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; -import io.entgra.device.mgt.core.device.mgt.common.StartupOperationConfig; -import io.entgra.device.mgt.core.device.mgt.common.BillingResponse; +import io.entgra.device.mgt.core.device.mgt.common.*; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.Application; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.ApplicationManagementException; -import io.entgra.device.mgt.core.device.mgt.common.app.mgt.MobileAppTypes; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.AmbiguousConfigurationException; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationEntry; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationManagementException; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.CorrectiveActionConfig; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.DeviceConfiguration; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.DevicePropertyInfo; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.EnrollmentConfiguration; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfiguration; +import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.*; import io.entgra.device.mgt.core.device.mgt.common.cost.mgt.Cost; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceData; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceInfo; @@ -89,15 +49,8 @@ import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceLocation import io.entgra.device.mgt.core.device.mgt.common.enrollment.notification.EnrollmentNotificationConfiguration; import io.entgra.device.mgt.core.device.mgt.common.enrollment.notification.EnrollmentNotifier; import io.entgra.device.mgt.core.device.mgt.common.enrollment.notification.EnrollmentNotifierException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.BadRequestException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceNotFoundException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceTypeNotFoundException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.InvalidDeviceException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.UnauthorizedDeviceAccessException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.UserNotFoundException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.MetadataManagementException; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.*; +import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoCluster; import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoQuery; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroupConstants; @@ -128,20 +81,13 @@ import io.entgra.device.mgt.core.device.mgt.core.cache.impl.DeviceCacheManagerIm import io.entgra.device.mgt.core.device.mgt.core.common.Constants; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceManagementConfig; -import io.entgra.device.mgt.core.device.mgt.core.dao.ApplicationDAO; -import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceDAO; -import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOException; -import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; -import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceStatusDAO; -import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceTypeDAO; -import io.entgra.device.mgt.core.device.mgt.core.dao.EnrollmentDAO; +import io.entgra.device.mgt.core.device.mgt.core.dao.*; import io.entgra.device.mgt.core.device.mgt.core.dao.util.DeviceManagementDAOUtil; import io.entgra.device.mgt.core.device.mgt.core.device.details.mgt.DeviceDetailsMgtException; import io.entgra.device.mgt.core.device.mgt.core.device.details.mgt.DeviceInformationManager; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceTypeServiceIdentifier; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceTypeVersion; -import io.entgra.device.mgt.core.device.mgt.common.geo.service.GeoCluster; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementServiceComponent; import io.entgra.device.mgt.core.device.mgt.core.internal.PluginInitializationListener; @@ -152,16 +98,25 @@ import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.CommandOperation; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.ProfileOperation; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; import io.entgra.device.mgt.core.device.mgt.core.util.HttpReportingUtil; -import io.entgra.device.mgt.core.transport.mgt.email.sender.core.ContentProviderInfo; -import io.entgra.device.mgt.core.transport.mgt.email.sender.core.EmailContext; -import io.entgra.device.mgt.core.transport.mgt.email.sender.core.EmailSendingFailedException; -import io.entgra.device.mgt.core.transport.mgt.email.sender.core.EmailTransportNotConfiguredException; -import io.entgra.device.mgt.core.transport.mgt.email.sender.core.TypedValue; +import io.entgra.device.mgt.core.transport.mgt.email.sender.core.*; import io.entgra.device.mgt.core.transport.mgt.email.sender.core.service.EmailSenderService; +import org.apache.commons.collections.map.SingletonMap; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.protocol.HTTP; +import org.wso2.carbon.CarbonConstants; +import org.wso2.carbon.context.CarbonContext; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.stratos.common.beans.TenantInfoBean; import org.wso2.carbon.tenant.mgt.services.TenantMgtAdminService; import org.wso2.carbon.user.api.UserStoreException; -import org.wso2.carbon.utils.multitenancy.MultitenantConstants; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; @@ -172,17 +127,7 @@ import java.lang.reflect.Type; import java.sql.SQLException; import java.sql.Timestamp; import java.time.LocalDateTime; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collection; -import java.util.Collections; -import java.util.Date; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Properties; +import java.util.*; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderService.java index 670c47f830..61a069f1d8 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderService.java @@ -37,15 +37,10 @@ package io.entgra.device.mgt.core.device.mgt.core.service; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceNotFoundException; import io.entgra.device.mgt.core.device.mgt.common.GroupPaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceTypesOfGroups; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupAlreadyExistException; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupManagementException; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupNotExistException; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.RoleDoesNotExistException; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceNotFoundException; +import io.entgra.device.mgt.core.device.mgt.common.group.mgt.*; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderServiceImpl.java index 46e168a4cc..87dc81825d 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderServiceImpl.java @@ -35,46 +35,29 @@ package io.entgra.device.mgt.core.device.mgt.core.service; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.CarbonConstants; -import org.wso2.carbon.context.CarbonContext; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; +import io.entgra.device.mgt.core.device.mgt.common.*; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceNotFoundException; -import io.entgra.device.mgt.core.device.mgt.common.GroupPaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.TrackerAlreadyExistException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroupConstants; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceTypesOfGroups; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupAlreadyExistException; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupManagementException; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupNotExistException; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.RoleDoesNotExistException; +import io.entgra.device.mgt.core.device.mgt.common.group.mgt.*; import io.entgra.device.mgt.core.device.mgt.core.dao.*; import io.entgra.device.mgt.core.device.mgt.core.event.config.GroupAssignmentEventOperationExecutor; import io.entgra.device.mgt.core.device.mgt.core.geo.task.GeoFenceEventOperationManager; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.OperationMgtConstants; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; -import io.entgra.device.mgt.core.device.mgt.core.util.HttpReportingUtil; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.CarbonConstants; +import org.wso2.carbon.context.CarbonContext; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.user.api.UserRealm; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.api.UserStoreManager; import java.sql.SQLException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.concurrent.ExecutionException; +import java.util.*; import java.util.concurrent.ExecutorService; import java.util.stream.Collectors; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/status/task/impl/DeviceStatusMonitoringTask.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/status/task/impl/DeviceStatusMonitoringTask.java index 407c0d9327..6494635bc8 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/status/task/impl/DeviceStatusMonitoringTask.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/status/task/impl/DeviceStatusMonitoringTask.java @@ -19,8 +19,6 @@ package io.entgra.device.mgt.core.device.mgt.core.status.task.impl; import com.google.gson.Gson; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.DeviceStatusTaskPluginConfig; import io.entgra.device.mgt.core.device.mgt.common.DynamicTaskContext; @@ -33,6 +31,8 @@ import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOExceptio import io.entgra.device.mgt.core.device.mgt.core.dao.DeviceManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.status.task.DeviceStatusTaskException; import io.entgra.device.mgt.core.device.mgt.core.task.impl.DynamicPartitionedScheduleTask; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.SQLException; import java.util.ArrayList; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/status/task/impl/DeviceStatusTaskManagerServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/status/task/impl/DeviceStatusTaskManagerServiceImpl.java index 1fcbf8f258..421659da62 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/status/task/impl/DeviceStatusTaskManagerServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/status/task/impl/DeviceStatusTaskManagerServiceImpl.java @@ -19,13 +19,13 @@ package io.entgra.device.mgt.core.device.mgt.core.status.task.impl; import com.google.gson.Gson; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.DeviceStatusTaskPluginConfig; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; import io.entgra.device.mgt.core.device.mgt.core.status.task.DeviceStatusTaskException; import io.entgra.device.mgt.core.device.mgt.core.status.task.DeviceStatusTaskManagerService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.wso2.carbon.ntask.common.TaskException; import org.wso2.carbon.ntask.core.TaskInfo; import org.wso2.carbon.ntask.core.TaskManager; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/ArchivalTask.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/ArchivalTask.java index 1d2ff568d5..3c2a1ffef7 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/ArchivalTask.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/ArchivalTask.java @@ -18,11 +18,11 @@ package io.entgra.device.mgt.core.device.mgt.core.task.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.core.archival.ArchivalException; import io.entgra.device.mgt.core.device.mgt.core.archival.ArchivalService; import io.entgra.device.mgt.core.device.mgt.core.archival.ArchivalServiceImpl; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.wso2.carbon.ntask.core.Task; import java.text.SimpleDateFormat; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/ArchivalTaskManagerImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/ArchivalTaskManagerImpl.java index 00c5e73f65..3c3326c68c 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/ArchivalTaskManagerImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/ArchivalTaskManagerImpl.java @@ -19,13 +19,13 @@ package io.entgra.device.mgt.core.device.mgt.core.task.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; import io.entgra.device.mgt.core.device.mgt.core.task.ArchivalTaskException; import io.entgra.device.mgt.core.device.mgt.core.task.ArchivalTaskManager; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.ntask.common.TaskException; import org.wso2.carbon.ntask.core.TaskInfo; import org.wso2.carbon.ntask.core.TaskManager; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/ArchivedDataDeletionTask.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/ArchivedDataDeletionTask.java index fe03d6251f..28df6536dc 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/ArchivedDataDeletionTask.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/ArchivedDataDeletionTask.java @@ -18,11 +18,11 @@ package io.entgra.device.mgt.core.device.mgt.core.task.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.core.archival.ArchivalException; import io.entgra.device.mgt.core.device.mgt.core.archival.ArchivalService; import io.entgra.device.mgt.core.device.mgt.core.archival.ArchivalServiceImpl; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.wso2.carbon.ntask.core.Task; import java.text.SimpleDateFormat; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/DeviceDetailsRetrieverTask.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/DeviceDetailsRetrieverTask.java index 66a47ebfde..0124124358 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/DeviceDetailsRetrieverTask.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/DeviceDetailsRetrieverTask.java @@ -35,10 +35,6 @@ package io.entgra.device.mgt.core.device.mgt.core.task.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.base.MultitenantConstants; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.OperationMonitoringTaskConfig; import io.entgra.device.mgt.core.device.mgt.common.StartupOperationConfig; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; @@ -46,6 +42,10 @@ import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHo import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.task.DeviceMgtTaskException; import io.entgra.device.mgt.core.device.mgt.core.task.DeviceTaskManager; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.base.MultitenantConstants; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/DeviceTaskManagerImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/DeviceTaskManagerImpl.java index 082ebbb07a..c1783b0f49 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/DeviceTaskManagerImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/DeviceTaskManagerImpl.java @@ -34,17 +34,10 @@ package io.entgra.device.mgt.core.device.mgt.core.task.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.base.ServerConfiguration; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.MonitoringOperation; -import io.entgra.device.mgt.core.device.mgt.common.OperationMonitoringTaskConfig; -import io.entgra.device.mgt.core.device.mgt.common.StartupOperationConfig; +import io.entgra.device.mgt.core.device.mgt.common.*; import io.entgra.device.mgt.core.device.mgt.common.exceptions.InvalidDeviceException; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManagementException; -import io.entgra.device.mgt.core.device.mgt.common.DynamicTaskContext; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.CommandOperation; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.ProfileOperation; @@ -52,12 +45,11 @@ import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProvide import io.entgra.device.mgt.core.device.mgt.core.task.DeviceMgtTaskException; import io.entgra.device.mgt.core.device.mgt.core.task.DeviceTaskManager; import io.entgra.device.mgt.core.device.mgt.core.task.Utils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.base.ServerConfiguration; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; public class DeviceTaskManagerImpl implements DeviceTaskManager { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/DeviceTaskManagerServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/DeviceTaskManagerServiceImpl.java index 3737aa389d..c4a72ed6d3 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/DeviceTaskManagerServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/DeviceTaskManagerServiceImpl.java @@ -20,13 +20,13 @@ package io.entgra.device.mgt.core.device.mgt.core.task.impl; import com.google.gson.Gson; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.OperationMonitoringTaskConfig; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; import io.entgra.device.mgt.core.device.mgt.core.task.DeviceMgtTaskException; import io.entgra.device.mgt.core.device.mgt.core.task.DeviceTaskManagerService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.ntask.common.TaskException; import org.wso2.carbon.ntask.core.TaskInfo; import org.wso2.carbon.ntask.core.TaskManager; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/DynamicPartitionedScheduleTask.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/DynamicPartitionedScheduleTask.java index 4aeb87289a..53e42edfc3 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/DynamicPartitionedScheduleTask.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/DynamicPartitionedScheduleTask.java @@ -18,13 +18,13 @@ package io.entgra.device.mgt.core.device.mgt.core.task.impl; +import io.entgra.device.mgt.core.device.mgt.common.DynamicTaskContext; +import io.entgra.device.mgt.core.device.mgt.common.ServerCtxInfo; +import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.exception.HeartBeatManagementException; import io.entgra.device.mgt.core.task.mgt.common.constant.TaskMgtConstants; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.DynamicTaskContext; -import io.entgra.device.mgt.core.device.mgt.common.ServerCtxInfo; -import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; import org.wso2.carbon.ntask.core.Task; import java.util.Map; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/RandomlyAssignedScheduleTask.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/RandomlyAssignedScheduleTask.java index 4a8cf638bd..bd5373862f 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/RandomlyAssignedScheduleTask.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/task/impl/RandomlyAssignedScheduleTask.java @@ -18,10 +18,10 @@ package io.entgra.device.mgt.core.device.mgt.core.task.impl; +import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.exception.HeartBeatManagementException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; import org.wso2.carbon.ntask.core.Task; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/traccar/api/service/TraccarClientFactory.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/traccar/api/service/TraccarClientFactory.java index 50a8f39359..bcdbedf09d 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/traccar/api/service/TraccarClientFactory.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/traccar/api/service/TraccarClientFactory.java @@ -18,27 +18,14 @@ package io.entgra.device.mgt.core.device.mgt.core.traccar.api.service; -import okhttp3.ConnectionPool; -import okhttp3.MediaType; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.json.JSONArray; -import org.json.JSONObject; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.TrackerDeviceInfo; import io.entgra.device.mgt.core.device.mgt.common.TrackerGroupInfo; import io.entgra.device.mgt.core.device.mgt.common.TrackerPermissionInfo; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TrackerAlreadyExistException; -import io.entgra.device.mgt.core.device.mgt.core.dao.TrackerManagementDAOException; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; import io.entgra.device.mgt.core.device.mgt.core.dao.TrackerDAO; +import io.entgra.device.mgt.core.device.mgt.core.dao.TrackerManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.dao.TrackerManagementDAOFactory; -import io.entgra.device.mgt.core.device.mgt.core.traccar.api.service.TraccarClient; import io.entgra.device.mgt.core.device.mgt.core.traccar.api.service.impl.DeviceAPIClientServiceImpl; import io.entgra.device.mgt.core.device.mgt.core.traccar.common.TraccarHandlerConstants; import io.entgra.device.mgt.core.device.mgt.core.traccar.common.beans.TraccarDevice; @@ -49,6 +36,13 @@ import io.entgra.device.mgt.core.device.mgt.core.traccar.common.config.TraccarGa import io.entgra.device.mgt.core.device.mgt.core.traccar.common.util.TraccarUtil; import io.entgra.device.mgt.core.device.mgt.core.traccar.core.config.TraccarConfigurationManager; import io.entgra.device.mgt.core.device.mgt.core.util.HttpReportingUtil; +import okhttp3.*; +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.json.JSONArray; +import org.json.JSONObject; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.io.IOException; import java.sql.SQLException; @@ -58,12 +52,7 @@ import java.util.Date; import java.util.List; import java.util.Objects; import java.util.Random; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; +import java.util.concurrent.*; import java.util.stream.Collectors; import java.util.stream.IntStream; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/traccar/api/service/addons/TraccarClientImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/traccar/api/service/addons/TraccarClientImpl.java index 21eccc0bcc..b988b7dde2 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/traccar/api/service/addons/TraccarClientImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/traccar/api/service/addons/TraccarClientImpl.java @@ -19,25 +19,13 @@ package io.entgra.device.mgt.core.device.mgt.core.traccar.api.service.addons; -import okhttp3.ConnectionPool; -import okhttp3.MediaType; -import okhttp3.OkHttpClient; -import okhttp3.Request; -import okhttp3.RequestBody; -import okhttp3.Response; -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.json.JSONArray; -import org.json.JSONObject; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.TrackerDeviceInfo; import io.entgra.device.mgt.core.device.mgt.common.TrackerGroupInfo; import io.entgra.device.mgt.core.device.mgt.common.TrackerPermissionInfo; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TrackerAlreadyExistException; -import io.entgra.device.mgt.core.device.mgt.core.dao.TrackerManagementDAOException; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; import io.entgra.device.mgt.core.device.mgt.core.dao.TrackerDAO; +import io.entgra.device.mgt.core.device.mgt.core.dao.TrackerManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.dao.TrackerManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.traccar.api.service.TraccarClient; import io.entgra.device.mgt.core.device.mgt.core.traccar.api.service.impl.DeviceAPIClientServiceImpl; @@ -50,6 +38,13 @@ import io.entgra.device.mgt.core.device.mgt.core.traccar.common.config.TraccarGa import io.entgra.device.mgt.core.device.mgt.core.traccar.common.util.TraccarUtil; import io.entgra.device.mgt.core.device.mgt.core.traccar.core.config.TraccarConfigurationManager; import io.entgra.device.mgt.core.device.mgt.core.util.HttpReportingUtil; +import okhttp3.*; +import org.apache.commons.codec.binary.Base64; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.json.JSONArray; +import org.json.JSONObject; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.sql.SQLException; import java.time.LocalDateTime; @@ -58,12 +53,7 @@ import java.util.Date; import java.util.List; import java.util.Objects; import java.util.Random; -import java.util.concurrent.Callable; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import java.util.concurrent.TimeUnit; +import java.util.concurrent.*; public class TraccarClientImpl implements TraccarClient { private static final Log log = LogFactory.getLog(TraccarClientImpl.class); diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/traccar/api/service/impl/DeviceAPIClientServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/traccar/api/service/impl/DeviceAPIClientServiceImpl.java index 5c39b2364c..f6c40e9c60 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/traccar/api/service/impl/DeviceAPIClientServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/traccar/api/service/impl/DeviceAPIClientServiceImpl.java @@ -19,15 +19,12 @@ package io.entgra.device.mgt.core.device.mgt.core.traccar.api.service.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.json.JSONObject; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.TrackerDeviceInfo; import io.entgra.device.mgt.core.device.mgt.common.TrackerPermissionInfo; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceLocation; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TrackerAlreadyExistException; +import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; import io.entgra.device.mgt.core.device.mgt.core.dao.TrackerManagementDAOException; import io.entgra.device.mgt.core.device.mgt.core.traccar.api.service.DeviceAPIClientService; import io.entgra.device.mgt.core.device.mgt.core.traccar.api.service.TraccarClientFactory; @@ -35,6 +32,9 @@ import io.entgra.device.mgt.core.device.mgt.core.traccar.common.beans.TraccarDev import io.entgra.device.mgt.core.device.mgt.core.traccar.common.beans.TraccarGroups; import io.entgra.device.mgt.core.device.mgt.core.traccar.common.beans.TraccarPosition; import io.entgra.device.mgt.core.device.mgt.core.traccar.common.beans.TraccarUser; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.json.JSONObject; import java.util.Date; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/traccar/common/util/TraccarUtil.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/traccar/common/util/TraccarUtil.java index 587612534f..d1f6a21ca9 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/traccar/common/util/TraccarUtil.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/traccar/common/util/TraccarUtil.java @@ -19,9 +19,9 @@ package io.entgra.device.mgt.core.device.mgt.core.traccar.common.util; -import org.json.JSONObject; import io.entgra.device.mgt.core.device.mgt.core.traccar.common.beans.TraccarDevice; import io.entgra.device.mgt.core.device.mgt.core.traccar.common.beans.TraccarUser; +import org.json.JSONObject; import java.util.ArrayList; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/traccar/core/config/TraccarConfigurationManager.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/traccar/core/config/TraccarConfigurationManager.java index ac2e9d855e..72d6a4513e 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/traccar/core/config/TraccarConfigurationManager.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/traccar/core/config/TraccarConfigurationManager.java @@ -19,13 +19,13 @@ package io.entgra.device.mgt.core.device.mgt.core.traccar.core.config; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.w3c.dom.Document; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.core.traccar.common.TraccarHandlerConstants; import io.entgra.device.mgt.core.device.mgt.core.traccar.common.config.TraccarConfiguration; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.w3c.dom.Document; import org.wso2.carbon.utils.CarbonUtils; import javax.xml.bind.JAXBContext; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/DeviceManagementSchemaInitializer.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/DeviceManagementSchemaInitializer.java index 5f6a07b75f..0a14040908 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/DeviceManagementSchemaInitializer.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/DeviceManagementSchemaInitializer.java @@ -18,9 +18,9 @@ package io.entgra.device.mgt.core.device.mgt.core.util; +import io.entgra.device.mgt.core.device.mgt.core.config.datasource.DataSourceConfig; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.core.config.datasource.DataSourceConfig; import org.wso2.carbon.utils.CarbonUtils; import org.wso2.carbon.utils.dbcreator.DatabaseCreator; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/DeviceManagerUtil.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/DeviceManagerUtil.java index 35beda596c..c573b2e69d 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/DeviceManagerUtil.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/DeviceManagerUtil.java @@ -36,34 +36,8 @@ package io.entgra.device.mgt.core.device.mgt.core.util; import com.fasterxml.jackson.databind.ObjectMapper; import com.google.gson.Gson; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.HttpResponse; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.entity.ContentType; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.protocol.HTTP; -import org.w3c.dom.Document; -import org.wso2.carbon.base.MultitenantConstants; -import org.wso2.carbon.caching.impl.CacheImpl; -import org.wso2.carbon.context.CarbonContext; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.AppRegistrationCredentials; -import io.entgra.device.mgt.core.device.mgt.common.ApplicationRegistration; -import io.entgra.device.mgt.core.device.mgt.common.ApplicationRegistrationException; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; -import io.entgra.device.mgt.core.device.mgt.common.GroupPaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationEntry; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationManagementException; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.EnrollmentConfiguration; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfiguration; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService; +import io.entgra.device.mgt.core.device.mgt.common.*; +import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.*; import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfigurationProviderService; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceNotFoundException; @@ -98,11 +72,21 @@ import io.entgra.device.mgt.core.identity.jwt.client.extension.JWTClient; import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.AccessTokenInfo; import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; import io.entgra.device.mgt.core.identity.jwt.client.extension.service.JWTClientManagerService; -import org.wso2.carbon.user.api.RealmConfiguration; -import org.wso2.carbon.user.api.TenantManager; -import org.wso2.carbon.user.api.UserRealm; -import org.wso2.carbon.user.api.UserStoreException; -import org.wso2.carbon.user.api.UserStoreManager; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.http.HttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.ContentType; +import org.apache.http.entity.StringEntity; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.protocol.HTTP; +import org.w3c.dom.Document; +import org.wso2.carbon.base.MultitenantConstants; +import org.wso2.carbon.caching.impl.CacheImpl; +import org.wso2.carbon.context.CarbonContext; +import org.wso2.carbon.context.PrivilegedCarbonContext; +import org.wso2.carbon.user.api.*; import org.wso2.carbon.user.core.config.RealmConfigXMLProcessor; import org.wso2.carbon.utils.CarbonUtils; import org.wso2.carbon.utils.ConfigurationContextService; @@ -121,13 +105,7 @@ import java.io.File; import java.io.IOException; import java.io.InputStreamReader; import java.sql.SQLException; -import java.util.ArrayList; -import java.util.Base64; -import java.util.HashMap; -import java.util.Hashtable; -import java.util.List; -import java.util.Map; -import java.util.StringJoiner; +import java.util.*; import java.util.concurrent.TimeUnit; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/HttpReportingUtil.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/HttpReportingUtil.java index 1cc50225b8..00e91007f3 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/HttpReportingUtil.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/HttpReportingUtil.java @@ -17,6 +17,8 @@ package io.entgra.device.mgt.core.device.mgt.core.util; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.EventPublishingException; +import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.http.HttpResponse; @@ -27,8 +29,7 @@ import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; import org.apache.http.protocol.HTTP; import org.json.JSONObject; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.EventPublishingException; -import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants; + import java.io.IOException; public class HttpReportingUtil { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/MDMAndroidOperationUtil.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/MDMAndroidOperationUtil.java index f433a19f64..de0c32727f 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/MDMAndroidOperationUtil.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/MDMAndroidOperationUtil.java @@ -19,13 +19,13 @@ package io.entgra.device.mgt.core.device.mgt.core.util; import io.entgra.device.mgt.core.device.mgt.common.MDMAppConstants; +import io.entgra.device.mgt.core.device.mgt.common.app.mgt.App; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.android.AppStoreApplication; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.android.EnterpriseApplication; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.android.WebApplication; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.UnknownApplicationTypeException; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.ProfileOperation; -import io.entgra.device.mgt.core.device.mgt.common.app.mgt.App; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.UnknownApplicationTypeException; /** * diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/MDMIOSOperationUtil.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/MDMIOSOperationUtil.java index ee8f73f0b0..8c0996b5d4 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/MDMIOSOperationUtil.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/MDMIOSOperationUtil.java @@ -19,11 +19,11 @@ package io.entgra.device.mgt.core.device.mgt.core.util; import io.entgra.device.mgt.core.device.mgt.common.MDMAppConstants; +import io.entgra.device.mgt.core.device.mgt.common.app.mgt.App; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.ios.AppStoreApplication; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.ios.EnterpriseApplication; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.ios.RemoveApplication; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.ios.WebClip; -import io.entgra.device.mgt.core.device.mgt.common.app.mgt.App; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.ProfileOperation; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/MDMWindowsOperationUtil.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/MDMWindowsOperationUtil.java index fb06594765..ea8a8ece87 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/MDMWindowsOperationUtil.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/MDMWindowsOperationUtil.java @@ -23,8 +23,6 @@ import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.MDMAppConstants; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.App; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.windows.EnterpriseApplication; @@ -33,6 +31,8 @@ import io.entgra.device.mgt.core.device.mgt.common.app.mgt.windows.HostedMSIAppl import io.entgra.device.mgt.core.device.mgt.common.exceptions.UnknownApplicationTypeException; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.ProfileOperation; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.util.ArrayList; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/DeviceManagementConfigTests.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/DeviceManagementConfigTests.java index 79516708e4..875c83f851 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/DeviceManagementConfigTests.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/DeviceManagementConfigTests.java @@ -17,12 +17,12 @@ */ package io.entgra.device.mgt.core.device.mgt.core; +import io.entgra.device.mgt.core.device.mgt.core.config.DeviceManagementConfig; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import io.entgra.device.mgt.core.device.mgt.core.config.DeviceManagementConfig; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/DeviceManagementRepositoryTests.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/DeviceManagementRepositoryTests.java index 18c66bbcbc..9ea9fb523f 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/DeviceManagementRepositoryTests.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/DeviceManagementRepositoryTests.java @@ -17,14 +17,14 @@ */ package io.entgra.device.mgt.core.device.mgt.core; -import org.testng.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.spi.DeviceManagementService; import io.entgra.device.mgt.core.device.mgt.core.common.TestDataHolder; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; import io.entgra.device.mgt.core.device.mgt.core.task.impl.DeviceTaskManagerServiceImpl; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; public class DeviceManagementRepositoryTests{ diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/TestDeviceManager.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/TestDeviceManager.java index 0b8ca1aece..6c3755345a 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/TestDeviceManager.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/TestDeviceManager.java @@ -15,12 +15,7 @@ */ package io.entgra.device.mgt.core.device.mgt.core; -import io.entgra.device.mgt.core.device.mgt.common.DeviceManager; -import io.entgra.device.mgt.core.device.mgt.common.FeatureManager; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; -import io.entgra.device.mgt.core.device.mgt.common.Feature; +import io.entgra.device.mgt.core.device.mgt.common.*; import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfiguration; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.license.mgt.License; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/TestHeartBeatManagementService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/TestHeartBeatManagementService.java index 2ba1696726..be8d3574b2 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/TestHeartBeatManagementService.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/TestHeartBeatManagementService.java @@ -18,11 +18,11 @@ package io.entgra.device.mgt.core.device.mgt.core; +import io.entgra.device.mgt.core.device.mgt.common.ServerCtxInfo; import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.dto.HeartBeatEvent; import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.dto.ServerContext; import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.exception.HeartBeatManagementException; import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBeatManagementService; -import io.entgra.device.mgt.core.device.mgt.common.ServerCtxInfo; import java.util.Map; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/TestTaskServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/TestTaskServiceImpl.java index 77e215e653..3f3f80fe09 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/TestTaskServiceImpl.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/TestTaskServiceImpl.java @@ -19,11 +19,9 @@ package io.entgra.device.mgt.core.device.mgt.core; import io.entgra.device.mgt.core.device.mgt.core.task.TestTaskManagerImpl; import org.wso2.carbon.ntask.common.TaskException; -import org.wso2.carbon.ntask.core.TaskInfo; import org.wso2.carbon.ntask.core.TaskManager; import org.wso2.carbon.ntask.core.service.TaskService; -import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/TestUtils.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/TestUtils.java index 39188314c2..4827f44256 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/TestUtils.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/TestUtils.java @@ -17,13 +17,13 @@ */ package io.entgra.device.mgt.core.device.mgt.core; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.GroupPaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; import io.entgra.device.mgt.core.device.mgt.core.common.TestDataHolder; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.wso2.carbon.registry.core.config.RegistryContext; import org.wso2.carbon.registry.core.exceptions.RegistryException; import org.wso2.carbon.registry.core.internal.RegistryDataHolder; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/app/mgt/AppManagementConfigurationManagerTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/app/mgt/AppManagementConfigurationManagerTest.java index 029cdd7744..e72b7848b9 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/app/mgt/AppManagementConfigurationManagerTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/app/mgt/AppManagementConfigurationManagerTest.java @@ -18,12 +18,12 @@ package io.entgra.device.mgt.core.device.mgt.core.app.mgt; +import io.entgra.device.mgt.core.device.mgt.core.app.mgt.config.AppManagementConfig; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import io.entgra.device.mgt.core.device.mgt.core.app.mgt.config.AppManagementConfig; import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/app/mgt/ApplicationManagementProviderServiceTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/app/mgt/ApplicationManagementProviderServiceTest.java index 11df30cfbd..577aacd235 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/app/mgt/ApplicationManagementProviderServiceTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/app/mgt/ApplicationManagementProviderServiceTest.java @@ -15,18 +15,18 @@ */ package io.entgra.device.mgt.core.device.mgt.core.app.mgt; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.testng.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.Application; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementPluginRepository; import io.entgra.device.mgt.core.device.mgt.core.TestDeviceManagementService; import io.entgra.device.mgt.core.device.mgt.core.common.TestDataHolder; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; import java.util.ArrayList; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/authorization/DeviceAccessAuthorizationServiceTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/authorization/DeviceAccessAuthorizationServiceTest.java index bd5c841b6d..7e9831f329 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/authorization/DeviceAccessAuthorizationServiceTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/authorization/DeviceAccessAuthorizationServiceTest.java @@ -18,23 +18,13 @@ package io.entgra.device.mgt.core.device.mgt.core.authorization; -import org.apache.commons.dbcp.BasicDataSource; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.mockito.Mockito; -import org.testng.Assert; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; -import org.wso2.carbon.CarbonConstants; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceNotFoundException; import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAccessAuthorizationException; import io.entgra.device.mgt.core.device.mgt.common.authorization.DeviceAuthorizationResult; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceNotFoundException; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupManagementException; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.RoleDoesNotExistException; import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagementException; @@ -47,23 +37,30 @@ import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProvide import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; import io.entgra.device.mgt.core.device.mgt.core.service.GroupManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.service.GroupManagementProviderServiceImpl; +import org.apache.commons.dbcp.BasicDataSource; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.mockito.Mockito; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.wso2.carbon.CarbonConstants; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.registry.core.config.RegistryContext; import org.wso2.carbon.registry.core.exceptions.RegistryException; import org.wso2.carbon.registry.core.internal.RegistryDataHolder; import org.wso2.carbon.registry.core.jdbc.realm.InMemoryRealmService; import org.wso2.carbon.registry.core.service.RegistryService; +import org.wso2.carbon.user.api.Permission; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.api.UserStoreManager; -import org.wso2.carbon.user.api.Permission; import org.wso2.carbon.user.core.service.RealmService; import org.wso2.carbon.user.core.tenant.JDBCTenantManager; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; + import java.io.InputStream; -import java.util.ArrayList; -import java.util.Map; -import java.util.List; -import java.util.HashMap; -import java.util.Arrays; +import java.util.*; /** * Unit tests for DeviceAccessAuthorizationServiceTest diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/cache/DeviceCacheManagerImplTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/cache/DeviceCacheManagerImplTest.java index 1b30508cc3..95560b0402 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/cache/DeviceCacheManagerImplTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/cache/DeviceCacheManagerImplTest.java @@ -18,11 +18,6 @@ package io.entgra.device.mgt.core.device.mgt.core.cache; -import org.mockito.Mockito; -import org.testng.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; @@ -32,7 +27,13 @@ import io.entgra.device.mgt.core.device.mgt.core.common.TestDataHolder; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceManagementConfig; import io.entgra.device.mgt.core.device.mgt.core.config.cache.DeviceCacheConfiguration; +import org.mockito.Mockito; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; + import java.io.File; import java.io.IOException; import java.util.ArrayList; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/common/BaseDeviceManagementTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/common/BaseDeviceManagementTest.java index c00c1b67a7..852780e9ad 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/common/BaseDeviceManagementTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/common/BaseDeviceManagementTest.java @@ -18,17 +18,6 @@ */ package io.entgra.device.mgt.core.device.mgt.core.common; -import org.apache.axis2.AxisFault; -import org.apache.axis2.context.ConfigurationContext; -import org.apache.axis2.context.ConfigurationContextFactory; -import org.apache.tomcat.jdbc.pool.PoolProperties; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.BeforeSuite; -import org.testng.annotations.Optional; -import org.testng.annotations.Parameters; -import org.w3c.dom.Document; -import org.wso2.carbon.base.MultitenantConstants; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.core.TestUtils; import io.entgra.device.mgt.core.device.mgt.core.authorization.DeviceAccessAuthorizationServiceImpl; @@ -45,6 +34,17 @@ import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProvide import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; import io.entgra.device.mgt.core.device.mgt.core.service.GroupManagementProviderServiceImpl; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; +import org.apache.axis2.AxisFault; +import org.apache.axis2.context.ConfigurationContext; +import org.apache.axis2.context.ConfigurationContextFactory; +import org.apache.tomcat.jdbc.pool.PoolProperties; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeSuite; +import org.testng.annotations.Optional; +import org.testng.annotations.Parameters; +import org.w3c.dom.Document; +import org.wso2.carbon.base.MultitenantConstants; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.registry.core.config.RegistryContext; import org.wso2.carbon.registry.core.exceptions.RegistryException; import org.wso2.carbon.registry.core.internal.RegistryDataHolder; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/common/TestDataHolder.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/common/TestDataHolder.java index 8cf7a98a10..9d42501c42 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/common/TestDataHolder.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/common/TestDataHolder.java @@ -15,11 +15,7 @@ */ package io.entgra.device.mgt.core.device.mgt.core.common; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; -import io.entgra.device.mgt.core.device.mgt.common.MonitoringOperation; -import io.entgra.device.mgt.core.device.mgt.common.OperationMonitoringTaskConfig; +import io.entgra.device.mgt.core.device.mgt.common.*; import io.entgra.device.mgt.core.device.mgt.common.app.mgt.Application; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceInfo; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/dao/DevicePersistTests.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/dao/DevicePersistTests.java index f15fc880df..677d309297 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/dao/DevicePersistTests.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/dao/DevicePersistTests.java @@ -18,11 +18,6 @@ package io.entgra.device.mgt.core.device.mgt.core.dao; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.testng.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo.Status; @@ -31,8 +26,16 @@ import io.entgra.device.mgt.core.device.mgt.core.TestUtils; import io.entgra.device.mgt.core.device.mgt.core.common.BaseDeviceManagementTest; import io.entgra.device.mgt.core.device.mgt.core.common.TestDataHolder; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; -import java.sql.*; +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; public class DevicePersistTests extends BaseDeviceManagementTest { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/dao/DeviceStatusPersistenceTests.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/dao/DeviceStatusPersistenceTests.java index 185c98103b..28d524726c 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/dao/DeviceStatusPersistenceTests.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/dao/DeviceStatusPersistenceTests.java @@ -18,20 +18,19 @@ */ package io.entgra.device.mgt.core.device.mgt.core.dao; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.testng.Assert; -import org.testng.annotations.Test; -import org.testng.annotations.BeforeClass; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; import io.entgra.device.mgt.core.device.mgt.common.type.mgt.DeviceStatus; import io.entgra.device.mgt.core.device.mgt.core.common.BaseDeviceManagementTest; import io.entgra.device.mgt.core.device.mgt.core.common.TestDataHolder; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; import java.sql.SQLException; import java.util.*; -import java.util.List; import java.util.stream.Stream; import static io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo.Status.*; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/dao/EnrolmentPersistenceTests.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/dao/EnrolmentPersistenceTests.java index fe400c4264..93725b7693 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/dao/EnrolmentPersistenceTests.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/dao/EnrolmentPersistenceTests.java @@ -18,15 +18,15 @@ */ package io.entgra.device.mgt.core.device.mgt.core.dao; +import io.entgra.device.mgt.core.device.mgt.common.Device; +import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; +import io.entgra.device.mgt.core.device.mgt.core.common.BaseDeviceManagementTest; +import io.entgra.device.mgt.core.device.mgt.core.common.TestDataHolder; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; -import io.entgra.device.mgt.core.device.mgt.core.common.BaseDeviceManagementTest; -import io.entgra.device.mgt.core.device.mgt.core.common.TestDataHolder; import java.sql.SQLException; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/dao/GroupPersistTests.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/dao/GroupPersistTests.java index 8cccaa4e15..9398305b82 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/dao/GroupPersistTests.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/dao/GroupPersistTests.java @@ -18,17 +18,17 @@ package io.entgra.device.mgt.core.device.mgt.core.dao; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.testng.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.GroupPaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; import io.entgra.device.mgt.core.device.mgt.core.common.BaseDeviceManagementTest; import io.entgra.device.mgt.core.device.mgt.core.common.TestDataHolder; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; import java.sql.SQLException; import java.util.ArrayList; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/geo/service/GeoLocationProviderServiceTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/geo/service/GeoLocationProviderServiceTest.java index 9b6137a26a..ae53028ef2 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/geo/service/GeoLocationProviderServiceTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/geo/service/GeoLocationProviderServiceTest.java @@ -19,10 +19,6 @@ package io.entgra.device.mgt.core.device.mgt.core.geo.service; -import org.mockito.Mockito; -import org.testng.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; @@ -34,6 +30,10 @@ import io.entgra.device.mgt.core.device.mgt.core.TestDeviceManagementService; import io.entgra.device.mgt.core.device.mgt.core.common.TestDataHolder; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import org.mockito.Mockito; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; import org.wso2.carbon.event.processor.stub.EventProcessorAdminServiceStub; import org.wso2.carbon.event.processor.stub.types.ExecutionPlanConfigurationDto; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockConnection.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockConnection.java index 4d82236c86..ea05eb59fc 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockConnection.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockConnection.java @@ -17,23 +17,7 @@ */ package io.entgra.device.mgt.core.device.mgt.core.mock; -import java.sql.Array; -import java.sql.Blob; -import java.sql.CallableStatement; -import java.sql.Clob; -import java.sql.Connection; -import java.sql.DatabaseMetaData; -import java.sql.NClob; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.RowIdLifetime; -import java.sql.SQLClientInfoException; -import java.sql.SQLException; -import java.sql.SQLWarning; -import java.sql.SQLXML; -import java.sql.Savepoint; -import java.sql.Statement; -import java.sql.Struct; +import java.sql.*; import java.util.ArrayList; import java.util.List; import java.util.Map; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockDataSource.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockDataSource.java index 7f96c0cd14..3b7c52e970 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockDataSource.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockDataSource.java @@ -17,8 +17,7 @@ */ package io.entgra.device.mgt.core.device.mgt.core.mock; -import org.mockito.Mock; - +import javax.sql.DataSource; import java.io.PrintWriter; import java.sql.Connection; import java.sql.SQLException; @@ -26,7 +25,6 @@ import java.sql.SQLFeatureNotSupportedException; import java.util.ArrayList; import java.util.List; import java.util.logging.Logger; -import javax.sql.DataSource; /** * This is the mock data source implementation that will be used in the test cases. diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockDatabaseMetaData.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockDatabaseMetaData.java index 3992e86f11..8d0599f3f2 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockDatabaseMetaData.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockDatabaseMetaData.java @@ -19,11 +19,7 @@ package io.entgra.device.mgt.core.device.mgt.core.mock; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; -import java.sql.Connection; -import java.sql.DatabaseMetaData; -import java.sql.ResultSet; -import java.sql.RowIdLifetime; -import java.sql.SQLException; +import java.sql.*; public class MockDatabaseMetaData implements DatabaseMetaData { private String url; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockJDBCDriver.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockJDBCDriver.java index 58d21b7daa..3e8990e9d9 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockJDBCDriver.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockJDBCDriver.java @@ -17,11 +17,7 @@ */ package io.entgra.device.mgt.core.device.mgt.core.mock; -import java.sql.Connection; -import java.sql.Driver; -import java.sql.DriverPropertyInfo; -import java.sql.SQLException; -import java.sql.SQLFeatureNotSupportedException; +import java.sql.*; import java.util.Properties; import java.util.logging.Logger; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockResultSet.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockResultSet.java index ddfa16efed..ad2f6ca4d1 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockResultSet.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockResultSet.java @@ -21,21 +21,7 @@ import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; import java.net.URL; -import java.sql.Array; -import java.sql.Blob; -import java.sql.Clob; -import java.sql.Date; -import java.sql.NClob; -import java.sql.Ref; -import java.sql.ResultSet; -import java.sql.ResultSetMetaData; -import java.sql.RowId; -import java.sql.SQLException; -import java.sql.SQLWarning; -import java.sql.SQLXML; -import java.sql.Statement; -import java.sql.Time; -import java.sql.Timestamp; +import java.sql.*; import java.util.ArrayList; import java.util.Calendar; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockStatement.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockStatement.java index df1f1cfd79..da11002f6d 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockStatement.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/mock/MockStatement.java @@ -21,24 +21,7 @@ import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; import java.net.URL; -import java.sql.Array; -import java.sql.Blob; -import java.sql.Clob; -import java.sql.Connection; -import java.sql.Date; -import java.sql.NClob; -import java.sql.ParameterMetaData; -import java.sql.PreparedStatement; -import java.sql.Ref; -import java.sql.ResultSet; -import java.sql.ResultSetMetaData; -import java.sql.RowId; -import java.sql.SQLException; -import java.sql.SQLWarning; -import java.sql.SQLXML; -import java.sql.Statement; -import java.sql.Time; -import java.sql.Timestamp; +import java.sql.*; import java.util.ArrayList; import java.util.Calendar; import java.util.List; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/NotificationManagementServiceImplTests.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/NotificationManagementServiceImplTests.java index 6500909e6d..5bcf1961cd 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/NotificationManagementServiceImplTests.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/notification/mgt/NotificationManagementServiceImplTests.java @@ -17,16 +17,11 @@ */ package io.entgra.device.mgt.core.device.mgt.core.notification.mgt; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.testng.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.EntityDoesNotExistException; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.EntityDoesNotExistException; import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.Notification; import io.entgra.device.mgt.core.device.mgt.common.notification.mgt.NotificationManagementException; import io.entgra.device.mgt.core.device.mgt.core.TestDeviceManagementService; @@ -38,6 +33,11 @@ import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementServic import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; import io.entgra.device.mgt.core.device.mgt.core.service.GroupManagementProviderServiceImpl; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; import org.wso2.carbon.registry.core.config.RegistryContext; import org.wso2.carbon.registry.core.exceptions.RegistryException; import org.wso2.carbon.registry.core.internal.RegistryDataHolder; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/operation/OperationManagementNegativeDBOperationTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/operation/OperationManagementNegativeDBOperationTest.java index e6b0952be5..8d1e13a614 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/operation/OperationManagementNegativeDBOperationTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/operation/OperationManagementNegativeDBOperationTest.java @@ -17,15 +17,10 @@ */ package io.entgra.device.mgt.core.device.mgt.core.operation; -import org.powermock.api.mockito.PowerMockito; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManagementException; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManager; @@ -38,6 +33,11 @@ import io.entgra.device.mgt.core.device.mgt.core.mock.MockDataSource; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.OperationManagerImpl; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import org.powermock.api.mockito.PowerMockito; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; import javax.sql.DataSource; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/operation/OperationManagementNoDBSchemaTests.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/operation/OperationManagementNoDBSchemaTests.java index 5ce9fe7e40..b49ab83208 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/operation/OperationManagementNoDBSchemaTests.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/operation/OperationManagementNoDBSchemaTests.java @@ -18,16 +18,11 @@ package io.entgra.device.mgt.core.device.mgt.core.operation; -import org.powermock.api.mockito.PowerMockito; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; +import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.InvalidDeviceException; -import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManagementException; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManager; @@ -41,6 +36,11 @@ import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.CommandOperation; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.OperationManagerImpl; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import org.powermock.api.mockito.PowerMockito; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; import javax.sql.DataSource; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/operation/OperationManagementTests.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/operation/OperationManagementTests.java index 8a9efe5979..018bf6efc2 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/operation/OperationManagementTests.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/operation/OperationManagementTests.java @@ -18,37 +18,25 @@ package io.entgra.device.mgt.core.device.mgt.core.operation; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.powermock.api.mockito.PowerMockito; -import org.testng.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; +import io.entgra.device.mgt.core.device.mgt.common.*; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; import io.entgra.device.mgt.core.device.mgt.common.exceptions.InvalidDeviceException; -import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Activity; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.ActivityStatus; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManagementException; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManager; +import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.*; import io.entgra.device.mgt.core.device.mgt.common.spi.DeviceManagementService; import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.core.TestDeviceManagementService; import io.entgra.device.mgt.core.device.mgt.core.common.BaseDeviceManagementTest; import io.entgra.device.mgt.core.device.mgt.core.common.TestDataHolder; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; -import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.CommandOperation; -import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.ConfigOperation; -import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.OperationManagerImpl; -import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.PolicyOperation; -import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.ProfileOperation; +import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.*; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.powermock.api.mockito.PowerMockito; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; import java.text.ParseException; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/operation/ScheduledTaskOperationTests.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/operation/ScheduledTaskOperationTests.java index 7c4d50b469..af33152652 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/operation/ScheduledTaskOperationTests.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/operation/ScheduledTaskOperationTests.java @@ -17,11 +17,6 @@ */ package io.entgra.device.mgt.core.device.mgt.core.operation; -import org.mockito.Mockito; -import org.powermock.api.mockito.PowerMockito; -import org.testng.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; @@ -42,6 +37,11 @@ import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.OperationManagerI import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.task.DeviceTaskManagerService; import io.entgra.device.mgt.core.device.mgt.core.task.impl.DeviceTaskManagerServiceImpl; +import org.mockito.Mockito; +import org.powermock.api.mockito.PowerMockito; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; import org.wso2.carbon.ntask.core.internal.TasksDSComponent; import org.wso2.carbon.ntask.core.service.TaskService; import org.wso2.carbon.ntask.core.service.impl.TaskServiceImpl; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/permission/mgt/PermissionManagerServiceTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/permission/mgt/PermissionManagerServiceTest.java index 4218aa315a..c7a30d474c 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/permission/mgt/PermissionManagerServiceTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/permission/mgt/PermissionManagerServiceTest.java @@ -17,6 +17,9 @@ */ package io.entgra.device.mgt.core.device.mgt.core.permission.mgt; +import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.Permission; +import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagementException; +import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagerService; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.powermock.api.mockito.PowerMockito; @@ -26,14 +29,10 @@ import org.testng.IObjectFactory; import org.testng.annotations.BeforeClass; import org.testng.annotations.ObjectFactory; import org.testng.annotations.Test; -import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.Permission; -import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagementException; -import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagerService; import org.wso2.carbon.registry.core.exceptions.RegistryException; import java.util.ArrayList; import java.util.List; -import java.util.Properties; import static org.mockito.MockitoAnnotations.initMocks; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/push/notification/mgt/task/PushNotificationSchedulerTaskTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/push/notification/mgt/task/PushNotificationSchedulerTaskTest.java index 87b78cf6d8..6ea50b6861 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/push/notification/mgt/task/PushNotificationSchedulerTaskTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/push/notification/mgt/task/PushNotificationSchedulerTaskTest.java @@ -17,12 +17,6 @@ */ package io.entgra.device.mgt.core.device.mgt.core.push.notification.mgt.task; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.mockito.Mockito; -import org.testng.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManagementException; import io.entgra.device.mgt.core.device.mgt.core.common.BaseDeviceManagementTest; @@ -37,6 +31,12 @@ import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationMana import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.dao.OperationManagementDAOFactory; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.mockito.Mockito; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; import org.wso2.carbon.registry.core.exceptions.RegistryException; import java.sql.SQLException; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/search/DeviceDetails.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/search/DeviceDetails.java index 8c97bd7b8f..8b34362bed 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/search/DeviceDetails.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/search/DeviceDetails.java @@ -19,16 +19,16 @@ package io.entgra.device.mgt.core.device.mgt.core.search; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; import io.entgra.device.mgt.core.device.mgt.core.common.BaseDeviceManagementTest; import io.entgra.device.mgt.core.device.mgt.core.device.details.mgt.DeviceInformationManager; import io.entgra.device.mgt.core.device.mgt.core.device.details.mgt.impl.DeviceInformationManagerImpl; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; public class DeviceDetails extends BaseDeviceManagementTest { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/search/ProcessorImplTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/search/ProcessorImplTest.java index ef8155b900..700ad7da06 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/search/ProcessorImplTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/search/ProcessorImplTest.java @@ -17,9 +17,6 @@ */ package io.entgra.device.mgt.core.device.mgt.core.search; -import org.testng.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.search.Condition; @@ -36,6 +33,9 @@ import io.entgra.device.mgt.core.device.mgt.core.search.util.ChangeEnumValues; import io.entgra.device.mgt.core.device.mgt.core.search.util.Utils; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; import java.util.ArrayList; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/search/SearchManagementServiceTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/search/SearchManagementServiceTest.java index 339fd06bf4..0273b0900d 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/search/SearchManagementServiceTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/search/SearchManagementServiceTest.java @@ -17,15 +17,10 @@ */ package io.entgra.device.mgt.core.device.mgt.core.search; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.testng.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.device.details.DeviceInfo; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.search.Condition; import io.entgra.device.mgt.core.device.mgt.common.search.SearchContext; import io.entgra.device.mgt.core.device.mgt.core.TestDeviceManagementService; @@ -43,6 +38,11 @@ import io.entgra.device.mgt.core.device.mgt.core.search.mgt.impl.SearchManagerSe import io.entgra.device.mgt.core.device.mgt.core.search.util.Utils; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; import java.util.ArrayList; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/search/SearchMgtUtilTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/search/SearchMgtUtilTest.java index 5a93437d5c..e50c121962 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/search/SearchMgtUtilTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/search/SearchMgtUtilTest.java @@ -17,13 +17,13 @@ */ package io.entgra.device.mgt.core.device.mgt.core.search; -import org.junit.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.core.common.TestDataHolder; import io.entgra.device.mgt.core.device.mgt.core.search.mgt.impl.Utils; +import org.junit.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; import java.util.ArrayList; import java.util.HashMap; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderServiceTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderServiceTest.java index c4744bbc0b..290f0e6bee 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderServiceTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderServiceTest.java @@ -53,21 +53,10 @@ package io.entgra.device.mgt.core.device.mgt.core.service; -import org.apache.commons.collections.map.SingletonMap; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.mockito.Mockito; -import org.testng.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; +import io.entgra.device.mgt.core.device.mgt.common.*; +import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; -import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; -import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationManagementException; import io.entgra.device.mgt.core.device.mgt.common.license.mgt.License; import io.entgra.device.mgt.core.device.mgt.core.TestDeviceManagementService; import io.entgra.device.mgt.core.device.mgt.core.authorization.DeviceAccessAuthorizationServiceImpl; @@ -87,6 +76,13 @@ import io.entgra.device.mgt.core.device.mgt.core.mock.MockConnection; import io.entgra.device.mgt.core.device.mgt.core.mock.MockDataSource; import io.entgra.device.mgt.core.device.mgt.core.mock.MockResultSet; import io.entgra.device.mgt.core.device.mgt.core.mock.MockStatement; +import org.apache.commons.collections.map.SingletonMap; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.mockito.Mockito; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; import org.wso2.carbon.registry.core.config.RegistryContext; import org.wso2.carbon.registry.core.exceptions.RegistryException; import org.wso2.carbon.registry.core.internal.RegistryDataHolder; @@ -99,12 +95,7 @@ import org.wso2.carbon.utils.multitenancy.MultitenantConstants; import java.io.InputStream; import java.lang.reflect.Field; import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collections; -import java.util.Date; -import java.util.List; -import java.util.Properties; +import java.util.*; public class DeviceManagementProviderServiceTest extends BaseDeviceManagementTest { diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderServiceNegativeTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderServiceNegativeTest.java index 6915fe5282..79cd951a1e 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderServiceNegativeTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderServiceNegativeTest.java @@ -35,8 +35,6 @@ package io.entgra.device.mgt.core.device.mgt.core.service; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceNotFoundException; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupManagementException; @@ -44,6 +42,8 @@ import io.entgra.device.mgt.core.device.mgt.common.group.mgt.RoleDoesNotExistExc import io.entgra.device.mgt.core.device.mgt.core.TestUtils; import io.entgra.device.mgt.core.device.mgt.core.common.BaseDeviceManagementTest; import io.entgra.device.mgt.core.device.mgt.core.dao.GroupManagementDAOFactory; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; import javax.sql.DataSource; import java.util.ArrayList; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderServiceTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderServiceTest.java index 9089c0f2f5..7561540d6e 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderServiceTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/service/GroupManagementProviderServiceTest.java @@ -35,27 +35,23 @@ package io.entgra.device.mgt.core.device.mgt.core.service; -import org.testng.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.DataProvider; -import org.testng.annotations.Test; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceNotFoundException; import io.entgra.device.mgt.core.device.mgt.common.GroupPaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceNotFoundException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupAlreadyExistException; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupManagementException; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupNotExistException; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.RoleDoesNotExistException; +import io.entgra.device.mgt.core.device.mgt.common.group.mgt.*; import io.entgra.device.mgt.core.device.mgt.core.TestUtils; import io.entgra.device.mgt.core.device.mgt.core.common.BaseDeviceManagementTest; import io.entgra.device.mgt.core.device.mgt.core.common.TestDataHolder; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; import io.entgra.device.mgt.core.device.mgt.core.config.cache.DeviceCacheConfiguration; import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.DataProvider; +import org.testng.annotations.Test; import org.wso2.carbon.registry.core.jdbc.realm.InMemoryRealmService; import org.wso2.carbon.user.api.Permission; import org.wso2.carbon.user.api.UserStoreException; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/task/DeviceTaskManagerServiceTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/task/DeviceTaskManagerServiceTest.java index 1825c67533..bda795dfe7 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/task/DeviceTaskManagerServiceTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/task/DeviceTaskManagerServiceTest.java @@ -17,17 +17,17 @@ */ package io.entgra.device.mgt.core.device.mgt.core.task; +import io.entgra.device.mgt.core.device.mgt.core.TestTaskServiceImpl; +import io.entgra.device.mgt.core.device.mgt.core.common.TestDataHolder; +import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; +import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; +import io.entgra.device.mgt.core.device.mgt.core.task.impl.DeviceTaskManagerServiceImpl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.mockito.Mockito; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import io.entgra.device.mgt.core.device.mgt.core.TestTaskServiceImpl; -import io.entgra.device.mgt.core.device.mgt.core.common.TestDataHolder; -import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; -import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; -import io.entgra.device.mgt.core.device.mgt.core.task.impl.DeviceTaskManagerServiceImpl; import org.wso2.carbon.ntask.common.TaskException; import org.wso2.carbon.ntask.core.TaskInfo; import org.wso2.carbon.ntask.core.TaskManager; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/task/DeviceTaskManagerTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/task/DeviceTaskManagerTest.java index a2e79103a0..743fbb88b2 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/task/DeviceTaskManagerTest.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/java/io/entgra/device/mgt/core/device/mgt/core/task/DeviceTaskManagerTest.java @@ -17,14 +17,6 @@ */ package io.entgra.device.mgt.core.device.mgt.core.task; -import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBeatManagementService; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.powermock.api.mockito.PowerMockito; -import org.testng.Assert; -import org.testng.annotations.AfterClass; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; @@ -46,14 +38,18 @@ import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProvide import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; import io.entgra.device.mgt.core.device.mgt.core.task.impl.DeviceDetailsRetrieverTask; import io.entgra.device.mgt.core.device.mgt.core.task.impl.DeviceTaskManagerImpl; +import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBeatManagementService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.powermock.api.mockito.PowerMockito; +import org.testng.Assert; +import org.testng.annotations.AfterClass; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; import org.wso2.carbon.registry.core.exceptions.RegistryException; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; +import java.util.*; /** * This is a test class to test the functionality in {@link DeviceTaskManager}. diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml index 897e33581c..2337c777e2 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml @@ -1,4 +1,4 @@ - + org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/resources/carbon-home/repository/conf/etc/tasks-config.xml b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/resources/carbon-home/repository/conf/etc/tasks-config.xml index 0a9289da70..4f5e043a15 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/resources/carbon-home/repository/conf/etc/tasks-config.xml +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/resources/carbon-home/repository/conf/etc/tasks-config.xml @@ -1,4 +1,4 @@ - + org.wso2.carbon diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.url.printer/src/main/java/io/entgra/device/mgt/core/device/mgt/url/printer/URLPrinterStartupHandler.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.url.printer/src/main/java/io/entgra/device/mgt/core/device/mgt/url/printer/URLPrinterStartupHandler.java index 827b456425..b991a6bb38 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.url.printer/src/main/java/io/entgra/device/mgt/core/device/mgt/url/printer/URLPrinterStartupHandler.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.url.printer/src/main/java/io/entgra/device/mgt/core/device/mgt/url/printer/URLPrinterStartupHandler.java @@ -18,10 +18,10 @@ package io.entgra.device.mgt.core.device.mgt.url.printer; +import io.entgra.device.mgt.core.device.mgt.url.printer.internal.UrlPrinterDataHolder; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.core.ServerStartupObserver; -import io.entgra.device.mgt.core.device.mgt.url.printer.internal.UrlPrinterDataHolder; import org.wso2.carbon.utils.CarbonUtils; import org.wso2.carbon.utils.ConfigurationContextService; import org.wso2.carbon.utils.NetworkUtils; diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.url.printer/src/main/java/io/entgra/device/mgt/core/device/mgt/url/printer/internal/UrlPrinterServiceComponent.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.url.printer/src/main/java/io/entgra/device/mgt/core/device/mgt/url/printer/internal/UrlPrinterServiceComponent.java index 96000edbed..06d0d4ac41 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.url.printer/src/main/java/io/entgra/device/mgt/core/device/mgt/url/printer/internal/UrlPrinterServiceComponent.java +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.url.printer/src/main/java/io/entgra/device/mgt/core/device/mgt/url/printer/internal/UrlPrinterServiceComponent.java @@ -18,28 +18,23 @@ package io.entgra.device.mgt.core.device.mgt.url.printer.internal; +import io.entgra.device.mgt.core.device.mgt.url.printer.URLPrinterStartupHandler; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleContext; import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.*; import org.wso2.carbon.core.ServerStartupObserver; -import io.entgra.device.mgt.core.device.mgt.url.printer.URLPrinterStartupHandler; import org.wso2.carbon.utils.ConfigurationContextService; -/** - * @scr.component name="UrlPrinterServiceComponent" - * immediate="true" - * @scr.reference name="config.context.service" - * interface="org.wso2.carbon.utils.ConfigurationContextService" - * cardinality="0..1" - * policy="dynamic" - * bind="setConfigurationContextService" - * unbind="unsetConfigurationContextService" - */ +@Component( + name = "io.entgra.device.mgt.core.device.mgt.url.printer.internal.UrlPrinterServiceComponent", + immediate = true) public class UrlPrinterServiceComponent { private static final Log log = LogFactory.getLog(UrlPrinterServiceComponent.class); + @Activate protected void activate(ComponentContext ctx) { if (log.isDebugEnabled()) { log.debug("Activating Url printer Service Component"); @@ -54,13 +49,19 @@ public class UrlPrinterServiceComponent { log.error("Error occurred while activating Url printer Service Component", e); } } - + @Deactivate protected void deactivate(ComponentContext ctx) { if (log.isDebugEnabled()) { log.debug("De-activating Url printer Service Component"); } } + @Reference( + name = "configuration.context.service", + service = org.wso2.carbon.utils.ConfigurationContextService.class, + cardinality = ReferenceCardinality.OPTIONAL, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetConfigurationContextService") protected void setConfigurationContextService(ConfigurationContextService configurationContextService) { if (log.isDebugEnabled()) { log.debug("Setting ConfigurationContextService"); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml index 954c10e8ff..0b238e4d9c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml @@ -31,7 +31,7 @@ bundle WSO2 Carbon - Device Analytics WSO2 Carbon - Device Analytics - http://wso2.org + https://entgra.io diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/pom.xml index b71ee171df..67b0d8d552 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/pom.xml @@ -27,7 +27,7 @@ org.wso2.carbon.device.mgt.analytics.wsproxy war WSO2 - Webapp for Web Socket Proxy - http://wso2.org + https://entgra.io diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml index e866e84aaf..6cf72dc999 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml @@ -31,7 +31,7 @@ pom WSO2 Carbon - Device Management Base UI WSO2 Carbon - Device Management Base UI - http://wso2.org + https://entgra.io diff --git a/components/device-mgt/pom.xml b/components/device-mgt/pom.xml index 0947987d7f..7611d57df3 100644 --- a/components/device-mgt/pom.xml +++ b/components/device-mgt/pom.xml @@ -30,7 +30,7 @@ device-mgt pom WSO2 Carbon - Device Management Component - http://wso2.org + https://entgra.io io.entgra.device.mgt.core.device.mgt.core diff --git a/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/pom.xml b/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/pom.xml index b04e6492c9..714c887fd4 100644 --- a/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/pom.xml +++ b/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/pom.xml @@ -36,8 +36,12 @@ - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -51,20 +55,28 @@ Server Startup Heart Beat Beacon Bundle io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.internal - org.apache.axis2.*;version="${axis2.osgi.version.range}", - org.apache.axiom.*; version="${axiom.osgi.version.range}", + io.entgra.device.mgt.core.device.mgt.common;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.exceptions;version="[5.0,6)", + io.entgra.device.mgt.core.server.bootup.heartbeat.beacon, + io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.config, + io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.config.datasource, + io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.dao, + io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.dao.exception, + io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.dao.impl, + io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.dao.util, + io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.dto, + io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.exception, + javax.naming, + javax.sql, + javax.xml.bind;version="[0.0,1)", + javax.xml.bind.annotation;version="[0.0,1)", + javax.xml.parsers, + org.apache.commons.logging;version="[1.2,2)", org.osgi.framework.*;version="${imp.package.version.osgi.framework}", org.osgi.service.*;version="${imp.package.version.osgi.service}", - org.apache.commons.logging, - javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional, - org.wso2.carbon.context, - org.wso2.carbon.utils.*, - org.wso2.carbon.ndatasource.core, org.w3c.dom, - org.apache.commons.io, - org.apache.axis2.transport.mail, - org.apache.commons.collections, - io.entgra.device.mgt.core.device.mgt.common.* + org.wso2.carbon.ndatasource.core;version="[4.8,5)", + org.wso2.carbon.utils;version="[4.8,5)" !io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.internal, @@ -73,55 +85,14 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.osgi - org.eclipse.osgi.services + org.apache.felix + org.apache.felix.scr.ds-annotations + provided org.ops4j.pax.logging diff --git a/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/HeartBeatBeaconUtils.java b/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/HeartBeatBeaconUtils.java index 32f7340998..211e4a890a 100644 --- a/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/HeartBeatBeaconUtils.java +++ b/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/HeartBeatBeaconUtils.java @@ -29,12 +29,7 @@ import javax.sql.DataSource; import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; +import java.io.*; import java.net.InetAddress; import java.net.SocketException; import java.net.UnknownHostException; diff --git a/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/config/datasource/JNDILookupDefinition.java b/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/config/datasource/JNDILookupDefinition.java index 2e6a09f1fe..7f2e4826e8 100644 --- a/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/config/datasource/JNDILookupDefinition.java +++ b/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/config/datasource/JNDILookupDefinition.java @@ -18,11 +18,7 @@ package io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.config.datasource; -import javax.xml.bind.annotation.XmlAttribute; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlValue; +import javax.xml.bind.annotation.*; import java.util.List; /** diff --git a/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/dao/HeartBeatBeaconDAOFactory.java b/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/dao/HeartBeatBeaconDAOFactory.java index 57599d4d2f..43f2986405 100644 --- a/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/dao/HeartBeatBeaconDAOFactory.java +++ b/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/dao/HeartBeatBeaconDAOFactory.java @@ -18,16 +18,14 @@ package io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.dao; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.IllegalTransactionStateException; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.HeartBeatBeaconUtils; import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.config.datasource.DataSourceConfig; import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.config.datasource.JNDILookupDefinition; import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.dao.impl.GenericHeartBeatDAOImpl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.IllegalTransactionStateException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.UnsupportedDatabaseEngineException; import javax.sql.DataSource; import java.sql.Connection; diff --git a/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/dao/impl/GenericHeartBeatDAOImpl.java b/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/dao/impl/GenericHeartBeatDAOImpl.java index 18303897b1..06bff0d1c5 100644 --- a/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/dao/impl/GenericHeartBeatDAOImpl.java +++ b/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/dao/impl/GenericHeartBeatDAOImpl.java @@ -28,12 +28,7 @@ import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.dto.ServerContex import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Statement; -import java.sql.Timestamp; +import java.sql.*; import java.util.HashMap; import java.util.List; import java.util.Map; diff --git a/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/internal/HeartBeatBeaconComponent.java b/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/internal/HeartBeatBeaconComponent.java index 990ca60b87..0a32c24e0c 100644 --- a/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/internal/HeartBeatBeaconComponent.java +++ b/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/internal/HeartBeatBeaconComponent.java @@ -27,23 +27,18 @@ import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBea import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.*; import org.wso2.carbon.ndatasource.core.DataSourceService; -/** - * @scr.component name="io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.heartbeatBeaconComponent" - * immediate="true" - * @scr.reference name="org.wso2.carbon.ndatasource" - * interface="org.wso2.carbon.ndatasource.core.DataSourceService" - * cardinality="1..1" - * policy="dynamic" - * bind="setDataSourceService" - * unbind="unsetDataSourceService" - */ +@Component( + name = "io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.internal.HeartBeatBeaconComponent", + immediate = true) public class HeartBeatBeaconComponent { private static Log log = LogFactory.getLog(HeartBeatBeaconComponent.class); @SuppressWarnings("unused") + @Activate protected void activate(ComponentContext componentContext) { try { if (log.isDebugEnabled()) { @@ -71,6 +66,7 @@ public class HeartBeatBeaconComponent { } @SuppressWarnings("unused") + @Deactivate protected void deactivate(ComponentContext componentContext) { //do nothing } @@ -84,6 +80,12 @@ public class HeartBeatBeaconComponent { componentContext.getBundleContext().registerService(HeartBeatManagementService.class, heartBeatServiceProvider, null); } + @Reference( + name = "datasource.service", + service = org.wso2.carbon.ndatasource.core.DataSourceService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetDataSourceService") protected void setDataSourceService(DataSourceService dataSourceService) { /* This is to avoid mobile device management component getting initialized before the underlying datasources are registered */ diff --git a/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/service/HeartBeatManagementService.java b/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/service/HeartBeatManagementService.java index 2b86a2e0b0..d187e1e8cd 100644 --- a/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/service/HeartBeatManagementService.java +++ b/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/service/HeartBeatManagementService.java @@ -18,10 +18,10 @@ package io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service; +import io.entgra.device.mgt.core.device.mgt.common.ServerCtxInfo; import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.dto.HeartBeatEvent; import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.dto.ServerContext; import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.exception.HeartBeatManagementException; -import io.entgra.device.mgt.core.device.mgt.common.ServerCtxInfo; import java.util.Map; diff --git a/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/service/HeartBeatManagementServiceImpl.java b/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/service/HeartBeatManagementServiceImpl.java index 616d1b5de5..9db98f88fb 100644 --- a/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/service/HeartBeatManagementServiceImpl.java +++ b/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/src/main/java/io/entgra/device/mgt/core/server/bootup/heartbeat/beacon/service/HeartBeatManagementServiceImpl.java @@ -18,6 +18,8 @@ package io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service; +import io.entgra.device.mgt.core.device.mgt.common.ServerCtxInfo; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.config.HeartBeatBeaconConfig; import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.dao.HeartBeatBeaconDAOFactory; import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.dao.HeartBeatDAO; @@ -29,17 +31,10 @@ import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.exception.HeartB import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.internal.HeartBeatBeaconDataHolder; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.ServerCtxInfo; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.TransactionManagementException; import java.sql.SQLException; import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Random; -import java.util.Set; +import java.util.*; import java.util.concurrent.TimeUnit; public class HeartBeatManagementServiceImpl implements HeartBeatManagementService { diff --git a/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/pom.xml b/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/pom.xml index 1198fd3b9a..732a2359c7 100644 --- a/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/pom.xml +++ b/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/pom.xml @@ -30,9 +30,14 @@ io.entgra.device.mgt.core.device.mgt.oauth.extensions bundle WSO2 Carbon - OAuth Extensions - http://wso2.org + https://entgra.io + + org.apache.felix + org.apache.felix.scr.ds-annotations + provided + commons-codec.wso2 commons-codec @@ -62,8 +67,12 @@ - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -81,32 +90,41 @@ io.entgra.device.mgt.core.device.mgt.oauth.extensions.* - org.wso2.carbon.identity.oauth2.grant.jwt;version="${carbon.identity.jwt.grant.version.range}", - org.apache.commons.lang, - org.apache.commons.logging, - org.osgi.service.component, - 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.core.service, - org.wso2.carbon.user.core.tenant, - org.wso2.carbon.user.core.util, - org.json.simple, - javax.cache, - org.wso2.carbon.identity.core.util;version="${carbon.identity.framework.version.range}", - org.wso2.carbon.utils, - org.wso2.carbon.context, - org.wso2.carbon.identity.oauth.*;version="${carbon.identity.framework.version.range}", - - org.wso2.carbon.base, - 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.oauth2.*;version="${carbon.identity.framework.version.range}", - org.wso2.carbon.utils.multitenancy, - org.apache.oltu.oauth2.common.validators, - org.apache.commons.lang3.tuple, + io.entgra.device.mgt.core.device.mgt.oauth.extensions.handlers.grant.oauth.validator, + io.entgra.device.mgt.core.device.mgt.oauth.extensions.handlers.grant.oauth.validator.internal, + javax.servlet.http;version="[2.6,3)", + org.apache.commons.lang;version="[2.6,3)", + org.apache.commons.lang3.tuple;version="[3.1,4)", + org.apache.commons.logging;version="[1.2,2)", + org.apache.oltu.oauth2.common.validators;version="[1.0,2)", + org.osgi.service.*;version="${imp.package.version.osgi.service}", + org.wso2.carbon.context;version="[4.8,5)", + org.wso2.carbon.identity.application.authentication.framework.model;version="[5.24,6)", + org.wso2.carbon.identity.application.common;version="[5.24,6)", + org.wso2.carbon.identity.application.common.model;version="[5.24,6)", + org.wso2.carbon.identity.application.mgt;version="[5.24,6)", + org.wso2.carbon.identity.core.util;version="[5.24,6)", + org.wso2.carbon.identity.oauth.cache;version="[6.9,7)", + org.wso2.carbon.identity.oauth2;version="[6.9,7)", + org.wso2.carbon.identity.oauth2.dao;version="[6.9,7)", + org.wso2.carbon.identity.oauth2.dto;version="[6.9,7)", + org.wso2.carbon.identity.oauth2.grant.jwt;version="[2.1,3)", + org.wso2.carbon.identity.oauth2.internal;version="[6.9,7)", + org.wso2.carbon.identity.oauth2.model;version="[6.9,7)", + org.wso2.carbon.identity.oauth2.token;version="[6.9,7)", + org.wso2.carbon.identity.oauth2.token.handlers.grant;version="[6.9,7)", + org.wso2.carbon.identity.oauth2.token.handlers.grant.saml;version="[6.9,7)", + org.wso2.carbon.identity.oauth2.util;version="[6.9,7)", + org.wso2.carbon.identity.oauth2.validators;version="[6.9,7)", + org.wso2.carbon.user.api;version="[1.0,2)", + org.wso2.carbon.user.core.service;version="[4.8,5)", + org.wso2.carbon.user.core.tenant;version="[4.8,5)", + org.wso2.carbon.user.core.util;version="[4.8,5)", + org.wso2.carbon.utils.multitenancy;version="[4.8,5)" + + oltu;scope=compile|runtime;inline=false + diff --git a/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/handlers/ScopeValidationHandler.java b/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/handlers/ScopeValidationHandler.java index 9799e8d8b8..4901099ce8 100644 --- a/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/handlers/ScopeValidationHandler.java +++ b/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/handlers/ScopeValidationHandler.java @@ -17,10 +17,10 @@ */ package io.entgra.device.mgt.core.device.mgt.oauth.extensions.handlers; +import io.entgra.device.mgt.core.device.mgt.oauth.extensions.internal.OAuthExtensionsDataHolder; import org.apache.commons.lang3.tuple.Pair; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.oauth.extensions.internal.OAuthExtensionsDataHolder; import org.wso2.carbon.identity.oauth.cache.CacheEntry; import org.wso2.carbon.identity.oauth.cache.OAuthCache; import org.wso2.carbon.identity.oauth.cache.OAuthCacheKey; diff --git a/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/handlers/grant/AccessTokenGrantHandler.java b/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/handlers/grant/AccessTokenGrantHandler.java index be84f5d12f..eda3a4a811 100644 --- a/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/handlers/grant/AccessTokenGrantHandler.java +++ b/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/handlers/grant/AccessTokenGrantHandler.java @@ -18,11 +18,11 @@ package io.entgra.device.mgt.core.device.mgt.oauth.extensions.handlers.grant; +import io.entgra.device.mgt.core.device.mgt.oauth.extensions.handlers.grant.oauth.validator.LocalOAuthValidator; +import io.entgra.device.mgt.core.device.mgt.oauth.extensions.handlers.grant.oauth.validator.OAuthValidationResponse; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.oauth.extensions.handlers.grant.oauth.validator.LocalOAuthValidator; -import io.entgra.device.mgt.core.device.mgt.oauth.extensions.handlers.grant.oauth.validator.OAuthValidationResponse; 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; @@ -35,6 +35,7 @@ import org.wso2.carbon.identity.oauth2.token.handlers.grant.AbstractAuthorizatio 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; /** diff --git a/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/handlers/grant/oauth/validator/internal/OAuthAuthenticatorServiceComponent.java b/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/handlers/grant/oauth/validator/internal/OAuthAuthenticatorServiceComponent.java index 5b61bbd2f8..45a3726a49 100755 --- a/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/handlers/grant/oauth/validator/internal/OAuthAuthenticatorServiceComponent.java +++ b/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/handlers/grant/oauth/validator/internal/OAuthAuthenticatorServiceComponent.java @@ -21,22 +21,18 @@ package io.entgra.device.mgt.core.device.mgt.oauth.extensions.handlers.grant.oau import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.*; import org.wso2.carbon.identity.oauth2.OAuth2TokenValidationService; -/** - * @scr.component name="io.entgra.device.mgt.core.device.mgt.oauth.extensions.authenticator" immediate="true" - * @scr.reference name="identity.oauth2.validation.service" - * interface="org.wso2.carbon.identity.oauth2.OAuth2TokenValidationService" - * cardinality="1..1" - * policy="dynamic" - * bind="setOAuth2ValidationService" - * unbind="unsetOAuth2ValidationService" - */ +@Component( + name = "io.entgra.device.mgt.core.device.mgt.oauth.extensions.handlers.grant.oauth.validator.internal.OAuthAuthenticatorServiceComponent", + immediate = true) public class OAuthAuthenticatorServiceComponent { private static final Log log = LogFactory.getLog(OAuthAuthenticatorServiceComponent.class); @SuppressWarnings("unused") + @Activate protected void activate(ComponentContext componentContext) { if (log.isDebugEnabled()) { log.debug("Starting Backend OAuthAuthenticator Framework Bundle"); @@ -44,6 +40,7 @@ public class OAuthAuthenticatorServiceComponent { } @SuppressWarnings("unused") + @Deactivate protected void deactivate(ComponentContext componentContext) { //do nothing } @@ -54,6 +51,12 @@ public class OAuthAuthenticatorServiceComponent { * @param tokenValidationService An instance of OAuth2TokenValidationService. */ @SuppressWarnings("unused") + @Reference( + name = "oauth2.token.validation.service", + service = org.wso2.carbon.identity.oauth2.OAuth2TokenValidationService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetOAuth2ValidationService") protected void setOAuth2ValidationService(OAuth2TokenValidationService tokenValidationService) { if (log.isDebugEnabled()) { log.debug("Setting OAuth2TokenValidationService Service"); diff --git a/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/internal/OAuthExtensionServiceComponent.java b/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/internal/OAuthExtensionServiceComponent.java index 4402d6a7cb..cb161906cf 100644 --- a/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/internal/OAuthExtensionServiceComponent.java +++ b/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/internal/OAuthExtensionServiceComponent.java @@ -22,33 +22,15 @@ import io.entgra.device.mgt.core.device.mgt.oauth.extensions.validators.Extended import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.service.component.ComponentContext; - +import org.osgi.service.component.annotations.*; import org.wso2.carbon.identity.oauth2.OAuth2TokenValidationService; import org.wso2.carbon.identity.oauth2.validators.JDBCScopeValidator; import org.wso2.carbon.identity.oauth2.validators.OAuth2ScopeValidator; import org.wso2.carbon.user.core.service.RealmService; -/** - * @scr.component name="io.entgra.device.mgt.core.device.mgt.oauth.extensions" immediate="true" - * @scr.reference name="user.realmservice.default" - * interface="org.wso2.carbon.user.core.service.RealmService" - * cardinality="1..1" - * policy="dynamic" - * bind="setRealmService" - * unbind="unsetRealmService" - * @scr.reference name="identity.oauth2.validation.service" - * interface="org.wso2.carbon.identity.oauth2.OAuth2TokenValidationService" - * cardinality="1..1" - * policy="dynamic" - * bind="setOAuth2ValidationService" - * unbind="unsetOAuth2ValidationService" - * * @scr.reference name="scope.validator.service" - * interface="org.wso2.carbon.identity.oauth2.validators.OAuth2ScopeValidator" - * cardinality="0..n" - * policy="dynamic" - * bind="addScopeValidator" - * unbind="removeScopeValidator" - */ +@Component( + name = "io.entgra.device.mgt.core.device.mgt.oauth.extensions.internal.OAuthExtensionServiceComponent", + immediate = true) public class OAuthExtensionServiceComponent { private static final Log log = LogFactory.getLog(OAuthExtensionServiceComponent.class); @@ -60,6 +42,7 @@ public class OAuthExtensionServiceComponent { @SuppressWarnings("unused") + @Activate protected void activate(ComponentContext componentContext) { if (log.isDebugEnabled()) { log.debug("Starting OAuthExtensionBundle"); @@ -75,6 +58,7 @@ public class OAuthExtensionServiceComponent { } @SuppressWarnings("unused") + @Deactivate protected void deactivate(ComponentContext componentContext) { if (log.isDebugEnabled()) { log.debug("Stopping OAuthExtensionBundle"); @@ -86,6 +70,12 @@ public class OAuthExtensionServiceComponent { * * @param realmService An instance of RealmService */ + @Reference( + name = "realm.service", + service = org.wso2.carbon.user.core.service.RealmService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetRealmService") protected void setRealmService(RealmService realmService) { if (log.isDebugEnabled()) { log.debug("Setting Realm Service"); @@ -110,6 +100,12 @@ public class OAuthExtensionServiceComponent { * * @param tokenValidationService An instance of OAuth2TokenValidationService */ + @Reference( + name = "oauth2.token.validation.service", + service = org.wso2.carbon.identity.oauth2.OAuth2TokenValidationService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetOAuth2ValidationService") protected void setOAuth2ValidationService(OAuth2TokenValidationService tokenValidationService) { if (log.isDebugEnabled()) { log.debug("Setting OAuth2TokenValidation Service"); @@ -133,6 +129,12 @@ public class OAuthExtensionServiceComponent { * Add scope validator to the map. * @param scopesValidator */ + @Reference( + name = "oauth2.scope.validator", + service = org.wso2.carbon.identity.oauth2.validators.OAuth2ScopeValidator.class, + cardinality = ReferenceCardinality.MULTIPLE, + policy = ReferencePolicy.DYNAMIC, + unbind = "removeScopeValidator") protected void addScopeValidator(OAuth2ScopeValidator scopesValidator) { OAuthExtensionsDataHolder.getInstance().addScopeValidator(scopesValidator, DEFAULT_PREFIX); } diff --git a/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/validators/ExtendedJDBCScopeValidator.java b/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/validators/ExtendedJDBCScopeValidator.java index 1f8dc547ba..40f9327b94 100644 --- a/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/validators/ExtendedJDBCScopeValidator.java +++ b/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/validators/ExtendedJDBCScopeValidator.java @@ -18,11 +18,11 @@ package io.entgra.device.mgt.core.device.mgt.oauth.extensions.validators; +import io.entgra.device.mgt.core.device.mgt.oauth.extensions.internal.OAuthExtensionsDataHolder; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.oauth.extensions.internal.OAuthExtensionsDataHolder; import org.wso2.carbon.identity.application.common.model.User; import org.wso2.carbon.identity.core.util.IdentityTenantUtil; import org.wso2.carbon.identity.oauth.cache.CacheEntry; diff --git a/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/validators/PermissionBasedScopeValidator.java b/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/validators/PermissionBasedScopeValidator.java index 9ca887beb7..722a8b7c9b 100644 --- a/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/validators/PermissionBasedScopeValidator.java +++ b/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/validators/PermissionBasedScopeValidator.java @@ -18,11 +18,11 @@ package io.entgra.device.mgt.core.device.mgt.oauth.extensions.validators; +import io.entgra.device.mgt.core.device.mgt.oauth.extensions.internal.OAuthExtensionsDataHolder; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.oauth.extensions.internal.OAuthExtensionsDataHolder; import org.wso2.carbon.identity.application.common.model.User; import org.wso2.carbon.identity.core.util.IdentityTenantUtil; import org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception; diff --git a/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/validators/RoleBasedScopeValidator.java b/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/validators/RoleBasedScopeValidator.java index 422739ea17..26d098b20f 100644 --- a/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/validators/RoleBasedScopeValidator.java +++ b/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/src/main/java/io/entgra/device/mgt/core/device/mgt/oauth/extensions/validators/RoleBasedScopeValidator.java @@ -18,11 +18,11 @@ package io.entgra.device.mgt.core.device.mgt.oauth.extensions.validators; +import io.entgra.device.mgt.core.device.mgt.oauth.extensions.internal.OAuthExtensionsDataHolder; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.oauth.extensions.internal.OAuthExtensionsDataHolder; import org.wso2.carbon.identity.application.common.model.User; import org.wso2.carbon.identity.base.IdentityConstants; import org.wso2.carbon.identity.core.util.IdentityTenantUtil; diff --git a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/pom.xml b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/pom.xml index 249ef62aec..fa65956a71 100644 --- a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/pom.xml +++ b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/pom.xml @@ -31,9 +31,14 @@ bundle WSO2 Carbon - Device Management JWT Client Extensions WSO2 Carbon - Device Management JWT Client Extensions - http://wso2.org + https://entgra.io + + org.apache.felix + org.apache.felix.scr.ds-annotations + provided + org.wso2.carbon.governance org.wso2.carbon.governance.api @@ -55,17 +60,9 @@ org.wso2.carbon.utils - org.wso2.orbit.org.scannotation + io.entgra.org.scannotation scannotation - - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.osgi - org.eclipse.osgi.services - org.wso2.tomcat tomcat @@ -124,7 +121,6 @@ org.ops4j.pax.logging pax-logging-api provided - org.testng @@ -171,8 +167,12 @@ - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -190,35 +190,35 @@ io.entgra.device.mgt.core.identity.jwt.client.extension.* + com.nimbusds.jose;version="[7.9,8)", + com.nimbusds.jose.crypto;version="[7.9,8)", + com.nimbusds.jwt;version="[7.9,8)", + io.entgra.device.mgt.core.identity.jwt.client.extension, + io.entgra.device.mgt.core.identity.jwt.client.extension.dto, + io.entgra.device.mgt.core.identity.jwt.client.extension.exception, + io.entgra.device.mgt.core.identity.jwt.client.extension.service, + javax.net.ssl, + org.apache.commons.codec.binary;version="[1.4,2)", + org.apache.commons.logging;version="[1.2,2)", + org.apache.http;version="[4.4,5)", + org.apache.http.client;version="[4.3,5)", + org.apache.http.client.entity;version="[4.3,5)", + org.apache.http.client.methods;version="[4.3,5)", + org.apache.http.conn.socket;version="[4.3,5)", + org.apache.http.conn.ssl;version="[4.3,5)", + org.apache.http.impl.client;version="[4.3,5)", + org.apache.http.message;version="[4.4,5)", + org.apache.http.util;version="[4.4,5)", + org.json.simple;version="[1.1,2)", + org.json.simple.parser;version="[1.1,2)", org.osgi.framework.*;version="${imp.package.version.osgi.framework}", org.osgi.service.*;version="${imp.package.version.osgi.service}", - org.wso2.carbon.context, - org.wso2.carbon.registry.core, - org.wso2.carbon.registry.core.exceptions, - org.wso2.carbon.registry.core.session, - org.wso2.carbon.utils, - org.apache.commons.logging, - org.wso2.carbon.registry.core.*;resolution:=optional, - org.wso2.carbon.registry.indexing.*; version="${carbon.registry.imp.pkg.version.range}", - com.nimbusds.jwt.*;version="${nimbus.orbit.version.range}", - com.nimbusds.jose.*;version="${nimbus.orbit.version.range}", - javax.net.ssl, - org.apache.commons.codec.binary;version="${commons-codec.wso2.osgi.version.range}", - org.apache.http;version="${httpclient.version.range}", - org.apache.http.client;version="${httpclient.version.range}", - org.apache.http.message;version="${httpclient.version.range}", - org.apache.http.client;version="${httpclient.version.range}", - org.apache.http.conn.*;version="${httpclient.version.range}", - org.apache.http.util;version="${httpclient.version.range}", - org.apache.http.client.entity;version="${httpclient.version.range}", - org.apache.http.client.methods;version="${httpclient.version.range}", - org.apache.http.impl.client;version="${httpclient.version.range}", - org.json.simple.*, - org.wso2.carbon.core.util, - javax.net.ssl, - org.wso2.carbon.user.core.service, - org.wso2.carbon.user.core.tenant, - org.wso2.carbon.base + org.wso2.carbon.context;version="${carbon.platform.package.import.version.range}", + org.wso2.carbon.core.*; version="${carbon.platform.package.import.version.range}", + org.wso2.carbon.registry.core.*; version="${carbon.registry.imp.pkg.version}", + org.wso2.carbon.registry.indexing.*;version="${carbon.registry.package.import.version.range}", + org.wso2.carbon.user.core.*;version="${carbon.platform.package.import.version.range}", + org.wso2.carbon.utils.*; version="${carbon.platform.package.import.version.range}" @@ -263,5 +263,4 @@ - diff --git a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/main/java/io/entgra/device/mgt/core/identity/jwt/client/extension/JWTClient.java b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/main/java/io/entgra/device/mgt/core/identity/jwt/client/extension/JWTClient.java index ea0ac57dd3..dff879db33 100644 --- a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/main/java/io/entgra/device/mgt/core/identity/jwt/client/extension/JWTClient.java +++ b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/main/java/io/entgra/device/mgt/core/identity/jwt/client/extension/JWTClient.java @@ -18,6 +18,11 @@ package io.entgra.device.mgt.core.identity.jwt.client.extension; +import io.entgra.device.mgt.core.identity.jwt.client.extension.constant.JWTConstants; +import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.AccessTokenInfo; +import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.JWTConfig; +import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; +import io.entgra.device.mgt.core.identity.jwt.client.extension.util.JWTClientUtil; import org.apache.commons.codec.binary.Base64; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -30,11 +35,6 @@ import org.apache.http.message.BasicNameValuePair; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; -import io.entgra.device.mgt.core.identity.jwt.client.extension.constant.JWTConstants; -import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.AccessTokenInfo; -import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.JWTConfig; -import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; -import io.entgra.device.mgt.core.identity.jwt.client.extension.util.JWTClientUtil; import java.io.IOException; import java.net.MalformedURLException; diff --git a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/main/java/io/entgra/device/mgt/core/identity/jwt/client/extension/dto/JWTConfig.java b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/main/java/io/entgra/device/mgt/core/identity/jwt/client/extension/dto/JWTConfig.java index 7a1fdc0d6e..f48ac99597 100644 --- a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/main/java/io/entgra/device/mgt/core/identity/jwt/client/extension/dto/JWTConfig.java +++ b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/main/java/io/entgra/device/mgt/core/identity/jwt/client/extension/dto/JWTConfig.java @@ -1,7 +1,7 @@ package io.entgra.device.mgt.core.identity.jwt.client.extension.dto; -import org.wso2.carbon.core.util.Utils; import io.entgra.device.mgt.core.identity.jwt.client.extension.constant.JWTConstants; +import org.wso2.carbon.core.util.Utils; import java.util.ArrayList; import java.util.List; diff --git a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/main/java/io/entgra/device/mgt/core/identity/jwt/client/extension/internal/JWTClientExtensionServiceComponent.java b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/main/java/io/entgra/device/mgt/core/identity/jwt/client/extension/internal/JWTClientExtensionServiceComponent.java index e4ff7849b6..06082de65b 100644 --- a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/main/java/io/entgra/device/mgt/core/identity/jwt/client/extension/internal/JWTClientExtensionServiceComponent.java +++ b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/main/java/io/entgra/device/mgt/core/identity/jwt/client/extension/internal/JWTClientExtensionServiceComponent.java @@ -18,53 +18,32 @@ */ package io.entgra.device.mgt.core.identity.jwt.client.extension.internal; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.osgi.framework.BundleContext; -import org.osgi.service.component.ComponentContext; import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientConfigurationException; import io.entgra.device.mgt.core.identity.jwt.client.extension.service.JWTClientManagerService; import io.entgra.device.mgt.core.identity.jwt.client.extension.service.JWTClientManagerServiceImpl; import io.entgra.device.mgt.core.identity.jwt.client.extension.util.JWTClientUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.osgi.framework.BundleContext; +import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.*; import org.wso2.carbon.registry.core.exceptions.RegistryException; import org.wso2.carbon.registry.core.service.RegistryService; import org.wso2.carbon.registry.core.service.TenantRegistryLoader; import org.wso2.carbon.registry.indexing.service.TenantIndexingLoader; import org.wso2.carbon.user.core.service.RealmService; + import java.io.IOException; -/** - * @scr.component name="io.entgra.device.mgt.core.identity.jwt.client.extension.internal.JWTClientExtensionServiceComponent" - * immediate="true" - * @scr.reference name="registry.service" - * interface="org.wso2.carbon.registry.core.service.RegistryService" - * cardinality="1..1" - * policy="dynamic" - * bind="setRegistryService" - * unbind="unsetRegistryService" - * @scr.reference name="tenant.registryloader" - * interface="org.wso2.carbon.registry.core.service.TenantRegistryLoader" - * cardinality="1..1" - * policy="dynamic" - * bind="setTenantRegistryLoader" - * unbind="unsetTenantRegistryLoader" - * @scr.reference name="tenant.indexloader" - * interface="org.wso2.carbon.registry.indexing.service.TenantIndexingLoader" - * cardinality="1..1" - * policy="dynamic" - * bind="setIndexLoader" - * unbind="unsetIndexLoader" - * @scr.reference name="realm.service" - * interface="org.wso2.carbon.user.core.service.RealmService" - * cardinality="1..1" - * policy="dynamic" - * bind="setRealmService" - * unbind="unsetRealmService" - */ +@Component( + name = "io.entgra.device.mgt.core.identity.jwt.client.extension.internal.JWTClientExtensionServiceComponent", + immediate = true) public class JWTClientExtensionServiceComponent { private static Log log = LogFactory.getLog(JWTClientExtensionServiceComponent.class); + // private ServiceRegistration serviceRegistration = null; + @Activate protected void activate(ComponentContext componentContext) { if (log.isDebugEnabled()) { log.debug("Initializing jwt extension bundle"); @@ -83,10 +62,19 @@ public class JWTClientExtensionServiceComponent { } } + @Deactivate protected void deactivate(ComponentContext componentContext) { - //do nothing + if (log.isDebugEnabled()) { + log.info("deactivating jwt extension bundle"); + } } + @Reference( + name = "registry.service", + service = org.wso2.carbon.registry.core.service.RegistryService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetRegistryService") protected void setRegistryService(RegistryService registryService) { if (registryService != null && log.isDebugEnabled()) { log.debug("Registry service initialized"); @@ -98,6 +86,12 @@ public class JWTClientExtensionServiceComponent { JWTClientExtensionDataHolder.getInstance().setRegistryService(null); } + @Reference( + name = "tenant.registry.loader", + service = org.wso2.carbon.registry.core.service.TenantRegistryLoader.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetTenantRegistryLoader") protected void setTenantRegistryLoader(TenantRegistryLoader tenantRegistryLoader) { JWTClientExtensionDataHolder.getInstance().setTenantRegistryLoader(tenantRegistryLoader); } @@ -106,6 +100,12 @@ public class JWTClientExtensionServiceComponent { JWTClientExtensionDataHolder.getInstance().setTenantRegistryLoader(null); } + @Reference( + name = "tenant.index.loader", + service = org.wso2.carbon.registry.indexing.service.TenantIndexingLoader.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetIndexLoader") protected void setIndexLoader(TenantIndexingLoader indexLoader) { if (indexLoader != null && log.isDebugEnabled()) { log.debug("IndexLoader service initialized"); @@ -122,6 +122,12 @@ public class JWTClientExtensionServiceComponent { * * @param realmService An instance of RealmService */ + @Reference( + name = "realm.service", + service = org.wso2.carbon.user.core.service.RealmService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetRealmService") protected void setRealmService(RealmService realmService) { if (log.isDebugEnabled()) { log.debug("Setting Realm Service"); diff --git a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/main/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/JWTClientManagerServiceImpl.java b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/main/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/JWTClientManagerServiceImpl.java index b74abc304a..4c3f132fa8 100644 --- a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/main/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/JWTClientManagerServiceImpl.java +++ b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/main/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/JWTClientManagerServiceImpl.java @@ -18,11 +18,6 @@ package io.entgra.device.mgt.core.identity.jwt.client.extension.service; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.base.MultitenantConstants; -import org.wso2.carbon.context.CarbonContext; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.identity.jwt.client.extension.JWTClient; import io.entgra.device.mgt.core.identity.jwt.client.extension.constant.JWTConstants; import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.JWTConfig; @@ -30,6 +25,11 @@ import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClie import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientConfigurationException; import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; import io.entgra.device.mgt.core.identity.jwt.client.extension.util.JWTClientUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.base.MultitenantConstants; +import org.wso2.carbon.context.CarbonContext; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.registry.core.Resource; import org.wso2.carbon.registry.core.exceptions.RegistryException; diff --git a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/main/java/io/entgra/device/mgt/core/identity/jwt/client/extension/util/JWTClientUtil.java b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/main/java/io/entgra/device/mgt/core/identity/jwt/client/extension/util/JWTClientUtil.java index 55be8b3afc..a42603f29c 100644 --- a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/main/java/io/entgra/device/mgt/core/identity/jwt/client/extension/util/JWTClientUtil.java +++ b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/main/java/io/entgra/device/mgt/core/identity/jwt/client/extension/util/JWTClientUtil.java @@ -24,6 +24,11 @@ import com.nimbusds.jose.JWSSigner; import com.nimbusds.jose.crypto.RSASSASigner; import com.nimbusds.jwt.JWTClaimsSet; import com.nimbusds.jwt.SignedJWT; +import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.JWTConfig; +import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientConfigurationException; +import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; +import io.entgra.device.mgt.core.identity.jwt.client.extension.internal.JWTClientExtensionDataHolder; +import io.entgra.device.mgt.core.identity.jwt.client.extension.service.JWTClientManagerService; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.http.HttpResponse; @@ -36,11 +41,6 @@ import org.apache.http.util.EntityUtils; import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.core.util.KeyStoreManager; -import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.JWTConfig; -import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientConfigurationException; -import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; -import io.entgra.device.mgt.core.identity.jwt.client.extension.internal.JWTClientExtensionDataHolder; -import io.entgra.device.mgt.core.identity.jwt.client.extension.service.JWTClientManagerService; import org.wso2.carbon.registry.core.Registry; import org.wso2.carbon.registry.core.Resource; import org.wso2.carbon.registry.core.exceptions.RegistryException; @@ -48,19 +48,10 @@ import org.wso2.carbon.registry.core.service.RegistryService; import org.wso2.carbon.registry.core.service.TenantRegistryLoader; import org.wso2.carbon.utils.CarbonUtils; -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; +import java.io.*; import java.net.URI; import java.net.URL; -import java.security.KeyManagementException; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; -import java.security.UnrecoverableKeyException; +import java.security.*; import java.security.cert.CertificateException; import java.security.interfaces.RSAPrivateKey; import java.util.Date; diff --git a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/JWTClientManagerServiceTest.java b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/JWTClientManagerServiceTest.java index 28d058b538..7117f29902 100644 --- a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/JWTClientManagerServiceTest.java +++ b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/JWTClientManagerServiceTest.java @@ -17,14 +17,14 @@ */ package io.entgra.device.mgt.core.identity.jwt.client.extension.service; +import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientConfigurationException; +import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; +import io.entgra.device.mgt.core.identity.jwt.client.extension.service.common.BaseJWTClientManagerExtTest; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientConfigurationException; -import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; -import io.entgra.device.mgt.core.identity.jwt.client.extension.service.common.BaseJWTClientManagerExtTest; import java.util.Properties; diff --git a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/JWTClientTest.java b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/JWTClientTest.java index 15f2476ee2..1b8492fc5d 100644 --- a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/JWTClientTest.java +++ b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/JWTClientTest.java @@ -17,6 +17,11 @@ */ package io.entgra.device.mgt.core.identity.jwt.client.extension.service; +import io.entgra.device.mgt.core.identity.jwt.client.extension.JWTClient; +import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.AccessTokenInfo; +import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.JWTConfig; +import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; +import io.entgra.device.mgt.core.identity.jwt.client.extension.util.JWTClientUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.http.HttpResponse; @@ -30,11 +35,6 @@ import org.testng.IObjectFactory; import org.testng.annotations.BeforeClass; import org.testng.annotations.ObjectFactory; import org.testng.annotations.Test; -import io.entgra.device.mgt.core.identity.jwt.client.extension.JWTClient; -import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.AccessTokenInfo; -import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.JWTConfig; -import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; -import io.entgra.device.mgt.core.identity.jwt.client.extension.util.JWTClientUtil; import java.io.IOException; import java.security.KeyManagementException; diff --git a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/JWTClientUtilTest.java b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/JWTClientUtilTest.java index 64e92e6fff..32177e1f93 100644 --- a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/JWTClientUtilTest.java +++ b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/JWTClientUtilTest.java @@ -17,6 +17,9 @@ */ package io.entgra.device.mgt.core.identity.jwt.client.extension.service; +import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.JWTConfig; +import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; +import io.entgra.device.mgt.core.identity.jwt.client.extension.util.JWTClientUtil; import org.apache.http.HttpResponse; import org.apache.http.HttpStatus; import org.apache.http.HttpVersion; @@ -29,9 +32,6 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.ObjectFactory; import org.testng.annotations.Test; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.JWTConfig; -import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; -import io.entgra.device.mgt.core.identity.jwt.client.extension.util.JWTClientUtil; import org.wso2.carbon.registry.core.exceptions.RegistryException; import java.io.ByteArrayInputStream; diff --git a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/common/BaseJWTClientManagerExtTest.java b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/common/BaseJWTClientManagerExtTest.java index 7103ac87dc..e68bd901c3 100644 --- a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/common/BaseJWTClientManagerExtTest.java +++ b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/java/io/entgra/device/mgt/core/identity/jwt/client/extension/service/common/BaseJWTClientManagerExtTest.java @@ -18,13 +18,13 @@ */ package io.entgra.device.mgt.core.identity.jwt.client.extension.service.common; +import io.entgra.device.mgt.core.identity.jwt.client.extension.internal.JWTClientExtensionDataHolder; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeSuite; import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.identity.jwt.client.extension.internal.JWTClientExtensionDataHolder; import org.wso2.carbon.registry.core.config.RegistryContext; import org.wso2.carbon.registry.core.exceptions.RegistryException; import org.wso2.carbon.registry.core.internal.RegistryDataHolder; diff --git a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml index 897e33581c..2337c777e2 100644 --- a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml +++ b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml @@ -1,4 +1,4 @@ - + org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader diff --git a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/resources/carbon-home/repository/conf/etc/tasks-config.xml b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/resources/carbon-home/repository/conf/etc/tasks-config.xml index 0a9289da70..4f5e043a15 100644 --- a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/resources/carbon-home/repository/conf/etc/tasks-config.xml +++ b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/src/test/resources/carbon-home/repository/conf/etc/tasks-config.xml @@ -1,4 +1,4 @@ - + + + @@ -59,6 +59,11 @@ org.apache.maven.plugins maven-compiler-plugin + + + 1.8 + 1.8 + org.apache.felix @@ -71,10 +76,12 @@ ${io.entgra.device.mgt.core.version} Device Notification Logger Bundle - io.entgra.device.mgt.core.device.mgt.extensions.logger.*, - org.apache.commons.logging;version="[1.2,2)", - org.apache.log4j;version="[1.2,2)", - org.wso2.carbon.context;version="[4.4,5) + io.entgra.device.mgt.core.device.mgt.extensions.logger;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.extensions.logger.spi;version="[5.0,6)", + io.entgra.device.mgt.core.notification.logger, + io.entgra.device.mgt.core.notification.logger.util, + org.apache.commons.logging;version="[1.2,2)" + io.entgra.device.mgt.core.notification.logger.* diff --git a/components/logger/pom.xml b/components/logger/pom.xml index 5375683ce9..baabe4d82f 100644 --- a/components/logger/pom.xml +++ b/components/logger/pom.xml @@ -36,8 +36,6 @@ - 8 - 8 UTF-8 diff --git a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/pom.xml b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/pom.xml index d92821cfc6..8c70a21b01 100644 --- a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/pom.xml +++ b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/pom.xml @@ -37,10 +37,10 @@ org.apache.maven.plugins maven-compiler-plugin - - - org.apache.felix - maven-scr-plugin + + 1.8 + 1.8 + org.apache.felix @@ -54,32 +54,33 @@ IOT Operation Template Bundle io.entgra.device.mgt.core.operation.template.internal + com.google.common.cache;version="[31.0,32)", + com.google.gson;version="[2.9,3)", + io.entgra.device.mgt.core.device.mgt.common.exceptions;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.service;version="[5.0,6)", + io.entgra.device.mgt.core.operation.template.cache, + io.entgra.device.mgt.core.operation.template.dao, + io.entgra.device.mgt.core.operation.template.dao.impl, + io.entgra.device.mgt.core.operation.template.dao.impl.config, + io.entgra.device.mgt.core.operation.template.dao.impl.config.datasource, + io.entgra.device.mgt.core.operation.template.dao.impl.util, + io.entgra.device.mgt.core.operation.template.dto, + io.entgra.device.mgt.core.operation.template.exception, + io.entgra.device.mgt.core.operation.template.impl, + io.entgra.device.mgt.core.operation.template.spi, + io.entgra.device.mgt.core.operation.template.util, + javax.naming, + javax.sql, + javax.xml.bind;version="[2.3,3)", + javax.xml.bind.annotation;version="[2.3,3)", + javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}", + org.apache.commons.lang;version="[2.4,3)", + org.apache.commons.logging;version="[1.2,2)", org.osgi.framework.*;version="${imp.package.version.osgi.framework}", org.osgi.service.*;version="${imp.package.version.osgi.service}", - org.apache.commons.logging, - org.apache.commons.lang, - javax.xml, - javax.xml.stream, - javax.xml.bind.*;version="${javax.xml.bind.imp.pkg.version}", - javax.sql, - javax.xml.parsers; version=0.0.0, - org.w3c.dom, - com.google.gson.*, - javax.naming, - org.wso2.carbon.context, - org.wso2.carbon.base, - org.wso2.carbon.utils.*, - io.entgra.device.mgt.core.device.mgt.common.*, - io.entgra.device.mgt.core.device.mgt.core.*, - org.wso2.carbon.ndatasource.core, - org.wso2.carbon.registry.core, - org.wso2.carbon.registry.core.session, - org.wso2.carbon.registry.core.service, - org.wso2.carbon.registry.api, - io.entgra.device.mgt.core.device.mgt.extensions.license.mgt.registry, - javax.net.ssl, - org.wso2.carbon.core.util, - okhttp3 + org.w3c.dom,org.wso2.carbon.ndatasource.core;version="[4.8,5)", + org.wso2.carbon.registry.core.service;version="[1.0,2)", + org.wso2.carbon.utils;version="[4.8,5)" !io.entgra.device.mgt.core.operation.template.internal, @@ -130,6 +131,11 @@ + + org.apache.felix + org.apache.felix.scr.ds-annotations + provided + io.entgra.device.mgt.core io.entgra.device.mgt.core.device.mgt.common @@ -159,10 +165,6 @@ org.codehaus.woodstox wstx-asl - - - - org.wso2.carbon.analytics org.wso2.carbon.analytics.api @@ -232,21 +234,11 @@ - - org.eclipse.osgi - org.eclipse.osgi - provided - org.wso2.orbit.com.h2database h2 test - - org.eclipse.osgi - org.eclipse.osgi.services - provided - org.wso2.carbon org.wso2.carbon.core @@ -256,7 +248,6 @@ org.ops4j.pax.logging pax-logging-api provided - org.wso2.carbon diff --git a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/dao/OperationTemplateDAOFactory.java b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/dao/OperationTemplateDAOFactory.java index c5a63ef251..e2f7145487 100644 --- a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/dao/OperationTemplateDAOFactory.java +++ b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/dao/OperationTemplateDAOFactory.java @@ -18,13 +18,13 @@ package io.entgra.device.mgt.core.operation.template.dao; +import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.operation.template.dao.impl.OperationTemplateDAOImpl; import io.entgra.device.mgt.core.operation.template.dao.impl.OperationTemplateMySQLDAOImpl; import io.entgra.device.mgt.core.operation.template.dao.impl.config.datasource.DataSourceConfig; import io.entgra.device.mgt.core.operation.template.util.ConnectionManagerUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; public class OperationTemplateDAOFactory { diff --git a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/dao/impl/OperationTemplateDAOImpl.java b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/dao/impl/OperationTemplateDAOImpl.java index 5111e48292..3fd1a9195d 100644 --- a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/dao/impl/OperationTemplateDAOImpl.java +++ b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/dao/impl/OperationTemplateDAOImpl.java @@ -19,22 +19,17 @@ package io.entgra.device.mgt.core.operation.template.dao.impl; import com.google.gson.Gson; -import io.entgra.device.mgt.core.operation.template.dto.OperationTemplate; import io.entgra.device.mgt.core.operation.template.dao.OperationTemplateDAO; +import io.entgra.device.mgt.core.operation.template.dto.OperationTemplate; import io.entgra.device.mgt.core.operation.template.exception.DBConnectionException; import io.entgra.device.mgt.core.operation.template.exception.OperationTemplateManagementDAOException; import io.entgra.device.mgt.core.operation.template.util.ConnectionManagerUtils; import io.entgra.device.mgt.core.operation.template.util.DAOUtil; - -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; - import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import java.sql.*; + /** * Implementation for generic DB engines. */ diff --git a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/dao/impl/config/DeviceConfigurationManager.java b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/dao/impl/config/DeviceConfigurationManager.java index e28960d1d3..968e1470f3 100644 --- a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/dao/impl/config/DeviceConfigurationManager.java +++ b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/dao/impl/config/DeviceConfigurationManager.java @@ -18,9 +18,9 @@ package io.entgra.device.mgt.core.operation.template.dao.impl.config; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.operation.template.dao.impl.util.OperationTemplateManagementUtil; import org.w3c.dom.Document; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import org.wso2.carbon.utils.CarbonUtils; import javax.xml.bind.JAXBContext; diff --git a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/dao/impl/util/OperationTemplateManagementUtil.java b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/dao/impl/util/OperationTemplateManagementUtil.java index e648778170..f340d3014e 100644 --- a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/dao/impl/util/OperationTemplateManagementUtil.java +++ b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/dao/impl/util/OperationTemplateManagementUtil.java @@ -18,9 +18,9 @@ package io.entgra.device.mgt.core.operation.template.dao.impl.util; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.operation.template.dto.OperationTemplateCacheKey; import org.w3c.dom.Document; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder; diff --git a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/impl/OperationTemplateServiceImpl.java b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/impl/OperationTemplateServiceImpl.java index 4ae9d343c1..b25356f8cd 100644 --- a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/impl/OperationTemplateServiceImpl.java +++ b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/impl/OperationTemplateServiceImpl.java @@ -30,8 +30,8 @@ import io.entgra.device.mgt.core.operation.template.exception.DBConnectionExcept import io.entgra.device.mgt.core.operation.template.exception.OperationTemplateManagementDAOException; import io.entgra.device.mgt.core.operation.template.exception.OperationTemplateMgtPluginException; import io.entgra.device.mgt.core.operation.template.spi.OperationTemplateService; -import io.entgra.device.mgt.core.operation.template.util.ConnectionManagerUtils; import io.entgra.device.mgt.core.operation.template.util.AssertUtils; +import io.entgra.device.mgt.core.operation.template.util.ConnectionManagerUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/internal/OperationTemplateMgtDataHolder.java b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/internal/OperationTemplateMgtDataHolder.java index bab25b690e..61af773f47 100644 --- a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/internal/OperationTemplateMgtDataHolder.java +++ b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/internal/OperationTemplateMgtDataHolder.java @@ -18,8 +18,8 @@ package io.entgra.device.mgt.core.operation.template.internal; -import io.entgra.device.mgt.core.operation.template.spi.OperationTemplateService; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import io.entgra.device.mgt.core.operation.template.spi.OperationTemplateService; import org.wso2.carbon.registry.core.service.RegistryService; /** diff --git a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/internal/OperationTemplateMgtServiceComponent.java b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/internal/OperationTemplateMgtServiceComponent.java index 2a35ebb632..90b67e1a09 100644 --- a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/internal/OperationTemplateMgtServiceComponent.java +++ b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/internal/OperationTemplateMgtServiceComponent.java @@ -28,18 +28,12 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleContext; import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.*; import org.wso2.carbon.ndatasource.core.DataSourceService; -/** - * @scr.component name="io.entgra.device.mgt.operation.template.internal.OperationTemplateMgtServiceComponent" immediate="true" - * immediate="true" - * @scr.reference name="org.wso2.carbon.ndatasource" - * interface="org.wso2.carbon.ndatasource.core.DataSourceService" - * cardinality="1..1" - * policy="dynamic" - * bind="setDataSourceService" - * unbind="unsetDataSourceService" - */ +@Component( + name = "io.entgra.device.mgt.core.operation.template.internal.OperationTemplateMgtServiceComponent", + immediate = true) public class OperationTemplateMgtServiceComponent { private static final Log log = LogFactory.getLog(OperationTemplateMgtServiceComponent.class); @@ -48,6 +42,7 @@ public class OperationTemplateMgtServiceComponent { * * @param componentContext */ + @Activate protected void activate(ComponentContext componentContext) { if (log.isDebugEnabled()) { @@ -77,6 +72,7 @@ public class OperationTemplateMgtServiceComponent { * * @param componentContext */ + @Deactivate protected void deactivate(ComponentContext componentContext) { if (log.isDebugEnabled()) { log.debug("De-activating Operation Template Management Service Component"); @@ -94,6 +90,12 @@ public class OperationTemplateMgtServiceComponent { * * @param dataSourceService */ + @Reference( + name = "datasource.service", + service = org.wso2.carbon.ndatasource.core.DataSourceService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetDataSourceService") protected void setDataSourceService(DataSourceService dataSourceService) { /* This is to avoid mobile device management component getting initialized before the underlying datasources are registered */ diff --git a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/util/ConnectionManagerUtils.java b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/util/ConnectionManagerUtils.java index 1945ddfaa0..f2cad4f3f4 100644 --- a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/util/ConnectionManagerUtils.java +++ b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/main/java/io/entgra/device/mgt/core/operation/template/util/ConnectionManagerUtils.java @@ -18,20 +18,19 @@ package io.entgra.device.mgt.core.operation.template.util; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.IllegalTransactionStateException; import io.entgra.device.mgt.core.operation.template.dao.impl.config.datasource.DataSourceConfig; import io.entgra.device.mgt.core.operation.template.dao.impl.config.datasource.JNDILookupDefinition; import io.entgra.device.mgt.core.operation.template.exception.DBConnectionException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import javax.naming.InitialContext; +import javax.sql.DataSource; import java.sql.Connection; import java.sql.SQLException; import java.util.Hashtable; import java.util.List; -import javax.naming.InitialContext; -import javax.sql.DataSource; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.IllegalTransactionStateException; /** * Connection Manager Utils class. diff --git a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/ServiceNegativeTest.java b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/ServiceNegativeTest.java index 5b6fa1d445..a5e9ec6275 100644 --- a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/ServiceNegativeTest.java +++ b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/ServiceNegativeTest.java @@ -21,8 +21,8 @@ package io.entgra.device.mgt.core.operation.template; import io.entgra.device.mgt.core.operation.template.dto.OperationTemplate; import io.entgra.device.mgt.core.operation.template.exception.OperationTemplateMgtPluginException; import io.entgra.device.mgt.core.operation.template.impl.OperationTemplateServiceImpl; -import io.entgra.device.mgt.core.operation.template.spi.OperationTemplateService; import io.entgra.device.mgt.core.operation.template.mock.BaseOperationTemplatePluginTest; +import io.entgra.device.mgt.core.operation.template.spi.OperationTemplateService; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.testng.annotations.BeforeClass; diff --git a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/BaseOperationTemplatePluginTest.java b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/BaseOperationTemplatePluginTest.java index 131c0de39e..829b79ac65 100644 --- a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/BaseOperationTemplatePluginTest.java +++ b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/BaseOperationTemplatePluginTest.java @@ -18,10 +18,13 @@ package io.entgra.device.mgt.core.operation.template.mock; +import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; +import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; import io.entgra.device.mgt.core.operation.template.DataSourceConfig; +import io.entgra.device.mgt.core.operation.template.TestUtils; import io.entgra.device.mgt.core.operation.template.dao.OperationTemplateDAOFactory; import io.entgra.device.mgt.core.operation.template.util.ConnectionManagerUtils; -import io.entgra.device.mgt.core.operation.template.TestUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.tomcat.jdbc.pool.PoolProperties; @@ -32,9 +35,6 @@ import org.testng.annotations.Parameters; import org.w3c.dom.Document; import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; import javax.sql.DataSource; import javax.xml.bind.JAXBContext; diff --git a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/MockConnection.java b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/MockConnection.java index 19d5c8f28c..e8489a82a3 100644 --- a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/MockConnection.java +++ b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/MockConnection.java @@ -18,21 +18,7 @@ package io.entgra.device.mgt.core.operation.template.mock; -import java.sql.CallableStatement; -import java.sql.SQLWarning; -import java.sql.Savepoint; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.Statement; -import java.sql.Clob; -import java.sql.Blob; -import java.sql.NClob; -import java.sql.SQLXML; -import java.sql.Struct; -import java.sql.Array; -import java.sql.SQLClientInfoException; -import java.sql.DatabaseMetaData; -import java.sql.SQLException; +import java.sql.*; import java.util.ArrayList; import java.util.List; import java.util.Map; diff --git a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/MockDatabaseMetaData.java b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/MockDatabaseMetaData.java index bc610469bc..2c397dd1f1 100644 --- a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/MockDatabaseMetaData.java +++ b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/MockDatabaseMetaData.java @@ -20,11 +20,7 @@ package io.entgra.device.mgt.core.operation.template.mock; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.RowIdLifetime; -import java.sql.DatabaseMetaData; -import java.sql.SQLException; +import java.sql.*; public class MockDatabaseMetaData implements DatabaseMetaData { private final String url; diff --git a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/MockResultSet.java b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/MockResultSet.java index 16fb7c09c1..0f0187acc9 100644 --- a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/MockResultSet.java +++ b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/MockResultSet.java @@ -22,21 +22,7 @@ import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; import java.net.URL; -import java.sql.ResultSet; -import java.sql.SQLWarning; -import java.sql.Date; -import java.sql.Time; -import java.sql.Timestamp; -import java.sql.Clob; -import java.sql.Blob; -import java.sql.NClob; -import java.sql.SQLXML; -import java.sql.Ref; -import java.sql.Array; -import java.sql.ResultSetMetaData; -import java.sql.RowId; -import java.sql.Statement; -import java.sql.SQLException; +import java.sql.*; import java.util.ArrayList; import java.util.Calendar; import java.util.List; diff --git a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/MockStatement.java b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/MockStatement.java index 84adadd585..a35641f2c1 100644 --- a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/MockStatement.java +++ b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/src/test/java/io/entgra/device/mgt/core/operation/template/mock/MockStatement.java @@ -22,23 +22,7 @@ import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; import java.net.URL; -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLWarning; -import java.sql.Date; -import java.sql.Time; -import java.sql.Timestamp; -import java.sql.PreparedStatement; -import java.sql.ParameterMetaData; -import java.sql.Clob; -import java.sql.Blob; -import java.sql.NClob; -import java.sql.SQLXML; -import java.sql.Ref; -import java.sql.Array; -import java.sql.ResultSetMetaData; -import java.sql.RowId; -import java.sql.SQLException; +import java.sql.*; import java.util.ArrayList; import java.util.Calendar; import java.util.List; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/pom.xml b/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/pom.xml index 62d02c301c..641afa455e 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/pom.xml +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/pom.xml @@ -12,13 +12,17 @@ bundle WSO2 Carbon - Policy Decision Point WSO2 Carbon - Policy Decision Point - http://wso2.org + https://entgra.io - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -32,14 +36,18 @@ Policy Decision Point Bundle io.entgra.device.mgt.core.policy.decision.point.internal - org.wso2.carbon.context;version="${carbon.kernel.version.range}", + io.entgra.device.mgt.core.device.mgt.common;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.policy.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.policy.decision.point.internal, + io.entgra.device.mgt.core.policy.decision.point.merged, + io.entgra.device.mgt.core.policy.decision.point.simple, + io.entgra.device.mgt.core.policy.mgt.common;version="[5.0,6)", + io.entgra.device.mgt.core.policy.mgt.core;version="[5.0,6)", + org.apache.commons.logging;version="[1.2,2)", org.osgi.framework.*;version="${imp.package.version.osgi.framework}", org.osgi.service.*;version="${imp.package.version.osgi.service}", - org.apache.commons.logging, - io.entgra.device.mgt.core.policy.mgt.common.*, - io.entgra.device.mgt.core.policy.mgt.core.*, - org.wso2.carbon.user.core.*, - io.entgra.device.mgt.core.device.mgt.common.* + org.wso2.carbon.context;version="[4.8,5)", + org.wso2.carbon.user.core.service;version="[4.8,5)" io.entgra.device.mgt.core.policy.decision.point.* @@ -77,12 +85,9 @@ - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.equinox - org.eclipse.equinox.common + org.apache.felix + org.apache.felix.scr.ds-annotations + provided org.ops4j.pax.logging diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/src/main/java/io/entgra/device/mgt/core/policy/decision/point/internal/MergedPolicyEvaluationServiceComponent.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/src/main/java/io/entgra/device/mgt/core/policy/decision/point/internal/MergedPolicyEvaluationServiceComponent.java index 24692c2c10..85e985c51b 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/src/main/java/io/entgra/device/mgt/core/policy/decision/point/internal/MergedPolicyEvaluationServiceComponent.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/src/main/java/io/entgra/device/mgt/core/policy/decision/point/internal/MergedPolicyEvaluationServiceComponent.java @@ -19,33 +19,22 @@ package io.entgra.device.mgt.core.policy.decision.point.internal; import io.entgra.device.mgt.core.policy.decision.point.merged.MergedEvaluationPoint; +import io.entgra.device.mgt.core.policy.mgt.common.PolicyEvaluationPoint; +import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.service.component.ComponentContext; -import io.entgra.device.mgt.core.policy.mgt.common.PolicyEvaluationPoint; -import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService; +import org.osgi.service.component.annotations.*; import org.wso2.carbon.user.core.service.RealmService; -/** - * @scr.component name="org.wso2.carbon.policy.decision.MergedPolicyEvaluationServiceComponent" immediate="true" - * @scr.reference name="user.realmservice.default" - * interface="org.wso2.carbon.user.core.service.RealmService" - * cardinality="1..1" - * policy="dynamic" - * bind="setRealmService" - * unbind="unsetRealmService" - * @scr.reference name="org.wso2.carbon.devicemgt.policy.manager" - * interface="io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService" - * cardinality="0..1" - * policy="dynamic" - * bind="setPolicyManagerService" - * unbind="unsetPolicyManagerService" - */ - +@Component( + name = "io.entgra.device.mgt.core.policy.decision.point.internal.MergedPolicyEvaluationServiceComponent", + immediate = true) public class MergedPolicyEvaluationServiceComponent { private static Log log = LogFactory.getLog(MergedPolicyEvaluationServiceComponent.class); + @Activate protected void activate(ComponentContext componentContext) { if (log.isDebugEnabled()) { log.debug("Activating the policy evaluation bundle."); @@ -59,6 +48,7 @@ public class MergedPolicyEvaluationServiceComponent { } } + @Deactivate protected void deactivate(ComponentContext componentContext) { if (log.isDebugEnabled()) { log.debug("De-activating the policy evaluation bundle."); @@ -70,6 +60,12 @@ public class MergedPolicyEvaluationServiceComponent { * * @param realmService An instance of RealmService */ + @Reference( + name = "realm.service", + service = org.wso2.carbon.user.core.service.RealmService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetRealmService") protected void setRealmService(RealmService realmService) { if (log.isDebugEnabled()) { @@ -90,6 +86,12 @@ public class MergedPolicyEvaluationServiceComponent { PolicyDecisionPointDataHolder.getInstance().setRealmService(null); } + @Reference( + name = "policy.mgt.service", + service = io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService.class, + cardinality = ReferenceCardinality.OPTIONAL, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetPolicyManagerService") protected void setPolicyManagerService(PolicyManagerService policyManagerService) { if (log.isDebugEnabled()) { log.debug("Unsetting PolicyManagerService Service"); diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/src/main/java/io/entgra/device/mgt/core/policy/decision/point/internal/PolicyEvaluationServiceComponent.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/src/main/java/io/entgra/device/mgt/core/policy/decision/point/internal/PolicyEvaluationServiceComponent.java index fe5cf9d206..e42ffbe652 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/src/main/java/io/entgra/device/mgt/core/policy/decision/point/internal/PolicyEvaluationServiceComponent.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/src/main/java/io/entgra/device/mgt/core/policy/decision/point/internal/PolicyEvaluationServiceComponent.java @@ -19,33 +19,22 @@ package io.entgra.device.mgt.core.policy.decision.point.internal; import io.entgra.device.mgt.core.policy.decision.point.simple.PolicyEvaluationServiceImpl; +import io.entgra.device.mgt.core.policy.mgt.common.PolicyEvaluationPoint; +import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.service.component.ComponentContext; -import io.entgra.device.mgt.core.policy.mgt.common.PolicyEvaluationPoint; -import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService; +import org.osgi.service.component.annotations.*; import org.wso2.carbon.user.core.service.RealmService; -/** - * @scr.component name="org.wso2.carbon.simple.policy.decision.PolicyEvaluationServiceComponent" immediate="true" - * @scr.reference name="user.realmservice.default" - * interface="org.wso2.carbon.user.core.service.RealmService" - * cardinality="1..1" - * policy="dynamic" - * bind="setRealmService" - * unbind="unsetRealmService" - * @scr.reference name="org.wso2.carbon.devicemgt.policy.manager" - * interface="io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService" - * cardinality="0..1" - * policy="dynamic" - * bind="setPolicyManagerService" - * unbind="unsetPolicyManagerService" - */ - +@Component( + name = "io.entgra.device.mgt.core.policy.decision.point.internal.PolicyEvaluationServiceComponent", + immediate = true) public class PolicyEvaluationServiceComponent { private static Log log = LogFactory.getLog(PolicyEvaluationServiceComponent.class); + @Activate protected void activate(ComponentContext componentContext) { if (log.isDebugEnabled()) { log.debug("Activating the policy evaluation bundle."); @@ -58,7 +47,7 @@ public class PolicyEvaluationServiceComponent { log.error("Error occurred while initializing the policy evaluation bundle"); } } - + @Deactivate protected void deactivate(ComponentContext componentContext) { if (log.isDebugEnabled()) { log.debug("De-activating the policy evaluation bundle."); @@ -70,6 +59,12 @@ public class PolicyEvaluationServiceComponent { * * @param realmService An instance of RealmService */ + @Reference( + name = "realm.service", + service = org.wso2.carbon.user.core.service.RealmService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetRealmService") protected void setRealmService(RealmService realmService) { if (log.isDebugEnabled()) { @@ -90,6 +85,12 @@ public class PolicyEvaluationServiceComponent { PolicyDecisionPointDataHolder.getInstance().setRealmService(null); } + @Reference( + name = "policy.mgt.service", + service = io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService.class, + cardinality = ReferenceCardinality.OPTIONAL, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetPolicyManagerService") protected void setPolicyManagerService(PolicyManagerService policyManagerService) { if (log.isDebugEnabled()) { diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/src/main/java/io/entgra/device/mgt/core/policy/decision/point/merged/MergedEvaluationPoint.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/src/main/java/io/entgra/device/mgt/core/policy/decision/point/merged/MergedEvaluationPoint.java index e075119881..39b322d6b7 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/src/main/java/io/entgra/device/mgt/core/policy/decision/point/merged/MergedEvaluationPoint.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/src/main/java/io/entgra/device/mgt/core/policy/decision/point/merged/MergedEvaluationPoint.java @@ -18,16 +18,16 @@ package io.entgra.device.mgt.core.policy.decision.point.merged; -import io.entgra.device.mgt.core.policy.decision.point.internal.PolicyDecisionPointDataHolder; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Profile; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; +import io.entgra.device.mgt.core.policy.decision.point.internal.PolicyDecisionPointDataHolder; import io.entgra.device.mgt.core.policy.mgt.common.*; import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.sql.Timestamp; import java.util.*; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/src/main/java/io/entgra/device/mgt/core/policy/decision/point/simple/PolicyEvaluationServiceImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/src/main/java/io/entgra/device/mgt/core/policy/decision/point/simple/PolicyEvaluationServiceImpl.java index 2aafb1159b..746b708173 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/src/main/java/io/entgra/device/mgt/core/policy/decision/point/simple/PolicyEvaluationServiceImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/src/main/java/io/entgra/device/mgt/core/policy/decision/point/simple/PolicyEvaluationServiceImpl.java @@ -20,9 +20,9 @@ package io.entgra.device.mgt.core.policy.decision.point.simple; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; import io.entgra.device.mgt.core.policy.mgt.common.PolicyEvaluationException; import io.entgra.device.mgt.core.policy.mgt.common.PolicyEvaluationPoint; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; import java.util.List; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/src/main/java/io/entgra/device/mgt/core/policy/decision/point/simple/SimpleEvaluationImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/src/main/java/io/entgra/device/mgt/core/policy/decision/point/simple/SimpleEvaluationImpl.java index c21cb848c1..696bafdfab 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/src/main/java/io/entgra/device/mgt/core/policy/decision/point/simple/SimpleEvaluationImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/src/main/java/io/entgra/device/mgt/core/policy/decision/point/simple/SimpleEvaluationImpl.java @@ -18,13 +18,13 @@ package io.entgra.device.mgt.core.policy.decision.point.simple; -import io.entgra.device.mgt.core.policy.decision.point.internal.PolicyDecisionPointDataHolder; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; +import io.entgra.device.mgt.core.policy.decision.point.internal.PolicyDecisionPointDataHolder; import io.entgra.device.mgt.core.policy.mgt.common.*; import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.util.ArrayList; import java.util.Collections; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.information.point/pom.xml b/components/policy-mgt/io.entgra.device.mgt.core.policy.information.point/pom.xml index c32695d6b2..6d4835556c 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.information.point/pom.xml +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.information.point/pom.xml @@ -13,14 +13,18 @@ bundle WSO2 Carbon - Policy Information Point WSO2 Carbon - Policy Information Point - http://wso2.org + https://entgra.io - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -37,6 +41,14 @@ io.entgra.device.mgt.core.policy.information.point.* + + io.entgra.device.mgt.core.device.mgt.common;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.policy.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.policy.information.point, + io.entgra.device.mgt.core.policy.mgt.common;version="[5.0,6)", + org.apache.commons.logging;version="[1.2,2)", + org.osgi.framework.*;version="${imp.package.version.osgi.framework}" + @@ -70,12 +82,9 @@ - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.equinox - org.eclipse.equinox.common + org.apache.felix + org.apache.felix.scr.ds-annotations + provided org.ops4j.pax.logging diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.information.point/src/main/java/io/entgra/device/mgt/core/policy/information/point/PolicyInformationServiceImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.information.point/src/main/java/io/entgra/device/mgt/core/policy/information/point/PolicyInformationServiceImpl.java index 139a7e1c67..223fab9142 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.information.point/src/main/java/io/entgra/device/mgt/core/policy/information/point/PolicyInformationServiceImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.information.point/src/main/java/io/entgra/device/mgt/core/policy/information/point/PolicyInformationServiceImpl.java @@ -20,8 +20,8 @@ package io.entgra.device.mgt.core.policy.information.point; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.Feature; -import io.entgra.device.mgt.core.policy.mgt.common.PIPDevice; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; +import io.entgra.device.mgt.core.policy.mgt.common.PIPDevice; import io.entgra.device.mgt.core.policy.mgt.common.PolicyInformationPoint; import java.util.List; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.information.point/src/main/java/io/entgra/device/mgt/core/policy/information/point/internal/PolicyInformationPointBundleActivator.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.information.point/src/main/java/io/entgra/device/mgt/core/policy/information/point/internal/PolicyInformationPointBundleActivator.java index b65388c7db..884cbdaaaf 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.information.point/src/main/java/io/entgra/device/mgt/core/policy/information/point/internal/PolicyInformationPointBundleActivator.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.information.point/src/main/java/io/entgra/device/mgt/core/policy/information/point/internal/PolicyInformationPointBundleActivator.java @@ -18,13 +18,13 @@ package io.entgra.device.mgt.core.policy.information.point.internal; +import io.entgra.device.mgt.core.policy.information.point.PolicyInformationServiceImpl; +import io.entgra.device.mgt.core.policy.mgt.common.PolicyInformationPoint; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleActivator; import org.osgi.framework.BundleContext; import org.osgi.framework.ServiceRegistration; -import io.entgra.device.mgt.core.policy.information.point.PolicyInformationServiceImpl; -import io.entgra.device.mgt.core.policy.mgt.common.PolicyInformationPoint; public class PolicyInformationPointBundleActivator implements BundleActivator { diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.common/pom.xml b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.common/pom.xml index 2ac8356ba7..7c84c52170 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.common/pom.xml +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.common/pom.xml @@ -31,13 +31,17 @@ bundle WSO2 Carbon - Policy Management Common WSO2 Carbon - Policy Management Common - http://wso2.org + https://entgra.io - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -50,11 +54,11 @@ ${io.entgra.device.mgt.core.version} Policy Management Common Bundle - javax.xml.bind.annotation, - io.swagger.annotations.*;resolution:=optional, - io.entgra.device.mgt.core.device.mgt.common.*, - io.entgra.device.mgt.core.device.mgt.core.dto.*, - javax.xml.bind.*, + io.entgra.device.mgt.core.device.mgt.common;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.group.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.policy.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.dto;version="[5.0,6)" io.entgra.device.mgt.core.policy.mgt.common.* @@ -93,18 +97,14 @@ - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.equinox - org.eclipse.equinox.common + org.apache.felix + org.apache.felix.scr.ds-annotations + provided org.ops4j.pax.logging pax-logging-api provided - org.testng diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.common/src/main/java/io/entgra/device/mgt/core/policy/mgt/common/PolicyAdministratorPoint.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.common/src/main/java/io/entgra/device/mgt/core/policy/mgt/common/PolicyAdministratorPoint.java index 6934803f8d..a72de49e6f 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.common/src/main/java/io/entgra/device/mgt/core/policy/mgt/common/PolicyAdministratorPoint.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.common/src/main/java/io/entgra/device/mgt/core/policy/mgt/common/PolicyAdministratorPoint.java @@ -17,8 +17,8 @@ */ package io.entgra.device.mgt.core.policy.mgt.common; + import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.DynamicTaskContext; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Profile; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.common/src/main/java/io/entgra/device/mgt/core/policy/mgt/common/monitor/ComplianceDecisionPoint.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.common/src/main/java/io/entgra/device/mgt/core/policy/mgt/common/monitor/ComplianceDecisionPoint.java index ef79616ddb..a0463b57bb 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.common/src/main/java/io/entgra/device/mgt/core/policy/mgt/common/monitor/ComplianceDecisionPoint.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.common/src/main/java/io/entgra/device/mgt/core/policy/mgt/common/monitor/ComplianceDecisionPoint.java @@ -22,9 +22,9 @@ package io.entgra.device.mgt.core.policy.mgt.common.monitor; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.NonComplianceData; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.PolicyComplianceException; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import java.util.List; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/pom.xml b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/pom.xml index c31384c31d..b98c1cbf55 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/pom.xml +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/pom.xml @@ -31,13 +31,17 @@ bundle WSO2 Carbon - Policy Management Core WSO2 Carbon - Policy Management Core - http://wso2.org + https://entgra.io - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -51,24 +55,53 @@ Policy Management Core Bundle io.entgra.device.mgt.core.policy.mgt.core.internal + com.google.gson;version="[2.9,3)", + io.entgra.device.mgt.core.device.mgt.common;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.configuration.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.exceptions;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.group.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.operation.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.policy.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.config;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.config.policy;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.config.tenant;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.dto;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.operation.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.service;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.task.impl;version="[5.0,6)", + io.entgra.device.mgt.core.policy.mgt.common;version="[5.0,6)", + io.entgra.device.mgt.core.policy.mgt.common.monitor;version="[5.0,6)", + io.entgra.device.mgt.core.policy.mgt.core.cache, + io.entgra.device.mgt.core.policy.mgt.core.cache.impl, + io.entgra.device.mgt.core.policy.mgt.core.config, + io.entgra.device.mgt.core.policy.mgt.core.config.datasource, + io.entgra.device.mgt.core.policy.mgt.core.dao, + io.entgra.device.mgt.core.policy.mgt.core.dao.impl, + io.entgra.device.mgt.core.policy.mgt.core.dao.impl.feature, + io.entgra.device.mgt.core.policy.mgt.core.dao.impl.policy, + io.entgra.device.mgt.core.policy.mgt.core.dao.util, + io.entgra.device.mgt.core.policy.mgt.core.mgt, + io.entgra.device.mgt.core.policy.mgt.core.mgt.bean, + io.entgra.device.mgt.core.policy.mgt.core.util, + javax.cache;version="[1.0,2)", + javax.naming, + javax.sql, + javax.xml.bind;version="[0.0,1)", + javax.xml.bind.annotation;version="[0.0,1)", + javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}", + org.apache.commons.lang;version="[2.6,3)", + org.apache.commons.logging;version="[1.2,2)", org.osgi.framework.*;version="${imp.package.version.osgi.framework}", org.osgi.service.*;version="${imp.package.version.osgi.service}", - org.apache.commons.logging, - javax.sql, - javax.cache, - javax.naming, - javax.xml.*, - javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional, org.w3c.dom, - io.entgra.device.mgt.core.policy.mgt.common.*, - org.wso2.carbon.user.core.*, - org.wso2.carbon.utils.*, - org.wso2.carbon.context.*, - org.wso2.carbon.user.api.*, - io.entgra.device.mgt.core.device.mgt.core.*, - io.entgra.device.mgt.core.device.mgt.common.*, - org.wso2.carbon.ntask.*, - org.wso2.carbon.caching.* + org.wso2.carbon.context;version="[4.8,5)", + org.wso2.carbon.ntask.common;version="[4.9,5)", + org.wso2.carbon.ntask.core;version="[4.9,5)", + org.wso2.carbon.ntask.core.service;version="[4.9,5)", + org.wso2.carbon.user.api;version="[1.0,2)", + org.wso2.carbon.user.core.service;version="[4.8,5)", + org.wso2.carbon.utils;version="[4.8,5)" !io.entgra.device.mgt.core.policy.mgt.core.internal, @@ -122,27 +155,19 @@ - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.equinox - org.eclipse.equinox.common + org.apache.felix + org.apache.felix.scr.ds-annotations + provided org.ops4j.pax.logging pax-logging-api provided - org.wso2.carbon org.wso2.carbon.utils - - - - org.wso2.carbon org.wso2.carbon.core @@ -212,11 +237,6 @@ h2 test - - - - - diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/PolicyManagerService.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/PolicyManagerService.java index 42a0ae2e76..49bccc0221 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/PolicyManagerService.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/PolicyManagerService.java @@ -19,18 +19,15 @@ package io.entgra.device.mgt.core.policy.mgt.core; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.Feature; -import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; +import io.entgra.device.mgt.core.device.mgt.common.*; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Profile; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; -import io.entgra.device.mgt.core.policy.mgt.common.*; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.NonComplianceData; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.ComplianceFeature; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.NonComplianceData; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.PolicyComplianceException; +import io.entgra.device.mgt.core.policy.mgt.common.*; import io.entgra.device.mgt.core.policy.mgt.core.task.TaskScheduleService; import java.util.List; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/PolicyManagerServiceImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/PolicyManagerServiceImpl.java index 02de4af98c..60748fb9aa 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/PolicyManagerServiceImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/PolicyManagerServiceImpl.java @@ -35,22 +35,17 @@ package io.entgra.device.mgt.core.policy.mgt.core; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.Feature; -import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; -import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; +import io.entgra.device.mgt.core.device.mgt.common.*; import io.entgra.device.mgt.core.device.mgt.common.exceptions.InvalidDeviceException; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManagementException; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Profile; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; -import io.entgra.device.mgt.core.policy.mgt.common.*; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.NonComplianceData; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.ComplianceFeature; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.NonComplianceData; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.PolicyComplianceException; +import io.entgra.device.mgt.core.policy.mgt.common.*; import io.entgra.device.mgt.core.policy.mgt.core.impl.PolicyAdministratorPointImpl; import io.entgra.device.mgt.core.policy.mgt.core.impl.PolicyInformationPointImpl; import io.entgra.device.mgt.core.policy.mgt.core.internal.PolicyManagementDataHolder; @@ -61,6 +56,8 @@ import io.entgra.device.mgt.core.policy.mgt.core.mgt.impl.PolicyManagerImpl; import io.entgra.device.mgt.core.policy.mgt.core.task.TaskScheduleService; import io.entgra.device.mgt.core.policy.mgt.core.task.TaskScheduleServiceImpl; import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagerUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.util.ArrayList; import java.util.List; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/cache/PolicyCacheManager.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/cache/PolicyCacheManager.java index 1c132cb3fd..8e1dc7fe17 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/cache/PolicyCacheManager.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/cache/PolicyCacheManager.java @@ -19,7 +19,6 @@ package io.entgra.device.mgt.core.policy.mgt.core.cache; -import io.entgra.device.mgt.core.device.mgt.common.DynamicTaskContext; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/cache/impl/PolicyCacheManagerImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/cache/impl/PolicyCacheManagerImpl.java index 06431891d4..b4e80c68b6 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/cache/impl/PolicyCacheManagerImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/cache/impl/PolicyCacheManagerImpl.java @@ -19,9 +19,6 @@ package io.entgra.device.mgt.core.policy.mgt.core.cache.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.DynamicTaskContext; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; import io.entgra.device.mgt.core.policy.mgt.core.cache.PolicyCacheManager; @@ -29,6 +26,8 @@ import io.entgra.device.mgt.core.policy.mgt.core.mgt.PolicyManager; import io.entgra.device.mgt.core.policy.mgt.core.mgt.impl.PolicyManagerImpl; import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagementConstants; import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagerUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.cache.Cache; import java.util.ArrayList; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/config/PolicyConfigurationManager.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/config/PolicyConfigurationManager.java index 2f61677584..7ca2b294de 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/config/PolicyConfigurationManager.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/config/PolicyConfigurationManager.java @@ -18,11 +18,11 @@ package io.entgra.device.mgt.core.policy.mgt.core.config; -import org.w3c.dom.Document; import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; import io.entgra.device.mgt.core.policy.mgt.core.config.datasource.DataSourceConfig; import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagementConstants; import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagerUtil; +import org.w3c.dom.Document; import org.wso2.carbon.utils.CarbonUtils; import javax.xml.bind.JAXBContext; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/MonitoringDAO.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/MonitoringDAO.java index dd5a218e3a..ec832a7634 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/MonitoringDAO.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/MonitoringDAO.java @@ -21,8 +21,8 @@ package io.entgra.device.mgt.core.policy.mgt.core.dao; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.ComplianceData; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.NonComplianceData; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.ComplianceFeature; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.NonComplianceData; import io.entgra.device.mgt.core.policy.mgt.common.monitor.PolicyDeviceWrapper; import java.util.List; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/PolicyDAO.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/PolicyDAO.java index dd019d17b5..983174d6cf 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/PolicyDAO.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/PolicyDAO.java @@ -38,10 +38,10 @@ package io.entgra.device.mgt.core.policy.mgt.core.dao; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.CorrectiveAction; -import io.entgra.device.mgt.core.policy.mgt.common.Criterion; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.DeviceGroupWrapper; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.PolicyCriterion; +import io.entgra.device.mgt.core.policy.mgt.common.Criterion; import java.util.HashMap; import java.util.List; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/PolicyManagementDAOFactory.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/PolicyManagementDAOFactory.java index 71e9af6e4d..7851815d6c 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/PolicyManagementDAOFactory.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/PolicyManagementDAOFactory.java @@ -18,8 +18,6 @@ package io.entgra.device.mgt.core.policy.mgt.core.dao; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.common.exceptions.IllegalTransactionStateException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.UnsupportedDatabaseEngineException; @@ -35,6 +33,8 @@ import io.entgra.device.mgt.core.policy.mgt.core.dao.impl.policy.OraclePolicyDAO import io.entgra.device.mgt.core.policy.mgt.core.dao.impl.policy.PostgreSQLPolicyDAOImpl; import io.entgra.device.mgt.core.policy.mgt.core.dao.impl.policy.SQLServerPolicyDAOImpl; import io.entgra.device.mgt.core.policy.mgt.core.dao.util.PolicyManagementDAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.sql.DataSource; import java.sql.Connection; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/MonitoringDAOImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/MonitoringDAOImpl.java index 851bd87d6c..f1b18ad955 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/MonitoringDAOImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/MonitoringDAOImpl.java @@ -19,19 +19,19 @@ package io.entgra.device.mgt.core.policy.mgt.core.dao.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.ComplianceData; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.NonComplianceData; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.ComplianceFeature; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.NonComplianceData; import io.entgra.device.mgt.core.policy.mgt.common.monitor.PolicyDeviceWrapper; import io.entgra.device.mgt.core.policy.mgt.core.dao.MonitoringDAO; import io.entgra.device.mgt.core.policy.mgt.core.dao.MonitoringDAOException; import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagementDAOFactory; import io.entgra.device.mgt.core.policy.mgt.core.dao.util.PolicyManagementDAOUtil; import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagerUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.sql.*; import java.util.*; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/ProfileDAOImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/ProfileDAOImpl.java index 78678470da..8f61defcbc 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/ProfileDAOImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/ProfileDAOImpl.java @@ -18,15 +18,14 @@ package io.entgra.device.mgt.core.policy.mgt.core.dao.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.DynamicTaskContext; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Profile; import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagementDAOFactory; import io.entgra.device.mgt.core.policy.mgt.core.dao.ProfileDAO; import io.entgra.device.mgt.core.policy.mgt.core.dao.ProfileManagerDAOException; import io.entgra.device.mgt.core.policy.mgt.core.dao.util.PolicyManagementDAOUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/feature/AbstractFeatureDAO.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/feature/AbstractFeatureDAO.java index df02a5107d..9c2035f635 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/feature/AbstractFeatureDAO.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/feature/AbstractFeatureDAO.java @@ -18,9 +18,6 @@ package io.entgra.device.mgt.core.policy.mgt.core.dao.impl.feature; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.Feature; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Profile; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; @@ -29,6 +26,9 @@ import io.entgra.device.mgt.core.policy.mgt.core.dao.FeatureManagerDAOException; import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagementDAOFactory; import io.entgra.device.mgt.core.policy.mgt.core.dao.util.PolicyManagementDAOUtil; import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagerUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.io.ByteArrayInputStream; import java.io.IOException; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/feature/GenericFeatureDAOImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/feature/GenericFeatureDAOImpl.java index 1c6adecb98..71cff8a38b 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/feature/GenericFeatureDAOImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/feature/GenericFeatureDAOImpl.java @@ -18,14 +18,14 @@ package io.entgra.device.mgt.core.policy.mgt.core.dao.impl.feature; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; import io.entgra.device.mgt.core.policy.mgt.core.dao.FeatureManagerDAOException; import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagementDAOFactory; import io.entgra.device.mgt.core.policy.mgt.core.dao.util.PolicyManagementDAOUtil; import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagerUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.io.IOException; import java.sql.Connection; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/feature/OracleServerFeatureDAOImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/feature/OracleServerFeatureDAOImpl.java index 3abd096d26..58a9e317f9 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/feature/OracleServerFeatureDAOImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/feature/OracleServerFeatureDAOImpl.java @@ -17,12 +17,12 @@ */ package io.entgra.device.mgt.core.policy.mgt.core.dao.impl.feature; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; import io.entgra.device.mgt.core.policy.mgt.core.dao.FeatureManagerDAOException; import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagementDAOFactory; import io.entgra.device.mgt.core.policy.mgt.core.dao.util.PolicyManagementDAOUtil; import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagerUtil; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.io.IOException; import java.sql.Connection; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/feature/SQLServerFeatureDAOImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/feature/SQLServerFeatureDAOImpl.java index ae3c418c66..a60f6acd83 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/feature/SQLServerFeatureDAOImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/feature/SQLServerFeatureDAOImpl.java @@ -18,14 +18,14 @@ package io.entgra.device.mgt.core.policy.mgt.core.dao.impl.feature; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; import io.entgra.device.mgt.core.policy.mgt.core.dao.FeatureManagerDAOException; import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagementDAOFactory; import io.entgra.device.mgt.core.policy.mgt.core.dao.util.PolicyManagementDAOUtil; import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagerUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.io.IOException; import java.sql.Connection; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/policy/AbstractPolicyDAOImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/policy/AbstractPolicyDAOImpl.java index 88b090bc1e..bebf93ca33 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/policy/AbstractPolicyDAOImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/policy/AbstractPolicyDAOImpl.java @@ -35,9 +35,6 @@ package io.entgra.device.mgt.core.policy.mgt.core.dao.impl.policy; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.CorrectiveAction; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.DeviceGroupWrapper; @@ -50,21 +47,15 @@ import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagerDAOException; import io.entgra.device.mgt.core.policy.mgt.core.dao.util.PolicyManagementDAOUtil; import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagerUtil; import io.entgra.device.mgt.core.policy.mgt.core.util.SetReferenceTransformer; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.ObjectInputStream; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; -import java.sql.Timestamp; -import java.sql.Types; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.HashMap; -import java.util.List; -import java.util.Properties; +import java.sql.*; +import java.util.*; /** * Abstract implementation of PolicyDAO which holds generic SQL queries. diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/policy/GenericPolicyDAOImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/policy/GenericPolicyDAOImpl.java index 9608e56637..fd1debda36 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/policy/GenericPolicyDAOImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/policy/GenericPolicyDAOImpl.java @@ -19,13 +19,13 @@ package io.entgra.device.mgt.core.policy.mgt.core.dao.impl.policy; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagementDAOFactory; import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagerDAOException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/policy/OraclePolicyDAOImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/policy/OraclePolicyDAOImpl.java index a0efdc4258..d4f1630559 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/policy/OraclePolicyDAOImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/policy/OraclePolicyDAOImpl.java @@ -19,13 +19,13 @@ package io.entgra.device.mgt.core.policy.mgt.core.dao.impl.policy; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagementDAOFactory; import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagerDAOException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/policy/PostgreSQLPolicyDAOImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/policy/PostgreSQLPolicyDAOImpl.java index c3025c4d2a..89065d783f 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/policy/PostgreSQLPolicyDAOImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/policy/PostgreSQLPolicyDAOImpl.java @@ -19,13 +19,13 @@ package io.entgra.device.mgt.core.policy.mgt.core.dao.impl.policy; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagementDAOFactory; import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagerDAOException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/policy/SQLServerPolicyDAOImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/policy/SQLServerPolicyDAOImpl.java index 62eac0338d..0bb44e70f4 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/policy/SQLServerPolicyDAOImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/dao/impl/policy/SQLServerPolicyDAOImpl.java @@ -19,13 +19,13 @@ package io.entgra.device.mgt.core.policy.mgt.core.dao.impl.policy; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagementDAOFactory; import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagerDAOException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/enforcement/DelegationTask.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/enforcement/DelegationTask.java index 71f108d61e..7cf274fdbb 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/enforcement/DelegationTask.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/enforcement/DelegationTask.java @@ -18,8 +18,6 @@ package io.entgra.device.mgt.core.policy.mgt.core.enforcement; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; @@ -33,6 +31,8 @@ import io.entgra.device.mgt.core.policy.mgt.core.internal.PolicyManagementDataHo import io.entgra.device.mgt.core.policy.mgt.core.mgt.PolicyManager; import io.entgra.device.mgt.core.policy.mgt.core.mgt.bean.UpdatedPolicyDeviceListBean; import io.entgra.device.mgt.core.policy.mgt.core.mgt.impl.PolicyManagerImpl; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.util.ArrayList; import java.util.List; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/enforcement/PolicyEnforcementDelegatorImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/enforcement/PolicyEnforcementDelegatorImpl.java index 0f972c58c6..602d189079 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/enforcement/PolicyEnforcementDelegatorImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/enforcement/PolicyEnforcementDelegatorImpl.java @@ -34,8 +34,6 @@ */ package io.entgra.device.mgt.core.policy.mgt.core.enforcement; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.exceptions.InvalidDeviceException; @@ -53,6 +51,8 @@ import io.entgra.device.mgt.core.policy.mgt.common.PolicyTransformException; import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService; import io.entgra.device.mgt.core.policy.mgt.core.internal.PolicyManagementDataHolder; import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagerUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.util.ArrayList; import java.util.List; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/impl/ComplianceDecisionPointImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/impl/ComplianceDecisionPointImpl.java index 74ab005edb..218a78975b 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/impl/ComplianceDecisionPointImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/impl/ComplianceDecisionPointImpl.java @@ -36,24 +36,26 @@ package io.entgra.device.mgt.core.policy.mgt.core.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.*; +import io.entgra.device.mgt.core.device.mgt.common.Device; +import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; +import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.InvalidDeviceException; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManagementException; -import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.PolicyOperation; -import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.ProfileOperation; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.NonComplianceData; -import io.entgra.device.mgt.core.policy.mgt.common.monitor.ComplianceDecisionPoint; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.ComplianceFeature; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.NonComplianceData; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.PolicyComplianceException; +import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.PolicyOperation; +import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.ProfileOperation; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import io.entgra.device.mgt.core.policy.mgt.common.monitor.ComplianceDecisionPoint; import io.entgra.device.mgt.core.policy.mgt.core.internal.PolicyManagementDataHolder; import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagementConstants; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.util.ArrayList; import java.util.List; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/impl/PolicyAdministratorPointImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/impl/PolicyAdministratorPointImpl.java index bf2208f2a4..bcf26e7470 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/impl/PolicyAdministratorPointImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/impl/PolicyAdministratorPointImpl.java @@ -18,21 +18,15 @@ package io.entgra.device.mgt.core.policy.mgt.core.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.DynamicTaskContext; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Profile; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; import io.entgra.device.mgt.core.device.mgt.core.config.policy.PolicyConfiguration; -import org.wso2.carbon.ntask.common.TaskException; -import org.wso2.carbon.ntask.core.TaskInfo; -import org.wso2.carbon.ntask.core.TaskManager; -import org.wso2.carbon.ntask.core.service.TaskService; -import io.entgra.device.mgt.core.policy.mgt.common.*; +import io.entgra.device.mgt.core.policy.mgt.common.PolicyAdministratorPoint; +import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; +import io.entgra.device.mgt.core.policy.mgt.common.ProfileManagementException; import io.entgra.device.mgt.core.policy.mgt.core.cache.PolicyCacheManager; import io.entgra.device.mgt.core.policy.mgt.core.cache.impl.PolicyCacheManagerImpl; import io.entgra.device.mgt.core.policy.mgt.core.internal.PolicyManagementDataHolder; @@ -41,6 +35,13 @@ import io.entgra.device.mgt.core.policy.mgt.core.mgt.ProfileManager; import io.entgra.device.mgt.core.policy.mgt.core.mgt.impl.PolicyManagerImpl; import io.entgra.device.mgt.core.policy.mgt.core.mgt.impl.ProfileManagerImpl; import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagementConstants; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; +import org.wso2.carbon.ntask.common.TaskException; +import org.wso2.carbon.ntask.core.TaskInfo; +import org.wso2.carbon.ntask.core.TaskManager; +import org.wso2.carbon.ntask.core.service.TaskService; import java.util.HashMap; import java.util.List; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/impl/PolicyFilterImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/impl/PolicyFilterImpl.java index 1749fd4c44..1a11e86a2f 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/impl/PolicyFilterImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/impl/PolicyFilterImpl.java @@ -36,13 +36,13 @@ package io.entgra.device.mgt.core.policy.mgt.core.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.DeviceGroupWrapper; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import io.entgra.device.mgt.core.policy.mgt.common.PolicyFilter; import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagementConstants; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.util.ArrayList; import java.util.HashMap; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/impl/PolicyInformationPointImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/impl/PolicyInformationPointImpl.java index 4938dea88f..1c03b2bcc0 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/impl/PolicyInformationPointImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/impl/PolicyInformationPointImpl.java @@ -35,9 +35,6 @@ package io.entgra.device.mgt.core.policy.mgt.core.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.CarbonContext; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.Feature; @@ -48,16 +45,15 @@ import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.service.GroupManagementProviderService; -import io.entgra.device.mgt.core.policy.mgt.common.FeatureManagementException; -import io.entgra.device.mgt.core.policy.mgt.common.PIPDevice; -import io.entgra.device.mgt.core.policy.mgt.common.PolicyFilter; -import io.entgra.device.mgt.core.policy.mgt.common.PolicyInformationPoint; -import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; +import io.entgra.device.mgt.core.policy.mgt.common.*; import io.entgra.device.mgt.core.policy.mgt.core.internal.PolicyManagementDataHolder; import io.entgra.device.mgt.core.policy.mgt.core.mgt.FeatureManager; import io.entgra.device.mgt.core.policy.mgt.core.mgt.PolicyManager; import io.entgra.device.mgt.core.policy.mgt.core.mgt.impl.FeatureManagerImpl; import io.entgra.device.mgt.core.policy.mgt.core.mgt.impl.PolicyManagerImpl; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.user.api.UserRealm; import org.wso2.carbon.user.api.UserStoreException; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/internal/PolicyManagementDataHolder.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/internal/PolicyManagementDataHolder.java index b7447e9ead..a462244511 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/internal/PolicyManagementDataHolder.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/internal/PolicyManagementDataHolder.java @@ -18,17 +18,17 @@ package io.entgra.device.mgt.core.policy.mgt.core.internal; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; import io.entgra.device.mgt.core.device.mgt.core.config.policy.PolicyConfiguration; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.service.GroupManagementProviderService; -import org.wso2.carbon.ntask.core.service.TaskService; import io.entgra.device.mgt.core.policy.mgt.common.PolicyEvaluationPoint; import io.entgra.device.mgt.core.policy.mgt.common.PolicyInformationPoint; import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService; import io.entgra.device.mgt.core.policy.mgt.core.mgt.MonitoringManager; import io.entgra.device.mgt.core.policy.mgt.core.mgt.PolicyManager; +import org.wso2.carbon.context.PrivilegedCarbonContext; +import org.wso2.carbon.ntask.core.service.TaskService; import org.wso2.carbon.user.core.service.RealmService; import java.util.HashMap; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/internal/PolicyManagementServiceComponent.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/internal/PolicyManagementServiceComponent.java index 0694b361a2..edff9188b2 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/internal/PolicyManagementServiceComponent.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/internal/PolicyManagementServiceComponent.java @@ -18,13 +18,9 @@ package io.entgra.device.mgt.core.policy.mgt.core.internal; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.osgi.service.component.ComponentContext; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; import io.entgra.device.mgt.core.device.mgt.core.config.policy.PolicyConfiguration; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; -import org.wso2.carbon.ntask.core.service.TaskService; import io.entgra.device.mgt.core.policy.mgt.common.PolicyEvaluationPoint; import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService; import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerServiceImpl; @@ -35,40 +31,22 @@ import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagementDAOFactory; import io.entgra.device.mgt.core.policy.mgt.core.task.TaskScheduleService; import io.entgra.device.mgt.core.policy.mgt.core.task.TaskScheduleServiceImpl; import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagerUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.*; +import org.wso2.carbon.ntask.core.service.TaskService; import org.wso2.carbon.user.core.service.RealmService; -/** - * @scr.component name="org.wso2.carbon.devicemgt.policy.manager" immediate="true" - * @scr.reference name="user.realmservice.default" - * interface="org.wso2.carbon.user.core.service.RealmService" - * cardinality="1..1" - * policy="dynamic" - * bind="setRealmService" - * unbind="unsetRealmService" - * @scr.reference name="org.wso2.carbon.devicemgt.policy.evaluation.manager" - * interface="io.entgra.device.mgt.core.policy.mgt.common.PolicyEvaluationPoint" - * cardinality="1..n" - * policy="dynamic" - * bind="setPEPService" - * unbind="unsetPEPService" - * @scr.reference name="org.wso2.carbon.device.manager" - * interface="io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService" - * cardinality="1..1" - * policy="dynamic" - * bind="setDeviceManagementService" - * unbind="unsetDeviceManagementService" - * @scr.reference name="ntask.component" - * interface="org.wso2.carbon.ntask.core.service.TaskService" - * cardinality="1..1" - * policy="dynamic" - * bind="setTaskService" - * unbind="unsetTaskService" - */ @SuppressWarnings("unused") +@Component( + name = "io.entgra.device.mgt.core.policy.mgt.core.internal.PolicyManagementServiceComponent", + immediate = true) public class PolicyManagementServiceComponent { private static final Log log = LogFactory.getLog(PolicyManagementServiceComponent.class); + @Activate protected void activate(ComponentContext componentContext) { try { @@ -95,6 +73,7 @@ public class PolicyManagementServiceComponent { } @SuppressWarnings("unused") + @Deactivate protected void deactivate(ComponentContext componentContext) { try { PolicyConfiguration policyConfiguration = @@ -114,6 +93,12 @@ public class PolicyManagementServiceComponent { * * @param realmService An instance of RealmService */ + @Reference( + name = "realm.service", + service = org.wso2.carbon.user.core.service.RealmService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetRealmService") protected void setRealmService(RealmService realmService) { if (log.isDebugEnabled()) { @@ -149,7 +134,12 @@ public class PolicyManagementServiceComponent { PolicyManagementDataHolder.getInstance().setPolicyInformationPoint(null); }*/ - + @Reference( + name = "pep.service", + service = io.entgra.device.mgt.core.policy.mgt.common.PolicyEvaluationPoint.class, + cardinality = ReferenceCardinality.MULTIPLE, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetPEPService") protected void setPEPService(PolicyEvaluationPoint pepService) { if (log.isDebugEnabled()) { log.debug("Setting Policy Information Service"); @@ -164,6 +154,12 @@ public class PolicyManagementServiceComponent { PolicyManagementDataHolder.getInstance().removePolicyEvaluationPoint(pepService); } + @Reference( + name = "device.mgt.provider.service", + service = io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetDeviceManagementService") protected void setDeviceManagementService(DeviceManagementProviderService deviceManagerService) { if (log.isDebugEnabled()) { log.debug("Setting Device Management Service"); @@ -178,6 +174,12 @@ public class PolicyManagementServiceComponent { PolicyManagementDataHolder.getInstance().setDeviceManagementService(null); } + @Reference( + name = "task.service", + service = org.wso2.carbon.ntask.core.service.TaskService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetTaskService") protected void setTaskService(TaskService taskService) { if (log.isDebugEnabled()) { log.debug("Setting the task service."); diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/MonitoringManager.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/MonitoringManager.java index 15ecc34037..225e9064ff 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/MonitoringManager.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/MonitoringManager.java @@ -22,8 +22,8 @@ import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.PaginationResult; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.NonComplianceData; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.ComplianceFeature; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.NonComplianceData; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.PolicyComplianceException; import java.util.List; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/PolicyManager.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/PolicyManager.java index 41b46c518d..d5de610624 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/PolicyManager.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/PolicyManager.java @@ -19,7 +19,6 @@ package io.entgra.device.mgt.core.policy.mgt.core.mgt; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.DynamicTaskContext; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/FeatureManagerImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/FeatureManagerImpl.java index b290fdf59e..8698837b52 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/FeatureManagerImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/FeatureManagerImpl.java @@ -18,19 +18,14 @@ package io.entgra.device.mgt.core.policy.mgt.core.mgt.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.Feature; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Profile; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; import io.entgra.device.mgt.core.policy.mgt.common.FeatureManagementException; -import io.entgra.device.mgt.core.policy.mgt.core.dao.FeatureDAO; -import io.entgra.device.mgt.core.policy.mgt.core.dao.FeatureManagerDAOException; -import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagementDAOFactory; -import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagerDAOException; -import io.entgra.device.mgt.core.policy.mgt.core.dao.ProfileDAO; -import io.entgra.device.mgt.core.policy.mgt.core.dao.ProfileManagerDAOException; +import io.entgra.device.mgt.core.policy.mgt.core.dao.*; import io.entgra.device.mgt.core.policy.mgt.core.mgt.FeatureManager; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.SQLException; import java.util.List; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/MonitoringManagerImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/MonitoringManagerImpl.java index a48e0848ef..01404cb8c8 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/MonitoringManagerImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/MonitoringManagerImpl.java @@ -18,8 +18,6 @@ package io.entgra.device.mgt.core.policy.mgt.core.mgt.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; @@ -40,15 +38,13 @@ import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProvide import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; import io.entgra.device.mgt.core.policy.mgt.common.monitor.ComplianceDecisionPoint; import io.entgra.device.mgt.core.policy.mgt.common.monitor.PolicyDeviceWrapper; -import io.entgra.device.mgt.core.policy.mgt.core.dao.MonitoringDAO; -import io.entgra.device.mgt.core.policy.mgt.core.dao.MonitoringDAOException; -import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyDAO; -import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagementDAOFactory; -import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagerDAOException; +import io.entgra.device.mgt.core.policy.mgt.core.dao.*; import io.entgra.device.mgt.core.policy.mgt.core.impl.ComplianceDecisionPointImpl; import io.entgra.device.mgt.core.policy.mgt.core.internal.PolicyManagementDataHolder; import io.entgra.device.mgt.core.policy.mgt.core.mgt.MonitoringManager; import io.entgra.device.mgt.core.policy.mgt.core.mgt.PolicyManager; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.SQLException; import java.util.ArrayList; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/PolicyManagerImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/PolicyManagerImpl.java index d588aaec55..e516095592 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/PolicyManagerImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/PolicyManagerImpl.java @@ -35,12 +35,8 @@ package io.entgra.device.mgt.core.policy.mgt.core.mgt.impl; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.DynamicTaskContext; import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.exceptions.InvalidDeviceException; @@ -48,12 +44,7 @@ import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupManagementException; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManagementException; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.CorrectiveAction; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.DeviceGroupWrapper; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.PolicyCriterion; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Profile; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.*; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; import io.entgra.device.mgt.core.device.mgt.core.config.policy.PolicyConfiguration; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.CommandOperation; @@ -64,28 +55,20 @@ import io.entgra.device.mgt.core.policy.mgt.common.Criterion; import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; import io.entgra.device.mgt.core.policy.mgt.common.ProfileManagementException; import io.entgra.device.mgt.core.policy.mgt.core.cache.impl.PolicyCacheManagerImpl; -import io.entgra.device.mgt.core.policy.mgt.core.dao.FeatureDAO; -import io.entgra.device.mgt.core.policy.mgt.core.dao.FeatureManagerDAOException; -import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyDAO; -import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagementDAOFactory; -import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagerDAOException; -import io.entgra.device.mgt.core.policy.mgt.core.dao.ProfileDAO; -import io.entgra.device.mgt.core.policy.mgt.core.dao.ProfileManagerDAOException; +import io.entgra.device.mgt.core.policy.mgt.core.dao.*; import io.entgra.device.mgt.core.policy.mgt.core.internal.PolicyManagementDataHolder; import io.entgra.device.mgt.core.policy.mgt.core.mgt.PolicyManager; import io.entgra.device.mgt.core.policy.mgt.core.mgt.ProfileManager; import io.entgra.device.mgt.core.policy.mgt.core.mgt.bean.UpdatedPolicyDeviceListBean; import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagementConstants; import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagerUtil; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.SQLException; import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; public class PolicyManagerImpl implements PolicyManager { diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/ProfileManagerImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/ProfileManagerImpl.java index e679c31493..6cb35f4a0a 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/ProfileManagerImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/ProfileManagerImpl.java @@ -18,19 +18,13 @@ package io.entgra.device.mgt.core.policy.mgt.core.mgt.impl; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.DynamicTaskContext; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Profile; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; import io.entgra.device.mgt.core.policy.mgt.common.ProfileManagementException; -import io.entgra.device.mgt.core.policy.mgt.core.dao.FeatureDAO; -import io.entgra.device.mgt.core.policy.mgt.core.dao.FeatureManagerDAOException; -import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagementDAOFactory; -import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagerDAOException; -import io.entgra.device.mgt.core.policy.mgt.core.dao.ProfileDAO; -import io.entgra.device.mgt.core.policy.mgt.core.dao.ProfileManagerDAOException; +import io.entgra.device.mgt.core.policy.mgt.core.dao.*; import io.entgra.device.mgt.core.policy.mgt.core.mgt.ProfileManager; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.sql.SQLException; import java.sql.Timestamp; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/task/MonitoringTask.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/task/MonitoringTask.java index a30f33a4a9..8d9673db56 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/task/MonitoringTask.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/task/MonitoringTask.java @@ -18,10 +18,6 @@ package io.entgra.device.mgt.core.policy.mgt.core.task; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.base.MultitenantConstants; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.PolicyMonitoringManager; @@ -31,6 +27,10 @@ import io.entgra.device.mgt.core.device.mgt.core.task.impl.DynamicPartitionedSch import io.entgra.device.mgt.core.policy.mgt.core.internal.PolicyManagementDataHolder; import io.entgra.device.mgt.core.policy.mgt.core.mgt.MonitoringManager; import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagementConstants; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.base.MultitenantConstants; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.util.ArrayList; import java.util.List; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/task/TaskScheduleServiceImpl.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/task/TaskScheduleServiceImpl.java index 25800dd02c..26b1300034 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/task/TaskScheduleServiceImpl.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/task/TaskScheduleServiceImpl.java @@ -19,19 +19,19 @@ package io.entgra.device.mgt.core.policy.mgt.core.task; +import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; +import io.entgra.device.mgt.core.device.mgt.core.config.policy.PolicyConfiguration; +import io.entgra.device.mgt.core.policy.mgt.common.PolicyMonitoringTaskException; +import io.entgra.device.mgt.core.policy.mgt.core.internal.PolicyManagementDataHolder; +import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagementConstants; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; -import io.entgra.device.mgt.core.device.mgt.core.config.policy.PolicyConfiguration; import org.wso2.carbon.ntask.common.TaskException; import org.wso2.carbon.ntask.core.TaskInfo; +import org.wso2.carbon.ntask.core.TaskInfo.TriggerInfo; import org.wso2.carbon.ntask.core.TaskManager; import org.wso2.carbon.ntask.core.service.TaskService; -import io.entgra.device.mgt.core.policy.mgt.common.PolicyMonitoringTaskException; -import io.entgra.device.mgt.core.policy.mgt.core.internal.PolicyManagementDataHolder; -import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagementConstants; -import org.wso2.carbon.ntask.core.TaskInfo.TriggerInfo; import java.util.HashMap; import java.util.Map; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/util/PolicyManagerUtil.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/util/PolicyManagerUtil.java index 6955c052f8..e0a2990891 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/util/PolicyManagerUtil.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/main/java/io/entgra/device/mgt/core/policy/mgt/core/util/PolicyManagerUtil.java @@ -36,13 +36,6 @@ package io.entgra.device.mgt.core.policy.mgt.core.util; import com.google.gson.Gson; -import org.apache.commons.lang.StringUtils; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.w3c.dom.Document; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationEntry; import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationManagementException; @@ -51,20 +44,24 @@ import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformCon import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.Operation; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.CorrectiveAction; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; import io.entgra.device.mgt.core.device.mgt.core.config.policy.PolicyConfiguration; import io.entgra.device.mgt.core.device.mgt.core.config.tenant.PlatformConfigurationManagementServiceImpl; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.PolicyOperation; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.ProfileOperation; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import io.entgra.device.mgt.core.policy.mgt.common.PolicyAdministratorPoint; import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; import io.entgra.device.mgt.core.policy.mgt.common.PolicyTransformException; import io.entgra.device.mgt.core.policy.mgt.core.config.datasource.DataSourceConfig; import io.entgra.device.mgt.core.policy.mgt.core.config.datasource.JNDILookupDefinition; import io.entgra.device.mgt.core.policy.mgt.core.dao.util.PolicyManagementDAOUtil; import io.entgra.device.mgt.core.policy.mgt.core.impl.PolicyAdministratorPointImpl; +import org.apache.commons.lang.StringUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.w3c.dom.Document; import javax.cache.Cache; import javax.cache.CacheManager; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/BasePolicyManagementDAOTest.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/BasePolicyManagementDAOTest.java index 6e79839d13..51f33a7ed4 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/BasePolicyManagementDAOTest.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/BasePolicyManagementDAOTest.java @@ -18,24 +18,6 @@ */ package io.entgra.device.mgt.core.policy.mgt.core; -import io.entgra.device.mgt.core.policy.mgt.common.PolicyEvaluationPoint; -import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; -import io.entgra.device.mgt.core.policy.mgt.core.common.DataSourceConfig; -import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagementDAOFactory; -import io.entgra.device.mgt.core.policy.mgt.core.internal.PolicyManagementDataHolder; -import io.entgra.device.mgt.core.policy.mgt.core.mgt.ProfileManager; -import io.entgra.device.mgt.core.policy.mgt.core.mgt.impl.ProfileManagerImpl; -import io.entgra.device.mgt.core.policy.mgt.core.services.SimplePolicyEvaluationTest; -import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagerUtil; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.tomcat.jdbc.pool.PoolProperties; -import org.testng.Assert; -import org.testng.annotations.BeforeSuite; -import org.testng.internal.collections.Pair; -import org.w3c.dom.Document; -import org.wso2.carbon.base.MultitenantConstants; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; @@ -57,6 +39,24 @@ import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProvide import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; import io.entgra.device.mgt.core.device.mgt.core.service.GroupManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.service.GroupManagementProviderServiceImpl; +import io.entgra.device.mgt.core.policy.mgt.common.PolicyEvaluationPoint; +import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; +import io.entgra.device.mgt.core.policy.mgt.core.common.DataSourceConfig; +import io.entgra.device.mgt.core.policy.mgt.core.dao.PolicyManagementDAOFactory; +import io.entgra.device.mgt.core.policy.mgt.core.internal.PolicyManagementDataHolder; +import io.entgra.device.mgt.core.policy.mgt.core.mgt.ProfileManager; +import io.entgra.device.mgt.core.policy.mgt.core.mgt.impl.ProfileManagerImpl; +import io.entgra.device.mgt.core.policy.mgt.core.services.SimplePolicyEvaluationTest; +import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagerUtil; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.tomcat.jdbc.pool.PoolProperties; +import org.testng.Assert; +import org.testng.annotations.BeforeSuite; +import org.testng.internal.collections.Pair; +import org.w3c.dom.Document; +import org.wso2.carbon.base.MultitenantConstants; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.registry.core.config.RegistryContext; import org.wso2.carbon.registry.core.exceptions.RegistryException; import org.wso2.carbon.registry.core.internal.RegistryDataHolder; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/MonitoringTestCase.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/MonitoringTestCase.java index 7ece16f38d..35b81cb6b8 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/MonitoringTestCase.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/MonitoringTestCase.java @@ -19,17 +19,6 @@ package io.entgra.device.mgt.core.policy.mgt.core; -import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; -import io.entgra.device.mgt.core.policy.mgt.core.internal.PolicyManagementDataHolder; -import io.entgra.device.mgt.core.policy.mgt.core.mgt.MonitoringManager; -import io.entgra.device.mgt.core.policy.mgt.core.mgt.PolicyManager; -import io.entgra.device.mgt.core.policy.mgt.core.mgt.impl.MonitoringManagerImpl; -import io.entgra.device.mgt.core.policy.mgt.core.mgt.impl.PolicyManagerImpl; -import io.entgra.device.mgt.core.policy.mgt.core.services.PolicyMonitoringManagerTest; -import junit.framework.Assert; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.testng.annotations.Test; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; @@ -42,6 +31,17 @@ import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.OperationManagerI import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; import io.entgra.device.mgt.core.device.mgt.core.service.GroupManagementProviderServiceImpl; +import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; +import io.entgra.device.mgt.core.policy.mgt.core.internal.PolicyManagementDataHolder; +import io.entgra.device.mgt.core.policy.mgt.core.mgt.MonitoringManager; +import io.entgra.device.mgt.core.policy.mgt.core.mgt.PolicyManager; +import io.entgra.device.mgt.core.policy.mgt.core.mgt.impl.MonitoringManagerImpl; +import io.entgra.device.mgt.core.policy.mgt.core.mgt.impl.PolicyManagerImpl; +import io.entgra.device.mgt.core.policy.mgt.core.services.PolicyMonitoringManagerTest; +import junit.framework.Assert; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.testng.annotations.Test; import java.util.List; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/PolicyDAOTestCase.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/PolicyDAOTestCase.java index 8d1f1a5b9f..6a3792bdb9 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/PolicyDAOTestCase.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/PolicyDAOTestCase.java @@ -17,18 +17,6 @@ */ package io.entgra.device.mgt.core.policy.mgt.core; -import io.entgra.device.mgt.core.policy.mgt.common.FeatureManagementException; -import io.entgra.device.mgt.core.policy.mgt.common.PolicyAdministratorPoint; -import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; -import io.entgra.device.mgt.core.policy.mgt.common.ProfileManagementException; -import io.entgra.device.mgt.core.policy.mgt.core.impl.PolicyAdministratorPointImpl; -import io.entgra.device.mgt.core.policy.mgt.core.internal.PolicyManagementDataHolder; -import io.entgra.device.mgt.core.policy.mgt.core.util.*; -import junit.framework.Assert; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.Feature; @@ -42,6 +30,18 @@ import io.entgra.device.mgt.core.device.mgt.core.dao.*; import io.entgra.device.mgt.core.device.mgt.core.dto.DeviceType; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; +import io.entgra.device.mgt.core.policy.mgt.common.FeatureManagementException; +import io.entgra.device.mgt.core.policy.mgt.common.PolicyAdministratorPoint; +import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; +import io.entgra.device.mgt.core.policy.mgt.common.ProfileManagementException; +import io.entgra.device.mgt.core.policy.mgt.core.impl.PolicyAdministratorPointImpl; +import io.entgra.device.mgt.core.policy.mgt.core.internal.PolicyManagementDataHolder; +import io.entgra.device.mgt.core.policy.mgt.core.util.*; +import junit.framework.Assert; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; import java.util.ArrayList; import java.util.List; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/PolicyEvaluationTestCase.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/PolicyEvaluationTestCase.java index fd8e2e0b32..3427185359 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/PolicyEvaluationTestCase.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/PolicyEvaluationTestCase.java @@ -19,6 +19,12 @@ package io.entgra.device.mgt.core.policy.mgt.core; +import io.entgra.device.mgt.core.device.mgt.common.Device; +import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; import io.entgra.device.mgt.core.policy.mgt.common.PolicyAdministratorPoint; import io.entgra.device.mgt.core.policy.mgt.common.PolicyEvaluationException; import io.entgra.device.mgt.core.policy.mgt.common.PolicyEvaluationPoint; @@ -31,12 +37,6 @@ import org.apache.commons.logging.LogFactory; import org.testng.annotations.BeforeClass; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderServiceImpl; import org.wso2.carbon.ntask.common.TaskException; import java.util.Collections; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/PolicyManagerServiceImplTest.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/PolicyManagerServiceImplTest.java index 6cd3da756a..ee27b3c281 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/PolicyManagerServiceImplTest.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/PolicyManagerServiceImplTest.java @@ -17,26 +17,6 @@ */ package io.entgra.device.mgt.core.policy.mgt.core; -import io.entgra.device.mgt.core.policy.mgt.common.FeatureManagementException; -import io.entgra.device.mgt.core.policy.mgt.common.PolicyEvaluationException; -import io.entgra.device.mgt.core.policy.mgt.common.PolicyEvaluationPoint; -import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; -import io.entgra.device.mgt.core.policy.mgt.core.enforcement.DelegationTask; -import io.entgra.device.mgt.core.policy.mgt.core.internal.PolicyManagementDataHolder; -import io.entgra.device.mgt.core.policy.mgt.core.mgt.MonitoringManager; -import io.entgra.device.mgt.core.policy.mgt.core.mgt.impl.MonitoringManagerImpl; -import io.entgra.device.mgt.core.policy.mgt.core.mock.TestHeartBeatManagementService; -import io.entgra.device.mgt.core.policy.mgt.core.mock.TypeXDeviceManagementService; -import io.entgra.device.mgt.core.policy.mgt.core.task.MonitoringTask; -import io.entgra.device.mgt.core.policy.mgt.core.task.TaskScheduleService; -import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagementConstants; -import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBeatManagementService; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.testng.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.common.Device; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; @@ -59,6 +39,26 @@ import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHo import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.OperationManagerImpl; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.PolicyOperation; import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.ProfileOperation; +import io.entgra.device.mgt.core.policy.mgt.common.FeatureManagementException; +import io.entgra.device.mgt.core.policy.mgt.common.PolicyEvaluationException; +import io.entgra.device.mgt.core.policy.mgt.common.PolicyEvaluationPoint; +import io.entgra.device.mgt.core.policy.mgt.common.PolicyManagementException; +import io.entgra.device.mgt.core.policy.mgt.core.enforcement.DelegationTask; +import io.entgra.device.mgt.core.policy.mgt.core.internal.PolicyManagementDataHolder; +import io.entgra.device.mgt.core.policy.mgt.core.mgt.MonitoringManager; +import io.entgra.device.mgt.core.policy.mgt.core.mgt.impl.MonitoringManagerImpl; +import io.entgra.device.mgt.core.policy.mgt.core.mock.TestHeartBeatManagementService; +import io.entgra.device.mgt.core.policy.mgt.core.mock.TypeXDeviceManagementService; +import io.entgra.device.mgt.core.policy.mgt.core.task.MonitoringTask; +import io.entgra.device.mgt.core.policy.mgt.core.task.TaskScheduleService; +import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagementConstants; +import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBeatManagementService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.wso2.carbon.context.PrivilegedCarbonContext; import java.sql.Timestamp; import java.util.ArrayList; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/FeatureManagerImplTest.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/FeatureManagerImplTest.java index e3e1e51589..431fc5c49d 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/FeatureManagerImplTest.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/FeatureManagerImplTest.java @@ -17,6 +17,14 @@ */ package io.entgra.device.mgt.core.policy.mgt.core.mgt.impl; +import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.IllegalTransactionStateException; +import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; +import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManager; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Profile; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; +import io.entgra.device.mgt.core.device.mgt.common.spi.DeviceManagementService; +import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.OperationManagerImpl; import io.entgra.device.mgt.core.policy.mgt.common.FeatureManagementException; import io.entgra.device.mgt.core.policy.mgt.core.BasePolicyManagementDAOTest; import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerServiceImpl; @@ -33,14 +41,6 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import org.testng.internal.collections.Pair; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.IllegalTransactionStateException; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManager; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Profile; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; -import io.entgra.device.mgt.core.device.mgt.common.spi.DeviceManagementService; -import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.OperationManagerImpl; import javax.sql.DataSource; import java.sql.Connection; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/MonitoringManagerImplTest.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/MonitoringManagerImplTest.java index 62173b4cef..3f3067cf28 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/MonitoringManagerImplTest.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/MonitoringManagerImplTest.java @@ -1,5 +1,20 @@ package io.entgra.device.mgt.core.policy.mgt.core.mgt.impl; +import io.entgra.device.mgt.core.device.mgt.common.Device; +import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.IllegalTransactionStateException; +import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; +import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManager; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.DeviceGroupWrapper; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Profile; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.ComplianceFeature; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.PolicyComplianceException; +import io.entgra.device.mgt.core.device.mgt.common.spi.DeviceManagementService; +import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.OperationManagerImpl; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import io.entgra.device.mgt.core.policy.mgt.core.BasePolicyManagementDAOTest; import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService; import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerServiceImpl; @@ -24,21 +39,6 @@ import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import org.testng.internal.collections.Pair; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.IllegalTransactionStateException; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManager; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.DeviceGroupWrapper; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Profile; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.ComplianceFeature; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.PolicyComplianceException; -import io.entgra.device.mgt.core.device.mgt.common.spi.DeviceManagementService; -import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.OperationManagerImpl; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; import javax.sql.DataSource; import java.lang.reflect.Field; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/ProfileManagerImplTest.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/ProfileManagerImplTest.java index 2bbb24a8cc..e8c92b29db 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/ProfileManagerImplTest.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/mgt/impl/ProfileManagerImplTest.java @@ -17,6 +17,14 @@ */ package io.entgra.device.mgt.core.policy.mgt.core.mgt.impl; +import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.IllegalTransactionStateException; +import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; +import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManager; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Profile; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; +import io.entgra.device.mgt.core.device.mgt.common.spi.DeviceManagementService; +import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.OperationManagerImpl; import io.entgra.device.mgt.core.policy.mgt.common.ProfileManagementException; import io.entgra.device.mgt.core.policy.mgt.core.BasePolicyManagementDAOTest; import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerServiceImpl; @@ -32,14 +40,6 @@ import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import org.testng.internal.collections.Pair; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.IllegalTransactionStateException; -import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup; -import io.entgra.device.mgt.core.device.mgt.common.operation.mgt.OperationManager; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Profile; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; -import io.entgra.device.mgt.core.device.mgt.common.spi.DeviceManagementService; -import io.entgra.device.mgt.core.device.mgt.core.operation.mgt.OperationManagerImpl; import javax.sql.DataSource; import java.sql.Connection; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/mock/TestHeartBeatManagementService.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/mock/TestHeartBeatManagementService.java index 13ec9c934c..5da0e3c402 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/mock/TestHeartBeatManagementService.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/mock/TestHeartBeatManagementService.java @@ -18,11 +18,11 @@ package io.entgra.device.mgt.core.policy.mgt.core.mock; +import io.entgra.device.mgt.core.device.mgt.common.ServerCtxInfo; import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.dto.HeartBeatEvent; import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.dto.ServerContext; import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.exception.HeartBeatManagementException; import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBeatManagementService; -import io.entgra.device.mgt.core.device.mgt.common.ServerCtxInfo; import java.util.Map; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/mock/TestPolicyMonitoringManager.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/mock/TestPolicyMonitoringManager.java index c861c3a73f..34c20ecc92 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/mock/TestPolicyMonitoringManager.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/mock/TestPolicyMonitoringManager.java @@ -17,14 +17,14 @@ */ package io.entgra.device.mgt.core.policy.mgt.core.mock; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.PolicyMonitoringManager; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.ComplianceFeature; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.NonComplianceData; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.PolicyComplianceException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.util.ArrayList; import java.util.List; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/services/PolicyMonitoringManagerTest.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/services/PolicyMonitoringManagerTest.java index d15fb90cdf..773dd89b11 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/services/PolicyMonitoringManagerTest.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/services/PolicyMonitoringManagerTest.java @@ -19,8 +19,6 @@ package io.entgra.device.mgt.core.policy.mgt.core.services; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.PolicyMonitoringManager; @@ -28,6 +26,8 @@ import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.ComplianceFeature; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.NonComplianceData; import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.monitor.PolicyComplianceException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.util.ArrayList; import java.util.List; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/services/SimplePolicyEvaluationTest.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/services/SimplePolicyEvaluationTest.java index 90c42d698d..5883432a87 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/services/SimplePolicyEvaluationTest.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/services/SimplePolicyEvaluationTest.java @@ -19,14 +19,14 @@ package io.entgra.device.mgt.core.policy.mgt.core.services; +import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; +import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; import io.entgra.device.mgt.core.policy.mgt.common.*; import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerService; import io.entgra.device.mgt.core.policy.mgt.core.PolicyManagerServiceImpl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; import java.util.Collections; import java.util.List; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/task/TaskSchedulerServiceImplTest.java b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/task/TaskSchedulerServiceImplTest.java index a9c65d77ad..ca025479fd 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/task/TaskSchedulerServiceImplTest.java +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/java/io/entgra/device/mgt/core/policy/mgt/core/task/TaskSchedulerServiceImplTest.java @@ -18,6 +18,8 @@ package io.entgra.device.mgt.core.policy.mgt.core.task; +import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; +import io.entgra.device.mgt.core.device.mgt.core.config.policy.PolicyConfiguration; import io.entgra.device.mgt.core.policy.mgt.common.PolicyMonitoringTaskException; import io.entgra.device.mgt.core.policy.mgt.core.internal.PolicyManagementDataHolder; import io.entgra.device.mgt.core.policy.mgt.core.util.PolicyManagementConstants; @@ -27,8 +29,6 @@ import org.mockito.Mockito; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; -import io.entgra.device.mgt.core.device.mgt.core.config.policy.PolicyConfiguration; import org.wso2.carbon.ntask.common.TaskException; import org.wso2.carbon.ntask.core.TaskInfo; import org.wso2.carbon.ntask.core.TaskManager; diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml index 897e33581c..2337c777e2 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml @@ -1,4 +1,4 @@ - + org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/resources/carbon-home/repository/conf/etc/tasks-config.xml b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/resources/carbon-home/repository/conf/etc/tasks-config.xml index dec2307f1d..bf7718b969 100644 --- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/resources/carbon-home/repository/conf/etc/tasks-config.xml +++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/src/test/resources/carbon-home/repository/conf/etc/tasks-config.xml @@ -1,4 +1,4 @@ - + - - - - - - - - - - - - - - - - - - - diff --git a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/pom.xml b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/pom.xml index 4349157706..e7a7c91ee0 100644 --- a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/pom.xml +++ b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/pom.xml @@ -33,13 +33,13 @@ - - org.apache.felix - maven-scr-plugin - org.apache.maven.plugins maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -53,37 +53,29 @@ Subtype Management Bundle io.entgra.device.mgt.core.subtype.mgt.internal + com.fasterxml.jackson.core;version="[2.10,3)", + com.google.common.cache;version="[31.0,32)", + io.entgra.device.mgt.core.device.mgt.common.exceptions;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.config;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.config.datasource;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.service;version="[5.0,6)", + io.entgra.device.mgt.core.subtype.mgt.cache, + io.entgra.device.mgt.core.subtype.mgt.dao, + io.entgra.device.mgt.core.subtype.mgt.dao.impl, + io.entgra.device.mgt.core.subtype.mgt.dao.util, + io.entgra.device.mgt.core.subtype.mgt.dto, + io.entgra.device.mgt.core.subtype.mgt.exception, + io.entgra.device.mgt.core.subtype.mgt.impl, + io.entgra.device.mgt.core.subtype.mgt.spi, + io.entgra.device.mgt.core.subtype.mgt.util, + javax.naming, + javax.sql, + org.apache.commons.logging;version="[1.2,2)", org.osgi.framework.*;version="${imp.package.version.osgi.framework}", org.osgi.service.*;version="${imp.package.version.osgi.service}", - org.apache.commons.logging, - org.apache.commons.lang, - javax.xml, - javax.xml.stream, - javax.xml.bind.*, - javax.sql, - javax.xml.parsers; version=0.0.0, - org.w3c.dom, - javax.naming, - org.wso2.carbon.context, - org.wso2.carbon.base, - org.wso2.carbon.utils.*, - io.entgra.device.mgt.core.device.mgt.common.*, - io.entgra.device.mgt.core.device.mgt.core.*, - org.wso2.carbon.ndatasource.core, - org.wso2.carbon.registry.core, - org.wso2.carbon.registry.core.session, - org.wso2.carbon.registry.core.service, - org.wso2.carbon.registry.api, - io.entgra.device.mgt.core.device.mgt.extensions.license.mgt.registry, - javax.net.ssl, - org.wso2.carbon.core.util, - okhttp3, - org.json.*, - com.google.gson.*, - com.fasterxml.jackson.core.*, - com.fasterxml.jackson.databind.*, - com.fasterxml.jackson.annotation.*, - com.google.common.cache.*, + org.wso2.carbon.context;version="[4.8,5)", + org.wso2.carbon.ndatasource.core;version="[4.8,5)", + org.wso2.carbon.registry.core.service;version="[1.0,2)" !io.entgra.device.mgt.core.subtype.mgt.internal, @@ -135,6 +127,11 @@ + + org.apache.felix + org.apache.felix.scr.ds-annotations + provided + io.entgra.device.mgt.core io.entgra.device.mgt.core.device.mgt.common @@ -164,10 +161,6 @@ org.codehaus.woodstox wstx-asl - - - - org.wso2.carbon.analytics org.wso2.carbon.analytics.api @@ -227,16 +220,6 @@ - - org.eclipse.osgi - org.eclipse.osgi - provided - - - org.eclipse.osgi - org.eclipse.osgi.services - provided - org.wso2.carbon org.wso2.carbon.core @@ -246,7 +229,6 @@ org.ops4j.pax.logging pax-logging-api provided - org.wso2.carbon @@ -341,19 +323,16 @@ com.google.guava guava - provided org.json.wso2 json - provided org.wso2.orbit.com.fasterxml.jackson.core jackson-databind - provided diff --git a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/cache/GetDeviceSubTypeCacheLoader.java b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/cache/GetDeviceSubTypeCacheLoader.java index 50350deadf..fab5e5f7a5 100644 --- a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/cache/GetDeviceSubTypeCacheLoader.java +++ b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/cache/GetDeviceSubTypeCacheLoader.java @@ -19,11 +19,11 @@ package io.entgra.device.mgt.core.subtype.mgt.cache; import com.google.common.cache.CacheLoader; -import io.entgra.device.mgt.core.subtype.mgt.dto.DeviceSubTypeCacheKey; import io.entgra.device.mgt.core.subtype.mgt.dao.DeviceSubTypeDAO; import io.entgra.device.mgt.core.subtype.mgt.dao.DeviceSubTypeDAOFactory; import io.entgra.device.mgt.core.subtype.mgt.dao.util.ConnectionManagerUtil; import io.entgra.device.mgt.core.subtype.mgt.dto.DeviceSubType; +import io.entgra.device.mgt.core.subtype.mgt.dto.DeviceSubTypeCacheKey; import io.entgra.device.mgt.core.subtype.mgt.exception.DBConnectionException; import io.entgra.device.mgt.core.subtype.mgt.exception.SubTypeMgtDAOException; import io.entgra.device.mgt.core.subtype.mgt.exception.SubTypeMgtPluginException; diff --git a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/dao/DeviceSubTypeDAO.java b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/dao/DeviceSubTypeDAO.java index 0ab0163d26..9b861e4b20 100644 --- a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/dao/DeviceSubTypeDAO.java +++ b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/dao/DeviceSubTypeDAO.java @@ -18,8 +18,8 @@ package io.entgra.device.mgt.core.subtype.mgt.dao; -import io.entgra.device.mgt.core.subtype.mgt.exception.SubTypeMgtDAOException; import io.entgra.device.mgt.core.subtype.mgt.dto.DeviceSubType; +import io.entgra.device.mgt.core.subtype.mgt.exception.SubTypeMgtDAOException; import java.util.List; diff --git a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/dao/DeviceSubTypeDAOFactory.java b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/dao/DeviceSubTypeDAOFactory.java index 88642b2360..882031d540 100644 --- a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/dao/DeviceSubTypeDAOFactory.java +++ b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/dao/DeviceSubTypeDAOFactory.java @@ -18,13 +18,13 @@ package io.entgra.device.mgt.core.subtype.mgt.dao; +import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; +import io.entgra.device.mgt.core.device.mgt.core.config.datasource.DataSourceConfig; import io.entgra.device.mgt.core.subtype.mgt.dao.impl.DeviceSubTypeDAOImpl; import io.entgra.device.mgt.core.subtype.mgt.dao.impl.DeviceSubTypeMySQLDAOImpl; +import io.entgra.device.mgt.core.subtype.mgt.dao.util.ConnectionManagerUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; -import io.entgra.device.mgt.core.subtype.mgt.dao.util.ConnectionManagerUtil; -import io.entgra.device.mgt.core.device.mgt.core.config.datasource.DataSourceConfig; public class DeviceSubTypeDAOFactory { private static final Log log = LogFactory.getLog(DeviceSubTypeDAOFactory.class); diff --git a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/dao/impl/DeviceSubTypeDAOImpl.java b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/dao/impl/DeviceSubTypeDAOImpl.java index a6aa286013..1c294747f4 100644 --- a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/dao/impl/DeviceSubTypeDAOImpl.java +++ b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/dao/impl/DeviceSubTypeDAOImpl.java @@ -18,12 +18,12 @@ package io.entgra.device.mgt.core.subtype.mgt.dao.impl; -import io.entgra.device.mgt.core.subtype.mgt.exception.DBConnectionException; -import io.entgra.device.mgt.core.subtype.mgt.exception.SubTypeMgtDAOException; import io.entgra.device.mgt.core.subtype.mgt.dao.DeviceSubTypeDAO; import io.entgra.device.mgt.core.subtype.mgt.dao.util.ConnectionManagerUtil; -import io.entgra.device.mgt.core.subtype.mgt.dto.DeviceSubType; import io.entgra.device.mgt.core.subtype.mgt.dao.util.DAOUtil; +import io.entgra.device.mgt.core.subtype.mgt.dto.DeviceSubType; +import io.entgra.device.mgt.core.subtype.mgt.exception.DBConnectionException; +import io.entgra.device.mgt.core.subtype.mgt.exception.SubTypeMgtDAOException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/dao/util/ConnectionManagerUtil.java b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/dao/util/ConnectionManagerUtil.java index da4e126730..bf7f3d8da0 100644 --- a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/dao/util/ConnectionManagerUtil.java +++ b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/dao/util/ConnectionManagerUtil.java @@ -18,12 +18,12 @@ package io.entgra.device.mgt.core.subtype.mgt.dao.util; -import io.entgra.device.mgt.core.subtype.mgt.exception.DBConnectionException; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.exceptions.IllegalTransactionStateException; import io.entgra.device.mgt.core.device.mgt.core.config.datasource.DataSourceConfig; import io.entgra.device.mgt.core.device.mgt.core.config.datasource.JNDILookupDefinition; +import io.entgra.device.mgt.core.subtype.mgt.exception.DBConnectionException; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import javax.naming.InitialContext; import javax.sql.DataSource; diff --git a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/impl/DeviceSubTypeServiceImpl.java b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/impl/DeviceSubTypeServiceImpl.java index bc5a4511bb..54c27535e5 100644 --- a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/impl/DeviceSubTypeServiceImpl.java +++ b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/impl/DeviceSubTypeServiceImpl.java @@ -22,16 +22,16 @@ import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; import io.entgra.device.mgt.core.subtype.mgt.cache.GetDeviceSubTypeCacheLoader; +import io.entgra.device.mgt.core.subtype.mgt.dao.DeviceSubTypeDAO; +import io.entgra.device.mgt.core.subtype.mgt.dao.DeviceSubTypeDAOFactory; +import io.entgra.device.mgt.core.subtype.mgt.dao.util.ConnectionManagerUtil; +import io.entgra.device.mgt.core.subtype.mgt.dto.DeviceSubType; import io.entgra.device.mgt.core.subtype.mgt.exception.BadRequestException; import io.entgra.device.mgt.core.subtype.mgt.exception.DBConnectionException; import io.entgra.device.mgt.core.subtype.mgt.exception.SubTypeMgtDAOException; import io.entgra.device.mgt.core.subtype.mgt.exception.SubTypeMgtPluginException; -import io.entgra.device.mgt.core.subtype.mgt.util.DeviceSubTypeMgtUtil; -import io.entgra.device.mgt.core.subtype.mgt.dto.DeviceSubType; -import io.entgra.device.mgt.core.subtype.mgt.dao.DeviceSubTypeDAO; -import io.entgra.device.mgt.core.subtype.mgt.dao.DeviceSubTypeDAOFactory; -import io.entgra.device.mgt.core.subtype.mgt.dao.util.ConnectionManagerUtil; import io.entgra.device.mgt.core.subtype.mgt.spi.DeviceSubTypeService; +import io.entgra.device.mgt.core.subtype.mgt.util.DeviceSubTypeMgtUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.CarbonContext; diff --git a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/internal/DeviceSubTypeMgtDataHolder.java b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/internal/DeviceSubTypeMgtDataHolder.java index fd091a63c9..b4fc94463a 100644 --- a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/internal/DeviceSubTypeMgtDataHolder.java +++ b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/internal/DeviceSubTypeMgtDataHolder.java @@ -18,8 +18,8 @@ package io.entgra.device.mgt.core.subtype.mgt.internal; -import io.entgra.device.mgt.core.subtype.mgt.spi.DeviceSubTypeService; import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import io.entgra.device.mgt.core.subtype.mgt.spi.DeviceSubTypeService; import org.wso2.carbon.registry.core.service.RegistryService; public class DeviceSubTypeMgtDataHolder { diff --git a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/internal/DeviceSubTypeMgtServiceComponent.java b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/internal/DeviceSubTypeMgtServiceComponent.java index c7e6ff632a..07a2474aee 100644 --- a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/internal/DeviceSubTypeMgtServiceComponent.java +++ b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/internal/DeviceSubTypeMgtServiceComponent.java @@ -18,45 +18,29 @@ package io.entgra.device.mgt.core.subtype.mgt.internal; +import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; +import io.entgra.device.mgt.core.device.mgt.core.config.DeviceManagementConfig; +import io.entgra.device.mgt.core.device.mgt.core.config.datasource.DataSourceConfig; +import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import io.entgra.device.mgt.core.subtype.mgt.dao.DeviceSubTypeDAOFactory; import io.entgra.device.mgt.core.subtype.mgt.impl.DeviceSubTypeServiceImpl; import io.entgra.device.mgt.core.subtype.mgt.spi.DeviceSubTypeService; -import io.entgra.device.mgt.core.subtype.mgt.dao.DeviceSubTypeDAOFactory; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleContext; import org.osgi.service.component.ComponentContext; -import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; -import io.entgra.device.mgt.core.device.mgt.core.config.DeviceManagementConfig; -import io.entgra.device.mgt.core.device.mgt.core.config.datasource.DataSourceConfig; -import io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService; +import org.osgi.service.component.annotations.*; import org.wso2.carbon.ndatasource.core.DataSourceService; import org.wso2.carbon.registry.core.service.RegistryService; -/** - * @scr.component name="io.entgra.device.mgt.core.subtype.mgt.internal.DeviceSubTypeMgtServiceComponent" immediate="true" - * @scr.reference name="org.wso2.carbon.device.manager" - * interface="io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService" - * cardinality="1..1" - * policy="dynamic" - * bind="setDeviceManagementService" - * unbind="unsetDeviceManagementService" - * @scr.reference name="org.wso2.carbon.ndatasource" - * interface="org.wso2.carbon.ndatasource.core.DataSourceService" - * cardinality="1..1" - * policy="dynamic" - * bind="setDataSourceService" - * unbind="unsetDataSourceService" - * @scr.reference name="registry.service" - * interface="org.wso2.carbon.registry.core.service.RegistryService" - * cardinality="0..1" - * policy="dynamic" - * bind="setRegistryService" - * unbind="unsetRegistryService" - */ +@Component( + name = "io.entgra.device.mgt.core.subtype.mgt.internal.DeviceSubTypeMgtServiceComponent", + immediate = true) public class DeviceSubTypeMgtServiceComponent { private static final Log log = LogFactory.getLog(DeviceSubTypeMgtServiceComponent.class); + @Activate protected void activate(ComponentContext componentContext) { if (log.isDebugEnabled()) { @@ -80,7 +64,7 @@ public class DeviceSubTypeMgtServiceComponent { log.error("Error occurred while activating Device SubType Management Service Component", e); } } - + @Deactivate protected void deactivate(ComponentContext componentContext) { if (log.isDebugEnabled()) { log.debug("De-activating Device SubType Management Service Component"); @@ -88,6 +72,12 @@ public class DeviceSubTypeMgtServiceComponent { } @SuppressWarnings("unused") + @Reference( + name = "data.mgt.provider.service", + service = io.entgra.device.mgt.core.device.mgt.core.service.DeviceManagementProviderService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetDeviceManagementService") protected void setDeviceManagementService(DeviceManagementProviderService deviceManagementProviderService) { if (log.isDebugEnabled()) { log.debug("Setting Device Management Service to Device SubType Mgt SC"); @@ -103,6 +93,12 @@ public class DeviceSubTypeMgtServiceComponent { DeviceSubTypeMgtDataHolder.getInstance().setDeviceManagementProviderService(null); } + @Reference( + name = "datasource.service", + service = org.wso2.carbon.ndatasource.core.DataSourceService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetDataSourceService") protected void setDataSourceService(DataSourceService dataSourceService) { /* This is to avoid mobile device management component getting initialized before the underlying datasources are registered */ @@ -118,7 +114,12 @@ public class DeviceSubTypeMgtServiceComponent { } } - + @Reference( + name = "registry.service", + service = org.wso2.carbon.registry.core.service.RegistryService.class, + cardinality = ReferenceCardinality.OPTIONAL, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetRegistryService") protected void setRegistryService(RegistryService registryService) { if (log.isDebugEnabled()) { log.debug("RegistryService set to Device SubType Mgt component"); diff --git a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/spi/DeviceSubTypeService.java b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/spi/DeviceSubTypeService.java index bcd412c80f..8e4f618edd 100644 --- a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/spi/DeviceSubTypeService.java +++ b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/spi/DeviceSubTypeService.java @@ -18,8 +18,8 @@ package io.entgra.device.mgt.core.subtype.mgt.spi; -import io.entgra.device.mgt.core.subtype.mgt.exception.SubTypeMgtPluginException; import io.entgra.device.mgt.core.subtype.mgt.dto.DeviceSubType; +import io.entgra.device.mgt.core.subtype.mgt.exception.SubTypeMgtPluginException; import java.util.List; diff --git a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/util/DeviceSubTypeMgtUtil.java b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/util/DeviceSubTypeMgtUtil.java index ed5216c663..a774d32147 100644 --- a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/util/DeviceSubTypeMgtUtil.java +++ b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/main/java/io/entgra/device/mgt/core/subtype/mgt/util/DeviceSubTypeMgtUtil.java @@ -18,8 +18,8 @@ package io.entgra.device.mgt.core.subtype.mgt.util; -import io.entgra.device.mgt.core.subtype.mgt.dto.DeviceSubTypeCacheKey; import io.entgra.device.mgt.core.subtype.mgt.dto.DeviceSubType; +import io.entgra.device.mgt.core.subtype.mgt.dto.DeviceSubTypeCacheKey; public class DeviceSubTypeMgtUtil { public static String setDeviceSubTypeCacheKey(int tenantId, String subTypeId, DeviceSubType.DeviceType deviceType) { diff --git a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/test/java/io/entgra/device/mgt/core/subtype/mgt/mock/BaseDeviceSubTypePluginTest.java b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/test/java/io/entgra/device/mgt/core/subtype/mgt/mock/BaseDeviceSubTypePluginTest.java index 3ef88509f4..c3563f76cb 100644 --- a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/test/java/io/entgra/device/mgt/core/subtype/mgt/mock/BaseDeviceSubTypePluginTest.java +++ b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/test/java/io/entgra/device/mgt/core/subtype/mgt/mock/BaseDeviceSubTypePluginTest.java @@ -18,9 +18,12 @@ package io.entgra.device.mgt.core.subtype.mgt.mock; +import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; +import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; +import io.entgra.device.mgt.core.subtype.mgt.DataSourceConfig; import io.entgra.device.mgt.core.subtype.mgt.TestUtils; import io.entgra.device.mgt.core.subtype.mgt.dao.DeviceSubTypeDAOFactory; -import io.entgra.device.mgt.core.subtype.mgt.DataSourceConfig; import io.entgra.device.mgt.core.subtype.mgt.dao.util.ConnectionManagerUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -32,9 +35,6 @@ import org.testng.annotations.Parameters; import org.w3c.dom.Document; import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; import javax.sql.DataSource; import javax.xml.bind.JAXBContext; diff --git a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/test/java/io/entgra/device/mgt/core/subtype/mgt/mock/MockConnection.java b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/test/java/io/entgra/device/mgt/core/subtype/mgt/mock/MockConnection.java index 0c57ddd085..2e66398c46 100644 --- a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/test/java/io/entgra/device/mgt/core/subtype/mgt/mock/MockConnection.java +++ b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/test/java/io/entgra/device/mgt/core/subtype/mgt/mock/MockConnection.java @@ -18,21 +18,7 @@ package io.entgra.device.mgt.core.subtype.mgt.mock; -import java.sql.CallableStatement; -import java.sql.SQLWarning; -import java.sql.Savepoint; -import java.sql.Connection; -import java.sql.PreparedStatement; -import java.sql.Statement; -import java.sql.Clob; -import java.sql.Blob; -import java.sql.NClob; -import java.sql.SQLXML; -import java.sql.Struct; -import java.sql.Array; -import java.sql.SQLClientInfoException; -import java.sql.DatabaseMetaData; -import java.sql.SQLException; +import java.sql.*; import java.util.ArrayList; import java.util.List; import java.util.Map; diff --git a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/test/java/io/entgra/device/mgt/core/subtype/mgt/mock/MockDatabaseMetaData.java b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/test/java/io/entgra/device/mgt/core/subtype/mgt/mock/MockDatabaseMetaData.java index 2888de59c3..018031fb16 100644 --- a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/test/java/io/entgra/device/mgt/core/subtype/mgt/mock/MockDatabaseMetaData.java +++ b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/test/java/io/entgra/device/mgt/core/subtype/mgt/mock/MockDatabaseMetaData.java @@ -20,11 +20,7 @@ package io.entgra.device.mgt.core.subtype.mgt.mock; import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.RowIdLifetime; -import java.sql.DatabaseMetaData; -import java.sql.SQLException; +import java.sql.*; public class MockDatabaseMetaData implements DatabaseMetaData { private final String url; diff --git a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/test/java/io/entgra/device/mgt/core/subtype/mgt/mock/MockResultSet.java b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/test/java/io/entgra/device/mgt/core/subtype/mgt/mock/MockResultSet.java index c040106fe8..299c668a2c 100644 --- a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/test/java/io/entgra/device/mgt/core/subtype/mgt/mock/MockResultSet.java +++ b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/test/java/io/entgra/device/mgt/core/subtype/mgt/mock/MockResultSet.java @@ -22,21 +22,7 @@ import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; import java.net.URL; -import java.sql.ResultSet; -import java.sql.SQLWarning; -import java.sql.Date; -import java.sql.Time; -import java.sql.Timestamp; -import java.sql.Clob; -import java.sql.Blob; -import java.sql.NClob; -import java.sql.SQLXML; -import java.sql.Ref; -import java.sql.Array; -import java.sql.ResultSetMetaData; -import java.sql.RowId; -import java.sql.Statement; -import java.sql.SQLException; +import java.sql.*; import java.util.ArrayList; import java.util.Calendar; import java.util.List; diff --git a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/test/java/io/entgra/device/mgt/core/subtype/mgt/mock/MockStatement.java b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/test/java/io/entgra/device/mgt/core/subtype/mgt/mock/MockStatement.java index 2d87ce2819..c041b37934 100644 --- a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/test/java/io/entgra/device/mgt/core/subtype/mgt/mock/MockStatement.java +++ b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/src/test/java/io/entgra/device/mgt/core/subtype/mgt/mock/MockStatement.java @@ -22,23 +22,7 @@ import java.io.InputStream; import java.io.Reader; import java.math.BigDecimal; import java.net.URL; -import java.sql.Connection; -import java.sql.ResultSet; -import java.sql.SQLWarning; -import java.sql.Date; -import java.sql.Time; -import java.sql.Timestamp; -import java.sql.PreparedStatement; -import java.sql.ParameterMetaData; -import java.sql.Clob; -import java.sql.Blob; -import java.sql.NClob; -import java.sql.SQLXML; -import java.sql.Ref; -import java.sql.Array; -import java.sql.ResultSetMetaData; -import java.sql.RowId; -import java.sql.SQLException; +import java.sql.*; import java.util.ArrayList; import java.util.Calendar; import java.util.List; diff --git a/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.common/pom.xml b/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.common/pom.xml index 6991abad15..12fbac8d4d 100755 --- a/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.common/pom.xml +++ b/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.common/pom.xml @@ -33,6 +33,14 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + org.apache.felix maven-bundle-plugin @@ -46,6 +54,10 @@ io.entgra.device.mgt.core.task.mgt.common.* + + io.entgra.device.mgt.core.task.mgt.common.bean, + io.entgra.device.mgt.core.task.mgt.common.exception + diff --git a/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.common/src/main/java/io/entgra/device/mgt/core/task/mgt/common/spi/TaskManagementService.java b/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.common/src/main/java/io/entgra/device/mgt/core/task/mgt/common/spi/TaskManagementService.java index 5c0b075477..fe8eff769d 100755 --- a/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.common/src/main/java/io/entgra/device/mgt/core/task/mgt/common/spi/TaskManagementService.java +++ b/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.common/src/main/java/io/entgra/device/mgt/core/task/mgt/common/spi/TaskManagementService.java @@ -18,8 +18,8 @@ package io.entgra.device.mgt.core.task.mgt.common.spi; import io.entgra.device.mgt.core.task.mgt.common.bean.DynamicTask; -import io.entgra.device.mgt.core.task.mgt.common.exception.TaskNotFoundException; import io.entgra.device.mgt.core.task.mgt.common.exception.TaskManagementException; +import io.entgra.device.mgt.core.task.mgt.common.exception.TaskNotFoundException; import java.util.List; diff --git a/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/pom.xml b/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/pom.xml index 8511e83f69..b4120513f3 100755 --- a/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/pom.xml +++ b/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/pom.xml @@ -35,8 +35,12 @@ - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -50,26 +54,36 @@ Task Management Core Bundle io.entgra.device.mgt.core.task.mgt.core.internal + com.google.gson;version="[2.9,3)", + io.entgra.device.mgt.core.device.mgt.common;version="[5.0,6)", + io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.exception;version="[5.0,6)", + io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service;version="[5.0,6)", + io.entgra.device.mgt.core.task.mgt.common.bean;version="[5.0,6)", + io.entgra.device.mgt.core.task.mgt.common.exception;version="[5.0,6)", + io.entgra.device.mgt.core.task.mgt.common.spi;version="[5.0,6)", + io.entgra.device.mgt.core.task.mgt.core.config, + io.entgra.device.mgt.core.task.mgt.core.config.datasource, + io.entgra.device.mgt.core.task.mgt.core.dao, + io.entgra.device.mgt.core.task.mgt.core.dao.common, + io.entgra.device.mgt.core.task.mgt.core.dao.impl, + io.entgra.device.mgt.core.task.mgt.core.dao.util, + javax.naming, + javax.sql, + javax.xml.bind;version="[0.0,1)", + javax.xml.bind.annotation;version="[0.0,1)", + javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}", + org.apache.commons.codec.digest;version="[1.4,2)", + org.apache.commons.lang;version="[2.4,3)", + org.apache.commons.logging;version="[1.2,2)", org.osgi.framework.*;version="${imp.package.version.osgi.framework}", org.osgi.service.*;version="${imp.package.version.osgi.service}", - org.apache.commons.logging, - org.wso2.carbon.ndatasource.core, org.w3c.dom, - javax.xml.bind.annotation, - javax.xml.bind, - javax.sql, - javax.naming, - io.entgra.device.mgt.core.task.mgt.common.*, - org.wso2.carbon.utils.*, - org.wso2.carbon.ntask.core.*, - org.wso2.carbon.ntask.common, - io.entgra.device.mgt.core.device.mgt.common.*, - org.wso2.carbon.context, - org.apache.commons.codec.binary;version="${commons-codec.wso2.osgi.version.range}", - org.apache.commons.codec.digest;version="${commons-codec.wso2.osgi.version.range}", - io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.dto, - io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.exception, - io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service, + org.wso2.carbon.context;version="[4.8,5)", + org.wso2.carbon.ndatasource.core;version="[4.8,5)", + org.wso2.carbon.ntask.common;version="[4.9,5)", + org.wso2.carbon.ntask.core;version="[4.9,5)", + org.wso2.carbon.ntask.core.service;version="[4.9,5)", + org.wso2.carbon.utils;version="[4.8,5)" !io.entgra.device.mgt.core.task.mgt.core.internal, @@ -83,13 +97,8 @@ - org.eclipse.osgi - org.eclipse.osgi - provided - - - org.eclipse.osgi - org.eclipse.osgi.services + org.apache.felix + org.apache.felix.scr.ds-annotations provided @@ -106,7 +115,6 @@ org.ops4j.pax.logging pax-logging-api provided - org.wso2.carbon diff --git a/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/config/TaskConfigurationManager.java b/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/config/TaskConfigurationManager.java index d245cf4cd2..55d2487e5f 100755 --- a/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/config/TaskConfigurationManager.java +++ b/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/config/TaskConfigurationManager.java @@ -17,9 +17,9 @@ */ package io.entgra.device.mgt.core.task.mgt.core.config; -import io.entgra.device.mgt.core.task.mgt.core.util.TaskManagementUtil; import io.entgra.device.mgt.core.task.mgt.common.constant.TaskMgtConstants; import io.entgra.device.mgt.core.task.mgt.common.exception.TaskManagementException; +import io.entgra.device.mgt.core.task.mgt.core.util.TaskManagementUtil; import org.w3c.dom.Document; import org.wso2.carbon.utils.CarbonUtils; diff --git a/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/dao/common/TaskManagementDAOFactory.java b/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/dao/common/TaskManagementDAOFactory.java index cf3bff0dc9..77dea7194f 100755 --- a/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/dao/common/TaskManagementDAOFactory.java +++ b/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/dao/common/TaskManagementDAOFactory.java @@ -17,7 +17,6 @@ */ package io.entgra.device.mgt.core.task.mgt.core.dao.common; -import io.entgra.device.mgt.core.task.mgt.core.dao.DynamicTaskPropDAO; import io.entgra.device.mgt.core.task.mgt.common.constant.TaskMgtConstants; import io.entgra.device.mgt.core.task.mgt.common.exception.IllegalTransactionStateException; import io.entgra.device.mgt.core.task.mgt.common.exception.TransactionManagementException; @@ -25,6 +24,7 @@ import io.entgra.device.mgt.core.task.mgt.common.exception.UnsupportedDatabaseEn import io.entgra.device.mgt.core.task.mgt.core.config.datasource.DataSourceConfig; import io.entgra.device.mgt.core.task.mgt.core.config.datasource.JNDILookupDefinition; import io.entgra.device.mgt.core.task.mgt.core.dao.DynamicTaskDAO; +import io.entgra.device.mgt.core.task.mgt.core.dao.DynamicTaskPropDAO; import io.entgra.device.mgt.core.task.mgt.core.dao.impl.DynamicTaskDAOImpl; import io.entgra.device.mgt.core.task.mgt.core.dao.impl.DynamicTaskPropDAOImpl; import io.entgra.device.mgt.core.task.mgt.core.dao.util.TaskManagementDAOUtil; diff --git a/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/dao/impl/DynamicTaskDAOImpl.java b/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/dao/impl/DynamicTaskDAOImpl.java index 90d73ca21b..067a76c380 100755 --- a/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/dao/impl/DynamicTaskDAOImpl.java +++ b/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/dao/impl/DynamicTaskDAOImpl.java @@ -17,11 +17,11 @@ */ package io.entgra.device.mgt.core.task.mgt.core.dao.impl; -import io.entgra.device.mgt.core.task.mgt.core.dao.common.TaskManagementDAOFactory; -import io.entgra.device.mgt.core.task.mgt.core.dao.util.TaskManagementDAOUtil; import io.entgra.device.mgt.core.task.mgt.common.bean.DynamicTask; import io.entgra.device.mgt.core.task.mgt.common.exception.TaskManagementDAOException; import io.entgra.device.mgt.core.task.mgt.core.dao.DynamicTaskDAO; +import io.entgra.device.mgt.core.task.mgt.core.dao.common.TaskManagementDAOFactory; +import io.entgra.device.mgt.core.task.mgt.core.dao.util.TaskManagementDAOUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; diff --git a/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/dao/impl/DynamicTaskPropDAOImpl.java b/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/dao/impl/DynamicTaskPropDAOImpl.java index fb613e683e..293934ed9b 100755 --- a/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/dao/impl/DynamicTaskPropDAOImpl.java +++ b/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/dao/impl/DynamicTaskPropDAOImpl.java @@ -17,11 +17,11 @@ */ package io.entgra.device.mgt.core.task.mgt.core.dao.impl; +import io.entgra.device.mgt.core.task.mgt.common.constant.TaskMgtConstants; +import io.entgra.device.mgt.core.task.mgt.common.exception.TaskManagementDAOException; import io.entgra.device.mgt.core.task.mgt.core.dao.DynamicTaskPropDAO; import io.entgra.device.mgt.core.task.mgt.core.dao.common.TaskManagementDAOFactory; import io.entgra.device.mgt.core.task.mgt.core.dao.util.TaskManagementDAOUtil; -import io.entgra.device.mgt.core.task.mgt.common.constant.TaskMgtConstants; -import io.entgra.device.mgt.core.task.mgt.common.exception.TaskManagementDAOException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; diff --git a/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/internal/TaskManagerServiceComponent.java b/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/internal/TaskManagerServiceComponent.java index 386aef3346..b7d6de0e2a 100755 --- a/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/internal/TaskManagerServiceComponent.java +++ b/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/internal/TaskManagerServiceComponent.java @@ -17,12 +17,12 @@ */ package io.entgra.device.mgt.core.task.mgt.core.internal; -import io.entgra.device.mgt.core.task.mgt.core.dao.common.TaskManagementDAOFactory; import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBeatManagementService; -import io.entgra.device.mgt.core.task.mgt.core.config.TaskManagementConfig; -import io.entgra.device.mgt.core.task.mgt.core.config.datasource.DataSourceConfig; import io.entgra.device.mgt.core.task.mgt.common.spi.TaskManagementService; import io.entgra.device.mgt.core.task.mgt.core.config.TaskConfigurationManager; +import io.entgra.device.mgt.core.task.mgt.core.config.TaskManagementConfig; +import io.entgra.device.mgt.core.task.mgt.core.config.datasource.DataSourceConfig; +import io.entgra.device.mgt.core.task.mgt.core.dao.common.TaskManagementDAOFactory; import io.entgra.device.mgt.core.task.mgt.core.service.TaskManagementServiceImpl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -30,32 +30,16 @@ import org.osgi.framework.BundleContext; import org.osgi.service.component.ComponentContext; import org.wso2.carbon.ndatasource.core.DataSourceService; import org.wso2.carbon.ntask.core.service.TaskService; +import org.osgi.service.component.annotations.*; -/** - * @scr.component name="io.entgra.task.mgt.service" immediate="true" - * @scr.reference name="datasource.service" - * interface="org.wso2.carbon.ndatasource.core.DataSourceService" - * cardinality="1..1" - * policy="dynamic" - * bind="setDataSourceService" - * unbind="unsetDataSourceService" - * @scr.reference name="app.mgt.ntask.component" - * interface="org.wso2.carbon.ntask.core.service.TaskService" - * cardinality="1..1" - * policy="dynamic" - * bind="setTaskService" - * unbind="unsetTaskService" - * @scr.reference name="entgra.heart.beat.service" - * interface="io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBeatManagementService" - * cardinality="0..1" - * policy="dynamic" - * bind="setHeartBeatService" - * unbind="unsetHeartBeatService" - */ +@Component( + name = "io.entgra.device.mgt.core.task.mgt.core.internal.TaskManagerServiceComponent", + immediate = true) public class TaskManagerServiceComponent { private static final Log log = LogFactory.getLog(TaskManagerServiceComponent.class); + @Activate protected void activate(ComponentContext ctx) { if (log.isDebugEnabled()) { @@ -80,13 +64,19 @@ public class TaskManagerServiceComponent { log.error("Error occurred while activating Task Manager Service Component", e); } } - + @Deactivate protected void deactivate(ComponentContext ctx) { if (log.isDebugEnabled()) { log.debug("De-activating Task Manager Service Component"); } } + @Reference( + name = "datasource.service", + service = org.wso2.carbon.ndatasource.core.DataSourceService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetDataSourceService") protected void setDataSourceService(DataSourceService dataSourceService) { /* This is to avoid Task Manager Service Component getting initialized before the underlying datasources are registered */ @@ -99,6 +89,12 @@ public class TaskManagerServiceComponent { //do nothing } + @Reference( + name = "task.service", + service = org.wso2.carbon.ntask.core.service.TaskService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetTaskService") @SuppressWarnings("unused") public void setTaskService(TaskService taskService) { if (log.isDebugEnabled()) { @@ -115,6 +111,12 @@ public class TaskManagerServiceComponent { TaskManagerDataHolder.getInstance().setnTaskService(null); } + @Reference( + name = "heartbeat.service", + service = io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBeatManagementService.class, + cardinality = ReferenceCardinality.OPTIONAL, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetHeartBeatService") @SuppressWarnings("unused") protected void setHeartBeatService(HeartBeatManagementService heartBeatService) { if (log.isDebugEnabled()) { diff --git a/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/service/TaskManagementServiceImpl.java b/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/service/TaskManagementServiceImpl.java index 80b757514f..b4858f3ba2 100755 --- a/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/service/TaskManagementServiceImpl.java +++ b/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/src/main/java/io/entgra/device/mgt/core/task/mgt/core/service/TaskManagementServiceImpl.java @@ -17,10 +17,6 @@ */ package io.entgra.device.mgt.core.task.mgt.core.service; -import io.entgra.device.mgt.core.task.mgt.core.dao.DynamicTaskPropDAO; -import io.entgra.device.mgt.core.task.mgt.core.dao.common.TaskManagementDAOFactory; -import io.entgra.device.mgt.core.task.mgt.core.internal.TaskManagerDataHolder; -import io.entgra.device.mgt.core.task.mgt.core.util.TaskManagementUtil; import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.exception.HeartBeatManagementException; import io.entgra.device.mgt.core.task.mgt.common.bean.DynamicTask; import io.entgra.device.mgt.core.task.mgt.common.constant.TaskMgtConstants; @@ -30,6 +26,10 @@ import io.entgra.device.mgt.core.task.mgt.common.exception.TaskNotFoundException import io.entgra.device.mgt.core.task.mgt.common.exception.TransactionManagementException; import io.entgra.device.mgt.core.task.mgt.common.spi.TaskManagementService; import io.entgra.device.mgt.core.task.mgt.core.dao.DynamicTaskDAO; +import io.entgra.device.mgt.core.task.mgt.core.dao.DynamicTaskPropDAO; +import io.entgra.device.mgt.core.task.mgt.core.dao.common.TaskManagementDAOFactory; +import io.entgra.device.mgt.core.task.mgt.core.internal.TaskManagerDataHolder; +import io.entgra.device.mgt.core.task.mgt.core.util.TaskManagementUtil; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/components/task-mgt/task-watcher/io.entgra.device.mgt.core.task.mgt.watcher/pom.xml b/components/task-mgt/task-watcher/io.entgra.device.mgt.core.task.mgt.watcher/pom.xml index 1011141e50..628dcad436 100755 --- a/components/task-mgt/task-watcher/io.entgra.device.mgt.core.task.mgt.watcher/pom.xml +++ b/components/task-mgt/task-watcher/io.entgra.device.mgt.core.task.mgt.watcher/pom.xml @@ -35,8 +35,12 @@ - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -50,18 +54,27 @@ Task Watcher Bundle io.entgra.device.mgt.core.task.mgt.watcher.internal - io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.*, - io.entgra.device.mgt.core.task.mgt.common.*, - io.entgra.device.mgt.core.task.mgt.core.*, - org.apache.commons.logging, + io.entgra.device.mgt.core.device.mgt.common;version="[5.0,6)", + io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.exception;version="[5.0,6)", + io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service;version="[5.0,6)", + io.entgra.device.mgt.core.task.mgt.common.bean;version="[5.0,6)", + io.entgra.device.mgt.core.task.mgt.common.exception;version="[5.0,6)", + io.entgra.device.mgt.core.task.mgt.common.spi;version="[5.0,6)", + io.entgra.device.mgt.core.task.mgt.core.config;version="[5.0,6)", + io.entgra.device.mgt.core.task.mgt.core.util;version="[5.0,6)", + io.entgra.device.mgt.core.task.mgt.watcher, + io.entgra.device.mgt.core.task.mgt.watcher.internal, + org.apache.commons.logging;version="[1.2,2)", org.osgi.framework.*;version="${imp.package.version.osgi.framework}", org.osgi.service.*;version="${imp.package.version.osgi.service}", - org.wso2.carbon.context, - org.wso2.carbon.core, - io.entgra.device.mgt.core.device.mgt.common.*, - org.wso2.carbon.ntask.*, - org.wso2.carbon.user.api, - org.wso2.carbon.user.core.*, + org.wso2.carbon.context;version="[4.8,5)", + org.wso2.carbon.core;version="[4.8,5)", + org.wso2.carbon.ntask.common;version="[4.9,5)", + org.wso2.carbon.ntask.core;version="[4.9,5)", + org.wso2.carbon.ntask.core.service;version="[4.9,5)", + org.wso2.carbon.user.api;version="[1.0,2)", + org.wso2.carbon.user.core.service;version="[4.8,5)", + org.wso2.carbon.user.core.tenant;version="[4.8,5)" io.entgra.device.mgt.core.task.mgt.watcher.* @@ -74,20 +87,14 @@ - org.eclipse.osgi - org.eclipse.osgi - provided - - - org.eclipse.osgi - org.eclipse.osgi.services + org.apache.felix + org.apache.felix.scr.ds-annotations provided org.ops4j.pax.logging pax-logging-api provided - io.entgra.device.mgt.core diff --git a/components/task-mgt/task-watcher/io.entgra.device.mgt.core.task.mgt.watcher/src/main/java/io/entgra/device/mgt/core/task/mgt/watcher/IoTSStartupHandler.java b/components/task-mgt/task-watcher/io.entgra.device.mgt.core.task.mgt.watcher/src/main/java/io/entgra/device/mgt/core/task/mgt/watcher/IoTSStartupHandler.java index c7ac374b80..eb23f5b824 100755 --- a/components/task-mgt/task-watcher/io.entgra.device.mgt.core.task.mgt.watcher/src/main/java/io/entgra/device/mgt/core/task/mgt/watcher/IoTSStartupHandler.java +++ b/components/task-mgt/task-watcher/io.entgra.device.mgt.core.task.mgt.watcher/src/main/java/io/entgra/device/mgt/core/task/mgt/watcher/IoTSStartupHandler.java @@ -36,14 +36,7 @@ import org.wso2.carbon.user.api.Tenant; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.core.service.RealmService; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Timer; -import java.util.TimerTask; +import java.util.*; public class IoTSStartupHandler implements ServerStartupObserver { private static final Log log = LogFactory.getLog(IoTSStartupHandler.class); diff --git a/components/task-mgt/task-watcher/io.entgra.device.mgt.core.task.mgt.watcher/src/main/java/io/entgra/device/mgt/core/task/mgt/watcher/internal/TaskWatcherServiceComponent.java b/components/task-mgt/task-watcher/io.entgra.device.mgt.core.task.mgt.watcher/src/main/java/io/entgra/device/mgt/core/task/mgt/watcher/internal/TaskWatcherServiceComponent.java index 876edb5b25..899d0f0338 100755 --- a/components/task-mgt/task-watcher/io.entgra.device.mgt.core.task.mgt.watcher/src/main/java/io/entgra/device/mgt/core/task/mgt/watcher/internal/TaskWatcherServiceComponent.java +++ b/components/task-mgt/task-watcher/io.entgra.device.mgt.core.task.mgt.watcher/src/main/java/io/entgra/device/mgt/core/task/mgt/watcher/internal/TaskWatcherServiceComponent.java @@ -17,11 +17,11 @@ */ package io.entgra.device.mgt.core.task.mgt.watcher.internal; +import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBeatManagementService; import io.entgra.device.mgt.core.task.mgt.common.spi.TaskManagementService; import io.entgra.device.mgt.core.task.mgt.core.config.TaskConfigurationManager; import io.entgra.device.mgt.core.task.mgt.core.config.TaskManagementConfig; import io.entgra.device.mgt.core.task.mgt.watcher.IoTSStartupHandler; -import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBeatManagementService; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleContext; @@ -29,39 +29,16 @@ import org.osgi.service.component.ComponentContext; import org.wso2.carbon.core.ServerStartupObserver; import org.wso2.carbon.ntask.core.service.TaskService; import org.wso2.carbon.user.core.service.RealmService; +import org.osgi.service.component.annotations.*; -/** - * @scr.component - * name="io.entgra.device.mgt.core.task.mgt.watcher" immediate="true" - * @scr.reference name="app.mgt.ntask.component" - * interface="org.wso2.carbon.ntask.core.service.TaskService" - * cardinality="1..1" - * policy="dynamic" - * bind="setTaskService" - * unbind="unsetTaskService" - * @scr.reference name="io.entgra.task.mgt.service" - * interface="io.entgra.device.mgt.core.task.mgt.common.spi.TaskManagementService" - * cardinality="1..1" - * policy="dynamic" - * bind="setTaskMgtService" - * unbind="unsetTaskMgtService" - * @scr.reference name="entgra.heart.beat.service" - * interface="io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBeatManagementService" - * cardinality="0..1" - * policy="dynamic" - * bind="setHeartBeatService" - * unbind="unsetHeartBeatService" - * @scr.reference name="user.realmservice.default" - * interface="org.wso2.carbon.user.core.service.RealmService" - * cardinality="1..1" - * policy="dynamic" - * bind="setRealmService" - * unbind="unsetRealmService" - */ +@Component( + name = "io.entgra.device.mgt.core.task.mgt.watcher.internal.TaskWatcherServiceComponent", + immediate = true) public class TaskWatcherServiceComponent { private static final Log log = LogFactory.getLog(TaskWatcherServiceComponent.class); + @Activate protected void activate(ComponentContext ctx) { if (log.isDebugEnabled()) { log.debug("Activating Task Watcher Service Component"); @@ -83,7 +60,7 @@ public class TaskWatcherServiceComponent { log.error("Error occurred while activating Task Watcher Service Component", e); } } - + @Deactivate protected void deactivate(ComponentContext ctx) { if (log.isDebugEnabled()) { log.debug("De-activating Task Watcher Service Component"); @@ -91,6 +68,12 @@ public class TaskWatcherServiceComponent { } @SuppressWarnings("unused") + @Reference( + name = "task.service", + service = org.wso2.carbon.ntask.core.service.TaskService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetTaskService") public void setTaskService(TaskService taskService) { if (log.isDebugEnabled()) { log.debug("Setting the task service to Task Watcher Service Component "); @@ -107,6 +90,12 @@ public class TaskWatcherServiceComponent { } @SuppressWarnings("unused") + @Reference( + name = "task.mgt.service", + service = io.entgra.device.mgt.core.task.mgt.common.spi.TaskManagementService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetTaskMgtService") protected void setTaskMgtService(TaskManagementService taskManagementService) { if (log.isDebugEnabled()) { log.debug("Setting the task service to Task Watcher Service Component "); @@ -121,6 +110,12 @@ public class TaskWatcherServiceComponent { } TaskWatcherDataHolder.getInstance().setTaskManagementService(null); } + @Reference( + name = "heartbeat.service", + service = io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBeatManagementService.class, + cardinality = ReferenceCardinality.OPTIONAL, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetHeartBeatService") @SuppressWarnings("unused") protected void setHeartBeatService(HeartBeatManagementService heartBeatService) { @@ -144,6 +139,12 @@ public class TaskWatcherServiceComponent { * @param realmService An instance of RealmService */ @SuppressWarnings("unused") + @Reference( + name = "realm.service", + service = org.wso2.carbon.user.core.service.RealmService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetRealmService") protected void setRealmService(RealmService realmService) { if (log.isDebugEnabled()) { log.debug("Setting Realm Service"); diff --git a/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.common/pom.xml b/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.common/pom.xml index 6b1aec0fc7..fdd9fab4cc 100644 --- a/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.common/pom.xml +++ b/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.common/pom.xml @@ -32,6 +32,14 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + org.apache.felix maven-bundle-plugin @@ -43,8 +51,8 @@ ${io.entgra.device.mgt.core.version} Tenant Management Common Bundle - org.apache.commons.logging, - org.wso2.carbon.stratos.common.beans + io.entgra.device.mgt.core.tenant.mgt.common.exception, + org.wso2.carbon.stratos.common.beans;version="[4.9,5)" io.entgra.device.mgt.core.tenant.mgt.common.* diff --git a/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/pom.xml b/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/pom.xml index e8f306be23..a03cbc362b 100644 --- a/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/pom.xml +++ b/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/pom.xml @@ -33,8 +33,12 @@ - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -48,26 +52,29 @@ Tenant Management Core Bundle io.entgra.device.mgt.core.tenant.mgt.core.internal + io.entgra.device.mgt.core.application.mgt.common.exception;version="[5.0,6)", + io.entgra.device.mgt.core.application.mgt.common.services;version="[5.0,6)", + io.entgra.device.mgt.core.application.mgt.core.config;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.exceptions;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.metadata.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.permission.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.roles.config;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.config;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.metadata.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.permission.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.tenant.mgt.common.exception;version="[5.0,6)", + io.entgra.device.mgt.core.tenant.mgt.common.spi;version="[5.0,6)", + io.entgra.device.mgt.core.tenant.mgt.core, + org.apache.commons.logging;version="[1.2,2)", org.osgi.framework.*;version="${imp.package.version.osgi.framework}", org.osgi.service.*;version="${imp.package.version.osgi.service}", - org.apache.commons.logging, - io.entgra.device.mgt.core.application.mgt.common.*, - io.entgra.device.mgt.core.application.mgt.core.config, - io.entgra.device.mgt.core.device.mgt.core, - org.wso2.carbon.user.api, - org.wso2.carbon.registry.core.exceptions, - io.entgra.device.mgt.core.tenant.mgt.common.*, - org.wso2.carbon.stratos.common.beans, - org.wso2.carbon.stratos.common.exception, - org.wso2.carbon.stratos.common.listeners, - io.entgra.device.mgt.core.device.mgt.common.metadata.mgt, - io.entgra.device.mgt.core.device.mgt.common.exceptions, - io.entgra.device.mgt.core.device.mgt.common.permission.mgt, - io.entgra.device.mgt.core.device.mgt.common.roles.config, - io.entgra.device.mgt.core.device.mgt.core.metadata.mgt, - io.entgra.device.mgt.core.device.mgt.core.config, - org.wso2.carbon.user.core.service, - org.wso2.carbon.context + org.wso2.carbon.context;version="[4.8,5)", + org.wso2.carbon.registry.core.exceptions;version="[1.0,2)", + org.wso2.carbon.stratos.common.beans;version="[4.9,5)", + org.wso2.carbon.stratos.common.exception;version="[4.9,5)", + org.wso2.carbon.stratos.common.listeners;version="[4.9,5)", + org.wso2.carbon.user.api;version="[1.0,2)", + org.wso2.carbon.user.core.service;version="[4.8,5)" !io.entgra.device.mgt.core.tenant.mgt.core.internal, @@ -81,12 +88,9 @@ - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.osgi - org.eclipse.osgi.services + org.apache.felix + org.apache.felix.scr.ds-annotations + provided org.wso2.carbon.commons diff --git a/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/src/main/java/io/entgra/device/mgt/core/tenant/mgt/core/impl/TenantManagerImpl.java b/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/src/main/java/io/entgra/device/mgt/core/tenant/mgt/core/impl/TenantManagerImpl.java index 4296031c88..e759e33e1d 100644 --- a/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/src/main/java/io/entgra/device/mgt/core/tenant/mgt/core/impl/TenantManagerImpl.java +++ b/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/src/main/java/io/entgra/device/mgt/core/tenant/mgt/core/impl/TenantManagerImpl.java @@ -18,23 +18,23 @@ package io.entgra.device.mgt.core.tenant.mgt.core.impl; import io.entgra.device.mgt.core.application.mgt.common.exception.ApplicationManagementException; -import io.entgra.device.mgt.core.application.mgt.core.config.ConfigurationManager; import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationManager; -import io.entgra.device.mgt.core.tenant.mgt.core.TenantManager; +import io.entgra.device.mgt.core.application.mgt.core.config.ConfigurationManager; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.MetadataManagementException; +import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagementException; +import io.entgra.device.mgt.core.device.mgt.common.roles.config.Role; +import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; +import io.entgra.device.mgt.core.device.mgt.core.config.DeviceManagementConfig; +import io.entgra.device.mgt.core.device.mgt.core.permission.mgt.PermissionUtils; import io.entgra.device.mgt.core.tenant.mgt.common.exception.TenantMgtException; +import io.entgra.device.mgt.core.tenant.mgt.core.TenantManager; import io.entgra.device.mgt.core.tenant.mgt.core.internal.TenantMgtDataHolder; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; -import io.entgra.device.mgt.core.device.mgt.core.config.DeviceManagementConfig; -import io.entgra.device.mgt.core.device.mgt.core.permission.mgt.PermissionUtils; import org.wso2.carbon.registry.core.exceptions.RegistryException; import org.wso2.carbon.stratos.common.beans.TenantInfoBean; import org.wso2.carbon.user.api.Permission; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.MetadataManagementException; -import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagementException; -import io.entgra.device.mgt.core.device.mgt.common.roles.config.Role; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.api.UserStoreManager; diff --git a/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/src/main/java/io/entgra/device/mgt/core/tenant/mgt/core/impl/TenantManagerServiceImpl.java b/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/src/main/java/io/entgra/device/mgt/core/tenant/mgt/core/impl/TenantManagerServiceImpl.java index 9013d534d9..8d130b6400 100644 --- a/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/src/main/java/io/entgra/device/mgt/core/tenant/mgt/core/impl/TenantManagerServiceImpl.java +++ b/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/src/main/java/io/entgra/device/mgt/core/tenant/mgt/core/impl/TenantManagerServiceImpl.java @@ -17,8 +17,8 @@ */ package io.entgra.device.mgt.core.tenant.mgt.core.impl; -import io.entgra.device.mgt.core.tenant.mgt.common.spi.TenantManagerService; import io.entgra.device.mgt.core.tenant.mgt.common.exception.TenantMgtException; +import io.entgra.device.mgt.core.tenant.mgt.common.spi.TenantManagerService; import io.entgra.device.mgt.core.tenant.mgt.core.internal.TenantMgtDataHolder; import org.wso2.carbon.stratos.common.beans.TenantInfoBean; diff --git a/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/src/main/java/io/entgra/device/mgt/core/tenant/mgt/core/internal/TenantMgtDataHolder.java b/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/src/main/java/io/entgra/device/mgt/core/tenant/mgt/core/internal/TenantMgtDataHolder.java index 0e301d6f8c..1b91bb57a0 100644 --- a/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/src/main/java/io/entgra/device/mgt/core/tenant/mgt/core/internal/TenantMgtDataHolder.java +++ b/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/src/main/java/io/entgra/device/mgt/core/tenant/mgt/core/internal/TenantMgtDataHolder.java @@ -18,8 +18,8 @@ package io.entgra.device.mgt.core.tenant.mgt.core.internal; import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationManager; -import io.entgra.device.mgt.core.tenant.mgt.core.TenantManager; import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.WhiteLabelManagementService; +import io.entgra.device.mgt.core.tenant.mgt.core.TenantManager; import org.wso2.carbon.user.core.service.RealmService; public class TenantMgtDataHolder { diff --git a/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/src/main/java/io/entgra/device/mgt/core/tenant/mgt/core/internal/TenantMgtServiceComponent.java b/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/src/main/java/io/entgra/device/mgt/core/tenant/mgt/core/internal/TenantMgtServiceComponent.java index 2fc6590ecd..bde5506a22 100644 --- a/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/src/main/java/io/entgra/device/mgt/core/tenant/mgt/core/internal/TenantMgtServiceComponent.java +++ b/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/src/main/java/io/entgra/device/mgt/core/tenant/mgt/core/internal/TenantMgtServiceComponent.java @@ -18,6 +18,8 @@ package io.entgra.device.mgt.core.tenant.mgt.core.internal; import io.entgra.device.mgt.core.application.mgt.common.services.ApplicationManager; +import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.WhiteLabelManagementService; +import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.WhiteLabelManagementServiceImpl; import io.entgra.device.mgt.core.tenant.mgt.common.spi.TenantManagerService; import io.entgra.device.mgt.core.tenant.mgt.core.TenantManager; import io.entgra.device.mgt.core.tenant.mgt.core.impl.TenantManagerImpl; @@ -26,33 +28,20 @@ import io.entgra.device.mgt.core.tenant.mgt.core.listener.DeviceMgtTenantListene import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.service.component.ComponentContext; -import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.WhiteLabelManagementService; -import io.entgra.device.mgt.core.device.mgt.core.metadata.mgt.WhiteLabelManagementServiceImpl; +import org.osgi.service.component.annotations.*; import org.wso2.carbon.stratos.common.listeners.TenantMgtListener; import org.wso2.carbon.user.core.service.RealmService; -/** - * @scr.component name="io.entgra.device.mgt.core.tenant.manager" immediate="true" - * @scr.reference name="org.wso2.carbon.application.mgt.service" - * interface="io.entgra.device.mgt.core.application.mgt.common.services.ApplicationManager" - * cardinality="1..1" - * policy="dynamic" - * bind="setApplicationManager" - * unbind="unsetApplicationManager" - * @scr.reference name="user.realmservice.default" - * interface="org.wso2.carbon.user.core.service.RealmService" - * cardinality="1..1" - * policy="dynamic" - * bind="setRealmService" - * unbind="unsetRealmService" - */ - +@Component( + name = "io.entgra.device.mgt.core.tenant.mgt.core.internal.TenantMgtServiceComponent", + immediate = true) @SuppressWarnings("unused") public class TenantMgtServiceComponent { private static final Log log = LogFactory.getLog(TenantManagerService.class); @SuppressWarnings("unused") + @Activate protected void activate(ComponentContext componentContext) { try { TenantManagerService tenantManagerService = new TenantManagerServiceImpl(); @@ -80,10 +69,17 @@ public class TenantMgtServiceComponent { } @SuppressWarnings("unused") + @Deactivate protected void deactivate(ComponentContext componentContext) { // nothing to do } + @Reference( + name = "application.mgr", + service = io.entgra.device.mgt.core.application.mgt.common.services.ApplicationManager.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetApplicationManager") protected void setApplicationManager(ApplicationManager applicationManager) { if(log.isDebugEnabled()) { log.info("Application manager service is binding"); @@ -98,6 +94,12 @@ public class TenantMgtServiceComponent { TenantMgtDataHolder.getInstance().setApplicationManager(null); } + @Reference( + name = "realm.service", + service = org.wso2.carbon.user.core.service.RealmService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetRealmService") protected void setRealmService(RealmService realmService) { if(log.isDebugEnabled()) { log.info("Realm Service service is binding"); diff --git a/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/src/main/java/io/entgra/device/mgt/core/tenant/mgt/core/listener/DeviceMgtTenantListener.java b/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/src/main/java/io/entgra/device/mgt/core/tenant/mgt/core/listener/DeviceMgtTenantListener.java index baaef87785..e121f21a4d 100644 --- a/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/src/main/java/io/entgra/device/mgt/core/tenant/mgt/core/listener/DeviceMgtTenantListener.java +++ b/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/src/main/java/io/entgra/device/mgt/core/tenant/mgt/core/listener/DeviceMgtTenantListener.java @@ -17,8 +17,8 @@ */ package io.entgra.device.mgt.core.tenant.mgt.core.listener; -import io.entgra.device.mgt.core.tenant.mgt.core.TenantManager; import io.entgra.device.mgt.core.tenant.mgt.common.exception.TenantMgtException; +import io.entgra.device.mgt.core.tenant.mgt.core.TenantManager; import io.entgra.device.mgt.core.tenant.mgt.core.internal.TenantMgtDataHolder; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/pom.xml b/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/pom.xml index b25f17413a..5fa628f088 100644 --- a/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/pom.xml +++ b/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/pom.xml @@ -31,13 +31,17 @@ bundle WSO2 Carbon - Email Sender Core WSO2 Carbon - Email Sender Core - http://wso2.org + https://entgra.io - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -51,27 +55,33 @@ Email Management Core Bundle io.entgra.device.mgt.core.transport.mgt.email.sender.core.internal - org.apache.axis2.*;version="${axis2.osgi.version.range}", - org.apache.axiom.*; version="${axiom.osgi.version.range}", + io.entgra.device.mgt.core.transport.mgt.email.sender.core, + javax.xml.bind;version="[0.0,1)", + javax.xml.bind.annotation;version="[0.0,1)", + javax.xml.parsers, + javax.xml.stream;version="[1.0,2)", + org.apache.axiom.om;version="[1.2,2)", + org.apache.axiom.om.impl.llom.util;version="[1.2,2)", + org.apache.axis2;version="[1.6,2)", + org.apache.axis2.addressing;version="[1.6,2)", + org.apache.axis2.client;version="[1.6,2)", + org.apache.axis2.context;version="[1.6,2)", + org.apache.axis2.description;version="[1.6,2)", + org.apache.axis2.engine;version="[1.6,2)", + org.apache.commons.io;version="[2.4,3)", + org.apache.commons.logging;version="[1.2,2)", + org.apache.velocity;version="[2.3,3)", + org.apache.velocity.app;version="[2.3,3)", + org.apache.velocity.context;version="[2.3,3)", + org.apache.velocity.exception;version="[2.3,3)", + org.apache.velocity.runtime.resource;version="[2.3,3)", + org.apache.velocity.runtime.resource.loader;version="[2.3,3)", + org.apache.velocity.util;version="[2.3,3)", org.osgi.framework.*;version="${imp.package.version.osgi.framework}", org.osgi.service.*;version="${imp.package.version.osgi.service}", - org.apache.commons.logging, - javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional, - org.wso2.carbon.context, - org.wso2.carbon.utils.*, - org.wso2.carbon.registry.api, org.w3c.dom, - org.apache.velocity;version="${velocity.version}", - org.apache.velocity.app;version="${velocity.version}", - org.apache.velocity.context;version="${velocity.version}", - org.apache.velocity.exception;version="${velocity.version}", - org.apache.velocity.runtime.resource;version="${velocity.version}", - org.apache.velocity.runtime.resource.loader;version="${velocity.version}", - org.apache.commons.io, - org.apache.axis2.transport.mail, - org.wso2.carbon.registry.core.service, - org.wso2.carbon.registry.core.session, - org.apache.commons.collections + org.wso2.carbon.context;version="[4.8,5)", + org.wso2.carbon.utils;version="[4.8,5)" !io.entgra.device.mgt.core.transport.mgt.email.sender.core.internal, @@ -80,61 +90,19 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.osgi - org.eclipse.osgi.services + org.apache.felix + org.apache.felix.scr.ds-annotations + provided org.ops4j.pax.logging pax-logging-api provided - org.wso2.carbon @@ -144,10 +112,6 @@ org.testng testng - - org.wso2.carbon - org.wso2.carbon.registry.api - org.wso2.carbon org.wso2.carbon.base @@ -157,8 +121,8 @@ axis2 - org.wso2.orbit.org.apache.velocity - velocity + org.apache.velocity + velocity-engine-core commons-io.wso2 @@ -168,10 +132,6 @@ org.apache.axis2.transport axis2-transport-mail - - org.wso2.carbon - org.wso2.carbon.registry.core - commons-collections.wso2 commons-collections diff --git a/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/EmailContext.java b/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/EmailContext.java index e9a8eb54e7..c8e2c3efc4 100644 --- a/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/EmailContext.java +++ b/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/EmailContext.java @@ -18,7 +18,9 @@ */ package io.entgra.device.mgt.core.transport.mgt.email.sender.core; -import java.util.*; +import java.util.HashSet; +import java.util.Properties; +import java.util.Set; public class EmailContext { diff --git a/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/RegistryBasedResourceLoader.java b/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/RegistryBasedResourceLoader.java index 24ba401944..72302647ae 100644 --- a/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/RegistryBasedResourceLoader.java +++ b/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/RegistryBasedResourceLoader.java @@ -18,44 +18,63 @@ */ package io.entgra.device.mgt.core.transport.mgt.email.sender.core; -import org.apache.commons.collections.ExtendedProperties; import org.apache.velocity.exception.ResourceNotFoundException; import org.apache.velocity.runtime.resource.Resource; import org.apache.velocity.runtime.resource.loader.ResourceLoader; -import org.wso2.carbon.context.CarbonContext; -import org.wso2.carbon.context.RegistryType; -import org.wso2.carbon.registry.api.Registry; -import org.wso2.carbon.registry.api.RegistryException; +import org.apache.velocity.util.ExtProperties; import java.io.InputStream; +import java.io.Reader; public class RegistryBasedResourceLoader extends ResourceLoader { private static final String EMAIL_CONFIG_BASE_LOCATION = "email-templates"; @Override - public void init(ExtendedProperties extendedProperties) { + public void init(ExtProperties extProperties) { } @Override + public Reader getResourceReader(String name, String encoding) throws ResourceNotFoundException { +// try { +// Registry registry = +// CarbonContext.getThreadLocalCarbonContext().getRegistry(RegistryType.SYSTEM_CONFIGURATION); +// if (registry == null) { +// throw new IllegalStateException("No valid registry instance is attached to the current carbon context"); +// } +// if (!registry.resourceExists(EMAIL_CONFIG_BASE_LOCATION + "/" + name)) { +// throw new ResourceNotFoundException("Resource '" + name + "' does not exist"); +// } +// org.wso2.carbon.registry.api.Resource resource = +// registry.get(EMAIL_CONFIG_BASE_LOCATION + "/" + name); +// resource.setMediaType("text/plain"); +// +// return new InputStreamReader(resource.getContentStream()); +// } catch (RegistryException e) { +// throw new ResourceNotFoundException("Error occurred while retrieving resource", e); +// } + return null; + } + public InputStream getResourceStream(String name) throws ResourceNotFoundException { - try { - Registry registry = - CarbonContext.getThreadLocalCarbonContext().getRegistry(RegistryType.SYSTEM_CONFIGURATION); - if (registry == null) { - throw new IllegalStateException("No valid registry instance is attached to the current carbon context"); - } - if (!registry.resourceExists(EMAIL_CONFIG_BASE_LOCATION + "/" + name)) { - throw new ResourceNotFoundException("Resource '" + name + "' does not exist"); - } - org.wso2.carbon.registry.api.Resource resource = - registry.get(EMAIL_CONFIG_BASE_LOCATION + "/" + name); - resource.setMediaType("text/plain"); - return resource.getContentStream(); - } catch (RegistryException e) { - throw new ResourceNotFoundException("Error occurred while retrieving resource", e); - } +// try { +// Registry registry = +// CarbonContext.getThreadLocalCarbonContext().getRegistry(RegistryType.SYSTEM_CONFIGURATION); +// if (registry == null) { +// throw new IllegalStateException("No valid registry instance is attached to the current carbon context"); +// } +// if (!registry.resourceExists(EMAIL_CONFIG_BASE_LOCATION + "/" + name)) { +// throw new ResourceNotFoundException("Resource '" + name + "' does not exist"); +// } +// org.wso2.carbon.registry.api.Resource resource = +// registry.get(EMAIL_CONFIG_BASE_LOCATION + "/" + name); +// resource.setMediaType("text/plain"); +// return resource.getContentStream(); +// } catch (RegistryException e) { +// throw new ResourceNotFoundException("Error occurred while retrieving resource", e); +// } + return null; } @Override diff --git a/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/VelocityBasedEmailContentProvider.java b/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/VelocityBasedEmailContentProvider.java index 06d8ece984..b4ac3fa1a4 100644 --- a/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/VelocityBasedEmailContentProvider.java +++ b/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/VelocityBasedEmailContentProvider.java @@ -23,18 +23,13 @@ import org.apache.commons.logging.LogFactory; import org.apache.velocity.Template; import org.apache.velocity.VelocityContext; import org.apache.velocity.app.VelocityEngine; -import org.apache.velocity.runtime.resource.loader.ResourceLoader; -import org.wso2.carbon.context.CarbonContext; -import org.wso2.carbon.context.RegistryType; -import org.wso2.carbon.registry.api.Registry; +import org.apache.velocity.runtime.RuntimeConstants; +import org.wso2.carbon.utils.CarbonUtils; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.StringWriter; +import java.io.*; import java.util.Map; public class VelocityBasedEmailContentProvider implements EmailContentProvider { @@ -42,12 +37,11 @@ public class VelocityBasedEmailContentProvider implements EmailContentProvider { private VelocityEngine engine; private static final Log log = LogFactory.getLog(VelocityBasedEmailContentProvider.class); + private static final String EMAIL_TEMPLATE_PATH = "repository" + File.separator + + "resources" + File.separator + "email-templates"; public VelocityBasedEmailContentProvider() { engine = new VelocityEngine(); - engine.setProperty("resource.loader", "registry"); - engine.setProperty("velocimacro.library", ""); - engine.setProperty("registry.resource.loader.class", - "io.entgra.device.mgt.core.transport.mgt.email.sender.core.RegistryBasedResourceLoader"); + engine.setProperty(RuntimeConstants.FILE_RESOURCE_LOADER_PATH, CarbonUtils.getCarbonHome()); engine.init(); } @@ -58,7 +52,7 @@ public class VelocityBasedEmailContentProvider implements EmailContentProvider { for (Map.Entry, Object>> param : params.entrySet()) { ctx.put(param.getKey(), param.getValue().getValue()); } - Template template = engine.getTemplate(name); + Template template = engine.getTemplate(EMAIL_TEMPLATE_PATH + File.separator + name + ".vm"); StringWriter content = new StringWriter(); template.merge(ctx, content); diff --git a/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/internal/EmailSenderAxis2ConfigContextObserver.java b/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/internal/EmailSenderAxis2ConfigContextObserver.java index 87e8c3a426..214c18b1b2 100644 --- a/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/internal/EmailSenderAxis2ConfigContextObserver.java +++ b/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/internal/EmailSenderAxis2ConfigContextObserver.java @@ -18,10 +18,10 @@ */ package io.entgra.device.mgt.core.transport.mgt.email.sender.core.internal; +import io.entgra.device.mgt.core.transport.mgt.email.sender.core.EmailSenderConfigurationFailedException; import org.apache.axis2.context.ConfigurationContext; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.transport.mgt.email.sender.core.EmailSenderConfigurationFailedException; import org.wso2.carbon.utils.Axis2ConfigurationContextObserver; class EmailSenderAxis2ConfigContextObserver implements Axis2ConfigurationContextObserver { diff --git a/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/internal/EmailSenderDataHolder.java b/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/internal/EmailSenderDataHolder.java index 9db2d4c3a4..5633b2374b 100644 --- a/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/internal/EmailSenderDataHolder.java +++ b/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/internal/EmailSenderDataHolder.java @@ -19,12 +19,11 @@ package io.entgra.device.mgt.core.transport.mgt.email.sender.core.internal; import io.entgra.device.mgt.core.transport.mgt.email.sender.core.service.EmailSenderService; -import org.wso2.carbon.registry.core.service.RegistryService; import org.wso2.carbon.utils.ConfigurationContextService; public class EmailSenderDataHolder { - private RegistryService registryService; +// private RegistryService registryService; private ConfigurationContextService configurationContextService; private EmailSenderService emailServiceProvider; @@ -36,16 +35,16 @@ public class EmailSenderDataHolder { return thisInstance; } - public RegistryService getRegistryService() { - if (registryService == null) { - throw new IllegalStateException("Registry service is not initialized properly"); - } - return registryService; - } - - public void setRegistryService(RegistryService registryService) { - this.registryService = registryService; - } +// public RegistryService getRegistryService() { +// if (registryService == null) { +// throw new IllegalStateException("Registry service is not initialized properly"); +// } +// return registryService; +// } +// +// public void setRegistryService(RegistryService registryService) { +// this.registryService = registryService; +// } public ConfigurationContextService getConfigurationContextService() { if (configurationContextService == null) { diff --git a/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/internal/EmailSenderServiceComponent.java b/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/internal/EmailSenderServiceComponent.java index 182a962e15..8a0ac57a72 100644 --- a/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/internal/EmailSenderServiceComponent.java +++ b/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/internal/EmailSenderServiceComponent.java @@ -17,37 +17,25 @@ */ package io.entgra.device.mgt.core.transport.mgt.email.sender.core.internal; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.osgi.service.component.ComponentContext; import io.entgra.device.mgt.core.transport.mgt.email.sender.core.EmailSenderConfig; import io.entgra.device.mgt.core.transport.mgt.email.sender.core.service.EmailSenderService; import io.entgra.device.mgt.core.transport.mgt.email.sender.core.service.EmailSenderServiceImpl; -import org.wso2.carbon.registry.core.service.RegistryService; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.*; import org.wso2.carbon.utils.Axis2ConfigurationContextObserver; import org.wso2.carbon.utils.ConfigurationContextService; -/** - * @scr.component name="io.entgra.device.mgt.core.email.sender.emailsendereervicecomponent" - * immediate="true" - * @scr.reference name="registry.service" - * interface="org.wso2.carbon.registry.core.service.RegistryService" - * cardinality="1..1" - * policy="dynamic" - * bind="setRegistryService" - * unbind="unsetRegistryService" - * @scr.reference name="config.context.service" - * interface="org.wso2.carbon.utils.ConfigurationContextService" - * cardinality="0..1" - * policy="dynamic" - * bind="setConfigurationContextService" - * unbind="unsetConfigurationContextService" - */ +@Component( + name = "io.entgra.device.mgt.core.transport.mgt.email.sender.core.internal.EmailSenderServiceComponent", + immediate = true) public class EmailSenderServiceComponent { private static Log log = LogFactory.getLog(EmailSenderServiceComponent.class); @SuppressWarnings("unused") + @Activate protected void activate(ComponentContext componentContext) { try { if (log.isDebugEnabled()) { @@ -73,6 +61,7 @@ public class EmailSenderServiceComponent { } @SuppressWarnings("unused") + @Deactivate protected void deactivate(ComponentContext componentContext) { //do nothing } @@ -86,30 +75,42 @@ public class EmailSenderServiceComponent { componentContext.getBundleContext().registerService(EmailSenderService.class, emailServiceProvider, null); } - /** - * Sets Registry Service. - * - * @param registryService An instance of RegistryService - */ - protected void setRegistryService(RegistryService registryService) { - if (log.isDebugEnabled()) { - log.debug("Setting Registry Service"); - } - EmailSenderDataHolder.getInstance().setRegistryService(registryService); - } - - /** - * Unsets Registry Service. - * - * @param registryService An instance of RegistryService - */ - protected void unsetRegistryService(RegistryService registryService) { - if (log.isDebugEnabled()) { - log.debug("Un setting Registry Service"); - } - EmailSenderDataHolder.getInstance().setRegistryService(null); - } +// /** +// * Sets Registry Service. +// * +// * @param registryService An instance of RegistryService +// */ +// @Reference( +// name = "registry.service", +// service = org.wso2.carbon.registry.core.service.RegistryService.class, +// cardinality = ReferenceCardinality.MANDATORY, +// policy = ReferencePolicy.DYNAMIC, +// unbind = "unsetRegistryService") +// protected void setRegistryService(RegistryService registryService) { +// if (log.isDebugEnabled()) { +// log.debug("Setting Registry Service"); +// } +// EmailSenderDataHolder.getInstance().setRegistryService(registryService); +// } +// +// /** +// * Unsets Registry Service. +// * +// * @param registryService An instance of RegistryService +// */ +// protected void unsetRegistryService(RegistryService registryService) { +// if (log.isDebugEnabled()) { +// log.debug("Un setting Registry Service"); +// } +// EmailSenderDataHolder.getInstance().setRegistryService(null); +// } + @Reference( + name = "configuration.context.service", + service = org.wso2.carbon.utils.ConfigurationContextService.class, + cardinality = ReferenceCardinality.OPTIONAL, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetConfigurationContextService") protected void setConfigurationContextService(ConfigurationContextService configurationContextService) { if (log.isDebugEnabled()) { log.debug("Setting ConfigurationContextService"); diff --git a/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/internal/EmailUtils.java b/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/internal/EmailUtils.java index 7eb06e83f0..72c549a452 100644 --- a/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/internal/EmailUtils.java +++ b/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/email/sender/core/internal/EmailUtils.java @@ -17,20 +17,15 @@ */ package io.entgra.device.mgt.core.transport.mgt.email.sender.core.internal; +import io.entgra.device.mgt.core.transport.mgt.email.sender.core.EmailSenderConfigurationFailedException; import org.apache.commons.io.FileUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.CarbonContext; -import io.entgra.device.mgt.core.transport.mgt.email.sender.core.EmailSenderConfigurationFailedException; -import org.wso2.carbon.registry.api.Collection; -import org.wso2.carbon.registry.api.Registry; -import org.wso2.carbon.registry.api.RegistryException; -import org.wso2.carbon.registry.api.Resource; import org.wso2.carbon.utils.CarbonUtils; import java.io.File; import java.io.FileNotFoundException; -import java.io.FilenameFilter; import java.io.IOException; class EmailUtils { @@ -49,31 +44,11 @@ class EmailUtils { } } if (templateDir.canRead()) { - File[] templates = templateDir.listFiles(new FilenameFilter() { - @Override - public boolean accept(File dir, String name) { - name = name.toLowerCase(); - return name.endsWith(".vm"); - } - }); try { int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); - Registry registry = - EmailSenderDataHolder.getInstance().getRegistryService().getConfigSystemRegistry(tenantId); - if (!registry.resourceExists(EMAIL_TEMPLATE_DIR_RELATIVE_REGISTRY_PATH)) { - Collection collection = registry.newCollection(); - registry.put(EMAIL_TEMPLATE_DIR_RELATIVE_REGISTRY_PATH, collection); - for (File template : templates) { - Resource resource = registry.newResource(); - resource.setMediaType("text/plain"); - String contents = FileUtils.readFileToString(template); - resource.setContent(contents); - registry.put(EMAIL_TEMPLATE_DIR_RELATIVE_REGISTRY_PATH + "/" - + template.getName().replace(".vm", ""), resource); - } - } - } catch (RegistryException e) { - throw new EmailSenderConfigurationFailedException("Error occurred while setting up email templates", e); + String tenantTemplateDirectory = CarbonUtils.getCarbonTenantsDirPath() + File.separator + tenantId + File.separator; + File destinationDirectory = new File(tenantTemplateDirectory); + FileUtils.copyDirectoryToDirectory(templateDir, destinationDirectory); } catch (FileNotFoundException e) { throw new EmailSenderConfigurationFailedException("Error occurred while writing template file " + "contents as an input stream of a resource", e); diff --git a/components/transport-mgt/email-sender/pom.xml b/components/transport-mgt/email-sender/pom.xml index 0cad77b1c5..612cc94052 100644 --- a/components/transport-mgt/email-sender/pom.xml +++ b/components/transport-mgt/email-sender/pom.xml @@ -30,7 +30,7 @@ email-sender pom WSO2 Carbon - Email Sender Component - http://wso2.org + https://entgra.io io.entgra.device.mgt.core.transport.mgt.email.sender.core diff --git a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/pom.xml b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/pom.xml index e04ee7b273..4d1bb36291 100644 --- a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/pom.xml +++ b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/pom.xml @@ -133,7 +133,6 @@ org.ops4j.pax.logging pax-logging-api provided - io.entgra.device.mgt.core diff --git a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/api/ConfigurationManagementService.java b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/api/ConfigurationManagementService.java index 656509e448..022920f3e7 100644 --- a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/api/ConfigurationManagementService.java +++ b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/api/ConfigurationManagementService.java @@ -18,19 +18,10 @@ package io.entgra.device.mgt.core.transport.mgt.sms.handler.api; -import io.entgra.device.mgt.core.transport.mgt.sms.handler.common.SMSHandlerConstants; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiResponse; -import io.swagger.annotations.ApiResponses; -import io.swagger.annotations.Extension; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Info; -import io.swagger.annotations.ResponseHeader; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Tag; import io.entgra.device.mgt.core.apimgt.annotations.Scope; import io.entgra.device.mgt.core.apimgt.annotations.Scopes; +import io.entgra.device.mgt.core.transport.mgt.sms.handler.common.SMSHandlerConstants; +import io.swagger.annotations.*; import javax.ws.rs.Consumes; import javax.ws.rs.GET; diff --git a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/api/addons/ApiOriginFilter.java b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/api/addons/ApiOriginFilter.java index 905deefcf6..b8b026d7a2 100644 --- a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/api/addons/ApiOriginFilter.java +++ b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/api/addons/ApiOriginFilter.java @@ -18,12 +18,7 @@ package io.entgra.device.mgt.core.transport.mgt.sms.handler.api.addons; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import javax.servlet.*; import javax.servlet.http.HttpServletResponse; import java.io.IOException; diff --git a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/api/addons/GsonMessageBodyHandler.java b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/api/addons/GsonMessageBodyHandler.java index 929799870c..09ef6238c8 100644 --- a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/api/addons/GsonMessageBodyHandler.java +++ b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/api/addons/GsonMessageBodyHandler.java @@ -24,11 +24,7 @@ import com.google.gson.GsonBuilder; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.OutputStreamWriter; +import java.io.*; import java.lang.annotation.Annotation; import java.lang.reflect.Type; diff --git a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/api/impl/ConfigurationManagementServiceImpl.java b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/api/impl/ConfigurationManagementServiceImpl.java index c4c37d0b72..5e64bf5bc4 100644 --- a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/api/impl/ConfigurationManagementServiceImpl.java +++ b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/api/impl/ConfigurationManagementServiceImpl.java @@ -18,11 +18,11 @@ package io.entgra.device.mgt.core.transport.mgt.sms.handler.api.impl; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.transport.mgt.sms.handler.api.ConfigurationManagementService; import io.entgra.device.mgt.core.transport.mgt.sms.handler.core.config.SMSConfigurationManager; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import javax.ws.rs.GET; import javax.ws.rs.Path; diff --git a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/src/main/webapp/WEB-INF/cxf-servlet.xml index 742790b542..f390f1b656 100644 --- a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/src/main/webapp/WEB-INF/cxf-servlet.xml +++ b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/src/main/webapp/WEB-INF/cxf-servlet.xml @@ -19,9 +19,9 @@ + http://cxf.apache.org/jaxrs http://cxf.apache.org/schemas/jaxrs.xsd"> diff --git a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.common/pom.xml b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.common/pom.xml index 6b59870558..5a7a59906c 100644 --- a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.common/pom.xml +++ b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.common/pom.xml @@ -35,6 +35,14 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + org.apache.felix maven-bundle-plugin @@ -49,7 +57,10 @@ io.entgra.device.mgt.core.transport.mgt.sms.handler.common.* - io.swagger.annotations; version="${swagger.annotations.version}"; resolution:=optional, + io.entgra.device.mgt.core.transport.mgt.sms.handler.common.bean, + io.entgra.device.mgt.core.transport.mgt.sms.handler.common.exception, + io.swagger.annotations;version="[1.6,2)", + javax.xml.bind.annotation;version="[0.0,1)" diff --git a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.core/pom.xml b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.core/pom.xml index 8b6bc1f41a..00fe2d2a6f 100644 --- a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.core/pom.xml +++ b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.core/pom.xml @@ -35,10 +35,6 @@ - - org.apache.felix - maven-scr-plugin - org.jacoco jacoco-maven-plugin @@ -65,6 +61,14 @@ + + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + + org.apache.felix maven-bundle-plugin @@ -77,14 +81,19 @@ SMS Management Core Bundle io.entgra.device.mgt.core.transport.mgt.sms.handler.core.internal - io.entgra.device.mgt.core.transport.mgt.sms.handler.common.*, - javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional, - javax.xml.bind.annotation, - javax.xml.bind, - org.apache.commons.lang, - org.wso2.carbon, - io.entgra.device.mgt.core.device.mgt.common.*, - io.entgra.device.mgt.core.device.mgt.core.* + io.entgra.device.mgt.core.device.mgt.common.exceptions;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.util;version="[5.0,6)", + io.entgra.device.mgt.core.transport.mgt.sms.handler.common.bean;version="[5.0,6)", + io.entgra.device.mgt.core.transport.mgt.sms.handler.common.config;version="[5.0,6)", + io.entgra.device.mgt.core.transport.mgt.sms.handler.common.exception;version="[5.0,6)", + io.entgra.device.mgt.core.transport.mgt.sms.handler.common.spi;version="[5.0,6)", + io.entgra.device.mgt.core.transport.mgt.sms.handler.core.config, + javax.xml.bind;version="[0.0,1)", + org.apache.commons.lang;version="[2.6,3)", + org.apache.commons.logging;version="[1.2,2)", + org.osgi.service.*;version="${imp.package.version.osgi.service}", + org.w3c.dom, + org.wso2.carbon.utils;version="[4.8,5)" !io.entgra.device.mgt.core.transport.mgt.sms.handler.core.internal, @@ -98,11 +107,15 @@ + + org.apache.felix + org.apache.felix.scr.ds-annotations + provided + org.ops4j.pax.logging pax-logging-api provided - org.wso2.carbon diff --git a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/core/config/SMSConfigurationManager.java b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/core/config/SMSConfigurationManager.java index ab21c30ea3..515c12b19f 100644 --- a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/core/config/SMSConfigurationManager.java +++ b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/core/config/SMSConfigurationManager.java @@ -18,13 +18,13 @@ package io.entgra.device.mgt.core.transport.mgt.sms.handler.core.config; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; +import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; import io.entgra.device.mgt.core.transport.mgt.sms.handler.common.SMSHandlerConstants; import io.entgra.device.mgt.core.transport.mgt.sms.handler.common.config.SMSConfiguration; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.w3c.dom.Document; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; -import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; import org.wso2.carbon.utils.CarbonUtils; import javax.xml.bind.JAXBContext; diff --git a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/core/internal/SMSHandlerServiceComponent.java b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/core/internal/SMSHandlerServiceComponent.java index 67b8c50b5b..96ed85756d 100644 --- a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/core/internal/SMSHandlerServiceComponent.java +++ b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.core/src/main/java/io/entgra/device/mgt/core/transport/mgt/sms/handler/core/internal/SMSHandlerServiceComponent.java @@ -22,15 +22,18 @@ import io.entgra.device.mgt.core.transport.mgt.sms.handler.core.config.SMSConfig import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.Activate; +import org.osgi.service.component.annotations.Component; +import org.osgi.service.component.annotations.Deactivate; -/** - * @scr.component - * name="io.entgra.device.mgt.core.transport.mgt.sms.handler.core.internal.SMSHandlerServiceComponent" immediate="true" - */ +@Component( + name = "io.entgra.device.mgt.core.transport.mgt.sms.handler.core.internal.SMSHandlerServiceComponent", + immediate = true) public class SMSHandlerServiceComponent { private static final Log log = LogFactory.getLog(SMSHandlerServiceComponent.class); + @Activate protected void activate(ComponentContext ctx) { if (log.isDebugEnabled()) { @@ -46,7 +49,7 @@ public class SMSHandlerServiceComponent { log.error("Error occurred while activating SMS Handler Service Component", e); } } - + @Deactivate protected void deactivate(ComponentContext ctx) { if (log.isDebugEnabled()) { log.debug("De-activating SMS Handler Service Component"); diff --git a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/DefaultTokenHandler.java b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/DefaultTokenHandler.java index f763118dde..9250675972 100644 --- a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/DefaultTokenHandler.java +++ b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/DefaultTokenHandler.java @@ -22,6 +22,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import io.entgra.device.mgt.core.ui.request.interceptor.beans.AuthData; +import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse; import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerConstants; import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerUtil; import org.apache.commons.lang.StringUtils; @@ -32,7 +33,6 @@ import org.apache.http.HttpStatus; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.utils.URIBuilder; import org.apache.http.entity.ContentType; -import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse; import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.WebServlet; diff --git a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/GrafanaHandler.java b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/GrafanaHandler.java index efc9f04f4d..ac74b60014 100644 --- a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/GrafanaHandler.java +++ b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/GrafanaHandler.java @@ -21,6 +21,7 @@ package io.entgra.device.mgt.core.ui.request.interceptor; import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.common.exception.GrafanaManagementException; import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.exception.GrafanaEnvVariablesNotDefined; import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.util.GrafanaUtil; +import io.entgra.device.mgt.core.device.mgt.core.common.util.HttpUtil; import io.entgra.device.mgt.core.ui.request.interceptor.beans.AuthData; import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse; import io.entgra.device.mgt.core.ui.request.interceptor.util.GrafanaHandlerUtil; @@ -35,7 +36,6 @@ import org.apache.http.HttpStatus; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.*; import org.apache.http.impl.client.CloseableHttpClient; -import io.entgra.device.mgt.core.device.mgt.core.common.util.HttpUtil; import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.WebServlet; diff --git a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/InvokerHandler.java b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/InvokerHandler.java index 660b2e55bc..c8861b286f 100644 --- a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/InvokerHandler.java +++ b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/InvokerHandler.java @@ -19,6 +19,7 @@ package io.entgra.device.mgt.core.ui.request.interceptor; import io.entgra.device.mgt.core.ui.request.interceptor.beans.AuthData; +import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse; import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerConstants; import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerUtil; import org.apache.commons.fileupload.FileUploadException; @@ -27,12 +28,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.http.HttpHeaders; import org.apache.http.HttpStatus; -import org.apache.http.client.methods.HttpDelete; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpHead; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.methods.HttpPut; -import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse; +import org.apache.http.client.methods.*; + import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; diff --git a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/LoginHandler.java b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/LoginHandler.java index 7368d2935d..5c014ae0fb 100644 --- a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/LoginHandler.java +++ b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/LoginHandler.java @@ -18,12 +18,9 @@ package io.entgra.device.mgt.core.ui.request.interceptor; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import com.google.gson.JsonSyntaxException; +import com.google.gson.*; import io.entgra.device.mgt.core.ui.request.interceptor.beans.AuthData; +import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse; import io.entgra.device.mgt.core.ui.request.interceptor.cache.LoginCache; import io.entgra.device.mgt.core.ui.request.interceptor.cache.OAuthApp; import io.entgra.device.mgt.core.ui.request.interceptor.cache.OAuthAppCacheKey; @@ -38,7 +35,6 @@ import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; import org.apache.http.protocol.HTTP; -import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse; import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.WebServlet; diff --git a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/LogoutHandler.java b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/LogoutHandler.java index dce8b5feab..d023cdbdbe 100644 --- a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/LogoutHandler.java +++ b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/LogoutHandler.java @@ -18,11 +18,11 @@ package io.entgra.device.mgt.core.ui.request.interceptor; +import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse; import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.http.HttpStatus; -import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; diff --git a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/OTPInvokerHandler.java b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/OTPInvokerHandler.java index 8b03ab6049..c1f1fd4170 100644 --- a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/OTPInvokerHandler.java +++ b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/OTPInvokerHandler.java @@ -18,6 +18,7 @@ package io.entgra.device.mgt.core.ui.request.interceptor; +import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse; import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerConstants; import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerUtil; import org.apache.commons.fileupload.FileUploadException; @@ -25,12 +26,8 @@ import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.http.HttpStatus; -import org.apache.http.client.methods.HttpDelete; -import org.apache.http.client.methods.HttpGet; -import org.apache.http.client.methods.HttpHead; -import org.apache.http.client.methods.HttpPost; -import org.apache.http.client.methods.HttpPut; -import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse; +import org.apache.http.client.methods.*; + import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; diff --git a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/SsoLoginCallbackHandler.java b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/SsoLoginCallbackHandler.java index 988c3aa330..19d124f3ac 100644 --- a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/SsoLoginCallbackHandler.java +++ b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/SsoLoginCallbackHandler.java @@ -22,6 +22,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import io.entgra.device.mgt.core.ui.request.interceptor.beans.AuthData; +import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse; import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerConstants; import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerUtil; import org.apache.commons.logging.Log; @@ -30,7 +31,6 @@ import org.apache.http.HttpHeaders; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; -import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse; import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.WebServlet; diff --git a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/SsoLoginHandler.java b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/SsoLoginHandler.java index 522258d9bc..121ea5b926 100644 --- a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/SsoLoginHandler.java +++ b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/SsoLoginHandler.java @@ -18,11 +18,8 @@ package io.entgra.device.mgt.core.ui.request.interceptor; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import com.google.gson.JsonSyntaxException; +import com.google.gson.*; +import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse; import io.entgra.device.mgt.core.ui.request.interceptor.cache.LoginCache; import io.entgra.device.mgt.core.ui.request.interceptor.cache.OAuthApp; import io.entgra.device.mgt.core.ui.request.interceptor.cache.OAuthAppCacheKey; @@ -43,7 +40,6 @@ import org.json.JSONArray; import org.json.JSONObject; import org.w3c.dom.Document; import org.w3c.dom.NodeList; -import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse; import org.xml.sax.InputSource; import org.xml.sax.SAXException; diff --git a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/SsoLogoutHandler.java b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/SsoLogoutHandler.java index 0567220ce5..b0b94d566a 100644 --- a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/SsoLogoutHandler.java +++ b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/SsoLogoutHandler.java @@ -18,20 +18,16 @@ package io.entgra.device.mgt.core.ui.request.interceptor; +import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse; import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerConstants; import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerUtil; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.http.HttpStatus; -import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse; import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.WebServlet; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import javax.servlet.http.Cookie; +import javax.servlet.http.*; import java.io.IOException; @MultipartConfig diff --git a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/UserHandler.java b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/UserHandler.java index 7451e92f6d..7d7c465eb7 100644 --- a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/UserHandler.java +++ b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/UserHandler.java @@ -22,20 +22,20 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.google.gson.JsonSyntaxException; +import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; +import io.entgra.device.mgt.core.device.mgt.core.config.DeviceManagementConfig; +import io.entgra.device.mgt.core.device.mgt.extensions.logger.spi.EntgraLogger; +import io.entgra.device.mgt.core.notification.logger.UserLogContext; +import io.entgra.device.mgt.core.notification.logger.impl.EntgraUserLoggerImpl; import io.entgra.device.mgt.core.ui.request.interceptor.beans.AuthData; import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse; import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerConstants; import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerUtil; -import io.entgra.device.mgt.core.device.mgt.extensions.logger.spi.EntgraLogger; -import io.entgra.device.mgt.core.notification.logger.UserLogContext; -import io.entgra.device.mgt.core.notification.logger.impl.EntgraUserLoggerImpl; import org.apache.http.HttpHeaders; import org.apache.http.HttpStatus; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; -import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; -import io.entgra.device.mgt.core.device.mgt.core.config.DeviceManagementConfig; import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.WebServlet; diff --git a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/util/HandlerUtil.java b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/util/HandlerUtil.java index 374fcc1931..4ebfffa5f1 100644 --- a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/util/HandlerUtil.java +++ b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/util/HandlerUtil.java @@ -18,12 +18,9 @@ package io.entgra.device.mgt.core.ui.request.interceptor.util; -import com.google.gson.Gson; -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import com.google.gson.JsonParser; +import com.google.gson.*; import io.entgra.device.mgt.core.ui.request.interceptor.beans.AuthData; +import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse; import io.entgra.device.mgt.core.ui.request.interceptor.cache.LoginCache; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileUploadException; @@ -54,7 +51,6 @@ import org.json.JSONArray; import org.json.JSONException; import org.json.JSONObject; import org.w3c.dom.Document; -import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse; import org.xml.sax.SAXException; import javax.servlet.http.HttpServletRequest; @@ -63,12 +59,7 @@ import javax.servlet.http.HttpSession; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; -import java.io.BufferedReader; -import java.io.File; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.PrintWriter; -import java.io.StringWriter; +import java.io.*; import java.util.Enumeration; import java.util.List; diff --git a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/websocket/GrafanaLiveSecurityFilter.java b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/websocket/GrafanaLiveSecurityFilter.java index 97e57394c5..98a9ce7db9 100644 --- a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/websocket/GrafanaLiveSecurityFilter.java +++ b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/websocket/GrafanaLiveSecurityFilter.java @@ -23,12 +23,7 @@ import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerConstants; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import javax.servlet.Filter; -import javax.servlet.FilterChain; -import javax.servlet.FilterConfig; -import javax.servlet.ServletException; -import javax.servlet.ServletRequest; -import javax.servlet.ServletResponse; +import javax.servlet.*; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import java.io.IOException; diff --git a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/websocket/GrafanaWebSocketClient.java b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/websocket/GrafanaWebSocketClient.java index efa63fd2d1..73fd04e49f 100644 --- a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/websocket/GrafanaWebSocketClient.java +++ b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/websocket/GrafanaWebSocketClient.java @@ -23,20 +23,9 @@ import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.util.GrafanaUt import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import javax.websocket.ClientEndpoint; -import javax.websocket.ContainerProvider; -import javax.websocket.Session; -import javax.websocket.OnOpen; -import javax.websocket.OnClose; -import javax.websocket.OnError; -import javax.websocket.CloseReason; -import javax.websocket.WebSocketContainer; -import java.net.URI; - -import javax.websocket.ClientEndpointConfig; -import javax.websocket.Endpoint; -import javax.websocket.EndpointConfig; +import javax.websocket.*; import javax.ws.rs.core.HttpHeaders; +import java.net.URI; import java.util.Collections; import java.util.List; import java.util.Map; diff --git a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/websocket/GrafanaWebSocketHandler.java b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/websocket/GrafanaWebSocketHandler.java index 66a7df6aa4..df055b17eb 100644 --- a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/websocket/GrafanaWebSocketHandler.java +++ b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/websocket/GrafanaWebSocketHandler.java @@ -24,13 +24,8 @@ import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.util.GrafanaUt import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import javax.websocket.CloseReason; +import javax.websocket.*; import javax.websocket.server.ServerEndpoint; -import javax.websocket.Session; -import javax.websocket.OnOpen; -import javax.websocket.OnMessage; -import javax.websocket.OnClose; -import javax.websocket.OnError; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/pom.xml b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/pom.xml index 3083d062f7..2bd2192b1d 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/pom.xml +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/pom.xml @@ -26,18 +26,21 @@ 4.0.0 - io.entgra.device.mgt.core io.entgra.device.mgt.core.webapp.authenticator.framework bundle WSO2 Carbon - Web Application Authenticator Framework Bundle WSO2 Carbon - Web Application Authenticator Framework Bundle - http://wso2.org + https://entgra.io - org.apache.felix - maven-scr-plugin + org.apache.maven.plugins + maven-compiler-plugin + + 1.8 + 1.8 + org.apache.felix @@ -55,65 +58,70 @@ io.entgra.device.mgt.core.webapp.authenticator.framework.* - com.nimbusds.jose;version="${nimbus.orbit.version.range}", - com.nimbusds.jose.crypto;version="${nimbus.orbit.version.range}", - com.nimbusds.jwt;version="${nimbus.orbit.version.range}", - javax.xml.bind, - javax.xml.bind.annotation, - javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional, - javax.xml.validation, - org.apache.catalina;version="9.0", - org.apache.catalina.connector;version="9.0", - org.apache.catalina.util;version="9.0", - org.apache.commons.logging, - org.apache.coyote;version="9.0", - org.apache.tomcat.util.buf;version="9.0", - org.apache.tomcat.util.http;version="9.0", + com.google.gson;version="[2.9,3)", + com.nimbusds.jose;version="[7.9,8)", + com.nimbusds.jose.crypto;version="[7.9,8)", + com.nimbusds.jwt;version="[7.9,8)", + io.entgra.device.mgt.core.certificate.mgt.core.dto;version="[5.0,6)", + io.entgra.device.mgt.core.certificate.mgt.core.exception;version="[5.0,6)", + io.entgra.device.mgt.core.certificate.mgt.core.scep;version="[5.0,6)", + io.entgra.device.mgt.core.certificate.mgt.core.service;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.otp.mgt.dto;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.permission.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.common.spi;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.permission.mgt;version="[5.0,6)", + io.entgra.device.mgt.core.device.mgt.core.util;version="[5.0,6)", + io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth, + io.entgra.device.mgt.core.webapp.authenticator.framework.authorizer, + io.entgra.device.mgt.core.webapp.authenticator.framework.config, + io.entgra.device.mgt.core.webapp.authenticator.framework.config.impl, + javax.servlet;version="[2.6,3)", + + + javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}", + + javax.xml.stream.*;version="[1.0.1,1.1.0)", + org.apache.axiom.om;version="[1.2,2)", + org.apache.axiom.om.impl.builder;version="[1.2,2)", + org.apache.axiom.om.util;version="[1.2,2)", + org.apache.axiom.soap;version="[1.2,2)", + org.apache.axiom.soap.impl.builder;version="[1.2,2)", + org.apache.axis2;version="[1.6,2)", + org.apache.axis2.client;version="[1.6,2)", + org.apache.axis2.context;version="[1.6,2)", + org.apache.catalina;version="${catalina.version.range}", + org.apache.catalina.connector;version="${catalina.version.range}", + org.apache.commons.codec.binary;version="[1.14,2)", + org.apache.commons.httpclient;version="[3.1,4)", + org.apache.commons.httpclient.params;version="[3.1,4)", + org.apache.commons.lang;version="[2.6,3)", + org.apache.commons.logging;version="[1.2,2)", + org.apache.commons.pool;version="[1.5,2)", + org.apache.commons.pool.impl;version="[1.5,2)", + org.apache.coyote;version="[9.0,10)", + org.apache.tomcat.util.buf;version="[9.0,10)", + org.apache.tomcat.util.http;version="[9.0,10)", org.osgi.framework.*;version="${imp.package.version.osgi.framework}", org.osgi.service.*;version="${imp.package.version.osgi.service}", + org.owasp.encoder;version="[1.2,2)", org.w3c.dom, - org.wso2.carbon.context, - org.wso2.carbon.core.util, - org.wso2.carbon.identity.base; version="${carbon.identity.imp.pkg.version}", - org.wso2.carbon.identity.core.util; version="${carbon.identity.imp.pkg.version}", - org.wso2.carbon.identity.oauth2.*; - version="${carbon.identity-inbound-auth-oauth.imp.pkg.version}", - org.wso2.carbon.tomcat.ext.valves, - org.wso2.carbon.user.api, - org.wso2.carbon.user.core.service, - org.wso2.carbon.user.core.tenant, - org.wso2.carbon.utils, - org.wso2.carbon.utils.multitenancy, - org.xml.sax, - - javax.servlet, - javax.servlet.http, - javax.xml, - org.apache.axis2.transport.http, - io.entgra.device.mgt.core.certificate.mgt.core.*, - io.entgra.device.mgt.core.device.mgt.core.permission.mgt.*, - io.entgra.device.mgt.core.device.mgt.core.util.*, - io.entgra.device.mgt.core.device.mgt.common.*, - io.entgra.device.mgt.core.device.mgt.common.permission.mgt.*, - org.apache.axis2, - org.apache.axis2.client, - org.apache.commons.codec.binary;version="${commons-codec.wso2.osgi.version.range}", - org.apache.commons.httpclient, - org.wso2.carbon.core.security, - org.apache.axis2.context, - org.apache.commons.httpclient.params, - org.apache.commons.pool, - org.apache.commons.pool.impl, - org.apache.http.conn, - org.apache.http.impl.conn, - - javax.xml.stream, - org.apache.axiom.*; version="${axiom.osgi.version.range}", - org.wso2.carbon.registry.core.*, - org.wso2.carbon.registry.common.*;version="${carbon.registry.imp.pkg.version.range}", - org.wso2.carbon.registry.indexing.*; version="${carbon.registry.imp.pkg.version.range}", - org.wso2.carbon.base, - org.owasp.encoder + org.wso2.carbon.base;version="[1.0,2)", + org.wso2.carbon.context;version="[4.8,5)", + org.wso2.carbon.core.util;version="[4.8,5)", + org.wso2.carbon.identity.oauth2;version="[6.9,7)", + org.wso2.carbon.identity.oauth2.dto;version="[6.9,7)", + org.wso2.carbon.identity.oauth2.stub;version="[6.9,7)", + org.wso2.carbon.identity.oauth2.stub.dto;version="[6.9,7)", + org.wso2.carbon.registry.core.exceptions;version="[1.0,2)", + org.wso2.carbon.registry.core.service;version="[1.0,2)", + org.wso2.carbon.registry.indexing.service;version="[4.8,5)", + org.wso2.carbon.tomcat.ext.valves;version="[4.8,5)", + org.wso2.carbon.user.api;version="[1.0,2)", + org.wso2.carbon.user.core.service;version="[4.8,5)", + org.wso2.carbon.user.core.tenant;version="[4.8,5)", + org.wso2.carbon.utils;version="[4.8,5)", + org.wso2.carbon.utils.multitenancy;version="[4.8,5)" @@ -160,6 +168,11 @@ + + org.apache.felix + org.apache.felix.scr.ds-annotations + provided + org.wso2.tomcat tomcat diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/AuthenticationFrameworkUtil.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/AuthenticationFrameworkUtil.java index baf336baf4..b8d81e96e3 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/AuthenticationFrameworkUtil.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/AuthenticationFrameworkUtil.java @@ -17,6 +17,7 @@ */ package io.entgra.device.mgt.core.webapp.authenticator.framework; +import io.entgra.device.mgt.core.webapp.authenticator.framework.internal.AuthenticatorFrameworkDataHolder; import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; import org.apache.commons.logging.Log; @@ -28,7 +29,6 @@ import org.wso2.carbon.user.api.UserRealm; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.core.service.RealmService; import org.wso2.carbon.utils.multitenancy.MultitenantUtils; -import io.entgra.device.mgt.core.webapp.authenticator.framework.internal.AuthenticatorFrameworkDataHolder; import javax.xml.XMLConstants; import javax.xml.parsers.DocumentBuilder; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/Utils/Utils.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/Utils/Utils.java index 148607606c..131a1c8479 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/Utils/Utils.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/Utils/Utils.java @@ -18,14 +18,7 @@ package io.entgra.device.mgt.core.webapp.authenticator.framework.Utils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.device.mgt.core.device.mgt.core.util.DeviceManagerUtil; -import org.wso2.carbon.user.api.TenantManager; -import org.wso2.carbon.user.api.UserStoreException; -import org.wso2.carbon.user.core.service.RealmService; -import org.wso2.carbon.utils.multitenancy.MultitenantUtils; import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationException; import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.WebappAuthenticator; @@ -33,6 +26,13 @@ import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oa import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.OAuthValidationResponse; import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.OAuthValidatorFactory; import io.entgra.device.mgt.core.webapp.authenticator.framework.internal.AuthenticatorFrameworkDataHolder; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.context.PrivilegedCarbonContext; +import org.wso2.carbon.user.api.TenantManager; +import org.wso2.carbon.user.api.UserStoreException; +import org.wso2.carbon.user.core.service.RealmService; +import org.wso2.carbon.utils.multitenancy.MultitenantUtils; import java.util.Properties; import java.util.regex.Matcher; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticationValve.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticationValve.java index 6d0152df5e..24776e3d86 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticationValve.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticationValve.java @@ -19,6 +19,9 @@ package io.entgra.device.mgt.core.webapp.authenticator.framework; import com.google.gson.Gson; +import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.WebappAuthenticator; +import io.entgra.device.mgt.core.webapp.authenticator.framework.authorizer.PermissionAuthorizer; +import io.entgra.device.mgt.core.webapp.authenticator.framework.authorizer.WebappTenantAuthorizer; import org.apache.catalina.Context; import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; @@ -32,9 +35,6 @@ import org.wso2.carbon.tomcat.ext.valves.CompositeValve; import org.wso2.carbon.user.api.Tenant; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.core.service.RealmService; -import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.WebappAuthenticator; -import io.entgra.device.mgt.core.webapp.authenticator.framework.authorizer.PermissionAuthorizer; -import io.entgra.device.mgt.core.webapp.authenticator.framework.authorizer.WebappTenantAuthorizer; import javax.servlet.http.HttpServletResponse; import java.net.InetAddress; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticatorFactory.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticatorFactory.java index 542f67d9a3..7864e0a8ea 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticatorFactory.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticatorFactory.java @@ -18,9 +18,9 @@ */ package io.entgra.device.mgt.core.webapp.authenticator.framework; -import org.apache.catalina.connector.Request; import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.WebappAuthenticator; import io.entgra.device.mgt.core.webapp.authenticator.framework.internal.AuthenticatorFrameworkDataHolder; +import org.apache.catalina.connector.Request; import java.util.Map; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/BSTAuthenticator.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/BSTAuthenticator.java index 7b6432ae6a..1a6d2f3803 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/BSTAuthenticator.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/BSTAuthenticator.java @@ -18,6 +18,12 @@ */ package io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator; +import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationException; +import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; +import io.entgra.device.mgt.core.webapp.authenticator.framework.Utils.Utils; +import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.OAuth2TokenValidator; +import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.OAuthTokenValidationException; +import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.OAuthValidationResponse; import org.apache.axiom.om.OMElement; import org.apache.axiom.om.impl.builder.StAXBuilder; import org.apache.axiom.om.util.StAXUtils; @@ -30,12 +36,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.coyote.InputBuffer; import org.apache.tomcat.util.buf.ByteChunk; -import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationException; -import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; -import io.entgra.device.mgt.core.webapp.authenticator.framework.Utils.Utils; -import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.OAuth2TokenValidator; -import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.OAuthTokenValidationException; -import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.OAuthValidationResponse; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/BasicAuthAuthenticator.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/BasicAuthAuthenticator.java index ffc9565914..c80f3aaa89 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/BasicAuthAuthenticator.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/BasicAuthAuthenticator.java @@ -18,6 +18,11 @@ */ package io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator; +import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationException; +import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; +import io.entgra.device.mgt.core.webapp.authenticator.framework.Constants; +import io.entgra.device.mgt.core.webapp.authenticator.framework.Utils.Utils; +import io.entgra.device.mgt.core.webapp.authenticator.framework.internal.AuthenticatorFrameworkDataHolder; import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; import org.apache.commons.logging.Log; @@ -27,11 +32,6 @@ import org.apache.tomcat.util.buf.MessageBytes; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.api.UserStoreManager; import org.wso2.carbon.utils.multitenancy.MultitenantUtils; -import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationException; -import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; -import io.entgra.device.mgt.core.webapp.authenticator.framework.internal.AuthenticatorFrameworkDataHolder; -import io.entgra.device.mgt.core.webapp.authenticator.framework.Constants; -import io.entgra.device.mgt.core.webapp.authenticator.framework.Utils.Utils; import java.nio.charset.Charset; import java.util.Base64; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/CertificateAuthenticator.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/CertificateAuthenticator.java index 4545b46033..c2ae19793d 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/CertificateAuthenticator.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/CertificateAuthenticator.java @@ -19,10 +19,6 @@ package io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator; -import org.apache.catalina.connector.Request; -import org.apache.catalina.connector.Response; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse; import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException; import io.entgra.device.mgt.core.certificate.mgt.core.scep.SCEPException; @@ -33,8 +29,12 @@ import io.entgra.device.mgt.core.device.mgt.common.DeviceManagementConstants; import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationException; import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; -import io.entgra.device.mgt.core.webapp.authenticator.framework.internal.AuthenticatorFrameworkDataHolder; import io.entgra.device.mgt.core.webapp.authenticator.framework.Utils.Utils; +import io.entgra.device.mgt.core.webapp.authenticator.framework.internal.AuthenticatorFrameworkDataHolder; +import org.apache.catalina.connector.Request; +import org.apache.catalina.connector.Response; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.security.cert.X509Certificate; import java.util.Properties; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/JWTAuthenticator.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/JWTAuthenticator.java index a1636159c7..4ae83e3f77 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/JWTAuthenticator.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/JWTAuthenticator.java @@ -21,6 +21,8 @@ package io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator; import com.nimbusds.jose.JWSVerifier; import com.nimbusds.jose.crypto.RSASSAVerifier; import com.nimbusds.jwt.SignedJWT; +import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; +import io.entgra.device.mgt.core.webapp.authenticator.framework.internal.AuthenticatorFrameworkDataHolder; import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; import org.apache.commons.logging.Log; @@ -35,19 +37,13 @@ import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.api.UserStoreManager; import org.wso2.carbon.utils.CarbonUtils; import org.wso2.carbon.utils.multitenancy.MultitenantUtils; -import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; -import io.entgra.device.mgt.core.webapp.authenticator.framework.internal.AuthenticatorFrameworkDataHolder; import java.io.FileInputStream; import java.security.KeyStore; import java.security.PublicKey; import java.security.interfaces.RSAPublicKey; import java.text.ParseException; -import java.util.HashMap; -import java.util.Map; -import java.util.Objects; -import java.util.Properties; -import java.util.StringTokenizer; +import java.util.*; /** * This authenticator authenticates HTTP requests using JWT header. diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/OAuthAuthenticator.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/OAuthAuthenticator.java index c239032a6e..69c51e8342 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/OAuthAuthenticator.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/OAuthAuthenticator.java @@ -18,11 +18,6 @@ */ package io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator; -import org.apache.catalina.connector.Response; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.tomcat.util.buf.ByteChunk; -import org.apache.tomcat.util.buf.MessageBytes; import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationException; import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; import io.entgra.device.mgt.core.webapp.authenticator.framework.Constants; @@ -30,6 +25,11 @@ import io.entgra.device.mgt.core.webapp.authenticator.framework.Utils.Utils; import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.OAuth2TokenValidator; import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.OAuthTokenValidationException; import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.OAuthValidationResponse; +import org.apache.catalina.connector.Response; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.tomcat.util.buf.ByteChunk; +import org.apache.tomcat.util.buf.MessageBytes; import java.util.Properties; import java.util.StringTokenizer; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/OneTimeTokenAuthenticator.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/OneTimeTokenAuthenticator.java index 7d439fbd01..c4c6c03ccc 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/OneTimeTokenAuthenticator.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/OneTimeTokenAuthenticator.java @@ -17,15 +17,15 @@ */ package io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator; -import org.apache.catalina.connector.Response; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.otp.mgt.dto.OneTimePinDTO; import io.entgra.device.mgt.core.device.mgt.common.spi.OTPManagementService; import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; import io.entgra.device.mgt.core.webapp.authenticator.framework.Constants; import io.entgra.device.mgt.core.webapp.authenticator.framework.Utils.Utils; import io.entgra.device.mgt.core.webapp.authenticator.framework.internal.AuthenticatorFrameworkDataHolder; +import org.apache.catalina.connector.Response; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.util.Properties; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/WebappAuthenticator.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/WebappAuthenticator.java index bb92594a9b..f9b55a4dac 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/WebappAuthenticator.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/WebappAuthenticator.java @@ -18,9 +18,9 @@ */ package io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator; +import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; -import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; import java.util.Properties; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/oauth/impl/LocalOAuthValidator.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/oauth/impl/LocalOAuthValidator.java index 41e6721f10..18bfc3a233 100755 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/oauth/impl/LocalOAuthValidator.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/oauth/impl/LocalOAuthValidator.java @@ -17,15 +17,15 @@ */ package io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.impl; -import org.wso2.carbon.identity.oauth2.dto.OAuth2TokenValidationRequestDTO; -import org.wso2.carbon.identity.oauth2.dto.OAuth2TokenValidationResponseDTO; -import org.wso2.carbon.utils.multitenancy.MultitenantConstants; -import org.wso2.carbon.utils.multitenancy.MultitenantUtils; -import io.entgra.device.mgt.core.webapp.authenticator.framework.internal.AuthenticatorFrameworkDataHolder; import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.OAuth2TokenValidator; import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.OAuthConstants; import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.OAuthTokenValidationException; import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.OAuthValidationResponse; +import io.entgra.device.mgt.core.webapp.authenticator.framework.internal.AuthenticatorFrameworkDataHolder; +import org.wso2.carbon.identity.oauth2.dto.OAuth2TokenValidationRequestDTO; +import org.wso2.carbon.identity.oauth2.dto.OAuth2TokenValidationResponseDTO; +import org.wso2.carbon.utils.multitenancy.MultitenantConstants; +import org.wso2.carbon.utils.multitenancy.MultitenantUtils; /** * Handles the OAuth2 token validation from the same server using OSGi services. diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/oauth/impl/RemoteOAuthValidator.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/oauth/impl/RemoteOAuthValidator.java index 1db832febf..4db78bb8d2 100755 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/oauth/impl/RemoteOAuthValidator.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/oauth/impl/RemoteOAuthValidator.java @@ -17,6 +17,10 @@ */ package io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.impl; +import io.entgra.device.mgt.core.webapp.authenticator.framework.Utils.OAuthTokenValidationStubFactory; +import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.OAuth2TokenValidator; +import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.OAuthTokenValidationException; +import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.OAuthValidationResponse; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.pool.impl.GenericObjectPool; @@ -26,10 +30,6 @@ import org.wso2.carbon.identity.oauth2.stub.dto.OAuth2TokenValidationRequestDTO_ import org.wso2.carbon.identity.oauth2.stub.dto.OAuth2TokenValidationRequestDTO_TokenValidationContextParam; import org.wso2.carbon.identity.oauth2.stub.dto.OAuth2TokenValidationResponseDTO; import org.wso2.carbon.utils.multitenancy.MultitenantUtils; -import io.entgra.device.mgt.core.webapp.authenticator.framework.Utils.OAuthTokenValidationStubFactory; -import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.OAuth2TokenValidator; -import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.OAuthTokenValidationException; -import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.OAuthValidationResponse; import java.rmi.RemoteException; import java.util.Properties; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authorizer/PermissionAuthorizer.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authorizer/PermissionAuthorizer.java index 20965b5fb7..bae38d3871 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authorizer/PermissionAuthorizer.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authorizer/PermissionAuthorizer.java @@ -17,9 +17,6 @@ */ package io.entgra.device.mgt.core.webapp.authenticator.framework.authorizer; -import org.apache.catalina.connector.Request; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.Permission; import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagementException; import io.entgra.device.mgt.core.device.mgt.common.permission.mgt.PermissionManagerService; @@ -28,6 +25,9 @@ import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationEx import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationFrameworkUtil; import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.WebappAuthenticator; +import org.apache.catalina.connector.Request; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import java.util.ArrayList; import java.util.List; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authorizer/WebappTenantAuthorizer.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authorizer/WebappTenantAuthorizer.java index 84622a3b1c..34054cd311 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authorizer/WebappTenantAuthorizer.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authorizer/WebappTenantAuthorizer.java @@ -18,9 +18,9 @@ package io.entgra.device.mgt.core.webapp.authenticator.framework.authorizer; -import org.apache.catalina.connector.Request; import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.WebappAuthenticator; +import org.apache.catalina.connector.Request; /** * This class represents the methods that are used to authorize requests based on the tenant subscription. diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/config/WebappAuthenticatorConfig.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/config/WebappAuthenticatorConfig.java index cd7ce74a1a..2e5783fcb9 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/config/WebappAuthenticatorConfig.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/config/WebappAuthenticatorConfig.java @@ -18,12 +18,12 @@ */ package io.entgra.device.mgt.core.webapp.authenticator.framework.config; +import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationFrameworkUtil; +import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticatorFrameworkException; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.w3c.dom.Document; import org.wso2.carbon.utils.CarbonUtils; -import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationFrameworkUtil; -import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticatorFrameworkException; import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBException; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/internal/AuthenticatorFrameworkDataHolder.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/internal/AuthenticatorFrameworkDataHolder.java index f241bf166c..e467723ccf 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/internal/AuthenticatorFrameworkDataHolder.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/internal/AuthenticatorFrameworkDataHolder.java @@ -21,11 +21,11 @@ package io.entgra.device.mgt.core.webapp.authenticator.framework.internal; import io.entgra.device.mgt.core.certificate.mgt.core.scep.SCEPManager; import io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementService; import io.entgra.device.mgt.core.device.mgt.common.spi.OTPManagementService; +import io.entgra.device.mgt.core.webapp.authenticator.framework.WebappAuthenticatorRepository; import org.wso2.carbon.identity.oauth2.OAuth2TokenValidationService; import org.wso2.carbon.registry.core.service.TenantRegistryLoader; import org.wso2.carbon.registry.indexing.service.TenantIndexingLoader; import org.wso2.carbon.user.core.service.RealmService; -import io.entgra.device.mgt.core.webapp.authenticator.framework.WebappAuthenticatorRepository; public class AuthenticatorFrameworkDataHolder { diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/internal/WebappAuthenticatorFrameworkServiceComponent.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/internal/WebappAuthenticatorFrameworkServiceComponent.java index 7625e6f13f..5fa88feb2c 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/internal/WebappAuthenticatorFrameworkServiceComponent.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/main/java/io/entgra/device/mgt/core/webapp/authenticator/framework/internal/WebappAuthenticatorFrameworkServiceComponent.java @@ -19,19 +19,9 @@ package io.entgra.device.mgt.core.webapp.authenticator.framework.internal; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.osgi.framework.BundleContext; -import org.osgi.service.component.ComponentContext; import io.entgra.device.mgt.core.certificate.mgt.core.scep.SCEPManager; import io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementService; import io.entgra.device.mgt.core.device.mgt.common.spi.OTPManagementService; -import org.wso2.carbon.identity.oauth2.OAuth2TokenValidationService; -import org.wso2.carbon.registry.core.service.TenantRegistryLoader; -import org.wso2.carbon.registry.indexing.service.TenantIndexingLoader; -import org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve; -import org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer; -import org.wso2.carbon.user.core.service.RealmService; import io.entgra.device.mgt.core.webapp.authenticator.framework.WebappAuthenticationValve; import io.entgra.device.mgt.core.webapp.authenticator.framework.WebappAuthenticatorRepository; import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.WebappAuthenticator; @@ -39,60 +29,30 @@ import io.entgra.device.mgt.core.webapp.authenticator.framework.config.Authentic import io.entgra.device.mgt.core.webapp.authenticator.framework.config.AuthenticatorConfigService; import io.entgra.device.mgt.core.webapp.authenticator.framework.config.WebappAuthenticatorConfig; import io.entgra.device.mgt.core.webapp.authenticator.framework.config.impl.AuthenticatorConfigServiceImpl; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.osgi.framework.BundleContext; +import org.osgi.service.component.ComponentContext; +import org.osgi.service.component.annotations.*; +import org.wso2.carbon.identity.oauth2.OAuth2TokenValidationService; +import org.wso2.carbon.registry.core.service.TenantRegistryLoader; +import org.wso2.carbon.registry.indexing.service.TenantIndexingLoader; +import org.wso2.carbon.tomcat.ext.valves.CarbonTomcatValve; +import org.wso2.carbon.tomcat.ext.valves.TomcatValveContainer; +import org.wso2.carbon.user.core.service.RealmService; import java.util.ArrayList; import java.util.List; import java.util.Properties; -/** - * @scr.component name="org.wso2.carbon.webapp.authenticator" immediate="true" - * @scr.reference name="user.realmservice.default" - * interface="org.wso2.carbon.user.core.service.RealmService" - * cardinality="1..1" - * policy="dynamic" - * bind="setRealmService" - * unbind="unsetRealmService" - * @scr.reference name="org.wso2.carbon.certificate.mgt" - * interface="io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementService" - * policy="dynamic" - * cardinality="1..n" - * bind="setCertificateManagementService" - * unbind="unsetCertificateManagementService" - * @scr.reference name="io.entgra.device.mgt.core.certificate.mgt.core.scep" - * interface="io.entgra.device.mgt.core.certificate.mgt.core.scep.SCEPManager" - * policy="dynamic" - * cardinality="1..n" - * bind="setSCEPManagementService" - * unbind="unsetSCEPManagementService" - * @scr.reference name="identity.oauth2.validation.service" - * interface="org.wso2.carbon.identity.oauth2.OAuth2TokenValidationService" - * cardinality="1..1" - * policy="dynamic" - * bind="setOAuth2ValidationService" - * unbind="unsetOAuth2ValidationService" - * @scr.reference name="tenant.indexloader" - * interface="org.wso2.carbon.registry.indexing.service.TenantIndexingLoader" - * cardinality="1..1" - * policy="dynamic" - * bind="setTenantIndexLoader" - * unbind="unsetTenantIndexLoader" - * @scr.reference name="tenant.registryloader" - * interface="org.wso2.carbon.registry.core.service.TenantRegistryLoader" - * cardinality="1..1" policy="dynamic" - * bind="setTenantRegistryLoader" - * unbind="unsetTenantRegistryLoader" - * @scr.reference name="org.wso2.carbon.device.manager" - * interface="io.entgra.device.mgt.core.device.mgt.common.spi.OTPManagementService" - * cardinality="1..1" - * policy="dynamic" - * bind="setOTPManagementService" - * unbind="unsetOTPManagementService" - */ - +@Component( + name = "io.entgra.device.mgt.core.webapp.authenticator.framework.internal.WebappAuthenticatorFrameworkServiceComponent", + immediate = true) public class WebappAuthenticatorFrameworkServiceComponent { private static final Log log = LogFactory.getLog(WebappAuthenticatorFrameworkServiceComponent.class); @SuppressWarnings("unused") + @Activate protected void activate(ComponentContext componentContext) { if (log.isDebugEnabled()) { log.debug("Starting Web Application Authenticator Framework Bundle"); @@ -135,10 +95,17 @@ public class WebappAuthenticatorFrameworkServiceComponent { } @SuppressWarnings("unused") + @Deactivate protected void deactivate(ComponentContext componentContext) { //do nothing } + @Reference( + name = "realm.service", + service = org.wso2.carbon.user.core.service.RealmService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetRealmService") protected void setRealmService(RealmService realmService) { if (log.isDebugEnabled()) { log.debug("RealmService acquired"); @@ -150,6 +117,12 @@ public class WebappAuthenticatorFrameworkServiceComponent { AuthenticatorFrameworkDataHolder.getInstance().setRealmService(null); } + @Reference( + name = "certificate.mgt.service", + service = io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementService.class, + cardinality = ReferenceCardinality.MULTIPLE, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetCertificateManagementService") protected void setCertificateManagementService(CertificateManagementService certificateManagementService) { if (log.isDebugEnabled()) { log.debug("Setting certificate management service"); @@ -165,6 +138,12 @@ public class WebappAuthenticatorFrameworkServiceComponent { AuthenticatorFrameworkDataHolder.getInstance().setCertificateManagementService(null); } + @Reference( + name = "scep.mgr", + service = io.entgra.device.mgt.core.certificate.mgt.core.scep.SCEPManager.class, + cardinality = ReferenceCardinality.MULTIPLE, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetSCEPManagementService") protected void setSCEPManagementService(SCEPManager scepManager) { if (log.isDebugEnabled()) { log.debug("Setting SCEP management service"); @@ -185,6 +164,12 @@ public class WebappAuthenticatorFrameworkServiceComponent { * * @param tokenValidationService An instance of OAuth2TokenValidationService */ + @Reference( + name = "oauth2.token.validation.service", + service = org.wso2.carbon.identity.oauth2.OAuth2TokenValidationService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetOAuth2ValidationService") protected void setOAuth2ValidationService(OAuth2TokenValidationService tokenValidationService) { if (log.isDebugEnabled()) { log.debug("Setting OAuth2TokenValidationService Service"); @@ -204,6 +189,12 @@ public class WebappAuthenticatorFrameworkServiceComponent { AuthenticatorFrameworkDataHolder.getInstance().setOAuth2TokenValidationService(null); } + @Reference( + name = "tenant.index.loader", + service = org.wso2.carbon.registry.indexing.service.TenantIndexingLoader.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetTenantIndexLoader") protected void setTenantIndexLoader(TenantIndexingLoader tenantIndexLoader) { AuthenticatorFrameworkDataHolder.getInstance().setTenantIndexingLoader(tenantIndexLoader); } @@ -212,6 +203,12 @@ public class WebappAuthenticatorFrameworkServiceComponent { AuthenticatorFrameworkDataHolder.getInstance().setTenantIndexingLoader(null); } + @Reference( + name = "tenant.registry.loader", + service = org.wso2.carbon.registry.core.service.TenantRegistryLoader.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetTenantRegistryLoader") protected void setTenantRegistryLoader(TenantRegistryLoader tenantRegistryLoader) { AuthenticatorFrameworkDataHolder.getInstance().setTenantRegistryLoader(tenantRegistryLoader); } @@ -220,6 +217,12 @@ public class WebappAuthenticatorFrameworkServiceComponent { AuthenticatorFrameworkDataHolder.getInstance().setTenantRegistryLoader(null); } + @Reference( + name = "otp.mgt.service", + service = io.entgra.device.mgt.core.device.mgt.common.spi.OTPManagementService.class, + cardinality = ReferenceCardinality.MANDATORY, + policy = ReferencePolicy.DYNAMIC, + unbind = "unsetOTPManagementService") protected void setOTPManagementService(OTPManagementService otpManagementService) { if (log.isDebugEnabled()) { log.debug("Setting OTP Management OSGI Service"); diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/BaseWebAppAuthenticatorFrameworkTest.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/BaseWebAppAuthenticatorFrameworkTest.java index 13b274663f..08ae619986 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/BaseWebAppAuthenticatorFrameworkTest.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/BaseWebAppAuthenticatorFrameworkTest.java @@ -19,12 +19,15 @@ package io.entgra.device.mgt.core.webapp.authenticator.framework; +import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; +import io.entgra.device.mgt.core.device.mgt.core.permission.mgt.PermissionUtils; +import io.entgra.device.mgt.core.webapp.authenticator.framework.internal.AuthenticatorFrameworkDataHolder; +import io.entgra.device.mgt.core.webapp.authenticator.framework.util.TestTenantIndexingLoader; +import io.entgra.device.mgt.core.webapp.authenticator.framework.util.TestTenantRegistryLoader; import org.testng.annotations.BeforeSuite; import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.core.internal.CarbonCoreDataHolder; -import io.entgra.device.mgt.core.device.mgt.core.internal.DeviceManagementDataHolder; -import io.entgra.device.mgt.core.device.mgt.core.permission.mgt.PermissionUtils; import org.wso2.carbon.registry.core.config.RegistryContext; import org.wso2.carbon.registry.core.exceptions.RegistryException; import org.wso2.carbon.registry.core.internal.RegistryDataHolder; @@ -35,9 +38,6 @@ import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.api.UserStoreManager; import org.wso2.carbon.user.core.service.RealmService; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; -import io.entgra.device.mgt.core.webapp.authenticator.framework.internal.AuthenticatorFrameworkDataHolder; -import io.entgra.device.mgt.core.webapp.authenticator.framework.util.TestTenantIndexingLoader; -import io.entgra.device.mgt.core.webapp.authenticator.framework.util.TestTenantRegistryLoader; import java.io.File; import java.io.InputStream; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticationValveTest.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticationValveTest.java index 54ed7447d7..32dc4cc825 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticationValveTest.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticationValveTest.java @@ -19,6 +19,7 @@ package io.entgra.device.mgt.core.webapp.authenticator.framework; +import io.entgra.device.mgt.core.webapp.authenticator.framework.util.TestRequest; import org.apache.catalina.Context; import org.apache.catalina.connector.Connector; import org.apache.catalina.connector.Request; @@ -31,7 +32,6 @@ import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import org.wso2.carbon.tomcat.ext.valves.CompositeValve; -import io.entgra.device.mgt.core.webapp.authenticator.framework.util.TestRequest; import javax.servlet.http.HttpServletResponse; import java.lang.reflect.Field; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticatorConfigTest.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticatorConfigTest.java index 1a2e3054e7..cd59086a01 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticatorConfigTest.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticatorConfigTest.java @@ -18,16 +18,15 @@ */ package io.entgra.device.mgt.core.webapp.authenticator.framework; -import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticatorFrameworkException; +import io.entgra.device.mgt.core.webapp.authenticator.framework.config.AuthenticatorConfig; +import io.entgra.device.mgt.core.webapp.authenticator.framework.config.AuthenticatorConfigService; +import io.entgra.device.mgt.core.webapp.authenticator.framework.config.WebappAuthenticatorConfig; +import io.entgra.device.mgt.core.webapp.authenticator.framework.config.impl.AuthenticatorConfigServiceImpl; import org.testng.Assert; import org.testng.annotations.AfterClass; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import org.wso2.carbon.utils.ServerConstants; -import io.entgra.device.mgt.core.webapp.authenticator.framework.config.AuthenticatorConfig; -import io.entgra.device.mgt.core.webapp.authenticator.framework.config.AuthenticatorConfigService; -import io.entgra.device.mgt.core.webapp.authenticator.framework.config.WebappAuthenticatorConfig; -import io.entgra.device.mgt.core.webapp.authenticator.framework.config.impl.AuthenticatorConfigServiceImpl; import java.util.List; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticatorFrameworkUtilTest.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticatorFrameworkUtilTest.java index fa69b1a472..4fc7a1e799 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticatorFrameworkUtilTest.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticatorFrameworkUtilTest.java @@ -18,6 +18,7 @@ */ package io.entgra.device.mgt.core.webapp.authenticator.framework; +import io.entgra.device.mgt.core.webapp.authenticator.framework.Utils.OAuthTokenValidationStubFactory; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.pool.ObjectPool; @@ -25,7 +26,6 @@ import org.apache.commons.pool.impl.GenericObjectPool; import org.testng.Assert; import org.testng.annotations.Test; import org.wso2.carbon.identity.oauth2.stub.OAuth2TokenValidationServiceStub; -import io.entgra.device.mgt.core.webapp.authenticator.framework.Utils.OAuthTokenValidationStubFactory; import java.util.Properties; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticatorRepositoryTest.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticatorRepositoryTest.java index c4603294c3..2a4c2b4a12 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticatorRepositoryTest.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/WebappAuthenticatorRepositoryTest.java @@ -18,12 +18,11 @@ */ package io.entgra.device.mgt.core.webapp.authenticator.framework; -import io.entgra.device.mgt.core.webapp.authenticator.framework.WebappAuthenticatorRepository; -import org.testng.Assert; -import org.testng.annotations.Test; import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.WebappAuthenticator; import io.entgra.device.mgt.core.webapp.authenticator.framework.util.MalformedAuthenticator; import io.entgra.device.mgt.core.webapp.authenticator.framework.util.TestWebappAuthenticator; +import org.testng.Assert; +import org.testng.annotations.Test; public class WebappAuthenticatorRepositoryTest { diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/BSTAuthenticatorTest.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/BSTAuthenticatorTest.java index d853b6d70d..208fba85d5 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/BSTAuthenticatorTest.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/BSTAuthenticatorTest.java @@ -19,6 +19,10 @@ package io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator; +import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; +import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.OAuth2TokenValidator; +import io.entgra.device.mgt.core.webapp.authenticator.framework.internal.AuthenticatorFrameworkDataHolder; +import io.entgra.device.mgt.core.webapp.authenticator.framework.util.TestInputBuffer; import org.apache.catalina.Context; import org.apache.catalina.connector.Request; import org.apache.catalina.core.StandardContext; @@ -33,10 +37,6 @@ import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.identity.oauth2.OAuth2TokenValidationService; import org.wso2.carbon.identity.oauth2.dto.OAuth2ClientApplicationDTO; import org.wso2.carbon.identity.oauth2.dto.OAuth2TokenValidationResponseDTO; -import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; -import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.OAuth2TokenValidator; -import io.entgra.device.mgt.core.webapp.authenticator.framework.internal.AuthenticatorFrameworkDataHolder; -import io.entgra.device.mgt.core.webapp.authenticator.framework.util.TestInputBuffer; import java.io.File; import java.io.IOException; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/BasicAuthAuthenticatorTest.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/BasicAuthAuthenticatorTest.java index dff4a120da..1e00539738 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/BasicAuthAuthenticatorTest.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/BasicAuthAuthenticatorTest.java @@ -19,6 +19,8 @@ package io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator; +import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; +import io.entgra.device.mgt.core.webapp.authenticator.framework.BaseWebAppAuthenticatorFrameworkTest; import org.apache.catalina.Context; import org.apache.catalina.connector.Request; import org.apache.catalina.core.StandardContext; @@ -27,11 +29,8 @@ import org.apache.tomcat.util.buf.MessageBytes; import org.apache.tomcat.util.http.MimeHeaders; import org.testng.Assert; import org.testng.annotations.BeforeClass; -import org.testng.annotations.BeforeTest; import org.testng.annotations.Test; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; -import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; -import io.entgra.device.mgt.core.webapp.authenticator.framework.BaseWebAppAuthenticatorFrameworkTest; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/CertificateAuthenticatorTest.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/CertificateAuthenticatorTest.java index 70d24be3ba..0011f87256 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/CertificateAuthenticatorTest.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/CertificateAuthenticatorTest.java @@ -19,22 +19,6 @@ package io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator; -import org.apache.catalina.Context; -import org.apache.catalina.connector.Request; -import org.apache.catalina.core.StandardContext; -import org.apache.tomcat.util.buf.MessageBytes; -import org.apache.tomcat.util.http.MimeHeaders; -import org.bouncycastle.cert.jcajce.JcaCertStore; -import org.bouncycastle.cms.CMSAbsentContent; -import org.bouncycastle.cms.CMSException; -import org.bouncycastle.cms.CMSSignedData; -import org.bouncycastle.cms.CMSSignedDataGenerator; -import org.h2.jdbcx.JdbcDataSource; -import org.mockito.Mockito; -import org.testng.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; -import org.wso2.carbon.base.MultitenantConstants; import io.entgra.device.mgt.core.certificate.mgt.core.dao.CertificateManagementDAOFactory; import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException; import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator; @@ -46,12 +30,28 @@ import io.entgra.device.mgt.core.certificate.mgt.core.scep.TenantedDeviceWrapper import io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementService; import io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementServiceImpl; import io.entgra.device.mgt.core.device.mgt.common.Device; -import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo; +import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException; import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager; import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; import io.entgra.device.mgt.core.webapp.authenticator.framework.internal.AuthenticatorFrameworkDataHolder; import io.entgra.device.mgt.core.webapp.authenticator.framework.util.TestCertificateGenerator; +import org.apache.catalina.Context; +import org.apache.catalina.connector.Request; +import org.apache.catalina.core.StandardContext; +import org.apache.tomcat.util.buf.MessageBytes; +import org.apache.tomcat.util.http.MimeHeaders; +import org.bouncycastle.cert.jcajce.JcaCertStore; +import org.bouncycastle.cms.CMSAbsentContent; +import org.bouncycastle.cms.CMSException; +import org.bouncycastle.cms.CMSSignedData; +import org.bouncycastle.cms.CMSSignedDataGenerator; +import org.h2.jdbcx.JdbcDataSource; +import org.mockito.Mockito; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; +import org.wso2.carbon.base.MultitenantConstants; import javax.sql.DataSource; import java.io.File; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/JWTAuthenticatorTest.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/JWTAuthenticatorTest.java index e4bee2f65d..cee5aa1a62 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/JWTAuthenticatorTest.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/JWTAuthenticatorTest.java @@ -18,6 +18,10 @@ package io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator; +import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.JWTConfig; +import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; +import io.entgra.device.mgt.core.identity.jwt.client.extension.util.JWTClientUtil; +import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; import org.apache.catalina.connector.Request; import org.apache.tomcat.util.buf.MessageBytes; import org.apache.tomcat.util.http.MimeHeaders; @@ -25,10 +29,6 @@ import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import org.wso2.carbon.base.MultitenantConstants; -import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.JWTConfig; -import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; -import io.entgra.device.mgt.core.identity.jwt.client.extension.util.JWTClientUtil; -import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; import java.io.File; import java.io.FileInputStream; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/OauthAuthenticatorTest.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/OauthAuthenticatorTest.java index 06523cee48..c3551da26a 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/OauthAuthenticatorTest.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/authenticator/OauthAuthenticatorTest.java @@ -19,6 +19,9 @@ package io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator; +import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; +import io.entgra.device.mgt.core.webapp.authenticator.framework.BaseWebAppAuthenticatorFrameworkTest; +import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.impl.RemoteOAuthValidator; import org.apache.catalina.connector.Request; import org.apache.commons.pool.impl.GenericObjectPool; import org.apache.tomcat.util.buf.MessageBytes; @@ -27,13 +30,9 @@ import org.mockito.Mockito; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import org.wso2.carbon.core.security.AuthenticatorsConfiguration; import org.wso2.carbon.identity.oauth2.stub.OAuth2TokenValidationServiceStub; import org.wso2.carbon.identity.oauth2.stub.dto.OAuth2ClientApplicationDTO; import org.wso2.carbon.identity.oauth2.stub.dto.OAuth2TokenValidationResponseDTO; -import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; -import io.entgra.device.mgt.core.webapp.authenticator.framework.BaseWebAppAuthenticatorFrameworkTest; -import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.oauth.impl.RemoteOAuthValidator; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/util/MalformedAuthenticator.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/util/MalformedAuthenticator.java index 7843cd0747..096b6dbe3c 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/util/MalformedAuthenticator.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/util/MalformedAuthenticator.java @@ -18,10 +18,10 @@ */ package io.entgra.device.mgt.core.webapp.authenticator.framework.util; -import org.apache.catalina.connector.Request; -import org.apache.catalina.connector.Response; import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.WebappAuthenticator; +import org.apache.catalina.connector.Request; +import org.apache.catalina.connector.Response; import java.util.Properties; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/util/TestCertificateGenerator.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/util/TestCertificateGenerator.java index 935a4a3e22..b9cf031421 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/util/TestCertificateGenerator.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/util/TestCertificateGenerator.java @@ -19,6 +19,11 @@ package io.entgra.device.mgt.core.webapp.authenticator.framework.util; +import io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate; +import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException; +import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator; +import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagementConstants; +import io.entgra.device.mgt.core.certificate.mgt.core.util.CommonUtil; import org.bouncycastle.cert.X509v3CertificateBuilder; import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter; import org.bouncycastle.cert.jcajce.JcaX509v3CertificateBuilder; @@ -26,23 +31,11 @@ import org.bouncycastle.jce.provider.BouncyCastleProvider; import org.bouncycastle.operator.ContentSigner; import org.bouncycastle.operator.OperatorCreationException; import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder; -import io.entgra.device.mgt.core.certificate.mgt.core.bean.Certificate; -import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException; -import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator; -import io.entgra.device.mgt.core.certificate.mgt.core.util.CertificateManagementConstants; -import io.entgra.device.mgt.core.certificate.mgt.core.util.CommonUtil; import org.wso2.carbon.context.PrivilegedCarbonContext; import javax.security.auth.x500.X500Principal; import java.math.BigInteger; -import java.security.InvalidKeyException; -import java.security.KeyPair; -import java.security.KeyPairGenerator; -import java.security.NoSuchAlgorithmException; -import java.security.NoSuchProviderException; -import java.security.SecureRandom; -import java.security.Security; -import java.security.SignatureException; +import java.security.*; import java.security.cert.CertificateException; import java.security.cert.CertificateExpiredException; import java.security.cert.CertificateNotYetValidException; diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/util/TestWebappAuthenticator.java b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/util/TestWebappAuthenticator.java index 460a3ae824..caf8ad4390 100644 --- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/util/TestWebappAuthenticator.java +++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/src/test/java/io/entgra/device/mgt/core/webapp/authenticator/framework/util/TestWebappAuthenticator.java @@ -18,10 +18,10 @@ */ package io.entgra.device.mgt.core.webapp.authenticator.framework.util; -import org.apache.catalina.connector.Request; -import org.apache.catalina.connector.Response; import io.entgra.device.mgt.core.webapp.authenticator.framework.AuthenticationInfo; import io.entgra.device.mgt.core.webapp.authenticator.framework.authenticator.WebappAuthenticator; +import org.apache.catalina.connector.Request; +import org.apache.catalina.connector.Response; import java.util.Properties; diff --git a/components/webapp-authenticator-framework/pom.xml b/components/webapp-authenticator-framework/pom.xml index 316f49a919..ba421a7957 100644 --- a/components/webapp-authenticator-framework/pom.xml +++ b/components/webapp-authenticator-framework/pom.xml @@ -31,29 +31,10 @@ webapp-authenticator-framework pom WSO2 Carbon - Webapp Authenticator Framework - http://wso2.org + https://entgra.io io.entgra.device.mgt.core.webapp.authenticator.framework - - - - - - - - - - - - - - - - - - - diff --git a/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.feature/pom.xml b/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.feature/pom.xml index 9bf539951e..86dcd4cc7e 100644 --- a/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.feature/pom.xml +++ b/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.feature/pom.xml @@ -29,7 +29,7 @@ io.entgra.device.mgt.core.apimgt.application.extension.feature pom WSO2 Carbon - API Management Application Extension Feature - http://wso2.org + https://entgra.io This feature contains an implementation of a api application registration, which takes care of subscription and generating keys. diff --git a/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.feature/pom.xml b/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.feature/pom.xml index 9cdd5f9e48..4f5e779833 100644 --- a/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.feature/pom.xml +++ b/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.feature/pom.xml @@ -29,7 +29,7 @@ io.entgra.device.mgt.core.apimgt.keymgt.extension.feature pom WSO2 Carbon - Api Key Mgt Extensions Feature - http://wso2.org + https://entgra.io This feature contains apimgt related key management extensions diff --git a/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher.feature/pom.xml b/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher.feature/pom.xml index 3b7e131862..88622fa4fb 100644 --- a/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher.feature/pom.xml +++ b/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher.feature/pom.xml @@ -29,7 +29,7 @@ io.entgra.device.mgt.core.apimgt.webapp.publisher.feature pom WSO2 Carbon - API Management Webapp Publisher Feature - http://wso2.org + https://entgra.io This feature contains an implementation of a Tomcat lifecycle listener, which takes care of publishing JAX-RS web applications as 'Managed APIs' @@ -44,7 +44,7 @@ io.entgra.device.mgt.core.apimgt.annotations - org.wso2.orbit.org.scannotation + io.entgra.org.scannotation scannotation @@ -141,7 +141,7 @@ io.entgra.device.mgt.core:io.entgra.device.mgt.core.apimgt.annotations:${io.entgra.device.mgt.core.version} - org.wso2.orbit.org.scannotation:scannotation:${scannotation.version} + io.entgra.org.scannotation:scannotation:${scannotation.version} io.swagger:swagger-annotations:${swagger.version} diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml index 6f2ae848bd..59bd3de0b2 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml @@ -30,7 +30,7 @@ org.wso2.carbon.apimgt.handler.server.feature pom WSO2 Carbon - Device Management - APIM handler Server Feature - http://wso2.org + https://entgra.io This feature contains the handler for the api authentications diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml index 9f8f8b4940..880622d16f 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml @@ -29,7 +29,7 @@ org.wso2.carbon.apimgt.integration.client.feature pom WSO2 Carbon - APIM Integration Client Feature - http://wso2.org + https://entgra.io This feature contains a http client implementation to communicate with WSO2-APIM server diff --git a/features/apimgt-extensions/pom.xml b/features/apimgt-extensions/pom.xml index bf4e7eb9b0..a50278538c 100644 --- a/features/apimgt-extensions/pom.xml +++ b/features/apimgt-extensions/pom.xml @@ -31,7 +31,7 @@ apimgt-extensions-feature pom WSO2 Carbon - API Management Extensions Feature - http://wso2.org + https://entgra.io io.entgra.device.mgt.core.apimgt.webapp.publisher.feature diff --git a/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/conf/datasources/application-mgt-datasources.xml b/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/conf/datasources/application-mgt-datasources.xml index 49f02f9318..234785a932 100644 --- a/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/conf/datasources/application-mgt-datasources.xml +++ b/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/conf/datasources/application-mgt-datasources.xml @@ -16,7 +16,7 @@ ~ under the License. --> - + org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader diff --git a/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql b/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql index f9c5861831..961e855337 100644 --- a/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql +++ b/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql @@ -42,6 +42,7 @@ CREATE TABLE IF NOT EXISTS AP_APP_RELEASE( RATED_USERS INTEGER NULL, AP_APP_ID INTEGER NOT NULL, PRIMARY KEY (ID), + CONSTRAINT UUID_CONSTRAINT UNIQUE (UUID), CONSTRAINT fk_AP_APP_RELEASE_AP_APP1 FOREIGN KEY (AP_APP_ID) REFERENCES AP_APP (ID) ON DELETE NO ACTION ON UPDATE NO ACTION @@ -267,7 +268,7 @@ CREATE INDEX fk_AP_APP_SUB_OP_MAPPING_AP_DEVICE_SUBSCRIPTION1_idx ON AP_APP_SUB_ CREATE TABLE IF NOT EXISTS AP_SCHEDULED_SUBSCRIPTION( ID INTEGER NOT NULL AUTO_INCREMENT, TASK_NAME VARCHAR(100) NOT NULL, - APPLICATION_UUID VARCHAR(36) NOT NULL, + APPLICATION_UUID VARCHAR(200) NOT NULL, SUBSCRIBER_LIST LONGVARCHAR NOT NULL, STATUS VARCHAR(15) NOT NULL, SCHEDULED_AT BIGINT NOT NULL, diff --git a/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.api.feature/pom.xml b/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.api.feature/pom.xml index 0a6662b1f1..ce9838e76a 100644 --- a/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.api.feature/pom.xml +++ b/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.api.feature/pom.xml @@ -30,7 +30,7 @@ io.entgra.device.mgt.core.certificate.mgt.api.feature pom WSO2 Carbon - Certificate Management API Feature - http://wso2.org + https://entgra.io This feature contains the APIs required for Certificate Management. diff --git a/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.feature/pom.xml b/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.feature/pom.xml index 736b0bd3d3..4e6b59d9b8 100644 --- a/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.feature/pom.xml +++ b/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.feature/pom.xml @@ -30,7 +30,7 @@ io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.feature pom WSO2 Carbon - Admin Certificate Management API Feature - http://wso2.org + https://entgra.io This feature contains the APIs required for Admin Certificate Management. diff --git a/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.server.feature/pom.xml b/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.server.feature/pom.xml index d2b9cc6553..dfe299370c 100644 --- a/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.server.feature/pom.xml +++ b/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.server.feature/pom.xml @@ -30,7 +30,7 @@ io.entgra.device.mgt.core.certificate.mgt.server.feature pom WSO2 Carbon - Certificate Management Server Feature - http://wso2.org + https://entgra.io This feature contains the core bundles required for back-end Certificate Management functionality @@ -48,7 +48,7 @@ bcpkix-jdk15on - org.wso2.orbit.com.google.code.jscep + io.entgra.com.google.code.jscep jscep @@ -123,7 +123,7 @@ org.wso2.orbit.org.bouncycastle:bcpkix-jdk15on:${bcpkix.wso2.version} - org.wso2.orbit.com.google.code.jscep:jscep:${jscep.version} + io.entgra.com.google.code.jscep:jscep:${jscep.version} commons-io.wso2:commons-io:${version.commons.io} diff --git a/features/certificate-mgt/pom.xml b/features/certificate-mgt/pom.xml index 8999232efa..0109ad3b2c 100644 --- a/features/certificate-mgt/pom.xml +++ b/features/certificate-mgt/pom.xml @@ -30,7 +30,7 @@ certificate-mgt-feature pom WSO2 Carbon - Certificate Management Feature - http://wso2.org + https://entgra.io io.entgra.device.mgt.core.certificate.mgt.server.feature diff --git a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.feature/pom.xml b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.feature/pom.xml index 60734677e6..e28b7d84c6 100644 --- a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.feature/pom.xml +++ b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.feature/pom.xml @@ -30,7 +30,7 @@ io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.feature pom WSO2 Carbon - Device Type Deployer Feature - http://wso2.org + https://entgra.io WSO2 Carbon - Device Type Deployer Feature diff --git a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml index 2779d21ec7..107de3a233 100644 --- a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml +++ b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml @@ -30,7 +30,7 @@ io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm.feature pom WSO2 Carbon - FCM Based Push Notification Provider Feature - http://wso2.org + https://entgra.io WSO2 Carbon - MQTT Based Push Notification Provider Feature diff --git a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http.feature/pom.xml b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http.feature/pom.xml index 9b660889a8..9c42d63459 100644 --- a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http.feature/pom.xml +++ b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http.feature/pom.xml @@ -30,7 +30,7 @@ io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http.feature pom WSO2 Carbon - MQTT Based Push Notification Provider Feature - http://wso2.org + https://entgra.io WSO2 Carbon - MQTT Based Push Notification Provider Feature diff --git a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml index 43b3dde6fb..9c23966075 100644 --- a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml +++ b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml @@ -30,7 +30,7 @@ io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt.feature pom WSO2 Carbon - MQTT Based Push Notification Provider Feature - http://wso2.org + https://entgra.io WSO2 Carbon - MQTT Based Push Notification Provider Feature diff --git a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml index 8014092801..c2c9259331 100644 --- a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml +++ b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml @@ -30,7 +30,7 @@ io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp.feature pom WSO2 Carbon - XMPP Based Push Notification Provider Feature - http://wso2.org + https://entgra.io WSO2 Carbon - XMPP Based Push Notification Provider Feature diff --git a/features/device-mgt-extensions/pom.xml b/features/device-mgt-extensions/pom.xml index 0f0c542f6c..a691ca886a 100644 --- a/features/device-mgt-extensions/pom.xml +++ b/features/device-mgt-extensions/pom.xml @@ -30,7 +30,7 @@ device-mgt-extensions-feature pom WSO2 Carbon - Device Management Extensions Feature - http://wso2.org + https://entgra.io io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.feature diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.api.feature/pom.xml b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.api.feature/pom.xml index 5ed82c80ef..2340bb89c7 100644 --- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.api.feature/pom.xml +++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.api.feature/pom.xml @@ -30,7 +30,7 @@ io.entgra.device.mgt.core.device.mgt.api.feature pom WSO2 Carbon - Device Management API Feature - http://wso2.org + https://entgra.io This feature contains the APIs required for Device Management console UI diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/pom.xml b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/pom.xml index f813b763a3..db92ee8599 100644 --- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/pom.xml +++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/pom.xml @@ -30,7 +30,7 @@ io.entgra.device.mgt.core.device.mgt.basics.feature pom WSO2 Carbon - Device Management Basics Feature - http://wso2.org + https://entgra.io This feature contains the core bundles required for Basic Device Management functionality diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/datasources/cdm-datasources.xml b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/datasources/cdm-datasources.xml index 3c83ee5d99..6ad6ddd274 100755 --- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/datasources/cdm-datasources.xml +++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/datasources/cdm-datasources.xml @@ -16,7 +16,7 @@ ~ under the License. --> - + org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/datasources/reporting-mgt-datasources.xml b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/datasources/reporting-mgt-datasources.xml index 4a518e77ac..24fb4508a3 100644 --- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/datasources/reporting-mgt-datasources.xml +++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/datasources/reporting-mgt-datasources.xml @@ -16,7 +16,7 @@ ~ under the License. --> - + org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/h2.sql b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/h2.sql index f675cfb0f3..87842e9da6 100644 --- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/h2.sql +++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/h2.sql @@ -42,7 +42,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE ( ID INTEGER auto_increment NOT NULL, DESCRIPTION TEXT DEFAULT NULL, NAME VARCHAR(100) DEFAULT NULL, - DEVICE_TYPE_ID INT(11) DEFAULT NULL, + DEVICE_TYPE_ID INT DEFAULT NULL, DEVICE_IDENTIFICATION VARCHAR(300) DEFAULT NULL, LAST_UPDATED_TIMESTAMP TIMESTAMP NOT NULL, TENANT_ID INTEGER DEFAULT 0, @@ -188,17 +188,17 @@ CREATE TABLE IF NOT EXISTS DM_PROFILE ( ); CREATE TABLE IF NOT EXISTS DM_POLICY ( - ID INT(11) NOT NULL AUTO_INCREMENT , + ID INT NOT NULL AUTO_INCREMENT , NAME VARCHAR(45) DEFAULT NULL , DESCRIPTION VARCHAR(1000) NULL, PAYLOAD_VERSION VARCHAR (45) NULL, - TENANT_ID INT(11) NOT NULL , - PROFILE_ID INT(11) NOT NULL , + TENANT_ID INT NOT NULL , + PROFILE_ID INT NOT NULL , OWNERSHIP_TYPE VARCHAR(45) NULL, COMPLIANCE VARCHAR(100) NULL, PRIORITY INT NOT NULL, - ACTIVE INT(2) NOT NULL, - UPDATED INT(1) NULL, + ACTIVE INT NOT NULL, + UPDATED INT NULL, POLICY_TYPE VARCHAR(45) NULL, PRIMARY KEY (ID) , CONSTRAINT FK_DM_PROFILE_DM_POLICY @@ -209,11 +209,11 @@ CREATE TABLE IF NOT EXISTS DM_POLICY ( ); CREATE TABLE IF NOT EXISTS DM_DEVICE_POLICY ( - ID INT(11) NOT NULL AUTO_INCREMENT , - DEVICE_ID INT(11) NOT NULL , - ENROLMENT_ID INT(11) NOT NULL, + ID INT NOT NULL AUTO_INCREMENT , + DEVICE_ID INT NOT NULL , + ENROLMENT_ID INT NOT NULL, DEVICE BLOB NOT NULL, - POLICY_ID INT(11) NOT NULL , + POLICY_ID INT NOT NULL , PRIMARY KEY (ID) , CONSTRAINT FK_POLICY_DEVICE_POLICY FOREIGN KEY (POLICY_ID ) @@ -228,9 +228,9 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_POLICY ( ); CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE_POLICY ( - ID INT(11) NOT NULL , + ID INT NOT NULL , DEVICE_TYPE VARCHAR(300) NOT NULL , - POLICY_ID INT(11) NOT NULL , + POLICY_ID INT NOT NULL , PRIMARY KEY (ID) , CONSTRAINT FK_DEVICE_TYPE_POLICY FOREIGN KEY (POLICY_ID ) @@ -240,11 +240,11 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_TYPE_POLICY ( ); CREATE TABLE IF NOT EXISTS DM_PROFILE_FEATURES ( - ID INT(11) NOT NULL AUTO_INCREMENT, - PROFILE_ID INT(11) NOT NULL, + ID INT NOT NULL AUTO_INCREMENT, + PROFILE_ID INT NOT NULL, FEATURE_CODE VARCHAR(100) NOT NULL, DEVICE_TYPE VARCHAR(300) NOT NULL, - TENANT_ID INT(11) NOT NULL , + TENANT_ID INT NOT NULL , CONTENT BLOB NULL DEFAULT NULL, PRIMARY KEY (ID), CONSTRAINT FK_DM_PROFILE_DM_POLICY_FEATURES @@ -255,11 +255,11 @@ CREATE TABLE IF NOT EXISTS DM_PROFILE_FEATURES ( ); CREATE TABLE IF NOT EXISTS DM_POLICY_CORRECTIVE_ACTION ( - ID INT(11) NOT NULL AUTO_INCREMENT, + ID INT NOT NULL AUTO_INCREMENT, ACTION_TYPE VARCHAR(45) NOT NULL, - CORRECTIVE_POLICY_ID INT(11) DEFAULT NULL, - POLICY_ID INT(11) NOT NULL, - FEATURE_ID INT(11) DEFAULT NULL, + CORRECTIVE_POLICY_ID INT DEFAULT NULL, + POLICY_ID INT NOT NULL, + FEATURE_ID INT DEFAULT NULL, IS_REACTIVE BOOLEAN NOT NULL DEFAULT FALSE, PRIMARY KEY (ID), CONSTRAINT FK_DM_POLICY_DM_POLICY_CORRECTIVE_ACTION @@ -270,9 +270,9 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_CORRECTIVE_ACTION ( ); CREATE TABLE IF NOT EXISTS DM_ROLE_POLICY ( - ID INT(11) NOT NULL AUTO_INCREMENT , + ID INT NOT NULL AUTO_INCREMENT , ROLE_NAME VARCHAR(45) NOT NULL , - POLICY_ID INT(11) NOT NULL , + POLICY_ID INT NOT NULL , PRIMARY KEY (ID) , CONSTRAINT FK_ROLE_POLICY_POLICY FOREIGN KEY (POLICY_ID ) @@ -296,11 +296,11 @@ CREATE TABLE IF NOT EXISTS DM_USER_POLICY ( CREATE TABLE IF NOT EXISTS DM_DEVICE_POLICY_APPLIED ( ID INT NOT NULL AUTO_INCREMENT , DEVICE_ID INT NOT NULL , - ENROLMENT_ID INT(11) NOT NULL, + ENROLMENT_ID INT NOT NULL, POLICY_ID INT NOT NULL , POLICY_CONTENT BLOB NULL , TENANT_ID INT NOT NULL, - APPLIED TINYINT(1) NULL , + APPLIED TINYINT NULL , CREATED_TIME TIMESTAMP NULL , UPDATED_TIME TIMESTAMP NULL , APPLIED_TIME TIMESTAMP NULL , @@ -353,7 +353,7 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_CRITERIA_PROPERTIES ( CREATE TABLE IF NOT EXISTS DM_POLICY_COMPLIANCE_STATUS ( ID INT NOT NULL AUTO_INCREMENT, DEVICE_ID INT NOT NULL, - ENROLMENT_ID INT(11) NOT NULL, + ENROLMENT_ID INT NOT NULL, POLICY_ID INT NOT NULL, TENANT_ID INT NOT NULL, STATUS INT NULL, @@ -368,7 +368,7 @@ CREATE TABLE IF NOT EXISTS DM_POLICY_CHANGE_MGT ( ID INT NOT NULL AUTO_INCREMENT, POLICY_ID INT NOT NULL, DEVICE_TYPE VARCHAR(300) NOT NULL , - TENANT_ID INT(11) NOT NULL, + TENANT_ID INT NOT NULL, PRIMARY KEY (ID) ); @@ -397,7 +397,7 @@ CREATE TABLE IF NOT EXISTS DM_APPLICATION ( LOCATION_URL VARCHAR(100) DEFAULT NULL, IMAGE_URL VARCHAR(100) DEFAULT NULL, APP_PROPERTIES BLOB NULL, - MEMORY_USAGE INTEGER(10) NULL, + MEMORY_USAGE INTEGER NULL, IS_ACTIVE BOOLEAN NOT NULL DEFAULT FALSE, DEVICE_ID INTEGER NOT NULL, ENROLMENT_ID INTEGER NOT NULL, @@ -466,7 +466,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_LOCATION ( STATE VARCHAR(45) NULL, COUNTRY VARCHAR(45) NULL, GEO_HASH VARCHAR(45) NULL, - UPDATE_TIMESTAMP BIGINT(15) NOT NULL, + UPDATE_TIMESTAMP BIGINT NOT NULL, ALTITUDE DOUBLE NULL, SPEED FLOAT NULL, BEARING FLOAT NULL, @@ -503,8 +503,8 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_DETAIL ( CPU_USAGE DECIMAL(5) NULL, TOTAL_RAM_MEMORY DECIMAL(30,3) NULL, AVAILABLE_RAM_MEMORY DECIMAL(30,3) NULL, - PLUGGED_IN INT(1) NULL, - UPDATE_TIMESTAMP BIGINT(15) NOT NULL, + PLUGGED_IN INT NULL, + UPDATE_TIMESTAMP BIGINT NOT NULL, PRIMARY KEY (ID), CONSTRAINT FK_DM_DEVICE_DETAILS_DEVICE FOREIGN KEY (DEVICE_ID) @@ -531,7 +531,7 @@ CREATE TABLE IF NOT EXISTS DM_DEVICE_HISTORY_LAST_SEVEN_DAYS LONGITUDE DOUBLE NULL, SPEED FLOAT NULL, HEADING FLOAT NULL, - TIMESTAMP BIGINT(15) NOT NULL, + TIMESTAMP BIGINT NOT NULL, GEO_HASH VARCHAR(45) NULL, DEVICE_OWNER VARCHAR(45) NULL, DEVICE_ALTITUDE DOUBLE NULL, @@ -812,16 +812,17 @@ CREATE TABLE IF NOT EXISTS DM_TRACCAR_UNSYNCED_DEVICES ( -- END OF DM_TRACCAR_UNSYNCED_DEVICES TABLE -- -- SUB_OPERATION_TEMPLATE TABLE-- -CREATE TABLE SUB_OPERATION_TEMPLATE ( - SUB_OPERATION_TEMPLATE_ID int NOT NULL AUTO_INCREMENT, +CREATE TABLE IF NOT EXISTS SUB_OPERATION_TEMPLATE ( + SUB_OPERATION_TEMPLATE_ID INT NOT NULL AUTO_INCREMENT, OPERATION_DEFINITION TEXT NOT NULL, - OPERATION_CODE varchar(100) NOT NULL, - SUB_TYPE_ID int NOT NULL, + OPERATION_CODE VARCHAR(100) NOT NULL, + SUB_TYPE_ID INT NOT NULL, DEVICE_TYPE VARCHAR(25) NOT NULL, - CREATE_TIMESTAMP timestamp NULL DEFAULT NULL, - UPDATE_TIMESTAMP timestamp NULL DEFAULT NULL, + CREATE_TIMESTAMP TIMESTAMP NULL DEFAULT NULL, + UPDATE_TIMESTAMP TIMESTAMP NULL DEFAULT NULL, PRIMARY KEY (SUB_OPERATION_TEMPLATE_ID), - UNIQUE KEY SUB_OPERATION_TEMPLATE (SUB_TYPE_ID,OPERATION_CODE, DEVICE_TYPE), + CONSTRAINT uk_sub_operation_template UNIQUE (SUB_TYPE_ID, OPERATION_CODE, DEVICE_TYPE), +-- UNIQUE KEY SUB_OPERATION_TEMPLATE (SUB_TYPE_ID, OPERATION_CODE, DEVICE_TYPE), CONSTRAINT fk_SUB_OPERATION_TEMPLATE_DM_DEVICE_SUB_TYPE FOREIGN KEY (SUB_TYPE_ID, DEVICE_TYPE) REFERENCES DM_DEVICE_SUB_TYPE (SUB_TYPE_ID, DEVICE_TYPE) ); diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.extensions.feature/pom.xml b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.extensions.feature/pom.xml index a0263bae1e..1d47540e6c 100644 --- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.extensions.feature/pom.xml +++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.extensions.feature/pom.xml @@ -12,7 +12,7 @@ io.entgra.device.mgt.core.device.mgt.extensions.feature pom WSO2 Carbon - Device Management Extensions Feature - http://wso2.org + https://entgra.io This feature contains common extensions used by key device management functionalities diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.feature/pom.xml b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.feature/pom.xml index ee9b93241a..c50b47db31 100644 --- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.feature/pom.xml +++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.feature/pom.xml @@ -30,7 +30,7 @@ io.entgra.device.mgt.core.device.mgt.feature pom WSO2 Carbon - Device Management Aggregate Feature - http://wso2.org + https://entgra.io This feature contains all the bundles required for device management related functionalities @@ -44,11 +44,7 @@ javax.servlet.jsp-api - org.wso2.carbon.store - org.wso2.store.sso.common - - - org.wso2.orbit.org.scannotation + io.entgra.org.scannotation scannotation @@ -78,8 +74,7 @@ javax.servlet.jsp:javax.servlet.jsp-api - org.wso2.carbon.store:org.wso2.store.sso.common:${carbon.store.sso.common.version} - org.wso2.orbit.org.scannotation:scannotation:${scannotation.version} + io.entgra.org.scannotation:scannotation:${scannotation.version} diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.server.feature/pom.xml b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.server.feature/pom.xml index 4ca9d1a8af..d4e8f99684 100644 --- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.server.feature/pom.xml +++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.server.feature/pom.xml @@ -30,7 +30,7 @@ io.entgra.device.mgt.core.device.mgt.server.feature pom WSO2 Carbon - Device Management Server Feature - http://wso2.org + https://entgra.io This feature contains the core bundles required for Back-end Device Management functionality diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/pom.xml index 154ccae674..577d9274b5 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/pom.xml @@ -30,7 +30,7 @@ org.wso2.carbon.device.mgt.analytics.feature pom WSO2 Carbon - Device Management Server Feature - http://wso2.org + https://entgra.io This feature contains bundles related to device analytics data publisher and ws proxy diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml index 173f3e4bd6..f487bfedb9 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml @@ -30,7 +30,7 @@ org.wso2.carbon.device.mgt.ui.feature pom WSO2 Carbon - Device Management Base UI Feature - http://wso2.org + https://entgra.io This feature contains the base UI required for Device Management diff --git a/features/device-mgt/pom.xml b/features/device-mgt/pom.xml index bc43a95417..59ec1b2abe 100644 --- a/features/device-mgt/pom.xml +++ b/features/device-mgt/pom.xml @@ -30,7 +30,7 @@ device-mgt-feature pom WSO2 Carbon - Device Management Feature - http://wso2.org + https://entgra.io io.entgra.device.mgt.core.device.mgt.basics.feature diff --git a/features/heartbeat-management/io.entgra.device.mgt.core.server.heart.beat.feature/src/main/resources/datasources/heart-beat-datasources.xml b/features/heartbeat-management/io.entgra.device.mgt.core.server.heart.beat.feature/src/main/resources/datasources/heart-beat-datasources.xml index ebbe5087f2..fe9328d7ad 100644 --- a/features/heartbeat-management/io.entgra.device.mgt.core.server.heart.beat.feature/src/main/resources/datasources/heart-beat-datasources.xml +++ b/features/heartbeat-management/io.entgra.device.mgt.core.server.heart.beat.feature/src/main/resources/datasources/heart-beat-datasources.xml @@ -16,7 +16,7 @@ ~ specific language governing permissions and limitations ~ under the License. --> - + org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader diff --git a/features/jwt-client/io.entgra.device.mgt.core.identity.jwt.client.extension.feature/pom.xml b/features/jwt-client/io.entgra.device.mgt.core.identity.jwt.client.extension.feature/pom.xml index f6e5d38608..a71e3d93ff 100644 --- a/features/jwt-client/io.entgra.device.mgt.core.identity.jwt.client.extension.feature/pom.xml +++ b/features/jwt-client/io.entgra.device.mgt.core.identity.jwt.client.extension.feature/pom.xml @@ -31,7 +31,7 @@ io.entgra.device.mgt.core.identity.jwt.client.extension.feature pom WSO2 Carbon - JWT Client Feature - http://wso2.org + https://entgra.io This feature contains jwt client implementation from which we can get a access token using the jwt grant type handler diff --git a/features/jwt-client/pom.xml b/features/jwt-client/pom.xml index 59a5fcd0bf..51d5fe9e41 100644 --- a/features/jwt-client/pom.xml +++ b/features/jwt-client/pom.xml @@ -31,7 +31,7 @@ jwt-client-feature pom WSO2 Carbon - JWT Client Extension Feature - http://wso2.org + https://entgra.io io.entgra.device.mgt.core.identity.jwt.client.extension.feature diff --git a/features/logger/io.entgra.device.mgt.core.notification.logger.feature/pom.xml b/features/logger/io.entgra.device.mgt.core.notification.logger.feature/pom.xml index b0962c8ec5..0a4532de48 100644 --- a/features/logger/io.entgra.device.mgt.core.notification.logger.feature/pom.xml +++ b/features/logger/io.entgra.device.mgt.core.notification.logger.feature/pom.xml @@ -41,7 +41,6 @@ org.ops4j.pax.logging pax-logging-api provided - org.testng diff --git a/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml b/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml index e932de7ba3..65c85253f4 100644 --- a/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml +++ b/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml @@ -31,7 +31,7 @@ io.entgra.device.mgt.core.device.mgt.oauth.extensions.feature pom WSO2 Carbon - Device Mgt OAuth Extensions Feature - http://wso2.org + https://entgra.io This feature contains devicemgt related OAuth extensions diff --git a/features/oauth-extensions/pom.xml b/features/oauth-extensions/pom.xml index 73b18607e7..74a3f53631 100644 --- a/features/oauth-extensions/pom.xml +++ b/features/oauth-extensions/pom.xml @@ -30,7 +30,7 @@ oauth-extensions-feature pom WSO2 Carbon - Device Management OAuth Extensions Feature - http://wso2.org + https://entgra.io io.entgra.device.mgt.core.device.mgt.oauth.extensions.feature diff --git a/features/policy-mgt/io.entgra.device.mgt.core.policy.mgt.server.feature/pom.xml b/features/policy-mgt/io.entgra.device.mgt.core.policy.mgt.server.feature/pom.xml index 925f43997a..5c773834cf 100644 --- a/features/policy-mgt/io.entgra.device.mgt.core.policy.mgt.server.feature/pom.xml +++ b/features/policy-mgt/io.entgra.device.mgt.core.policy.mgt.server.feature/pom.xml @@ -31,7 +31,7 @@ io.entgra.device.mgt.core.policy.mgt.server.feature pom WSO2 Carbon - Policy Management Server Feature - http://wso2.org + https://entgra.io This feature contains the core bundles required for Back-end Device Management functionality diff --git a/features/policy-mgt/pom.xml b/features/policy-mgt/pom.xml index 0b9372a42e..282d237923 100644 --- a/features/policy-mgt/pom.xml +++ b/features/policy-mgt/pom.xml @@ -32,7 +32,7 @@ policy-mgt-feature pom WSO2 Carbon - Policy Management Feature - http://wso2.org + https://entgra.io io.entgra.device.mgt.core.policy.mgt.server.feature diff --git a/features/task-mgt/io.entgra.device.mgt.core.task.mgt.feature/pom.xml b/features/task-mgt/io.entgra.device.mgt.core.task.mgt.feature/pom.xml index 4993d7a081..40a949721b 100755 --- a/features/task-mgt/io.entgra.device.mgt.core.task.mgt.feature/pom.xml +++ b/features/task-mgt/io.entgra.device.mgt.core.task.mgt.feature/pom.xml @@ -29,7 +29,7 @@ io.entgra.device.mgt.core.task.mgt.feature pom Entgra IoT - Task Manager Feature - http://wso2.org + https://entgra.io diff --git a/features/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.server.feature/pom.xml b/features/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.server.feature/pom.xml index 3478f76af9..f735af22bb 100644 --- a/features/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.server.feature/pom.xml +++ b/features/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.server.feature/pom.xml @@ -90,7 +90,6 @@ - io.entgra.device.mgt.core:io.entgra.device.mgt.core.tenant.mgt.core:${io.entgra.device.mgt.core.version} diff --git a/features/transport-mgt/email-sender/io.entgra.device.mgt.core.email.sender.feature/pom.xml b/features/transport-mgt/email-sender/io.entgra.device.mgt.core.email.sender.feature/pom.xml index a38d042939..78a9a261c8 100644 --- a/features/transport-mgt/email-sender/io.entgra.device.mgt.core.email.sender.feature/pom.xml +++ b/features/transport-mgt/email-sender/io.entgra.device.mgt.core.email.sender.feature/pom.xml @@ -30,7 +30,7 @@ io.entgra.device.mgt.core.email.sender.feature pom WSO2 Carbon - Email Sender Feature - http://wso2.org + https://entgra.io This feature contains the core bundles required for email sender related functionality @@ -39,10 +39,6 @@ io.entgra.device.mgt.core io.entgra.device.mgt.core.transport.mgt.email.sender.core - - org.wso2.orbit.org.apache.velocity - velocity - @@ -96,9 +92,6 @@ io.entgra.device.mgt.core:io.entgra.device.mgt.core.transport.mgt.email.sender.core:${io.entgra.device.mgt.core.version} - - org.wso2.orbit.org.apache.velocity:velocity:${velocity.version} - org.wso2.carbon.core.server:${carbon.kernel.version} diff --git a/features/transport-mgt/email-sender/pom.xml b/features/transport-mgt/email-sender/pom.xml index aa3b05ee62..fb3d7a0c1f 100644 --- a/features/transport-mgt/email-sender/pom.xml +++ b/features/transport-mgt/email-sender/pom.xml @@ -31,7 +31,7 @@ email-sender-feature pom WSO2 Carbon - Email Sender Feature - http://wso2.org + https://entgra.io io.entgra.device.mgt.core.email.sender.feature diff --git a/features/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor.feature/src/main/resources/payloads/update-app-request.xml b/features/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor.feature/src/main/resources/payloads/update-app-request.xml index 50e82b986c..192e1dd103 100644 --- a/features/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor.feature/src/main/resources/payloads/update-app-request.xml +++ b/features/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor.feature/src/main/resources/payloads/update-app-request.xml @@ -1,5 +1,6 @@ - + diff --git a/features/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework.server.feature/pom.xml b/features/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework.server.feature/pom.xml index b35902a323..f16f479d35 100644 --- a/features/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework.server.feature/pom.xml +++ b/features/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework.server.feature/pom.xml @@ -30,7 +30,7 @@ io.entgra.device.mgt.core.webapp.authenticator.framework.server.feature pom WSO2 Carbon - Webapp Authenticator Framework Server Feature - http://wso2.org + https://entgra.io This feature contains the core bundles required for Back-end Device Management functionality diff --git a/features/webapp-authenticator-framework/pom.xml b/features/webapp-authenticator-framework/pom.xml index baa7ba13e1..b51534e648 100644 --- a/features/webapp-authenticator-framework/pom.xml +++ b/features/webapp-authenticator-framework/pom.xml @@ -31,7 +31,7 @@ webapp-authenticator-framework-feature pom WSO2 Carbon - Webapp Authenticator Framework Feature - http://wso2.org + https://entgra.io io.entgra.device.mgt.core.webapp.authenticator.framework.server.feature diff --git a/pom.xml b/pom.xml index 5504751710..71bf206021 100644 --- a/pom.xml +++ b/pom.xml @@ -25,7 +25,7 @@ pom 5.0.26-SNAPSHOT WSO2 Carbon - Device Management - Parent - http://wso2.org + https://entgra.io WSO2 Connected Device Manager Components org.wso2 @@ -609,28 +609,6 @@ - - - org.eclipse.osgi - org.eclipse.osgi - ${eclipse.osgi.version} - - - org.eclipse.equinox - org.eclipse.equinox.common - ${eclipse.equinox.common.version} - - - org.eclipse.osgi - org.eclipse.osgi.services - ${eclipse.equinox.services.version} - - - - - - - org.testng @@ -732,10 +710,6 @@ org.eclipse.equinox org.eclipse.equinox.http.helper - org.wso2.carbon org.wso2.carbon.registry.core @@ -838,12 +812,6 @@ - - - - - - org.wso2.orbit.com.h2database h2 @@ -933,12 +901,6 @@ axiom ${axiom.wso2.version} - - - - - - org.wso2.carbon.apimgt org.wso2.carbon.apimgt.api @@ -1180,42 +1142,6 @@ cxf-rt-transports-http ${cxf.version} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - org.wso2.carbon.identity.framework @@ -1284,11 +1210,6 @@ - - - - - com.googlecode.json-simple.wso2 json-simple @@ -1339,7 +1260,7 @@ ${bcpkix.wso2.version} - org.wso2.orbit.com.google.code.jscep + io.entgra.com.google.code.jscep jscep ${jscep.version} @@ -1389,11 +1310,6 @@ okhttp ${squareup.okhttp3.version} - - - - - io.github.openfeign feign-okhttp @@ -1433,12 +1349,7 @@ org.apache.velocity - velocity - 1.7 - - - org.wso2.orbit.org.apache.velocity - velocity + velocity-engine-core ${velocity.version} @@ -1451,12 +1362,6 @@ commons-collections ${commons-collections.version} - - - - - - @@ -1467,11 +1372,6 @@ - - - - - org.wso2.carbon.analytics-common org.wso2.carbon.event.stream.core @@ -1497,16 +1397,6 @@ org.wso2.carbon.event.output.adapter.rdbms ${carbon.analytics.common.version} - - - - - - - - - - org.wso2.carbon.analytics-common org.wso2.carbon.databridge.commons @@ -1556,7 +1446,7 @@ - org.wso2.orbit.org.scannotation + io.entgra.org.scannotation scannotation ${scannotation.version} @@ -1595,11 +1485,6 @@ ${eclipse.paho.version} - - - - - io.swagger swagger-annotations @@ -1625,16 +1510,6 @@ org.wso2.carbon.event.output.adapter.core ${carbon.analytics.common.version} - - - - - - - - - - org.wso2.carbon.analytics-common org.wso2.carbon.event.publisher.stub @@ -1747,11 +1622,6 @@ wss4j ${org.apache.ws.security.wso2.version} - - org.wso2.carbon.store - org.wso2.store.sso.common - ${carbon.store.sso.common.version} - io.github.openfeign feign-core @@ -1777,16 +1647,6 @@ feign-slf4j ${io.github.openfeign.version} - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - ${oltu.client.version} - - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson.datatype.joda.version} - org.javassist javassist @@ -1922,6 +1782,11 @@ javax.cache.wso2 4.6.3-m5 + + org.apache.felix + org.apache.felix.scr.ds-annotations + ${apache.felix.scr.ds.annotations.version} + @@ -1960,8 +1825,8 @@ 3.8.1 UTF-8 - 17 - 17 + 11 + 11 @@ -1994,23 +1859,10 @@ 17 - - - - - - - - - - - - - org.apache.felix maven-bundle-plugin - 5.1.1 + 3.2.0 true NONE @@ -2104,28 +1956,13 @@ 4.8.1 [4.5.0, 5.0.0) 5.1.2 - - - [1.6.1, 1.7.0) 1.6.1-wso2v85 1.1.0-wso2v10 - - - - - - - - - - - - 4.13.1 @@ -2133,27 +1970,20 @@ 3.3.100.v20120522-1822 3.8.1.v20120830-144521 - - 7.0.93.wso2v1 7.0.93.wso2v1 7.0.34.wso2v2 - - - 5.24.8 [5.14.0, 6.0.0) 6.9.6 - 2.1.1 [2.1.1, 3.0.0) [5.14.0, 6.0.0) [6.0.0, 7.0.0) - 4.9.20 @@ -2185,7 +2015,6 @@ 5.3.5 [5.3.0,6.0.0) 1.3.25 - 2.3.5 @@ -2195,22 +2024,16 @@ 3.5.5 - 1.1.wso2v1 1.9.13 - - - - - - 1.60.0.wso2v1 - 1.60.0.wso2v1 - [1.52.0,1.70.0) + 1.70.0.wso2v1 + 1.70.0.wso2v1 + [1.52.0,1.80.0) - 2.3.0.wso2v2 + 2.3.0.entgrav2 3.0.0.wso2v1 1.3 @@ -2231,11 +2054,8 @@ 3.1.1 2.0.4.wso2v4 - - - - 1.0.3.wso2v1 + 1.0.3.entgrav1 [1.0.3, 2.0.0) 1.5.6.wso2v1 @@ -2245,12 +2065,11 @@ 3.1.0.wso2v2 4.2.5.wso2v1 - 1.7.0.wso2v1 + 2.3 2.4.0.wso2v1 3.2.0.wso2v1 (3.2.0, 3.3.0] - 5.1.34 @@ -2267,7 +2086,7 @@ 2.0.1 1.6.9 - + 1.6.9 4.0.1 @@ -2283,8 +2102,6 @@ 1.8.10.wso2v2 - - 1.7.0 @@ -2299,18 +2116,12 @@ 2.1.7-wso2v227 1.5.11-wso2v18 - - 1.5.1 - 11.0 [9.3.1,10.0.0) - - 1.0.1 - 2.1.5 1.9 (1.9,2.0] - 3.26.0-GA + 3.18.1-GA true @@ -2332,7 +2143,6 @@ 9.0.24 1.1 - 5.3.23 2.7.18 @@ -2342,7 +2152,6 @@ [1.2.0,1.3.0) 4.2.0 - 2.8.1.wso2v2 4.3.1.wso2v1 2.1.210.wso2v1 @@ -2352,6 +2161,11 @@ 2.3.1.wso2v1 2.4 1.2.2.wso2v1 + [9.0,10) + 1.2.4 + [4.7.0, 4.9.0) + [1.0.1, 2.0.0) + [4.7.0, 5.0.0)